diff --git a/src/apicode.a b/src/apicode.a index d65be58..eb0b125 100644 --- a/src/apicode.a +++ b/src/apicode.a @@ -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 diff --git a/src/apidefs.a b/src/apidefs.a index b333123..3e75e6e 100644 --- a/src/apidefs.a +++ b/src/apidefs.a @@ -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 diff --git a/src/id/davidson.a b/src/id/davidson.a new file mode 100644 index 0000000..e715253 --- /dev/null +++ b/src/id/davidson.a @@ -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 +} diff --git a/src/passport.a b/src/passport.a index 76f7f3c..23e0f2a 100755 --- a/src/passport.a +++ b/src/passport.a @@ -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 diff --git a/src/patchers/davidsonasm.a b/src/patchers/davidsonasm.a new file mode 100644 index 0000000..34dad8e --- /dev/null +++ b/src/patchers/davidsonasm.a @@ -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 +} diff --git a/src/patchers/davidsonforth.a b/src/patchers/davidsonforth.a new file mode 100644 index 0000000..247e9a9 --- /dev/null +++ b/src/patchers/davidsonforth.a @@ -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 +} diff --git a/src/strings/en.a b/src/strings/en.a index 0435585..189fccf 100755 --- a/src/strings/en.a +++ b/src/strings/en.a @@ -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 } diff --git a/src/strings/enid.a b/src/strings/enid.a index f5c39cd..f102aec 100644 --- a/src/strings/enid.a +++ b/src/strings/enid.a @@ -105,4 +105,5 @@ s_tamper = $63 s_microfun = $64 s_advent = $65 s_gathering = $66 -STRINGCOUNT = $67 +s_davidson = $67 +STRINGCOUNT = $68