Jeff Epler's blog2022-04-15T02:14:10ZPhotos, electronics, cnc, and moreJeff Eplerjepler@unpythonic.netAn interesting finding about Apple DOS 3.3 diskettes2022-04-15T02:14:10Z2022-04-15T02:14:10Zhttps://emergent.unpythonic.net/01649988850
<p>I can't be the first to have noticed this, but if somebody wrote about it years
ago there's no way a search engine today will turn it up since they over-value
recency and pay little attention to little sites with niche information.
So here's my write-up. It feels a little inconclusive, but so be it. I <em>imagine</em> that these disks were mastered in an unsual way, rather than by duplicating a disk written on an Apple II using normal Apple II RWTS code.
<p>I've been working on <a href="https://github.com/jepler/passport.py/tree/rawconvert">an open source tool to convert .a2r to .woz</a>. While
doing so, I got pretty low level with the Apple flux encoding.
<p>This encoding varied over the years, and of course what really matters is
what would work on real machines in the wild.
<p>But one central claim about Apple floppy formats is that early DOS before 3.3 used the repeated bit sequence "1111 1111 0" to allow the floppy interace's state machine to synchronize with the stream of bits on the floppy. Starting with DOS 3.3 and continuing with ProDOS, and ProDOS, the bit sequence "1111 1111 00" is used instead. The newer sequence (also called FF40, because its hex value is FF and it takes 10 bits or 40 microseconds to transmit; the old code is also called FF36) is longer, but fewer repetitions are required to guarantee synchronization.
<p>So I was surprised to see the following when I peered into "DOS 3.3 System Master [1983] - Disk 1, Side A.a2r" from <a href="https://archive.org/details/CowgodA2R">CowgodA2R on archive.org</a> (as are all the a2r files I inspected for this blog post):
<pre>
111111110 FF36
111111110 FF36
111111110 FF36
111111110 FF36
111111110 FF36
111111110 FF36
111111110 FF36
111111110 FF36
111111110 FF36
111111110 FF36
111111110 FF36
111111110 FF36
111111110 FF36
111111110 FF36
111111110 FF36
111111110 FF36
111111110 FF36
111111110 FF36
111111110 FF36
111111110 FF36
11111111 FF
11010101 D5
10101010 AA
10010110 96
11111111 FF
11111110 FE
10101010 AA
10101010 AA
10101111 AF
10101010 AA
11111010 FA
11111110 FE
11011110 DE
10101010 AA
</pre>
<p>That's right, the FF36 sequence appears in this DOS 3.3 floppy from 1983. Essentially the same sequence is seen on ProDOS User's Disk - Disk 1, Side A.a2r.
<p>An even odder sequence is seen on the 1980 edition of DOS 3.3:
<pre>
1111111100 FF40
1111111100 FF40
1111111100 FF40
1111111100 FF40
1111111100 FF40
1111111100 FF40
1111111100 FF40
1111111100 FF40
1111111100 FF40
1111111100 FF40
111111110 FF36
1111111100 FF40
11111111 FF
11111111 FF
11001111 CF
11110011 F3
11111100 FC
11111111 FF
11010101 D5
10101010 AA
10010110 96
11111111 FF
11111110 FE
10101010 AA
10101010 AA
10101011 AB
10101110 AE
11111110 FE
11111010 FA
11011110 DE
10101010 AA
</pre>
<p>The CF/F3/FC/FF sequence would be an FF40 sequence if the earlier FF bytes hadn't already left you synchronized, but .. there's absolutely no reason for it!
<p>Finally, a disk from the "non-originals" section, which I assume means it's cracked software, has the sequence I expect (more or less) based on reading documentation from the time as well as modern emulator source code:
<pre>
1111111100 FF40
1111111100 FF40
1111111100 FF40
1111111100 FF40
1111111100 FF40
1111111100 FF40
1111111100 FF40
1111111100 FF40
1111111100 FF40
1111111100 FF40
1111111100 FF40
11111111 FF
11010101 D5
10101010 AA
10010110 96
11111111 FF
11111110 FE
10101010 AA
10101010 AA
10101010 AA
10101011 AB
11111111 FF
11111111 FF
11111111 FF
11111111 FF
11101000 E8
10111111 BF
11111100 FC
</pre>