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

Re: Apple ][ using PC floppy



On Dec 28, 9:44 am, David Wilson <mcs6...@gmail.com> wrote:
> On Dec 28, 8:06 am, vladitx <vlad...@nucleusys.com> wrote:
>
> > One feature I put is converting Apple's half-tracks to real tracks, so
> > the PC diskette can hold up-to 80 tracks. Anyone to know a quick patch
> > of DOS / ProDOS to use them? It will result in 280KB (70 tracks) or
> > 320KB (80 tracks) capacity if there isn't any internal OS limitation.
>
> If you look at Beneath Apple ProDOS the patch to change from 35 to 40
> tracks is a single byte. The code in question looks something like
> this:
>
> ; on entry A=LSB of block number
>     LDX $D356 ; get MSB of block #
>    BEQ OK ; 00nn is always OK
>    DEX
>    BNE BAD ; 0200 and higher is never OK
>    CMP #$18
>    BCC OK ; less than 0118 is OK
> BAD
>    SEC ; indicate error
>    RTS
> OK
>    CLC ; indicate sucess
>    RTS
>
> It is easy to patch this to allow 40 tracks as 40 * 8 is $0140 in hex
> so all that changes is the CMP #$18 => CMP #$40.
>
> Changing the CMP #$18 to CMP #$FF would increase the block count to
> $01FF (511 blocks) or just under 64 tracks.Replacing the CMP #$18 with
> NOP, CLC would allow the use of a full 64 tracks.
>
> 80 tracks is $0280 blocks so the short cut using DEX no longer works
> and the routine needs to become slightly longer (there is fortunately
> some unused space following this routine). You either need to use a
> proper 16 bit comparison or a different clever piece of code. I will
> have a think about this. Also, this change would affect any real 5.25"
> Disk II drives you might have on the system.

David, this is a spot-on answer. Only one question arises - is this
routine checking the block bounds for sanity, or is used when creating
a new volume? When a new logical volume is to be created on enlarged
Disk ][ it has to have this information written in the right place of
the file system (ProDOS equivalent to "superblock").

As to the comparison, what about something like this:

; on entry A=LSB of block number
    LDX $D356 ; get MSB of block #
    CPX #$03
    BCS X
    CMP #$80
X: RTS

I might be wrong about the 'C' flag on comparisons, it has been ages
since last serious 6502 programming, but the original code has excess
"CLC" and "SEC".

> Finally, as the Disk II driver does not implement a FORMAT routine,
> you will need to either modify an existing ProDOS disk formatter or
> write your own to format these larger disks.

I was thinking about using Locksmith 6.0 "16-sector Utilites" ->
"Format". It allows to specify start/end tracks, physical and logical
increment.

If the efforts of using the additional 80 - 35 = 45 tracks is too big,
they can just be well ignored.