[Coco] Help with ms-dos DSKINI please

Boisy G. Pitre boisy at boisypitre.com
Mon Jul 19 18:30:35 EDT 2004


On Jul 19, 2004, at 5:12 PM, Robert Gault wrote:

> If you take the lsl.dsk image as downloaded from the source, it won't 
> be read by MESS. However, if you dEd it or use a PC disk editor and 
> change lsn0 byte $10 from 3 to 2, MESS can read it.
>
> This indicates to me that the image format is not correct and that for 
> use with MESS it works as a single sided drive.

Either the image format is not correct, or MESS isn't handling it 
correctly.

 From rbfdefs:

* DD.FMT Bit Definitions - valid only if device is a floppy disk
FMT.SIDE equ   %00000001  Single Sided=0, Double Sided=1
FMT.DNS  equ   %00000010  Single Density=0, Double Density=1
FMT.TDNS equ   %00000100  Track Density: 48 TPI=0, 96/135 TPI=1
FMT.T0DN equ   %00100000  Track 0 Density, see FMT.DNS

DD.FMT is byte $10, and a value of $03 is FMD.SIDE + FMT.DNS.  If 
changing the value to $02 allows it to be accessed under MESS, then 
either the driver (rb1773) is incorrectly interpreting the bit, or MESS 
isn't emulating double sided disks properly.

Here's the code from rb1773.asm that deals with FMT.SIDE:

          lda   <DD.FMT,y      Get format for disk in drive
          ldy   2,s            restore path descriptor pointer
          ldb   <PD.DNS,y      Get path's density settings
          bita  #FMT.DNS       Disk in drive double density?
          beq   L0115          No, all drives can read single, skip ahead
          bitb  #DNS.MFM       Can our path dsc. handle double density?
          beq   erbtyp         No, illegal
L0115    bita  #FMT.TDNS      Is new disk 96/135 tpi?
          beq   L011D          No, all drives handle 48 tpi, so skip 
ahead
          bitb  #DNS.DTD       Can path dsc. handle 96/135 tpi?
          beq   erbtyp         No, illegal
L011D    bita  #FMT.SIDE      Is new disk double sided?
          beq   L0128          No, all drives handle single sided, we're 
done
          lda   <PD.SID,y      Get # sides path dsc. can handle
          suba  #2             sides higher or equal to 2?

I would say from looking at the code that FMT.SIDE is being interpreted 
as a double-sided disk when set.

Further evidence on a real CoCo 3:

format /d0 2 '40'
[ format performs ok ]
dump /d0@

shows that byte $10 has a value of $03.

Therefore, I postulate that $03 is the correct DD.FMT value for a 
double sided 5.25" disk.

Boisy




More information about the Coco mailing list