Hxc Rev3: track change too slow?

HxC Floppy Emulator on Amstrad CPC support
Post Reply
Targhan
Posts: 25
Joined: Wed May 20, 2015 9:46 pm

Hxc Rev3: track change too slow?

Post by Targhan »

Hello,

On my previous production on CPC (Orion Prime), I used two tricks that allowed me to have very fast loading time:
- The sectors are encoded and read linearly (#b1, #b2 ... #ba).
- The sectors of the NEXT track are shifted so that, by the time the head goes from track T to track T+1, it can "land" directly on the right sector (landing on #b1 of T+1 after leaving #ba on T).

Here is a little schematic: (there are 10 sectors per track, size 2).

Track - sectors
00 #b1 #b2 #b3 #b4 #b5 #b6 #b7 #b8 #b9 #ba
01 #ba #b1 #b2 #b3 #b4 #b5 #b6 #b7 #b8 #b9
02 #b9 #ba #b1 #b2 #b3 #b4 #b5 #b6 #b7 #b8
03 #b8 #b9 #ba #b1 #b2 #b3 #b4 #b5 #b6 #b7
...

This works perfectly on all the drives of the CPC (3", 3,5"). Note that I keep the default values of the FDC (step rate : #a, unload head : #1, load head : #1).

However, it doesn't work with the HxC : the loading is not as fast as on the real hardware. The head clearly takes "too much time" to be ready after a track change, and misses the #b1 sector, so it has to wait for another round to read it.

As a test, I created another HFE with sectors shifted, not by one by two slots, like this:
Track - sectors
00 #b1 #b2 #b3 #b4 #b5 #b6 #b7 #b8 #b9 #ba
01 #b9 #ba #b1 #b2 #b3 #b4 #b5 #b6 #b7 #b8
02 #b7 #b8 #b9 #ba #b1 #b2 #b3 #b4 #b5 #b6
03 #b5 #b6 #b7 #b8 #b9 #ba #b1 #b2 #b3 #b4
...

This time, it works. The problem is that the loading time isn't as fast as the first version, on a real CPC.

So my question is : what can I do to have the HxC match the behavior of the FDC of the CPC? Maybe there are some "hidden values" that can be tweaked in the configuration file (though I couldn't find anything in the documentation of the format...)?

Don't hesitate to ask if you want me to provide the HFEs.

Thank you.

Julien.

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

Re: Hxc Rev3: track change too slow?

Post by Jeff »

Probably a GAP3 setting issue. How did you generate the HFE file ? From a dsk image ?

Targhan
Posts: 25
Joined: Wed May 20, 2015 9:46 pm

Re: Hxc Rev3: track change too slow?

Post by Targhan »

Thanks for your answer.

Indeed the HFE was generated from a DSK. However, I don't think it's a GAP#3 issue.

The schema shown by the HxC software seems pretty accurate of the situation. In Orion Prime, the GAP #3 is #30. I tested a lot of different one on the HxC, even ridiculous ones, and I could see the difference: too low a gap (like #10) and the head would miss a sector after reading the previous one, then having to wait for a new round to read it. I dare not to increase the GAP too much, because I don't want the end sector to overlap the first one. People dumping the HFE on a real drive may have problems. But I went up to #4e, and it didn't correct the behavior.

I can send you a test DSK if you want, or you can download it here (any version will do. I advise the 3" version for the tests).

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

Re: Hxc Rev3: track change too slow?

Post by Jeff »

Targhan wrote:Thanks for your answer.

Indeed the HFE was generated from a DSK. However, I don't think it's a GAP#3 issue.

The schema shown by the HxC software seems pretty accurate of the situation. In Orion Prime, the GAP #3 is #30. I tested a lot of different one on the HxC, even ridiculous ones, and I could see the difference: too low a gap (like #10) and the head would miss a sector after reading the previous one, then having to wait for a new round to read it. I dare not to increase the GAP too much, because I don't want the end sector to overlap the first one. People dumping the HFE on a real drive may have problems. But I went up to #4e, and it didn't correct the behavior.

I can send you a test DSK if you want, or you can download it here (any version will do. I advise the 3" version for the tests).
I will write this disk to a floppy and redump it to check if the gap3 is the same.

Targhan
Posts: 25
Joined: Wed May 20, 2015 9:46 pm

Re: Hxc Rev3: track change too slow?

Post by Targhan »

Great, thanks. However, I used Disc+Ultra on the CPC using the HxC on all my generated DSK (using various gaps), and the measurement of the GAP#3 of Disc+Ultra was quite correct. So my conclusion is that the discs were rightly written. Maybe something must be improved on the HxC about the speed of the track change or the "readiness" of the head after a track change?

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

Re: Hxc Rev3: track change too slow?

Post by Jeff »

Targhan wrote:Great, thanks. However, I used Disc+Ultra on the CPC using the HxC on all my generated DSK (using various gaps), and the measurement of the GAP#3 of Disc+Ultra was quite correct. So my conclusion is that the discs were rightly written. Maybe something must be improved on the HxC about the speed of the track change or the "readiness" of the head after a track change?
Hi,

I told GAP3, but for sure this is the GAP around the index the problem.
The HxC take ~5ms to make a step and output data, a way faster than a floppy (16ms-20ms).

Targhan
Posts: 25
Joined: Wed May 20, 2015 9:46 pm

Re: Hxc Rev3: track change too slow?

Post by Targhan »

Ok, so is there a way to correct this? Maybe the problem can be resolved by generating the HFE in another way?

Thanks.

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

Re: Hxc Rev3: track change too slow?

Post by Jeff »

Targhan wrote:Ok, so is there a way to correct this? Maybe the problem can be resolved by generating the HFE in another way?

Thanks.
You can make some experimentations : export the image to XML, modify the rpm field (reduce it a bit ... 290 for example)
and reload again this xml file (and then reconvert it to HFE...).
You can try to modify any parameter (pregap,gap3...)

TFM
Posts: 29
Joined: Fri Sep 24, 2010 6:07 pm

Re: Hxc Rev3: track change too slow?

Post by TFM »

5 ms is very fast. CPC works still fine with 12 ms for 3". However 3.5" can work with 4 ms without a problem.

The problem with the delay in this case seems to be IMHO somewhere in the HxC software, because 5 ms is really fast enough to get the next sector (I mean to skip only one sector while moving the head).

FutureOS uses a similar technique for reading regular Data discs, to read 180 KB takes 9 seconds. I will check this with the HxC again and let you know if there are problem (but I don't remember any speed differences though... I will check and let you know here...).

Good luck!

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

Re: Hxc Rev3: track change too slow?

Post by Jeff »

This is the last GAP around the index. Make it longer, and thing will be better.

Targhan
Posts: 25
Joined: Wed May 20, 2015 9:46 pm

Re: Hxc Rev3: track change too slow?

Post by Targhan »

I found the time to play with the formats again (I was busy actually filling the bytes of the disk :)).
Like you suggested I exported the DSK/HFE into XML, modified it, and converted it back to HFE. However, nothing really worked. Maybe I don't understand how it work, but the XML conversion seems strange to me.

For example, I carefully set my own GAP for each track in the original DSK, but on the XML, there is only one GAP3 value in a top node, and its value is 255. I thought it was just an "automatic" value, but modifying it provokes a read fail (it seems the RPM is set to 0 when the gap is set to a "good" value (such as 50)).

I also tried to decrease/increase slightly the RPM, but it only provoked a Read Fail on CPC at worst (or changes nothing at best).
The same for the Pregap. After converting back to HFE, I converted the HFE to XML: my values were gone or modified to illogical values.

I also created a HFE from scratch right from the software and save it to XML. Sadly, the generated file does not seem to include my values: the pregap is forced to 0, the gap3 to 255.

Could you explain to me how this is supposed to work?

Thanks,
Julien.

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

Re: Hxc Rev3: track change too slow?

Post by Jeff »

Without the files you have modified, hard to say.
Can you share them ?

Targhan
Posts: 25
Joined: Wed May 20, 2015 9:46 pm

Re: Hxc Rev3: track change too slow?

Post by Targhan »

Of course. Here is the DSK of the first side of Orion Prime (which uses "my" special format, as explained at the top of the thread).

Step 1:
I simply loaded it to the HxC software, and exported it to XML. Here a snippet of what I got:
<gap3>255</gap3>
<bitrate>250000</bitrate>
<pregap>0</pregap>
<rpm>300</rpm>

The GAP3 is 255 and global, but, according to the DSK I generated, it should be #4e on the track 0, and #30 on any other track. In the XML format, there is no such thing as a GAP#3 per track, which is strange to me.

Step 2:
Let's modify the GAP to 48 (=0x30) in the XML, import it to the HxC software, and export it again to XML. Here what I find:
<gap3>255</gap3>
<bitrate>250000</bitrate>
<pregap>0</pregap>
<rpm>300</rpm>

Nothing has changed! My forced value of the GAP has been ignored.

Step 3:
As you suggested, let's modify the Pregap to 20, import it to the HxC software, and export it again to XML. Here what I find:
<gap3>255</gap3>
<bitrate>250000</bitrate>
<pregap>0</pregap>
<rpm>300</rpm>

Again, nothing has changed.

Step 4:
Modifying the RPM to 280 is taken in account:
<gap3>255</gap3>
<bitrate>250000</bitrate>
<pregap>0</pregap>
<rpm>280</rpm>

On CPC, I get these results:
- I can increase the RPM as much as I can, I don't have any difference (I set the RPM up to 800!).
- If I decrease the RPM (down to 50), I get a much slower loading.

Step 5:
Now here is something strange: Let's only set the GAP3 to 48, save the XML, export to HFE, load this HFE into the HxC software, and export it again to XML. Here is what I find:
<gap3>255</gap3>
<bitrate>250000</bitrate>
<pregap>0</pregap>
<rpm>0</rpm>

The RPM is 0! So I guess there is a problem somewhere.

Thanks for you time.
Julien.
Attachments
OP_FR_3p_Side_1.zip
(197.26 KiB) Downloaded 503 times

Targhan
Posts: 25
Joined: Wed May 20, 2015 9:46 pm

Re: Hxc Rev3: track change too slow?

Post by Targhan »

Ok, after some more tests, it seems the modified value from the XML *are* taken in account in the generated HFE. However taking this HFE and converting it to XML seems to be buggy and values are messed...

Anyway, so far I modified the GAP to 48, tested various RPM and Pregap, but I could never get the full speed I expect and that, I emphasize on this, I get when dumping my DSK directly to the real hardware drive. At worst, I get a slower loading.

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

Re: Hxc Rev3: track change too slow?

Post by Jeff »

Where this test image/software can be found ?

Post Reply