[Coco] HDBDOS - RETRIEVE FIXED!!

David Ladd davidwladd at gmail.com
Tue Jan 20 13:14:36 EST 2015


Chad,

I am posting the code snips that I changed in the hdbdos.asm file here for
now till Tormod has a chance to review my changes..

I changed some code between labels LD69A and LD6C2:
LD691          ldx       >$1F
               ldd       #$204E              GET SET TO WRITE 32 BYTES OF
$4E
               bsr       LD6C2               GO WRITE GAP IV
               clrb                          RESET    SECTOR COUNTER
LD69A          pshs      B                   SAVE SECTOR COUNTER
               ldu       #DBUF1              POINT U TO THE TABLE OF
LOGICAL SECTORS
               ldb       B,U                 * GET LOGICAL SECTOR NUMBER
FROM TABLE AND
               stb       DSEC                * SAVE IT IN THE DSKCON
VARIABLE
               ldu       #LD6D4              POINT U TO TABLE OF SECTOR
FORMATTING DATA
               ldb       #$03                * GET FIRST 3 DATA BLOCKS AND
               bsr       LD6C8               * WRITE THEM TO BUFFER
               lda       DCTRK               = GET TRACK NUMBER AND STORE lT
               sta       ,X+                 = IN THE RAM BUFFER
               lbsr      TFSIDE
               NOP
*               clr       ,X+                 CLEAR A BYTE (SIDE NUMBER) IN
BUFFER
*               lda       DSEC                * GET SECTOR NUMBER AND
               sta       ,X+                 * STORE IT IN THE BUFFER
               ldb       #$09                = GET THE LAST NINE DATA
BLOCKS AND
               bsr       LD6C8               = WRITE THEM TO THE BUFFER
               puls      B                   GET SECTOR COUNTER
               incb                          NEXT SECTOR
               cmpb      #SECMAX             18 SECTORS PER TRACK
               blo       LD69A               BRANCH IF ALL SECTORS NOT DONE
               ldd       #$C84E              WRITE 200 BYTES OF $4E AT END
OF TRACK
* WRITE ACCA BYTES OF ACCB INTO BUFFER

Now Chad I also added the new sub code under DOSIN2 section.  I am posting
that area of the code here now:
DOSIN2         ldd       #(6*256)+$3B        6 "RTI" opcodes
               ldx       #$100               Point to SWI vectors
               jsr       >LD6C2               Store 6 RTIs
               puls      d,x,pc              Restore & return

* SIDE select portion of the track buffer format routine.
TFSIDE         pshs      x
               ldx       #LD89D
               ldb       <DCDRV
               ldb       b,x
               puls      x
               clra
               lslb
               lslb
               rola
               sta       ,x+
               lda       DSEC
               rts

               fcb       $FF,$FF,$FF,$FF,$FF
               fcb       $99


* HDB-DOS Version

Now the reasons for me changing the code in the main track building routine
was to keep the code space size the same.  I then branch sub routine to the
code that was added after the DOSIN2 routine. Then I return.  I also
shortened the FCB section there again to keep all code space size the same.

William Astle actually gave me the optimized code for the TFSIDE section as
mine was a few bytes larger.

Now just so you know I did do a test on a real floppy disk drive with a
real floppy disk for 5 HOURS!  I didn't get any nice sparklies or other
crazy stuff.  I also verified that the side select value was encoded into
the track data correctly using DEFEATER to read in a track and looking at
what the convert option told me.

So as far as I can tell it is stable.


