Test with 8 drives for ProDOS 2.5

This commit is contained in:
Florian Reitz 2019-11-10 10:56:31 +01:00
parent 320602e692
commit 65bff70367
3 changed files with 37 additions and 20 deletions

View File

@ -1,10 +1,10 @@
;******************************* ;*******************************
; ;
; Apple][Sd Firmware ; Apple][Sd Firmware
; Version 1.2 ; Version 1.3
; Defines ; Defines
; ;
; (c) Florian Reitz, 2017 - 2018 ; (c) Florian Reitz, 2017 - 2019
; ;
; X register usually contains SLOT16 ; X register usually contains SLOT16
; Y register is used for counting or SLOT ; Y register is used for counting or SLOT
@ -61,7 +61,7 @@ WP = $20
CD = $40 CD = $40
INITED = $80 INITED = $80
SMDRIVERVER = $120B ; Version 1.2 Beta SMDRIVERVER = $130B ; Version 1.3 Beta
; Error codes ; Error codes
NO_ERR = $00 NO_ERR = $00

View File

@ -1,10 +1,10 @@
;******************************* ;*******************************
; ;
; Apple][Sd Firmware ; Apple][Sd Firmware
; Version 1.2.1 ; Version 1.3
; Main source ; Main source
; ;
; (c) Florian Reitz, 2017 - 2018 ; (c) Florian Reitz, 2017 - 2019
; ;
; X register usually contains SLOT16 ; X register usually contains SLOT16
; Y register is used for counting or SLOT ; Y register is used for counting or SLOT
@ -368,7 +368,7 @@ INIT: LDA #$03 ; set SPI mode 3
RTS RTS
TEXT: .asciiz " Apple][Sd v1.2.1 (c)2018 Florian Reitz " TEXT: .asciiz " Apple][Sd v1.3 (c)2019 Florian Reitz "
CMD0: .byt $40, $00, $00 CMD0: .byt $40, $00, $00
.byt $00, $00, $95 .byt $00, $00, $95

View File

@ -1,10 +1,10 @@
;******************************* ;*******************************
; ;
; Apple][Sd Firmware ; Apple][Sd Firmware
; Version 1.2 ; Version 1.3
; Helper functions ; Helper functions
; ;
; (c) Florian Reitz, 2017 - 2018 ; (c) Florian Reitz, 2017 - 2019
; ;
; X register usually contains SLOT16 ; X register usually contains SLOT16
; Y register is used for counting or SLOT ; Y register is used for counting or SLOT
@ -102,10 +102,13 @@ GETR3: JSR GETR1 ; get R1 first
;******************************* ;*******************************
; ;
; Calculate block address ; Calculate block address
; Unit number is in $43 DSSS0000 ; Unit number is in $43 DSSS0000 / DSSS00DD
; Block no is in $46-47 ; Block no is in $46-47
; Address is in R30-R33 ; Address is in R30-R33
; ;
; Starting ProDOS 2.5a5 the unit number
; has been enhanced to DSSS00DD
;
;******************************* ;*******************************
GETBLOCK: PHX ; save X GETBLOCK: PHX ; save X
@ -116,21 +119,35 @@ GETBLOCK: PHX ; save X
STA R33,X ; in R30-R33 STA R33,X ; in R30-R33
LDA BLOCKNUM+1 LDA BLOCKNUM+1
STA R32,X STA R32,X
STZ R31,X
STZ R30,X STZ R30,X
TYA ; get SLOT16 .if 1
LDA DSNUMBER ; calculate drive number
ASL A
AND #$07
ADC #$01
STA R31,X
.else
LDA DSNUMBER
AND #$03 ; mask extended drive bits (bits 0-1)
STA R31,X
BIT DSNUMBER ; check old drive number (bit 7)
BPL @PHANTOM
INC A ; increase by one
STA R31,X
.endif
.if 0
@PHANTOM: TYA ; get SLOT16
EOR DSNUMBER EOR DSNUMBER
AND #$70 ; check only slot bits AND #$70 ; check only slot bits
BEQ @DRIVE ; it is our slot BEQ @SDHC ; it is our slot
LDA #2 ; it is a phantom slot LDA R31,X ; it is a phantom slot, multiply by 16
STA R31,X ASL A
ASL A
@DRIVE: BIT DSNUMBER ; drive number ASL A
BPL @SDHC ; D1 ASL A
LDA R31,X ; D2
INC A
STA R31,X STA R31,X
.endif
@SDHC: LDA #SDHC @SDHC: LDA #SDHC
AND SS,Y ; if card is SDHC, AND SS,Y ; if card is SDHC,
@ -144,7 +161,7 @@ GETBLOCK: PHX ; save X
DEY DEY
BNE @LOOP BNE @LOOP
@END: PLY ; restore Y @END: PLY ; restore Y
PLX ; restore X PLX ; restore X
RTS RTS