TRD Images - Problem with command FORMAT.

HxC Floppy Emulator on ZX Spectrum and compatible support
Post Reply
Alex_NEMO
Posts: 20
Joined: Wed May 12, 2010 10:46 am
Location: RUSSIA, Kamyshin

TRD Images - Problem with command FORMAT.

Post by Alex_NEMO »

Hi, Jeff!

There are problems at work of the emulator with images of format TRD (ZX-Spectrum Beta Disk Interface (TR-DOS)).
The problem is manifested only with command FORMAT - the disk is formatted as single-sided, instead of two-sided.
I.e. after formatting of any TRD-image we gain 1264/1264 though should be 2544/2544.
Thus, visual representation to the monitor and on LCD the emulator is characteristic also
All other commands TR-DOS complete correctly, including commands MOVE and ERASE.

The last accessible versions were used:
software for image conversion: v1.5.2.1
PIC firmware: v1.6.0.0

HELP!

Jeff
Site Admin
Posts: 8092
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: TRD Images - Problem with command FORMAT.

Post by Jeff »

Alex_NEMO wrote:Hi, Jeff!

There are problems at work of the emulator with images of format TRD (ZX-Spectrum Beta Disk Interface (TR-DOS)).
The problem is manifested only with command FORMAT - the disk is formatted as single-sided, instead of two-sided.
I.e. after formatting of any TRD-image we gain 1264/1264 though should be 2544/2544.
Thus, visual representation to the monitor and on LCD the emulator is characteristic also
All other commands TR-DOS complete correctly, including commands MOVE and ERASE.

The last accessible versions were used:
software for image conversion: v1.5.2.1
PIC firmware: v1.6.0.0

HELP!
I don't think that this is related to a problem with the emulator. The computer doesn't try to format the side 1.

Alex_NEMO
Posts: 20
Joined: Wed May 12, 2010 10:46 am
Location: RUSSIA, Kamyshin

Re: TRD Images - Problem with command FORMAT.

Post by Alex_NEMO »

Jeff wrote:I don't think that this is related to a problem with the emulator. The computer doesn't try to format the side 1.
The real floppy disk is normally formatted on this computer. Also we receive after the termination of a command the FORMAT - 2544/2544 sectors. I.e. a problem not in the computer or the FDD-controler of this computer! The same problem is watched and on a "prototype", with last accessible to it firmware v0.2.2.0. And it seems that this problem exists since those times...

TRD-file format.
The given format is used by emulators of the Spectrum as an image of a diskette. Т е. When by operation in the emulator there is a reversal to TR-DOS, the emulator works with this file, including its diskette. A format of an image *.trd - one of the most simple. It, as a matter of fact, ordinary double-side 80-track TR-DOS a disk with 16 sectors on the track, on 256 byte everyone. Т е. Content TR-DOS of a diskette entirely is stored in a file of the given format (together with the directory). For decoding in a format of a real Spectrum it is necessary to write down simply the data containing in it on pure TR-DOS a diskette since the zero track. The size of files *.trd is equal 655360 byte (2544+16 tr-dos sectors) more often, but sometimes meet cut off *.trd images (less than 655360 byte), and also "rubber" (it is more 655360 byte).
Original Link(RUS): http://zxpress.ru/article.php?id=5075 , in more details: http://zxdocs.fatal.ru/formats/formats. ... &type=html

P.S. Jeff, please, answer my letter on e-mail.

Jeff
Site Admin
Posts: 8092
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: TRD Images - Problem with command FORMAT.

Post by Jeff »

Alex_NEMO wrote:
Jeff wrote:I don't think that this is related to a problem with the emulator. The computer doesn't try to format the side 1.
The real floppy disk is normally formatted on this computer. Also we receive after the termination of a command the FORMAT - 2544/2544 sectors. I.e. a problem not in the computer or the FDD-controler of this computer! The same problem is watched and on a "prototype", with last accessible to it firmware v0.2.2.0. And it seems that this problem exists since those times...
In this case how the Zx Spectrum detect an two sided or a one sided disk ?

Alex_NEMO
Posts: 20
Joined: Wed May 12, 2010 10:46 am
Location: RUSSIA, Kamyshin

Re: TRD Images - Problem with command FORMAT.

Post by Alex_NEMO »

