foft Posted June 23, 2014 Share Posted June 23, 2014 I'm investigating why some large ATR images are not working with the drive emulator I built into the FPGA. The images work fine with ASPEQT, but not with my code. I thought the easiest way to debug would be to just check a few sector contents via a sector editor. However I can't find one that works with such large images and double density. Are there any that support this? I can't see anything simple wrong with my code to access the atr sectors: location = offset; if (sector>3) { sector-=4; location += 128*3; location += sector*atr_header.wSecSize; sectorSize = atr_header.wSecSize; } else { location += 128*(sector-1); sectorSize = 128; } I heard some disks incorrectly have 256 bytes for the first 3 sectors. Is there a good way to check if that is the case? Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted June 23, 2014 Share Posted June 23, 2014 (edited) EDDY (SpartaDOS X toolkit) will handle these on the A8. The best way (I found) to check for long or short boot sectors was to compute the would-be size of the file according to the paragraph count in the header, then compare this with the actual ATR file size. EDIT: actually I had no recourse to the FAT file size at all. I think I convert paragraphs to bytes, divide by 256, and check if there's any remainder. If there is, the boot sectors are short. Edited June 23, 2014 by flashjazzcat Quote Link to comment Share on other sites More sharing options...
phaeron Posted June 24, 2014 Share Posted June 24, 2014 I guess "how you really read ATR files" is another document we need written.... Checking the paragraph count is also the way I handle it in Altirra. Note that if you do encounter this case, there are two subtypes of screwiness to deal with: each 128 byte sector padded to 256 bytes, and three 128 byte sectors followed by 384 bytes of padding. I handle this by checking for whether the second and fifth 128-byte slots are empty. 2 Quote Link to comment Share on other sites More sharing options...
foft Posted June 24, 2014 Author Share Posted June 24, 2014 (edited) Great thanks. I've just downloaded SDX - I wasn't aware of the update project, fantastic! Errr, they all need flashing to expansions, no boot disk? Thanks for the info on 'how to really read ATR files'. I've not come across any like that yet (I checked this in a sector editor) but sure I will! Edited June 24, 2014 by foft Quote Link to comment Share on other sites More sharing options...
foft Posted June 24, 2014 Author Share Posted June 24, 2014 (edited) Well I didn't manage to get Eddy running, crashed on Spartados 3.2 for some reason. I found the issue thanks to Russg's rw13.bas - as referenced here http://atariage.com/forums/topic/223509-floppy-verifier/. Put one disk in aspeqt and the other in my drive emulation... It showed it stopped working at sector 32768! Sure enough looking at the code I'm anding aux2 with 0x7f. Not sure why I'm clearing the top bit, but that appears to be the cause here. Edited June 24, 2014 by foft Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.