add support for unencrypted AdvInt [fixes Spiderman,War]

This commit is contained in:
4am 2024-04-28 02:09:21 -04:00
parent cc3a9c4f7e
commit 43a719aa56
4 changed files with 47 additions and 7 deletions

View File

@ -466,6 +466,8 @@ _byte_skip_hi:
rts
!source "id/bootfailure.a"
nop
nop
!source "wholetrack.a"
!source "apicode.a" ; /!\ must be last

View File

@ -1,30 +1,66 @@
;-------------------------------
; #ADVINT
; encrypted protection check on
; Adventure International disks
; protection check on Adventure International disks
; usually encrypted but not always
;
; tested on
; - Curse of Crowley Manor
; - Earthquake San Francisco 1906
; - QuestProbe featuring The Hulk
; - QuestProbe featuring Spider-Man vB-258
; - QuestProbe featuring Spider-Man vF-261
; - SAGA1 - Adventureland v2.0-416
; - SAGA1 - Adventureland v2.1-416
; - SAGA2 - Pirate Adventure v2.1-408
; - SAGA3 - Mission Impossible v2.1/306
; - SAGA4 - Voodoo Castle v2.1/119
; - SAGA3 - Mission Impossible v2.1-306
; - SAGA4 - Voodoo Castle v2.1-119
; - SAGA5 - The Count v2.1-115
; - SAGA6 - Strange Odyssey v2.1-119
;-------------------------------
!zone {
lda gAdventureInternational
bne .exit
; variant 0 - very old, possibly first generation
ldy #$09
jsr SearchTrack
!byte $C9,$9C
!byte $B0,$04
!byte $BD,$88,$C0
!byte $60
!byte $4C
bcs .variant1 ; passport-test-suite/War.woz [C=0] matches
jsr PrintByID
!byte s_advint
jsr inx8
jsr modify3
!byte $18 ;CLC
!byte $90,$F9 ;BCC -$F9
bvc .exit ; always branches
;-----
.variant1
; variant 1 - unencrypted
ldy #$08
jsr SearchTrack
!byte $4C,WILDCARD,WILDCARD ;JMP $****
!byte $BD,$8C,$C0 ;LDA $C08C,X
!byte $10,$FB ;BPL -$FB
bcs .variant2 ; passport-test-suite/Spiderman B.woz [C=0] matches
jsr PrintByID
!byte s_advint
jsr modify3
!byte $18 ;CLC
!byte $90,$6E ;BCC +$6E
bvc .exit ; always branches
;-----
.variant2
; variant 2 - bytes are XOR'd with #$C9 on disk
; comments show decrypted code
ldy #$08
jsr SearchTrack
; bytes are XORd with #$C9 on disk -- comments show decrypted code
!byte $85,WILDCARD,WILDCARD ;JMP $****
!byte $74,$45,$09 ;LDA $C08C,X
!byte $D9,$32 ;BPL -$FB
bcs .exit ; passport-test-suite/S.A.G.A. 6.woz [C=0] matches
bcs .exit ; passport-test-suite/S.A.G.A. 6.woz [C=0] matches
jsr PrintByID
!byte s_advint
jsr modify3

View File

@ -387,7 +387,7 @@ StringTableHigh ; must be kept in sync with constants in enid.a
.passport
!text "Passport ",$00
.header
!text "@",s_passport,"by 4am@",s_space7,"@",s_space7," 2024-03-27",$00
!text "@",s_passport,"by 4am@",s_space7,"@",s_space7," 2024-04-28",$00
.bar9
!text "_________",$00
.bar18

View File

@ -87,6 +87,8 @@ SkipTrack
cmp #$22
clc
bne @donotskip
lda #TRUE
sta gAdventureInternational
lda gIsProDOS
bne @donotskip
sta gPossibleGamco