[Coco] Vcc and real floppy disks
Darren A
mechacoco at gmail.com
Sat Sep 27 12:34:20 EDT 2008
On 9/26/08, Robert Gault wrote:
>>
>> $82 for a Read Sector on Side 0
>> $86 for a Read Sector on Side 1
>> $A2 for a Write Sector on Side 0
>> $A6 for a Write Sector on Side 1
>
> Not so. There are two sets of commands:
> $80 read side 0
> $88 read side 1
> $A0 write side 0
> $A8 write side 1
> and
> $82 read side 0 with side compare
> $8A read side 1 with side compare
> with no analogous command for write as it becomes precomp. Your example
> uses bit2 which is the 30ms settling delay.
No. There are 4 distinct commands that perform Side Comparison. I used
the wrong values in my original post. They should have been:
$82 for a Read Sector on Side 0
$8A for a Read Sector on Side 1
$A2 for a Write Sector on Side 0
$AA for a Write Sector on Side 1
> Well the problem may indeed be fdrawcmd.sys. Here is how the controllers
> work on a real Coco.
>
> The latch at $FF40 is used for side Select while the latch at $FF48 is
> used to Compare sides under certain copy protection schemes. You can
> study either the DSKCON or rb1773 code and see that this scheme is still
> being used.
>
> Note the emphasis on Compare vs Select. There are two bits in WD1773
> and WD1793 type II commands used to control which head is selected. Bit1
> enables/disables side compare. Bit3 selects side0 or side1.
> Without a circuit diagram, I can only infer what happens based on
> actual results. It looks like $FF40 is used to control bit 3 of a
> command while $FF48 is used to control bit 1. There is no question that
> with the DSKCON code, changing the drive masks permits access to the
> second side of a disk even though the $FF48 command does not change. The
> same is true of my own OS-9 drivers.
> In short, you can tell the WD1773 to select a side without making a
> comparison. There are Coco copy protection schemes that mismatch the
> sector/track IDs with Actual side vs Reported side.
>
> Fdrawcmd.sys should accept bits as described in the Western Digital
> manual. In that case, you can look at $FF40 to obtain the value of bit3
> and look at $FF48 to obtain the value for bit1 of the WD1773 command.
You are mistaken about how WD1773 and WD1793 FDCs operate. There is no
SIDE SELECT on the WD17x3. That feature is available in WD1795 and
WD1797 FDCs (among others). Bit 3 is 'SIDE COMPARE' and indicates
which side you are comparing for. Bit 1 is 'ENABLE SIDE COMPARE' and
must be set to 1 in order for bit 3 to have any meaning. Also, bit 1
is NOT used for PRECOMP on the WD17x3, but only in the WD1770 and
WD1772. The WD17x3 gets PRECOMP ENABLE from pin 20. This is why you
have to set the PRECOMP bit in the $FF40 latch.
The latch at $FF40 is not a part of the WD1773. Setting bit 6 in $FF40
has no effect on the operation of the FDC whatsoever. That bit
directly drives a control line to the disk drive. On double-sided
drives that line is used to control which head is enabled for
read/write. The WD17x3 takes no part in the Side Selection process.
Bits 1 and 3 in the TYPE II commands for a WD17x3 are used for Side
Comparison only. They can be used in both Read and Write operations.
The WD17x3 does not require Side Comparison and neither Disk Basic nor
the rb1773 driver appear to utilize it. The standard controller in a
PC does require Side Comparison. This is a problem for VCC when
working with real disks. It has to specify a Side Compare value when
reading and writing sectors, but since the CoCo software does not do
so, it can't know for sure what value to use.
One possible solution for VCC would be to use a Side Compare value
that matches the Side Select bit from $FF40. If that fails, it could
try a second time with the opposite value. If that suuceeds it could
then cache the value for subsequent operations on that side of the
disk.
Darren
More information about the Coco
mailing list