Oric HFE file

If you want to ask questions about how the machine works, peculiar details, the differences between models, here it is !
How to program the oric hardware (VIA, FDC, ...) is also welcome.
User avatar
Jeff
2nd Star Corporal
Posts: 30
Joined: Mon Aug 01, 2011 11:34 am
Location: Paris, France
Contact:

Re: Oric HFE file

Post by Jeff »

Jeff wrote:
Sat May 15, 2021 4:37 pm
Please note that many (most?) Oric dsk images are corrupted/malformed : Bad header, bad sync word, bad crc... The hardware will reject most of them.
The emulator will have to fix them at the load.
Btw this is maybe why Oricutron and OricExplorer use hardcoded values...

I think that the Oric community should choose another disk image format and "redump/regenerate" the collection.

User avatar
Jeff
2nd Star Corporal
Posts: 30
Joined: Mon Aug 01, 2011 11:34 am
Location: Paris, France
Contact:

Re: Oric HFE file

Post by Jeff »

xahmol wrote:
Sat May 15, 2021 5:02 pm
So in most cases, end users will not be able to do this easily themselves, because you need a number of things to be able to reprogram that Gotek Floppydrive Emulator.
Between 100 and 200 "end users" per month flash the HxC firmware to Gotek. There is nothing difficult and this can be done with a simple usb cable.... Or like you do today, with an usb stick :D

User avatar
xahmol
Flying Officer
Posts: 243
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: Oric HFE file

Post by xahmol »

Jeff wrote:
Sat May 15, 2021 4:37 pm

Once all the "hidden" dsk format constraints/specifications are cleared, i will be able to evaluate this possibility.

Please note that many (most?) Oric dsk images are corrupted/malformed : Bad header, bad sync word, bad crc... The hardware will reject most of them.
The emulator will have to fix them at the load.
Ok. Did not know that (just a user, never dived into the technical formats).
Guess than this community should first invest in updated cross platform tools that create standard compliant and consistent DSK images. Hope persons here take up that gauntlet as I do not see myself doing that.

User avatar
xahmol
Flying Officer
Posts: 243
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: Oric HFE file

Post by xahmol »

Jeff wrote:
Sat May 15, 2021 5:08 pm


Between 100 and 200 "end users" per month flash the HxC firmware to Gotek. There is nothing difficult and this can be done with a simple usb cable.... Or like you do today, with an usb stick :D
Not my text 😉just a copy paste. Will add quote tag to make that clear.

User avatar
Steve M
Squad Leader
Posts: 733
Joined: Fri Mar 24, 2006 3:33 am
Location: Cumbria, UK
Contact:

Re: Oric HFE file

Post by Steve M »

Jeff wrote:
Sat May 15, 2021 1:25 pm

No problem but please don't ask me support anymore then ! (And read the license attached to this software !)
Sorry, I'm not blaming you, just trying to understand what is going on. The latest issue seems to be with your software, so I thought you be interested and maybe would like to know if there was an issue.

I thought the most obvious person to ask about your software would be you.

Either there's an issue with the software or with the source .

I thought it might be beneficial to both of us to highlight the issue.

In my experience most vintage computer users are willing to share information and exchange knowledge. It's what I've done for over 30 years having been involved in various user groups. Sorry if that offends.
Attachments
broken dsk1.jpg
broken disk2.jpg

christian
Pilot Officer
Posts: 90
Joined: Sun Nov 24, 2013 9:58 pm

Re: Oric HFE file

Post by christian »

I checked SEDO40.DSK and hxctest_hfe.dsk from hxctest.zip.

The size of GAP and the order of the sectors are not the same i don't know why but this is not the issue with Oricutron

I found some tracks that seem weird to me.
These are sectors 6 and 7 of track 7 that correspond to your test program (bitmap and basic code) and sectors 2 and 4 of track 20 (directory)

Normal sector format is:
<GAP2> <index field> <GAP3> <data fields> <GAP4>

GAP2: 00 00 00.. A1 A1 A1 (min 8x$00 bytes)
Index Field: FE <track> <side> <sector> <size> <CRC>
GAP3: 4E 4E... 00 00...A1 A1 A1 (22x$4E, 12x$00)
Data Field: FB <data> <CRC>
GAP4: 4E 4E... (min 24x$4E)

<GAP2> <index field> <GAP3> is the "header" of the sector.

Normal sector:

Code: Select all

0001fdb0  4e 4e 4e 4e 4e 4e 4e 4e  4e 4e 4e 4e 4e 4e 4e 4e  |<GAP4> (previous sector)
0001fdc0  4e 4e 4e 4e 4e 4e 4e 4e  4e 4e 4e 4e 4e 4e 4e 4e
0001fdd0  4e 4e

                00 00 00 00 00 00  00 00 00 00 00 00 a1 a1  | <GAP2>
0001fde0  a1
             fe 14 00 06 01 b2 cd                           | <index field> (Track:$14, Side:0, Sector:$06; Size:$1 (256 bytes), CRC: $b2cd)

                                   4e 4e 4e 4e 4e 4e 4e 4e  | <GAP3>