Jeff wrote:In this case how the Zx Spectrum detect an two sided or a one sided disk ?
By default, in TR-DOS ROM, 80 tracks, 2 sides are installed. The matter is that any TRD an image loaded in HxCFloppyEmulator software v1.5.2.1, (scrolling line) accurately shows: GAMES003.TRD - 80 track(s) 2 side(s).
Besides, reads an image the emulator correctly! Also displays the information on a disk truly!

I once again will attentively check up mounting of the emulator and FDD controler.

Alex_NEMO
Posts: 20
Joined: Wed May 12, 2010 10:46 am
Location: RUSSIA, Kamyshin

Re: TRD Images - Problem with command FORMAT.

Post by Alex_NEMO »

I have found and have solved a problem with errors at reading SCL and TRD-images.
All problem has appeared in parametre options "Double Step" in point "HFE file interface mode". It appears, this checkbox cannot be marked.
But unfortunately, the problem with formatting 1264/1264 with "pure" TR-DOS, and remains. Thus, if to format from some "external" programs, for example, "QuickCommander", there is a "normal" formatting - 2544/2544.
The possible reason is described more low:

Most likely it because of that that TR-DOS ignores setting of number of the side in markers of sectors at formatting of the track and it turns out that two tracks are superimposed in one.

Before each sector at formatting title 6 byte is written
1. № the cylinder (the physical track) - 1 byte
2. № the diskette sides (0 or 1) - 1 byte (here TR-DOS always puts 0 it is not dependent on the side)
3. № sectors (1-16 for TRDOS) - 1 byte
4. The size of sector (0-3, for TRDOS=1) - 1 byte
5,6. Title checksum - 2 bytes.

It is impossible to rely on the second byte of titles of the disk formatted in TRDOS.


Whether probably somehow to solve this problem?

The complete (extended) information on a TRD-format (RUS - sorry...):
http://www.zxdocs.fatal.ru/formats/form ... &type=html

Jeff
Site Admin
Posts: 8092
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: TRD Images - Problem with command FORMAT.

Post by Jeff »

Alex_NEMO wrote:I have found and have solved a problem with errors at reading SCL and TRD-images.
All problem has appeared in parametre options "Double Step" in point "HFE file interface mode". It appears, this checkbox cannot be marked.
But unfortunately, the problem with formatting 1264/1264 with "pure" TR-DOS, and remains. Thus, if to format from some "external" programs, for example, "QuickCommander", there is a "normal" formatting - 2544/2544.
The possible reason is described more low:

Most likely it because of that that TR-DOS ignores setting of number of the side in markers of sectors at formatting of the track and it turns out that two tracks are superimposed in one.

Before each sector at formatting title 6 byte is written
1. № the cylinder (the physical track) - 1 byte
2. № the diskette sides (0 or 1) - 1 byte (here TR-DOS always puts 0 it is not dependent on the side)
3. № sectors (1-16 for TRDOS) - 1 byte
4. The size of sector (0-3, for TRDOS=1) - 1 byte
5,6. Title checksum - 2 bytes.

It is impossible to rely on the second byte of titles of the disk formatted in TRDOS.


Whether probably somehow to solve this problem?

The complete (extended) information on a TRD-format (RUS - sorry...):
http://www.zxdocs.fatal.ru/formats/form ... &type=html
Well in this case this can be changed easily :

http://hxcfloppyemu.svn.sourceforge.net ... iew=markup

Just change
currentcylinder->sides=tg_generatetrack(trackdata,sectorsize,floppydisk->floppySectorPerTrack,(unsigned char)j,(unsigned char)i,1,interleave,(unsigned char)(((j<<1)|(i&1))*skew),floppydisk->floppyBitRate,currentcylinder->floppyRPM,trackformat,gap3len,2000,-2000);


by

currentcylinder->sides=tg_generatetrack(trackdata,sectorsize,floppydisk->floppySectorPerTrack,(unsigned char)j,0,1,interleave,(unsigned char)(((j<<1)|(i&1))*skew),floppydisk->floppyBitRate,currentcylinder->floppyRPM,trackformat,gap3len,2000,-2000);


i will do this evening.

Alex_NEMO
Posts: 20
Joined: Wed May 12, 2010 10:46 am
Location: RUSSIA, Kamyshin

Re: TRD Images - Problem with command FORMAT.

