I’m beginning to think more and more that my software on the SX is just fine. Perhaps minus the idle routine mentioned in the last post. I have to do something there.
However, without the idle routine, I was only seeing a couple sector headers out of 11+ in one diskmontools read that were properly byte-aligned. I was wondering if there were other sectors there, but hidden from view because they were bit-shifted. I calculated 0xAAAA 0xAAAA 0x4489 0x4489 shifted left by one through 7 bits, to get seven different results. I searched on the remaining center two bytes and got hits on practically all of them.
Out of 13k+, I should be getting 11-12 sectors, and I found 11 sector headers. This is very good news. I have to automate this process to really see the results of the overall read, but I think I’m onto something here.
I’m going to update Marco’s code from the afr(amiga floppy reader), which looks pretty portable. His code relies on some assumptions about global variables, etc etc so I’ll haveta play with writing some code to drive his routines, but this should be easy.
Right now I’m remaining cautiously optimistic about the results.
What Marco does is basically first do a bit by bit search for the FIRST sector header, and then assumes the rest of the sector headers are shifted by the same amount. In my most recent case, I found that there there five sectors shifted by x, 3 shfited by y, and 3 shifted by z. It’s interesting that they are grouped together. If Marco’s code can’t find the next sector header byte-aligned (after adjusting for the preliminary bit-shift result), then he goes right back to bit-shifting.
This tells me that he expected sectors to not be byte-aligned AND he expected the sector-headers plus data etc to be bit-shifted too. This is important, and the results will be interesting here.