0001fdf0  4e 4e 4e 4e 4e 4e 4e 4e  4e 4e 4e 4e 4e 4e 00 00
0001fe00  00 00 00 00 00 00 00 00  00 00 a1 a1 a1
                                                  fb 00 00  | >Data Field>
0001fe10  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fe20  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fe30  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fe40  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fe50  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fe60  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fe70  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fe80  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fe90  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fea0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001feb0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fec0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fed0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fee0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fef0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001ff00  00 00 00 00 00 00 00 00  00 00 00 00 00 00
                                                     e1 22  | <CRC>

0001ff10  4e 4e 4e 4e 4e 4e 4e 4e  4e 4e 4e 4e 4e 4e 4e 4e  | <GAP4>
0001ff20  4e 4e 4e 4e 4e 4e 4e 4e  4e 4e 4e 4e 4e 4e 4e 4e  |NNNNNNNNNNNNNNNN|
0001ff30  4e 4e
                00 00 00 00 00 00  00 00 00 00 00 00 a1 a1  | <GAP2> (next sector)
Weird sector

Code: Select all

0001faf0  4e 4e 4e 4e 4e 4e 4e 4e  4e 4e 4e 4e 4e 4e 4e 4e  | <GAP4>
0001fb00  4e 4e 4e 4e 4e 4e 4e 4e  4e 4e 4e 4e 4e 4e 4e 4e
0001fb10  4e 4e
                00 00 00 00 00 00  00 00 00 00 00 00 a1 a1  | <GAP2>
0001fb20  a1
             fe 14 00 04 01 d4 af                           | <index field> (Track:$14, Side:0, Sector:$04; Size:$1 (256 bytes), CRC: $d4af)
                                   4e 4e 4e 4e 4e 4e 4e 4e  | <GAP3>
0001fb30  4e 4e 4e 4e 4e 4e 4e 4e  4e 4e 4e 4e 4e 4e 00 00
0001fb40  00 00 00 00 00 00 00 00  00 00 a1 a1 a1
                                                  fb 00 00  |<Data Field>
0001fb50  20 00 00 00 00 00 00 00  00 00 00 00 00 00 54 45  | .............TE|
0001fb60  53 54 20 20 20 20 20 43  4f 4d 07 06 02 40 00 00  |ST     COM...@..|
0001fb70  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fb80  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fb90  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fba0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fbb0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fbc0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fbd0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fbe0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fbf0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fc00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fc10  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fc20  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fc30  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0001fc40  00 00 00 00 00 00 00 00  00 00 00 00 00 00
                                                     a5 5f  | <CRC>

0001fc50  fe 4e 4e 4e 4e 4e 4e 4e  4e 4e 4e 4e 4e 4e 4e 4e  | ?? <GAP4>
0001fc60  4e 4e 4e 4e 4e 4e 4e 4e  4e 4e 4e 4e 4e 4e 4e 4e
0001fc70  4e 4e
You can see a FE byte rbetween the CRC and the GAP4 at the end of the weird sector.
Oricutron looks for $FE byte in the header of the sector to find the sector's spec.
So, it read the sector $04, track $14 until the CRC and then looks for $FE to find the next sector's specs which is here in the GAP4 followed by $4E...

I don't know why there is a $FE after the CRC of all the modified sectors but it shouldn't be there.
Oricutron may be modified to have a better dsk scanning routine but i think hxctest_hfe.dsk is faulty.

If somebody can check the gap at the end of the sector 4 track $14 in hxctest.hfe and see if the $fe byte is here or not.
If it's present then i think the firmware is responsible, if not then it's the conversion from hfe to dsk.

User avatar
Jeff
2nd Star Corporal
Posts: 30
Joined: Mon Aug 01, 2011 11:34 am
Location: Paris, France
Contact:

Re: Oric HFE file

Post by Jeff »

christian wrote:
Sun May 16, 2021 1:14 pm
I don't know why there is a $FE after the CRC of all the modified sectors but it shouldn't be there.
Oricutron may be modified to have a better dsk scanning routine but i think hxctest_hfe.dsk is faulty.

If somebody can check the gap at the end of the sector 4 track $14 in hxctest.hfe and see if the $fe byte is here or not.
If it's present then i think the firmware is responsible, if not then it's the conversion from hfe to dsk.
This is just how the FDC is stopping the sector write. An extra byte is sent to avoid to have the write splice too close to the CRC field. Nothing is "faulty" here. (Please note that the there is no missing clock on this byte -> This is not a sync word...)
Anyway just looking for a single "0xFE" to search a sector/data header is not enough and far to be reliable .
You should search for the "0xA1 0xA1 0xA1 0xFE" sequence, as done in all MFM/DD/HD floppy controllers.

Note :
- 2 completely different firmwares (from the implementation point of view...) was tested .
- Only modified sector appears to have this post CRC "FE" byte.
So the conversion is probably fine and this would be very strange to have the exact same "bug" with two different firmwares.

christian
Pilot Officer
Posts: 90
Joined: Sun Nov 24, 2013 9:58 pm

Re: Oric HFE file

Post by christian »

