add support for Didatech [fixes Crosscountry USA, Canada, California]

This commit is contained in:
4am 2023-03-26 15:00:07 -04:00
parent 540c9fb161
commit 84a1713b5b
9 changed files with 65 additions and 5 deletions

View File

@ -180,7 +180,7 @@ ADStyle
;
+
b4bbcompare
lda #$FD ; modified at runtime (in Inspect1)
lda #$FD ; SMC
ldx #$00
ldy #$20
jsr CompareMemory
@ -236,10 +236,10 @@ x0 lda $FFC2 ; high byte modified at runtime (above)
sta gPossibleB4BBBasic
lda #$BB
b4bbmodify
sta $FFFF ; modified at runtime (high byte in Inspect1, low byte above)
sta $FFFF ; SMC
lda #$DE
b4bbmodify2
sta $FFFF ; modified at runtime (high byte in Inspect1, low byte above)
sta $FFFF ; SMC
lda gIsDOS32
bne _b4bbexit
lda #kSectorCustomDOS32B4BB

View File

@ -79,6 +79,10 @@
; set in IDBootFailure() after reading T00
FIRSTFILTER
;gIsDidatech
!byte FALSE ; 0=true, 1=false
; reset before each operation
; set in TraceDOS33c() after tracing DOS 3.3-shaped RWTS
;gIsEnlightenment
!byte FALSE ; 0=true, 1=false
; reset before each operation

View File

@ -185,9 +185,10 @@ gPossibleB4BBBasic = gPossibleWoodbury-$01 ; byte
gIsLowDOS = gPossibleB4BBBasic-$01 ; byte
gIsBaudville = gIsLowDOS-$01 ; byte
gIsEnlightenment = gIsBaudville-$01 ; byte
gIsDidatech = gIsEnlightenment-$01 ; byte
;LASTFILTER ; add new gIs* above this line
;gIsInfocom18 is a special case whose ID is not in the regular inspection path
gIsInfocom18 = gIsEnlightenment-$01 ; byte
gIsInfocom18 = gIsDidatech-$01 ; byte
;gIs13Sector is a special case whose ID is not in the regular inspection path
gIs13Sector = gIsInfocom18-$01 ; byte
;gMECCFastloadType is a special case integer whose default value cannot be #FALSE

View File

@ -204,6 +204,28 @@ TraceDOS33c ; 2nd-level trace callback is here
sta T02S05
.notMilliken
;
; Check for Didatech decryption routine
; (affects readable/ignoreable sector map, so must ID now)
;
jsr $ff58
lda MaybeBC
ldx #$E1
ldy #$0A
jsr CompareMemory
!byte $A2,$04
!byte $A0,$05
!byte $A9,$96
!byte $59,$00,$08
!byte $99
bcs .notDidatech ; passport-test-suite/Crosscountry Canada.woz [C=0] matches
jsr PrintByID
!byte s_didatech
lda #kSectorOptional
sta T02S07
lda #TRUE
sta gIsDidatech
.notDidatech
;
; Try to initialize the 'current track' variable like the bootloader would --
; required for some disks that use a strange location for this variable
; e.g. Super Taxman II

View File

@ -385,7 +385,8 @@ AnalyzeTrack
!source "patchers/mak.a" ; gIsBoot0 && T02 only
!source "patchers/jsr8635.a" ; gIsBoot0 only
!source "patchers/sierra.a" ; gIsBoot0 only
!source "patchers/probs5.a"
!source "patchers/probs5.a" ; gIsBoot0 only
!source "patchers/didatech.a" ; gIsBoot0 && gIsDidatech only
_endDOS33Patchers
;
; Diversi-DOS-specific patchers

25
src/patchers/didatech.a Normal file
View File

@ -0,0 +1,25 @@
;-------------------------------
; #DIDATECH
; nibble check of malformed T02,S07
;
; tested on
; - Crosscountry Canada
; - Crosscountry USA
; - Crosscountry California
;-------------------------------
lda gIsDidatech
bne +
ldy #$09
jsr SearchTrack; code is XOR #$96 but not tamper-checked
!byte $06,$59 ; BCC -$CF
!byte $8E ; CLC
!byte $36,$68 ; LDY #$FE
!byte $06,$97 ; BCC +$01
!byte $5E ; INY
!byte $1A ; STY ....
bcs + ; passport-test-suite/Crosscountry Canada.woz [C=0] matches
jsr inx7
jsr modify1
!byte $7C ; NOP instead of INY
+

View File

@ -75,6 +75,7 @@ T01S0F = T01 + $0F
T02 = T01 + $10
T02S04 = T02 + $04
T02S05 = T02 + $05
T02S07 = T02 + $07
T02S0A = T02 + $0A
T02S0C = T02 + $0C
T02S0F = T02 + $0F

View File

@ -218,6 +218,7 @@ StringTableLow ; must be kept in sync with constants in enid.a
!byte <.sfc
!byte <.neosoft
!byte <.probs5
!byte <.didatech
StringTableHigh ; must be kept in sync with constants in enid.a
!byte >.header
@ -375,6 +376,7 @@ StringTableHigh ; must be kept in sync with constants in enid.a
!byte >.sfc
!byte >.neosoft
!byte >.probs5
!byte >.didatech
.passport
!text "Passport ",$00
@ -776,3 +778,6 @@ StringTableHigh ; must be kept in sync with constants in enid.a
!text "@",s_found,"Neosoft @",s_protectioncheck,$8D,$00
.probs5
!text "@",s_found,"PROBS5 @",s_protectioncheck,$8D,$00
.didatech
!text "@",s_found,"Didatech @",s_protectioncheck,$8D
!text "T02,S07 @",s_maybeunreadable,$8D,$00

View File

@ -156,3 +156,4 @@ s_enlightenment = $97
s_sfc = $98
s_neosoft = $99
s_probs5 = $9A
s_didatech = $9B