jfdelnero / HxCFloppyEmulator

HxC Floppy Drive Emulator toolkit
https://hxc2001.com/floppy_drive_emulator/
87 stars 13 forks source link

Trying to use HxCFloppyEmulator to remove padding from an image but results in missing sector #4

Open n6il opened 1 year ago

n6il commented 1 year ago

Goal: Convert a FLEX DSK image with padding on Track 0 into a DMK file without padding Method: Made a custom XML which skips the padding sectors on Track 0 Result: Using the raw importer and the XML results in one missing sector at the end Versions Used: 2.5.6.6(Win) 2.14.4.1(Mac), 2.14.6.2(Mac)

The FLEX disk in question is a relatively standard one. Track 0: IBM_FM 10 sectors 256 bytes Tracks 1-34 IBM_MFM 18 sectors 256 bytes Sides: 1

The CCSPELL.DSK disk image is a sector image with padding. All tracks in this image, including track 0, have 18 sectors. So as stated in the goal, I want to remove the padding sectors. I created the custom XML which reads the first 10 sectors of track 0, then the offset where track 1 starts skips over the 8 padding sectors. If I import the disk image using this XML the result is that the last sector of Track 34 Sector 18 is always missing -- the data is filled with the fill value instead of the actual data. Everything else in the image other than this correct.

As an experiment I made a test image (test.dsk) For this image I appended 2560 additional bytes on the end of CCSPELL.DSK. When I use the XML to import this file then the missing sector is present. The results of this experiment suggest that something is getting confused somewhere when the image is being imported.

Attachments in the Zip File CCSPELL.DSK DiskLayout_FLEX_SSDD_35T_padding_removed.xml test.dsk ccspell.zip

jfdelnero commented 1 year ago

Hello, Thanks for reporting this issue.

The bug is now fixed : https://hxc2001.com/download/floppy_drive_emulator/HxCFloppyEmulator_soft_beta.zip

n6il commented 1 year ago

Thanks so much for the quick fix! I verified that it works correctly now, it did indeed seem like an off-by-one somewhere.

If you don't mind if I ask a related question... If I wanted to put the padding back in, how would I do that with HxCFloppyEmulator Software? Is there something I can put in the XML so it will add empty sectors which only contain the fill value?

jfdelnero commented 1 year ago

I need to add an xml guided export function to support this. This shouldn't be too hard to add.