Post by Alex_NEMO »

Jeff wrote: Just change
currentcylinder->sides=tg_generatetrack(trackdata,sectorsize,floppydisk->floppySectorPerTrack,(unsigned char)j,(unsigned char)i,1,interleave,(unsigned char)(((j<<1)|(i&1))*skew),floppydisk->floppyBitRate,currentcylinder->floppyRPM,trackformat,gap3len,2000,-2000);


by

currentcylinder->sides=tg_generatetrack(trackdata,sectorsize,floppydisk->floppySectorPerTrack,(unsigned char)j,0,1,interleave,(unsigned char)(((j<<1)|(i&1))*skew),floppydisk->floppyBitRate,currentcylinder->floppyRPM,trackformat,gap3len,2000,-2000);


i will do this evening.

Hi, Jeff!
I will be very grateful and at once I will test and I will write about results.

Jeff
Site Admin
Posts: 8092
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: TRD Images - Problem with command FORMAT.

Post by Jeff »

Alex_NEMO wrote:
Jeff wrote: Just change
currentcylinder->sides=tg_generatetrack(trackdata,sectorsize,floppydisk->floppySectorPerTrack,(unsigned char)j,(unsigned char)i,1,interleave,(unsigned char)(((j<<1)|(i&1))*skew),floppydisk->floppyBitRate,currentcylinder->floppyRPM,trackformat,gap3len,2000,-2000);


by

currentcylinder->sides=tg_generatetrack(trackdata,sectorsize,floppydisk->floppySectorPerTrack,(unsigned char)j,0,1,interleave,(unsigned char)(((j<<1)|(i&1))*skew),floppydisk->floppyBitRate,currentcylinder->floppyRPM,trackformat,gap3len,2000,-2000);


i will do this evening.

Hi, Jeff!
I will be very grateful and at once I will test and I will write about results.



To be tested:
https://hxc2001.com/floppy_drive_emulat ... t_beta.zip

Alex_NEMO
Posts: 20
Joined: Wed May 12, 2010 10:46 am
Location: RUSSIA, Kamyshin

Re: TRD Images - Problem with command FORMAT.

Post by Alex_NEMO »

Jeff, many thanks!
Tonight, after work, I will necessarily check up and I will write about results of testing.

Alex_NEMO
Posts: 20
Joined: Wed May 12, 2010 10:46 am
Location: RUSSIA, Kamyshin

Re: TRD Images - Problem with command FORMAT.

Post by Alex_NEMO »

I and one more person from our forum checked up the new beta version software. Unfortunately, the same result.
I.e. in "pure" TR-DOS, by system level command FORMAT "DISK1", after formatting it is received 1264/1264 sectors though should receive 2544/2544 sectors. In the course of formatting both on monitor ZX-Spectrum, and on LCD the emulator (IS not not present) passage to 1st side.
At usage of the external program - a file manager "Quick Commander" - formatting process happens normally, but this program uses own subroutine of formatting and formats a disk from its "end" - i.e. with 80 on 0 track. After its formatting - it is received the demanded
2544/2544 sectors. I just in case, collected 3 files:
  • image01_clean.hfe - An image converted a software in format HFE (contains a row of games for ZX-Spectrum);
    image01_qc_frmt.hfe - The same, as the first image, but is formatted by a file manager "Quick Commander" - received demanded 2544/2544 of sectors;
    image01_trd_frmt.hfe - The same, as the first image, but is formatted in TR-DOS, system level command FORMAT "DISK1", received 1264/1264 sectors, thus, the directory is cleared NOT completely - command LIST produces not the complete list of files and an error since there is "overlay" or not the full cleaning in view of not the correct formatting.
Probably, the analysis of these files helps to understand and solve a problem.
the Link to archive

I want to ask still - at track record at image through the emulator how it defines its number? Whether it is used signal SIDE of the floppy interface, or all information takes from title of sector of a file-image?
If signal SIDE is not analyzed, whether probably to implement this function?

Still the question - whether considers the emulator at formatting of the track the information in markers of sectors and what will be if markers are not standard?

P.S.
Jean François if there is time, desire, possibilities, at our forum (page 8 and further) we lead research of the possible reasons of this problem. It is possible to try to translate into English or French languages OnLine Translate services:
* Google Tranlate
* Promt Tranlate (russian service)

Post Reply