ADTPro / adtpro

Apple Disk Transfer ProDOS (ADTPro)
http://adtpro.com
GNU General Public License v2.0
131 stars 19 forks source link

ProDOS formatting attempts to write 36 tracks rather than 35 #163

Open einstein95 opened 1 year ago

einstein95 commented 1 year ago

After writing track 0, the ProDOS formatting code then writes 35 more tracks in the MInc function (with TRKend defined to be 35): https://github.com/ADTPro/adtpro/blob/552170569181b05e810bdbcca6828efab3b3ae83/src/client/prodos/format.asm#L547-L552

I noticed this in MAME, as writing the 36th track will increase the size of the .dsk file (to 147,456 bytes), making it unreadable to other applications.

david-schmidt commented 1 year ago

I believe that's true, it'll iterate for 36 writes when initializing a disk. But does this actually cause a problem in practice? ADTPro won't read or write 36 tracks when transferring disks, and won't ever create a .dsk that is the wrong size.

I think I see what you're saying now - it's MAME that will bump up the size, because it sees the additional seek/write and decides to modify the underlying disk image. That's definitely a Bad Thing(tm). I see the bug is present in the original Hyper-FORMAT II code, and it transcribed as-is in ADTPro...