You're right about Oricutron.

What you are saying is that the FDC automatically adds this extra byte after the CRC, so if we format a floppy disk there will also be this extra byte at the end of the index field?
I don't remember reading this in the FDC specs but maybe I missed it.

The other thing I find weird is that a lot of GAPs seem to be modified when converted or used by the floppy drive (different size), but only the sectors actually modified have this extra byte in the GAP4

Can someone format a sedoric 3, or better ftdos, floppy disk with HxC, convert it to .dsk and make it available?

User avatar
Jeff
2nd Star Corporal
Posts: 30
Joined: Mon Aug 01, 2011 11:34 am
Location: Paris, France
Contact:

Re: Oric HFE file

Post by Jeff »

christian wrote:
Sun May 16, 2021 3:44 pm
You're right about Oricutron.

What you are saying is that the FDC automatically adds this extra byte after the CRC, so if we format a floppy disk there will also be this extra byte at the end of the index field?
I don't remember reading this in the FDC specs but maybe I missed it.
This depend on the FDC model : this might by only some bits with some FDC. And don't forget the write splice. The extras bit(s) + the write splice mixed with the previous data may result to any possible value.
christian wrote:
Sun May 16, 2021 3:44 pm
The other thing I find weird is that a lot of GAPs seem to be modified when converted or used by the floppy drive (different size), but only the sectors actually modified have this extra byte in the GAP4
The others GAP changes are due to the DSK->HFE conversion. Since many DSK files are malformed (bad sector header, gap length, bad crc...), i had to extract the sectors from the image, and regenerate all the tracks "from scratch"...

christian
Pilot Officer
Posts: 90
Joined: Sun Nov 24, 2013 9:58 pm

Re: Oric HFE file

Post by christian »

Jeff wrote:
Sun May 16, 2021 4:52 pm
And don't forget the write splice. The extras bit(s) + the write splice mixed with the previous data may result to any possible value.
Exact.

So, it's time to add some improvements to Oricutron.

Thanks

User avatar
xahmol
Flying Officer
Posts: 243
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: Oric HFE file

Post by xahmol »

christian wrote:
Sun May 16, 2021 5:31 pm
So, it's time to add some improvements to Oricutron.
Not only Oricutron, at least also OricExplorer..... not sure, but maybe also TAP2DSK from OSDK?
For me as a user my problem that there seems not to be a viable way to get data back from the original hardware using the Cumana Reborn.

So actually, it would already help a LOT if OricExplorer, or a any tool that on Windows or Linux can properly retrieve files FROM an adapted HFE image (or the DSK conversion of it) so I can extract the data out of an adapted image on my PC. In that sense, solving it in Oricutron would not even be my first priority.

But great that this thread helps at least to get the problem clear for getting a bug report to the author/maintainer of the right tools.

AtomeX
Private
Posts: 7
Joined: Tue Apr 27, 2021 8:52 am

Re: Oric HFE file

Post by AtomeX »

Hi here is the solution:

First you need to have HxC firmware, FF is not working with HxCfloppyEmulator.

Then you simply have to convert your hfe file to dsk(Oric) and a second time from dsk(Oric) to dsk (Oric) and it's work you can do all you want with OricExplorer or Emulator and then convert back to hfe and use in a real Oric.

I gave you a mastered 2 side disk with no jasmin pub and black and green color.
All the best to all.

Cyril
Attachments
DSKA0002_2sideMasterPatched_hfe_dsk.dsk
(512.75 KiB) Downloaded 42 times

christian
Pilot Officer
Posts: 90
Joined: Sun Nov 24, 2013 9:58 pm

Re: Oric HFE file

Post by christian »

I just submitted a PR for oricutron to correct the problem.

@AtmoeX: thanks

User avatar
iss
Wing Commander
Posts: 1337
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Oric HFE file

Post by iss »

christian wrote:
Mon May 17, 2021 1:47 pm
I just submitted a PR for oricutron to correct the problem.

@AtmoeX: thanks
... and PR merged. I tested it quickly and it seams to work as expected ;).

User avatar
xahmol
Flying Officer
Posts: 243
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: Oric HFE file

Post by xahmol »

AtomeX wrote:
Mon May 17, 2021 1:02 pm
Then you simply have to convert your hfe file to dsk(Oric) and a second time from dsk(Oric) to dsk (Oric) and it's work you can do all you want with OricExplorer or Emulator and then convert back to hfe and use in a real Oric.
Works! Many thanks!
Is a lttle bit cumbersome all that conversions, but it is very doable and a working workaround, so happy! Can now FINALLY analyse the save games from my own game made on original hardware via OricExplorer back on the PC.....
iss wrote:
Mon May 17, 2021 5:50 pm
... and PR merged. I tested it quickly and it seams to work as expected ;).
Great! Can I download an updated binary build somewhere? (could not find it on the Github unless I overlooked something....)
I do not have a Windows C build chain quickly available. Can obviously install one, but that is a bit cumbersome for a quick test.....
Have a Linux C build chain, but under WSL so only CLI, no GUI, so not a handy target to run the build Oricutron in.

Post Reply