[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patching the ProDOS Disk ][ driver?



On Nov 24, 9:25 am, ferd...@gmx.de wrote:
> As I set up my 80-track/3.5'' drives which emulate a disk ][ I got a
> patch for DOS 3.3 and PASCAL, but I don't have a patch for ProDOS. Due
> to the modular nature of ProDOS it should be simple to patch the
> driver, but since I don't have a commented disassembly it is difficult
> to understand the code. Does anybody know that information? If it
> would be possible to patch it to write halftracks, I could even use
> 160 tracks of data.

The Disk ][ driver code moves around depending on the version of
ProDOS. Here is some info about patching P8 for 40 track drives:

    To patch Prodos 1.8 (and probably the other versions too), scan
the
prodos file for CA D0 04 C9 (18) 90 02 38.  Change the $18 to $40.
This
number is the total number of blocks on the disk less 256.  For Prodos
1.8,
this byte has the offset postion of $39E3 into the file.

Here is what this code looks like in V1.4 (the addresses are where it
loads into RAM, not the offsets into the file):

********************************
* Check command code for range 0 - 3 and that the
*  requested block number is $0000 - $0117 (280 blks).

* This is where ProDOS limits access to 280 ($0118) blocks
* per floppy.  If checking for over 512 ($0200) blocks
* the MSB test must be changed by adding DEX's.

HD6D0    LDA   H0042      ;Get command code.
         CMP   #$04       ;Check if command 0 to 3.
         BCS   HD6E6      ;Branch if >= 4, BAD.

         LDA   H0046      ;LSB of block number.
         LDX   H0047      ;MSB of block number.
         STX   HD356
         BEQ   HD6E8      ;Branch if MSB=0.

         DEX              ;*** MSB=1 check.
         BNE   HD6E6      ;Branch if MSB-1 <> 0.

         CMP   #$18       ;*** LSB check.
         BCC   HD6E8      ;Branch if LSB < $18.

HD6E6    SEC              ;Set carry for BAD RTS.
         RTS

HD6E8    CLC              ;Clear carry for OK RTS.
         RTS

*
********************************

The problem with patching it to support 80 or 160 tracks is fitting
the code into the space available - it is optimized for testing $01xx
blocks.