DMK to HFE conversion problem

General discussion forum - for all that doesn't fit in any other category.
Post Reply
pnp2084
Posts: 2
Joined: Tue Aug 11, 2020 7:28 am

DMK to HFE conversion problem

Post by pnp2084 »

First, thanks for documenting your format and providing the tools, it is very helpful in understanding it! But I think I found a bug.

I was using HxCFloppyEmulator.exe to convert some TRS-80 DMK files to HFE and ran into a problem with TRSDOS23.DMK

The problem seems to be with Track 17 sector ID 02. The IDAM looks like "FE 11 00 02 FA A2" and when converted, the first FA is clocked with C7 but the subsequent FA (which starts the DAM) is left unmarked with a clock of FF.

If I understand the log correctly, the marking is done at FM 054C where it marks the 5th byte after the IDAM (instead of the expected 0x18 byte)
DEBUG : Track 17 Side 0 Tracklen 3264 TTableOffset:0x0000d8d0
DEBUG : ----------------------------
DEBUG : IDAM Code : 0x0094
DEBUG : FM 0094 - 0018
DEBUG : IDAM Code : 0x01C2
DEBUG : FM 01C2 - 0018
DEBUG : IDAM Code : 0x02F0
DEBUG : FM 02F0 - 0018
DEBUG : IDAM Code : 0x041E
DEBUG : FM 041E - 0018
DEBUG : IDAM Code : 0x054C
DEBUG : FM 054C - 0005
DEBUG : IDAM Code : 0x067A
DEBUG : FM 067A - 0018
DEBUG : IDAM Code : 0x07A8
DEBUG : FM 07A8 - 0018
DEBUG : IDAM Code : 0x08D6
DEBUG : FM 08D6 - 0018
DEBUG : IDAM Code : 0x0A04
DEBUG : FM 0A04 - 0018
DEBUG : IDAM Code : 0x0B32
DEBUG : FM 0B32 - 0018
From what I can understand from dmk_loader.c I think the fix is around line 262 in DMKpatchtrack()

Code: Select all

j=8*(trackstep*2);
Should be:

Code: Select all

j=8*(trackstep+1);
Then j should skip the IDAM data before looking for FB...FA to clock.

I've attached the original TRSDOS23.DMK file and the converted TRSDOS23.HFE
Attachments
TRSDOS.zip
TRSDOS 2.3 DMK format and HFE converted.
(95.98 KiB) Downloaded 134 times

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

Re: DMK to HFE conversion problem

Post by Jeff »

Thanks. Yes this appears to fix the issue. This is now on the repository.

pnp2084
Posts: 2
Joined: Tue Aug 11, 2020 7:28 am

Re: DMK to HFE conversion problem

Post by pnp2084 »

That was fast! Thanks for putting in the fix.

Post Reply