add support for Davidson disks (ID on T22, patch FORTH and asm variants)

This commit is contained in:
4am 2018-06-16 11:38:26 -04:00
parent 5ed95fa109
commit d6e3e0033e
8 changed files with 119 additions and 6 deletions

View File

@ -49,6 +49,10 @@
; compile-time flag, no way to change at runtime
FIRSTFILTER
;gIsDavidson
!byte FALSE ; 0=true, 1=false
; reset before each operation
; set after reading T22,S00
;gIsPanglosDOS
!byte FALSE ; 0=true, 1=false
; reset before each operation

View File

@ -89,9 +89,10 @@ gPolarwareTamperCheck = gIsTrillium-$01 ; byte
gForceDiskVol = gPolarwareTamperCheck-$01 ; byte
gIsAdvent = gForceDiskVol-$01 ; byte
gIsPanglosDOS = gIsAdvent-$01 ; byte
gIsDavidson = gIsPanglosDOS-$01 ; byte
;LASTFILTER ; add new gIs* above this line
gOnAClearDayYouCanReadForever = gIsPanglosDOS-$01 ; byte
gOnAClearDayYouCanReadForever = gIsDavidson-$01 ; byte
gUsingRAMDisk = gOnAClearDayYouCanReadForever-$01 ; byte
gRAMDiskRef = gUsingRAMDisk-$01 ; byte
gDisplayBytes = gRAMDiskRef-$0A ; 10 bytes
@ -152,13 +153,14 @@ ConstructStandardDelivery = jConstructStandardDelivery
!warn "gIsLaureate=",gIsLaureate
!warn "gIsDatasoft=",gIsDatasoft
!warn "gIsSierra=",gIsSierra
!warn "gIsSierra13=",gIsSierra13
!warn "gissierra13=",gissierra13
!warn "gIsF7F6=",gIsF7F6
!warn "gIsTrillium=",gIsTrillium
!warn "gPolarwareTamperCheck=",gPolarwareTamperCheck
!warn "gForceDiskVol=",gIsForceDiskVol
!warn "gIsAdvent=",gIsAdvent
!warn "gIsPanglosDOS=",gIsPanglosDOS
!warn "gIsDavidson=",gIsDavidson
!warn "gOnAClearDayYouCanReadForever=",gOnAClearDayYouCanReadForever
!warn "gUsingRAMDisk=",gUsingRAMDisk
!warn "gRAMDiskRef=",gRAMDiskRef

34
src/id/davidson.a Normal file
View File

@ -0,0 +1,34 @@
;-------------------------------
; IDDavidson
; identify Davidson disk after failing to read T22,S00
;
; in: track buffer contains track $22
; out: C clear if Davidson disk found
; C set otherwise
; all registers clobbered
; all other flags clobbered
;-------------------------------
!zone {
IDDavidson
lda gIsProDOS ; ProDOS?
bne .no ; no, give up
lda gTrack ; track $22?
cmp #$22
bne .no ; no, give up
lda gSector ; sector $00?
bne .no ; no, give up
lda #$00 ; try re-reading the sector but
sta $B92E ; ignore data field checksum failure
jsr ReadSector
lda #$13
sta $B92E
bcs .no ; didn't work, give up
lda #s_davidson
jsr PrintByID
lda #TRUE
sta gIsDavidson
clc
!byte $24
.no sec
rts
}

View File

@ -149,6 +149,7 @@ FirstMover
!source "id/dinkeydos.a"
!source "id/advent.a"
!source "id/panglosdos.a"
!source "id/davidson.a"
!source "print.a"
!source "compare.a"
!source "modify.a"
@ -440,10 +441,14 @@ checksector
lda gIsDOS32 ; is this a DOS 3.2 disk?
beq .fatal ; yes, so read error is fatal
lda gTriedUniv ; have we tried the universal RWTS?
beq .fatal ; yes, so read error is fatal
beq .maybedavidson ; yes, but check one last thing
jsr SwitchToUniv ; no, switch it in now
jmp .read ; and re-read this sector
.maybedavidson
jsr IDDavidson
bcc .optional
.fatal pla ; if we get to here, we've
jmp FatalError ; decided the read error is fatal
@ -780,6 +785,8 @@ _applyToAll
!source "patchers/f7f6.a" ; gIsF7F6 only
!source "patchers/trillium.a" ; gIsTrillium only
!source "patchers/advent.a" ; gIsAdvent only
!source "patchers/davidsonforth.a" ; gIsDavidson only
!source "patchers/davidsonasm.a" ; gIsDavidson only
lda gPatchCount
beq .nopatches

View File

@ -0,0 +1,36 @@
;-------------------------------
; #DAVIDSONASM
; bad block check of T22,S00
; implemented in assembly
;
; tested on
; - Alge-Blaster Plus 1.0
; - Math Blaster Mystery 1.0
; - Math Blaster Mystery 1.3
; - Reading and Me
; - Spell It Plus
; - Word Attack Plus 1.2
; - Word Attack Plus French 1.2
; - Word Attack Plus Spanish 1.2
;-------------------------------
!zone {
lda gIsDavidson
bne .exit
lda #$0F
sta .sector+1
.sector lda #$FF ; modified at runtime
ldx #$00
ldy #$06
jsr compare
!byte $20,$D2,$25; JSR $25D2
!byte $4C,$74,$08; JMP $0874
bcs +
ldx #$04
ldy #$01
jsr modify
!byte $79 ; JMP to $0879 instead
+ dec .sector+1
bpl .sector
.exit
}

View File

@ -0,0 +1,26 @@
;-------------------------------
; #DAVIDSONFORTH
; bad block check of T22,S00
; implemented in FORTH
;
; tested on
; - Math Blaster Plus 1.6
; - Read N Roll 1.0
; - Read N Roll 1.1
; - Math and Me 1.0
;-------------------------------
!zone {
lda gIsDavidson
bne .exit
ldy #$08
jsr SearchTrack
!byte $08,$80,$00,$FD,$1C,$D1,$0D,$EC
bcs .exit
sta gDisplayBytes
inx
ldy #$01
jsr modify
!byte $CC ; MLI CLOSE command (instead of BLOCKREAD)
.exit
}

View File

@ -118,6 +118,7 @@ StringTable
!word .microfun
!word .advent
!word .gathering
!word .davidson
;
; Text can contain substitution strings, which
; are replaced by current values at runtime. Each
@ -143,7 +144,7 @@ StringTable
; can be set directly before calling PrintByID.
;
.header
!text "Passport by 4am 2018-06-08",$00
!text "Passport by 4am 2018-06-16",$00
.mainmenu
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
!text " "
@ -442,5 +443,7 @@ StringTable
.advent
!text "T%t,S%0 Found Interplay bootloader",$8D,$00
.gathering
!text "Gathering per-file encryption keys",$8D,00
!text "Gathering per-file encryption keys",$8D,$00
.davidson
!text "T%t Found Davidson & Associates disk",$8D,$00
}

View File

@ -105,4 +105,5 @@ s_tamper = $63
s_microfun = $64
s_advent = $65
s_gathering = $66
STRINGCOUNT = $67
s_davidson = $67
STRINGCOUNT = $68