WD1793 read-track weirdness

From: Bill Yakowenko <yakowenk_at_yahoo.com>
Date: Thu Mar 25 22:34:31 2004

Hey all,

Has anybody out there written drivers for the WD1793 floppy
disk controller chip? I've been doing that for fun, and have
hit on a very strange problem with the 'read track' command.
It seems to work just fine, returning a stream of bytes that
includes the data for each sector, until it finds a byte with
a value of $29 (or 29H, if you prefer). From that point up
to the next address mark, it gets garbled data. No other data
value seems to have any odd effect. 'Read sector' returns
the right data with no weirdness.

It is extremely consistent; using read-sector and write-sector,
I can add/move/remove bytes with that value, and get the same
result every time: read-track returns garbled from the $29 up
to the next address mark.

At first I thought it was just losing synchronization, because
the address mark (at which it synchronizes) puts it back on
track. But the garbling seems weirder than just out-of-sync.
After the $29 byte, it seems to be OR-ing the byte with itself
shifted right one bit, and then inverting that. More precisely,
it seems to be doing something like this (in 'C' notation):

        found_29 = 0;
        while ( /* whatever */ ) {
                input = get_input(); // input from disk
                if ( got_address_mark() ) found_29 = 0;
                if (found_29) {
                        carry = (prev_input & 1) << 7;
                        output( ~ ( input | carry | (input>>1) ) );
                } else if (input == 0x29) {
                        found_29 = 1;
                        output( 0x14 );
                        continue;
                } else {
                        output( input );
                }
                prev_input = input;
        }

In case it's relevant, it is a Radio Shack Color Computer 2,
with a standard controller cartridge. (The label has wandered
off, so I'm not sure whether it is the older or newer model of
controller.)

I don't suppose anyone would care to venture an explanation?
Anyone? Anyone? ....

        Cheers,
        Bill.

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html
Received on Thu Mar 25 2004 - 22:34:31 GMT

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:37:06 BST