[Coco] Vcc and real floppy disks

Robert Gault robert.gault at worldnet.att.net
Fri Sep 26 15:06:05 EDT 2008


Darren A wrote:
> I was referring to the FDC command code bits; not the bits for the
> Drive / Side select latch.  In the source code I have for rb1773, it
> appears that command $80 is always issued for a Read Sector and $A0
> for a Write Sector. Ideally, when working with a true double-sided
> disk, the FDC commands used would be:
> 
> $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.

> 
> By using $80 and $A0, the driver is telling the WD17x3 that it doesn't
> care about the SIDE number in the sector's ID field and that it should
> search using only the TRACK and SECTOR numbers.

Correct.

> Unfortunately, on the
> PC (or at least with FdRawcmd.sys) the SIDE number is always required
> to identify the targeted sector. The VCC emulator needs to know what
> to supply for the SIDE number. If it uses bit 6 of $FF40 for this
> purpose then it won't be able to access a single-sided format on the
> back side of the disk. If the driver used the commands for
> side-specific access, then bit 6 of $FF40 can be used solely to
> indicate the physical head, and the bits in the command code can be
> used to determine the SIDE number for the sector ID field.
> 
> Darren

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.



More information about the Coco mailing list