[Coco] [COCO] Proposed HDBDOS Patch

Arthur Flexser flexser at fiu.edu
Mon Jan 26 18:20:47 EST 2015


I haven't pored over your code to see exactly what it is doing.  But,
here's my recollection of some fixes that were incorporated in ADOS that
may be of help.

1.  DSKINI was modified so that the verify pass starts at the highest track
and proceeds backwards to zero, so the head automatically winds up at track
0 with no restore needed.

2.  Fix for the "head-banging" bug:  On cold start, $FF is loaded
into Basic's 4 track registers.  The first time a drive is accessed,
determined by checking whether that $FF is still there, the drive is
restored to track 0 and the track register gets zeroed prior to seeking the
desired track.

3.  Double-sided operation:  If the DOS is configured for double-sided
drives, two of the 4 track registers aren't used, so that Basic has a
single value for the track location of a double-sided drive that is updated
when either side of the drive is accessed.

Hope that's helpful.

Art

On Mon, Jan 26, 2015 at 5:54 PM, David Ladd <davidwladd at gmail.com> wrote:

> Everyone,
>
> Here is the next patch that I was talking about previously proposed.
>
> This patch includes a track 0 seek at the end of the verify process of
> DSKINI
>
> This patch also required change of the side encoding code to change from X
> register to the use of the Y register so could get enough space to add the
> track 0 seek code.
>
> Here is the diff output from HG for HDBDOS.ASM
> -----------------------------------------------
> diff -r c850a6e703b2 hdbdos/hdbdos.asm
> --- a/hdbdos/hdbdos.asm    Wed Jan 21 11:11:07 2015 -0600
> +++ b/hdbdos/hdbdos.asm    Mon Jan 26 16:36:44 2015 -0600
> @@ -3321,7 +3321,7 @@
>                 inca                          = ADD ONE TO IT, COMPARE TO
> THE MAXIMUM TRACK
>                 cmpa      #TRKMAX             = NUMBER AND KEEP LOOPING IF
>                 blo       LD66F               = THERE ARE STILL TRACKS TO
> DO
> -               jmp       >BEEP
> +               jmp       >FDPAT1
>  *    JMP    >LD2CD    GO CHECK FOR A DOS RESET
>  LD688          clr       DRGRAM              CLEAR RAM IMAGE OF DSKREG
>                 clr       DSKREG              CLEAR DSKREG - TURN DISK
> MOTORS OFF
> @@ -3341,7 +3341,7 @@
>                 bsr       LD6C8               * WRITE THEM TO BUFFER
>                 lda       DCTRK               = GET TRACK NUMBER AND STORE
> lT
>                 sta       ,X+                 = IN THE RAM BUFFER
> -               lbsr      TFSIDE              branch to sub routine that
> deals with the side
> +               jsr       TFSIDE              branch to sub routine that
> deals with the side
>                 NOP                           This NOP is used to keep rom
> spacing correct
>  *               clr       ,X+                 CLEAR A BYTE (SIDE NUMBER)
> IN BUFFER
>  *               lda       DSEC                * GET SECTOR NUMBER AND
> @@ -3357,7 +3357,7 @@
>  LD6C2          stb       ,X+                 STORE A BYTE IN THE BUFFER
>                 deca                          DECREMENT COUNTER
>                 bne       LD6C2               BRANCH IF ALL BYTES NOT MOVED
> -               rts
> +               rts
>  LD6C8          pshs      B                   SAVE THE COUNTER ON THE STACK
>                 ldd       ,U++                GET TWO BYTES OF DATA FROM
> THE TABLE
>                 bsr       LD6C2               WRITE ACCA BYTES OF ACCB INTO
> THE BUFFER
> @@ -3694,11 +3694,10 @@
>                 puls      d,x,pc              Restore & return
>
>  * SIDE select portion of the track buffer format routine.
> -TFSIDE         pshs      x                   Backup X onto stack
> -               ldx       #LD89D              Set X to point to drive table
> +TFSIDE         EQU       *
> +               ldy       #LD89D              Set Y to point to drive table
>                 ldb       <DCDRV              Get current drive from DCDRV
> -               ldb       b,x                 Get drive masks from drive
> table for B
> -               puls      x                   Restore X from stack
> +               ldb       b,y                 Get drive masks from drive
> table for B
>                 clra                          clear A to have it ready for
> bit6 from B
>                 lslb                          roll bit 7 into C and bit 6
> into N
>                 lslb                          roll what was bit 6 into C
> @@ -3706,8 +3705,11 @@
>                 sta       ,x+                 store A into track format
> buffer
>                 lda       DSEC                * GET SECTOR NUMBER AND
>                 rts
> +FDPAT1         CLR       DCOPC   RESTORE HEAD TO TRACK ZERO DSKCON OP CODE
> +               JSR       >LD6F2  RESTORE HEAD TO TRACK ZERO
> +               jmp       >BEEP
>  * These fcb's are filler
> -               fcb       $FF,$FF,$FF,$FF,$FF
> +*               fcb       $FF,$FF,$FF,$FF,$FF
>  * This fcb is also filler and is used to help check ROM locations
>                 fcb       $99
>
> ---------------------------------------
> Please reply with commends about this and as well if the code looks
> acceptable enough for pushing to the repo.
>
> I have verified this code actually works as I had a DSKINI loop going for 5
> hours.  No lockups and defeater still reports the side select is still
> encoded correctly.  After DSKINI finished both the low level format and
> verify the heads were reset back to track 0 after verify was complete.
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>


More information about the Coco mailing list