<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
<link rel="alternate" type="text/html" href="https://gamma.unpythonic.net/"/>

<title>Jeff Epler's blog</title>
<modified>2022-04-15T16:23:27Z</modified>
<tagline>Photos, electronics, cnc, and more</tagline>
<author><name>Jeff Epler</name><email>jepler@unpythonic.net</email></author>
<entry>
<title>Generate the 64 GCR values used by Apple DOS 3.3 and ProDos</title>
<issued>2022-04-15T16:23:27Z</issued>
<modified>2022-04-15T16:23:27Z</modified>
<id>https://gamma.unpythonic.net/01650039807</id>
<link rel="alternate" type="text/html" href="https://gamma.unpythonic.net/01650039807"/>
<content type="text/html" mode="escaped">

&lt;pre&gt;
for i in range(128):
    b = f&quot;{i:07b}&quot;                    # All these tests apply to the low 7 bits
    if '000' in b: continue           # 3 consecutive zeros disallowed
    if b.count('00') &amp;gt; 1: continue    # only one pair of consecutive 0s allowed
    if not '11' in b: continue        # one pair of consecutive 1s required 
    print(hex(i | 128), bin(i | 128)) # top bit is always a 1
&lt;/pre&gt;
</content>
</entry>
<entry>
<title>An interesting finding about Apple DOS 3.3 diskettes</title>
<issued>2022-04-15T02:14:10Z</issued>
<modified>2022-04-15T02:14:10Z</modified>
<id>https://gamma.unpythonic.net/01649988850</id>
<link rel="alternate" type="text/html" href="https://gamma.unpythonic.net/01649988850"/>
<content type="text/html" mode="escaped">


&lt;p&gt;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 &lt;em&gt;imagine&lt;/em&gt; 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.

&lt;p&gt;I've been working on &lt;a href=&quot;https://github.com/jepler/passport.py/tree/rawconvert&quot;&gt;an open source tool to convert .a2r to .woz&lt;/a&gt;. While
doing so, I got pretty low level with the Apple flux encoding.

&lt;p&gt;This encoding varied over the years, and of course what really matters is
what would work on real machines in the wild.

&lt;p&gt;But one central claim about Apple floppy formats is that early DOS before 3.3 used the repeated bit sequence &amp;quot;1111 1111 0&amp;quot; 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 &amp;quot;1111 1111 00&amp;quot; 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.

&lt;p&gt;So I was surprised to see the following when I peered into &amp;quot;DOS 3.3 System Master [1983] - Disk 1, Side A.a2r&amp;quot; from &lt;a href=&quot;https://archive.org/details/CowgodA2R&quot;&gt;CowgodA2R on archive.org&lt;/a&gt; (as are all the a2r files I inspected for this blog post):
&lt;pre&gt;
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
&lt;/pre&gt;

&lt;p&gt;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.

&lt;p&gt;An even odder sequence is seen on the 1980 edition of DOS 3.3:
&lt;pre&gt;
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
&lt;/pre&gt;

&lt;p&gt;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!

&lt;p&gt;Finally, a disk from the &amp;quot;non-originals&amp;quot; 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:
&lt;pre&gt;
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
&lt;/pre&gt;
</content>
</entry>
<entry>
<title>An interesting Disk ][ Interface Card Fault</title>
<issued>2022-03-15T21:13:12Z</issued>
<modified>2022-03-15T21:13:12Z</modified>
<id>https://gamma.unpythonic.net/01647378792</id>
<link rel="alternate" type="text/html" href="https://gamma.unpythonic.net/01647378792"/>
<content type="text/html" mode="escaped">
tl;dr: I recently got into 8-bit Apple retrocomputing due to my work with
Adafruit.  I had a Disk II setup that couldn't write to any floppy. I fixed it
by replacing a 74LS05 IC on the Disk II Interface Card.</content>
</entry>
</feed>
