[Coco] CoCo Disk Basic and head banging

Arthur Flexser flexser at fiu.edu
Mon Jan 3 11:34:56 EST 2022


Much of the head banging in some cases is due to patching Disk Basic's
drive mask values to allow double-sided drives with Drive 2 as the back of
Drive0 and Drive 3 as the back of Drive 1.  This patch, by itself, worsens
the track position confusion since Disk Basic does not know to update Drive
2's track position when the track position of Drive 0 is changed, etc.  A
proper double-sided patch changes the track position table from four values
to only two.

There is also a further issue due to some inappropriate logic in the disk
controller chip.  When the head bangs into the zero stop on its way to a
track that doesn't exist, the controller chip tries to correct the
situation by changing its track position register to zero, appropriately.
But it also, inappropriately, changes its DESTINATION track register value
to zero.  So, the chip, now seeing that the current track matches the
destination track, performs the selected operation on Track 0.  This causes
havoc when the current operation is updating the GAT, for the updated GAT
is written to Track 0 Sector 2 instead of Track 17 Sector 2.  When the
diskette is subsequently accessed, you typically get a ?FS (file structure)
error.  If you've ever seen one of these errors, which render the diskette
useless, this problem was almost certainly the cause.   I experienced this
error a few times prior to patching Disk Basic to fix this, and never saw
the dreaded ?FS ERROR message again.  (Of course, if you know the cause,
you should be able to repair the diskette by copying T0, S2 to T17, S2.)

Art

On Mon, Jan 3, 2022 at 9:06 AM Rick Ulland <rickulland1 at gmail.com> wrote:

> Thank you for clearing this up. Don't mind not knowing, hate getting it
> wrong.
>
> -rick
>
>
> On 1/1/22 6:01 PM, Robert Gault wrote:
> > For most of us there will be head banging with floppies because Disk
> Basic ignored this issue. I wrote a patch for the Disk ROM and included
> code to prevent head banging regardless of the type of floppy drive.
> > I assigned a byte in low RAM as last drive used. When initializing Disk
> Basic, that bytes was set to $FF. Each time Basic needed to read or write
> to a disk, the new code checked to see if the drive had changed by
> comparing the needed drive with LASTDR. If there was a difference, and
> there always was at turn on, the drive was told to read the head address:
> #$C0 sent to $FF48.
> > So knowing where the drive head was located, there was no reason to
> attempt to move the head an arbitrary number of tracks to a lower number
> which might actually be a "negative" one.
> >
> > Sent from AT&T Yahoo Mail on Android
> >
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>


More information about the Coco mailing list