Well, after much thought, pondering, and discussion with David, I finally implemented a working byte-sync routine to my SX software.
I don’t have it fully working with the PC side software yet, because this requires semi-major surgery on that side.
I added it to the transfer routine, aka fram -> usb, and here’s how I did it:
Basically did a
for loop = 1 to 14 (sectors)
for insideloop=1 to 1088(bytes in a sector)
where findsync() looks for a $4489, and when it finds one, it returns with the fram properly aligned to start recv’ing bytes, I send 1088 bytes, and then I look for another sync.
This has a downside of eating the AAAA AAAA 4489, so each sector starts with just a “4489” but who cares?
I ran some quick numbers and the time penalty for doing this MIGHT be 1/2 second per disk! So it’s really quite reasonable in terms of time. 380ns per bit avg, 500ns worst case. And this is only on NON-sync’d data. So only something like 1000 or 1100 bytes per disk. Data at beginning of read + gap. So minimum 830 bytes, maximum of 830+1087 bytes. OK, so maybe around 1800.
This really drops the PC requirement as far as software. I can get rid of all those damn bitshifting routines, searching for sectors, retrieving data properly shifted, etc. All bytes will arrive properly shifted. This means much smaller code, easier to read/write, and so on.
I have other plans in the back of my head, too. DOWN THE ROAD, I want to start looking at semi-realtime transparent reads. Eliminate the buffer…