From 8d136c6c5db4477807ee0dcbdab14d8739c759a4 Mon Sep 17 00:00:00 2001 From: 4am Date: Wed, 14 Apr 2021 14:13:58 -0400 Subject: [PATCH] minor refactor --- src/mli.a | 53 ++++++++++++++++++++--------------------------------- 1 file changed, 20 insertions(+), 33 deletions(-) diff --git a/src/mli.a b/src/mli.a index 0190fed..b6cae1c 100755 --- a/src/mli.a +++ b/src/mli.a @@ -62,7 +62,26 @@ WriteTrackMLI and gUsingRAMDisk beq + jsr ReorderBuffer -+ jsr CalculateAndStoreUnitNumber ++ +; ProDOS 'unit number' is DSSS0000, where +; D is the drive number (0=drive 1, 1=drive 2) and +; SSS is the slot number (1-7) +; c.f. 'Beneath Apple ProDOS' page 6-19 +; + lda DRIVE ; drive number is stored as ASCII text + sec + sbc #$31 + lsr + lda #0 + ror + sta mliparam+1 + lda SLOT + asl + asl + asl + asl + ora mliparam+1 + sta mliparam+1 ; ProDOS unit number lda #$00 sta mliparam+2 ; lo byte of data buffer lda #$08 @@ -112,37 +131,6 @@ WriteTrackMLI .blockcount !byte $FF } -;------------------------------- -; CalculateAndStoreUnitNumber -; -; ProDOS 'unit number' is DSSS0000, where -; D is the drive number (0=drive 1, 1=drive 2) and -; SSS is the slot number (1-7) -; c.f. 'Beneath Apple ProDOS' page 6-19 -; -; in: @SLOT contains (slot x 16) + $30 -; @DRIVE contains drive + $30 -; out: mliparam+1 contains ProDOS unit number -;------------------------------- -!zone { -CalculateAndStoreUnitNumber - lda DRIVE ; drive number is stored as ASCII text - sec - sbc #$31 - lsr - lda #0 - ror - sta mliparam+1 - lda SLOT - asl - asl - asl - asl - ora mliparam+1 - sta mliparam+1 - rts -} - ;------------------------------- ; SaveFile1Shot ; save a file to disk all at once, @@ -763,7 +751,6 @@ CreateHardDir !zone { GetVolumeName sta mliparam+1 -GetVolumeNameInternal lda #OnlineReturn