On Sun, Jan 18, 2015 at 11:24 AM, Chad H <chadbh74 at hotmail.com> wrote:
> Yayyy!!!  After 1,327 compiles I finally managed to DSKINI floppies with
my CoCo 2 that can be read flawlessly on BOTH sides by Johns current
RETRIEVE utility!  There was never anything wrong with the RETRIEVE
utility.  The CoCo was just still stuck in single-sided mentality.  (note:
previous assessment of total compiles exaggerated to illustrate frustration
to relief factor)
>
> Please note this code sets the drive head byte to 0 or 1 as appropriate
where as before it was always 0.  It is based on the default HDBDOS drive
table.  If you choose to alter your drive table, this too may have to be
adjusted to remain in effect.
>
> == Unit 0 ==
> Drive 0 (0 gets written)
> Drive 2 (1 gets written)
>
> == Unit 1 ==
> Drive 1 (0 gets written)
> Drive 2 (1 gets written)
>
> Here's the final track build code for HDBDOS if anyone is interested in
applying this. ..
>
> * BUILD A FORMATTED TRACK OF DATA IN RAM STARTING AT DFLBUF.
> LD691          ldx       >$1F
> *LD691  LDX     #DFLBUF START TRACK BUFFER AT DFLBUF
>                ldd       #$204E              GET SET TO WRITE 32 BYTES OF
$4E
>                bsr       LD6C2               GO WRITE GAP IV
>                clrb                          RESET      SECTOR COUNTER
> LD69A          pshs      B                   SAVE SECTOR COUNTER
>                ldu       #DBUF1              POINT U TO THE TABLE OF
LOGICAL SECTORS
>                ldb       B,U                 * GET LOGICAL SECTOR NUMBER
FROM TABLE AND
>                stb       DSEC                * SAVE IT IN THE DSKCON
VARIABLE
>                ldu       #LD6D4              POINT U TO TABLE OF SECTOR
FORMATTING DATA
>                ldb       #$03                * GET FIRST 3 DATA BLOCKS AND
>                bsr       LD6C8               * WRITE THEM TO BUFFER
>                lda       DCTRK               = GET TRACK NUMBER AND STORE
lT
>                sta       ,X+                 = IN THE RAM BUFFER
>                ldb           <DCDRV                     'GET DRIVE #
>                  cmpb         #$01                      ANYTHING >1 is
Side 1
>                  lbhi       SIDE1
> SIDE0            clra                               <=1, set Side #0 byte
>                   bra           WRTBT
> SIDE1             lda           #$01                    else Set Side #1
Byte
> WRTBT             sta           ,X+                         Store Byte
>                  lda       DSEC                * GET SECTOR NUMBER AND
>                sta       ,X+                 * STORE IT IN THE BUFFER
>                ldb       #$09                = GET THE LAST NINE DATA
BLOCKS AND
>                bsr       LD6C8               = WRITE THEM TO THE BUFFER
>                puls      B                   GET SECTOR COUNTER
>                incb                          NEXT SECTOR
>                cmpb      #SECMAX             18 SECTORS PER TRACK
>                blo       LD69A               BRANCH IF ALL SECTORS NOT
DONE
>                ldd       #$C84E              WRITE 200 BYTES OF $4E AT
END OF TRACK
> * WRITE ACCA BYTES OF ACCB INTO BUFFER
>
>
>
> -----Original Message-----
> From: Coco [mailto:coco-bounces at maltedmedia.com] On Behalf Of Chad H
> Sent: Sunday, January 18, 2015 10:44 AM
> To: 'CoCoList for Color Computer Enthusiasts'
> Subject: [Coco] HDBDOS assembly patch help! (RETRIEVE resolution)
>
> Well I took a glance at that site and at the 'OmniDisk' counterpart there
for Win9x platforms and it seemed too complex and universal.  I would be
much happier if I could just get the RETRIEVE issue eliminated so I can use
it without any problems...which I'm very close to accomplishing.
>
> I've only got 2 problems right now...
>
> 1> Apparently the FD-502 controller doesn't connect the A13 line from the
EPROM to the CART connector so I can't put in a 16K EPROM without
installing a jumper..  But I can fix that later, right now I'm testing by
loading .BIN files.
>
> 2> I know just enough assembly to cause myself a headache.  I was beating
my head on this seemingly very very simple thing yesterday for more hours
than I care to admit.  I know someone with basic assembly knowledge will be
able to spot my error and help me out though
>
> Here is the excerpt from the HDBDOS DSKINI section I'm trying to change.
I want it to write a head byte #0 for Drives 0/1 and byte #1 for Drives 2/3
(side 2 of floppies).  Right now, it's still writing all #0 as listed.  I
can fiddle with the code and make it write #1 all the time. But then my
RETRIEVE problem flips to the other side of the disk ugh.   I need it to
behave and write the correct byte depending on drive number.  Anyone please?
>
> * BUILD A FORMATTED TRACK OF DATA IN RAM STARTING AT DFLBUF.
> LD691          ldx       >$1F
> *LD691  LDX     #DFLBUF START TRACK BUFFER AT DFLBUF
>                ldd       #$204E              GET SET TO WRITE 32 BYTES OF
$4E
>                bsr       LD6C2               GO WRITE GAP IV
>                clrb                          RESET      SECTOR COUNTER
> LD69A          pshs      B                   SAVE SECTOR COUNTER
>                ldu       #DBUF1              POINT U TO THE TABLE OF
LOGICAL SECTORS
>                ldb       B,U                 * GET LOGICAL SECTOR NUMBER
FROM TABLE AND
>                stb       DSEC                * SAVE IT IN THE DSKCON
VARIABLE
>                ldu       #LD6D4              POINT U TO TABLE OF SECTOR
FORMATTING DATA
>                ldb       #$03                * GET FIRST 3 DATA BLOCKS AND
>                bsr       LD6C8               * WRITE THEM TO BUFFER
>                lda       DCTRK               = GET TRACK NUMBER AND STORE
lT
>                sta       ,X+                 = IN THE RAM BUFFER
>                ldb          <DCDRV                              'GET
DRIVE #
>                   cmpb        #2                                ANYTHING
>1 is Side 1
>                   blo       SIDE0                               Less is
Side #0
> SIDE1             lda           1                               else Set
Side #1 Byte
>                   bra        WRTBT
> SIDE0             clra                              Less than 2, set Side
#0 byte
> WRTBT             sta         ,X+                           Store Byte
>                   lda       DSEC                * GET SECTOR NUMBER AND
>                sta       ,X+                 * STORE IT IN THE BUFFER
>                ldb       #$09                = GET THE LAST NINE DATA
BLOCKS AND
>                bsr       LD6C8               = WRITE THEM TO THE BUFFER
>                puls      B                   GET SECTOR COUNTER
>                incb                          NEXT SECTOR
>                cmpb      #SECMAX             18 SECTORS PER TRACK
>                blo       LD69A               BRANCH IF ALL SECTORS NOT
DONE
>                ldd       #$C84E              WRITE 200 BYTES OF $4E AT
END OF TRACK
> * WRITE ACCA BYTES OF ACCB INTO BUFFER
>
> -----Original Message-----
> From: Coco [mailto:coco-bounces at maltedmedia.com] On Behalf Of Robert Gault
> Sent: Sunday, January 18, 2015 7:21 AM
> To: CoCoList for Color Computer Enthusiasts
> Subject: Re: [Coco] FW: Color Computer DSKINI / RETRIEVE
>
> OK, then try using a different PC program to read Coco disks. Check this
out.
> http://www.shlock.co.uk/Utils/OmniFlop/OmniFlop.htm
>
> This program by Jason Watton is a great utility that should work with any
Coco disk. The latest version is stated to work with Win7 systems. Coco
disks can be 35, 40, or 80 track and single or double sided. It doesn't
matter whether the disks are true doubles or separate disks per side.
>
> The program has no problems reading the second side of a Coco disk
formatted with HDBDOS or the standard Tandy DOS.
>
> Robert
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco


More information about the Coco mailing list