Hxc Rev3: track change too slow?

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

Re: Hxc Rev3: track change too slow?

Post by Targhan »

I attached it to my first response just above, look at the bottom of it.

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:I attached it to my first response just above, look at the bottom of it.

how many time the load should take exactly ?

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

Re: Hxc Rev3: track change too slow?

Post by Targhan »

Let's say that, while loading the introduction, there should be at least 3 tracks loaded per seconds. So it's much faster than loading any file with the AMSDOS.

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

Re: Hxc Rev3: track change too slow?

Post by Targhan »

To be more accurate: with the DSK I provided, using the Hxc, and typing run"orion":
- The tracks 3-9 are "slow" to read: about 2 tracks per seconds.
- Then a second loading loads the tracks 10-13: these have the normal speed, they are quickly read (why, I don't know).

With the same DSK transferred to the CPC (using CPCDiskXP for example) and read by the real hardware drive, it is always fast like for the tracks 10-13.

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

Re: Hxc Rev3: track change too slow?

Post by TFM »

Sorry, for coming back that late.

I can confirm Targhans original problem. I have the same problem with Vortex Format. FutureOS reads the sectors as they come. This is similar to Targhans technique.

I face the same problem. Loading is much too slow... So I assume the HxC does take too long and there fore comes too late to find the sector ID (I know it's all simulated, but dunno how to put it in better words).

Possible solution: After the head moves to a new track, allow the head "more early" to be able to find a Sektor ID / start of a sector. And maybe more towards the beginning of the track, don't advance too quick.

Hope this problem can be solved.

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 »

I will check it, but i suspect that you are making a settle time violation with these formats. ( not waiting the 15ms/18ms)
This may "work" with some drives, but for sure not with all.


EDIT : i assume that you didn't tried the rev2 HFE format ? This may solve the issue ;)

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

Re: Hxc Rev3: track change too slow?

Post by Targhan »

Thanks a lot for checking. Orion Prime (our previous game) has been sold to "many" units and both on 3" and 3,5" and, to my knowledge, the loading has always been as fast as possible. Plus I checked many times my code on real drives before that, on many CPCs. So I'm pretty sure the code is rock solid. And if on top of that TFM confirms the same problem with his code, I can only assume there's a problem with the HxC :).

About the HFE Rev2, I didn't know about it, so I made a test (DSK -> HFE Rev2). It doesn't change a thing about the speed, sorry...

Thanks again.

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 »

So you confirm that you are expecting a settle time under 5/10ms ? in this case i am sorry but this is just not possible. A normal drive have a settle of ~16/20ms. Most 3"5 drive doesn't output anything during the settle time. Maybe that the cpc drive output something during the settle time.

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

Re: Hxc Rev3: track change too slow?

Post by Targhan »

I'll be honest, I'm not the kind of guy that measure timings. I programmed the FDC, made the fastest code I could, then had fun with some formats (on real hardware) and made sure it worked on every drive I tested (and it did).

You can check easily by yourself: simply dump the Orion Prime DSK, which I provided, on a real CPC drive (CPCDiskXP does the job right) and check how fast loading the game goes. Then convert the same DSK to HFE and test it with the HxC : it will load twice slower. That's the only thing I can confirm :).

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

Re: Hxc Rev3: track change too slow?

Post by Targhan »

Just to be clear about "my" format: after the last sector of a track is read, the head goes to the next track. It will NOT be able to read the first sector of this next track. Hence the trick of shifting the sector names so that the first logical sector to read is the second physical sector. Minimizing the GAP#3 to #30 helps, but it seems it is not mandatory, as some people confirmed. Anyway, all the Orion Prime disks were dumped with this #30 value, and so far, so good.

Now, I don't know how many ms that costs :).

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 »

here is a super fast loading with the HxC :
https://www.youtube.com/watch?v=PnS0LlvHnY4
So this is possible without any particular hack or modification.

What do you call "the last sector" exactly ?

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

Re: Hxc Rev3: track change too slow?

Post by Targhan »

Yes, this seems to be the right speed.

I can assure you that, with 10 sectors per track, it is not possible to achieve that speed on CPC. Maybe the format the guy in the video has is only 9 sectors, so by the time the last sector is read, the head has enough time to move to the next track and read the first sector.

What I call "the last sector" is... well, the last sector of the track. I copy/paste the little schematic from the beginning of the thread:
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

On CPC, you can't read the full Track 0, move your head to track 1 and expect to read the first sector directly (#ba). The head has already missed its beginning, so it waits for another round (slow!). So the trick I use is to shift the sectors. On track 0, I read #b1...#ba, then goes to Track 1 and read #b1...#ba. But as the first physical sector is #ba and not #b1 (which is the first sector I want to read), the head has enough time and "land" just before it after leaving the Track 0. Fast 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 »

Here is the fast version :

<gap3>145</gap3>
<bitrate>260000</bitrate>
<pregap>35</pregap>

https://hxc2001.com/download/floppy_driv ... sk_xml.hfe

Without these modifications, there is only 1.9ms between the sectors so this is well under the 16 ms head settling time, under the 3ms stepping rate, and under the 4/5ms hxc settling time.

The modified HFE have more than 4ms between the sectors.

FYI here some drives datasheet :
https://hxc2001.com/download/datasheet/f ... hirdparty/
Image2.png
Image2.png (25.74 KiB) Viewed 10683 times

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

Re: Hxc Rev3: track change too slow?

Post by Targhan »

Thanks a lot. However, I tested the HFE wxith my HxC and... unfortunately, it doesn't work very well. Some tracks are read faster, but some not (three good, one bad I would say). So it's the loading is not smooth.

Those values you used are really puzzling. With such a high GAP#3, it don't understand how all the bytes can be actually written on the disc! I know it's all virtual, but I thought that, at some point, real magnetic data was encoded. One other (minor) problem is that even if this HFE works, someone who would dump it on a real CPC disc wouldn't create a working copy: I believe the last sector of the tracks will overlap the first one (10 sectors with a gap#3 of #30 is already a limit).

One thing I have tested with the REAL Orion Prime disc on the real hardware, is to calculate the GAP#3. I used the CPC tool Disc+Ultra, and it always came up with the right GAP (#4e for track 0, #30 for the other ones, exactly like I). So there is no doubt about what is actually dumped on the CPC. And the FDC can actually read the sectors!

Thanks for taking your time to produce this HFE. If you have any other ideas to make it work, I would be very grateful to hear about them.

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 »

Attached the hxc firmware with the head teleportation emulation. this is just a hack, no official release planned.
Just use the normal hfe converted from the dsk.

i am pretty sure that 1.9ms isn't enough for a large kind of drives. If i got time i will make some videos to show you.
Anyway have a look to the datasheets.
Attachments
hxcfe.zip
(48.87 KiB) Downloaded 475 times

Post Reply