diff --git a/src/apicode.a b/src/apicode.a index c1e0857..10dac5b 100644 --- a/src/apicode.a +++ b/src/apicode.a @@ -53,6 +53,11 @@ FIRSTFILTER !byte FALSE ; 0=true, 1=false ; reset before each operation ; set in patchers/f7f6 +;gPolarwareTamperCheck + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in patchers/polarware + ; used to avoid an expensive search ;gIsTrillium !byte FALSE ; 0=true, 1=false ; reset before each operation diff --git a/src/apidefs.a b/src/apidefs.a index e62914a..5b15864 100644 --- a/src/apidefs.a +++ b/src/apidefs.a @@ -85,7 +85,8 @@ gIsSierra = gIsDatasoft-$01 ; byte gIsSierra13 = gIsSierra-$01 ; byte gIsF7F6 = gIsSierra13-$01 ; byte gIsTrillium = gIsF7F6-$01 ; byte -gForceDiskVol = gIsTrillium-$01 ; byte +gPolarwareTamperCheck = gIsTrillium-$01 ; byte +gForceDiskVol = gPolarwareTamperCheck-$01 ; byte ;LASTFILTER ; add new gIs* above this line gOnAClearDayYouCanReadForever = gForceDiskVol-$01 ; byte @@ -152,6 +153,7 @@ ConstructStandardDelivery = jConstructStandardDelivery !warn "gIsSierra13=",gIsSierra13 !warn "gIsF7F6=",gIsF7F6 !warn "gIsTrillium=",gIsTrillium +!warn "gPolarwareTamperCheck=",gPolarwareTamperCheck !warn "gForceDiskVol=",gIsForceDiskVol !warn "gOnAClearDayYouCanReadForever=",gOnAClearDayYouCanReadForever !warn "gUsingRAMDisk=",gUsingRAMDisk diff --git a/src/patchers/fbffencrypted.a b/src/patchers/fbffencrypted.a index 126bf32..b420567 100644 --- a/src/patchers/fbffencrypted.a +++ b/src/patchers/fbffencrypted.a @@ -25,10 +25,10 @@ lda gIsProDOS ; only seen this protection on ProDOS disks bne .exit ldy #$06 - jsr SearchTrack - !byte $39,$FD - !byte $2F,$FB - !byte $39,$FC + jsr SearchTrack ; (all bytes are XOR #$FF) + !byte $39,$FD ; DEC $02 + !byte $2F,$FB ; BNE +4 + !byte $39,$FC ; DEC $03 bcs .exit inx inx @@ -40,6 +40,6 @@ pla ldy #$01 jsr modify - !byte $A2 + !byte $A2 ; change encrypted BNE +4 to +5D so code exits with Death Counter > 0 .exit } diff --git a/src/patchers/polarware.a b/src/patchers/polarware.a index 61c7e26..102e0b1 100644 --- a/src/patchers/polarware.a +++ b/src/patchers/polarware.a @@ -1,6 +1,6 @@ ;------------------------------- ; #POLARWARE -; a delayed secondary protection check +; a delayed secondary protection check and anti-tamper check ; seen on Polarware games ; similar to #FBFFENCRYPTED but the encryption key is different ; and the routine ultimately returns regardless of success or failure @@ -18,11 +18,11 @@ lda gIsProDOS ; only seen this protection on ProDOS disks bne .exit ldy #$06 - jsr SearchTrack - !byte $29,$6D - !byte $3F,$EB - !byte $29,$60 - bcs .exit + jsr SearchTrack ; (all bytes are XOR #$EF) + !byte $29,$6D ; DEC $82 + !byte $3F,$EB ; BNE +4 + !byte $29,$60 ; DEC $8F + bcs .tamper inx inx inx @@ -33,6 +33,26 @@ pla ldy #$01 jsr modify - !byte $B2 + !byte $B2 ; change encrypted BNE +4 to +5D so code exits with Death Counter > 0 + lda #TRUE + sta gPolarwareTamperCheck +.tamper lda gPolarwareTamperCheck + bne .exit + ldy #$0C + jsr SearchTrack + !byte $01,$02,$03,$03,$03,$03;prologue marker (not code) + !byte $EC,WILDCARD,WILDCARD ; CPX absolute + !byte $F0,$09 ; BEQ +9 + !byte $AE ; LDX + bcs .exit + pha + txa + adc #$09 + tax + stx gDisplayBytes + pla + ldy #$01 + jsr modify + !byte $50 ; change BEQ to BVC which acts as a branch-always .exit } diff --git a/src/strings/en.a b/src/strings/en.a index f431479..52947ad 100755 --- a/src/strings/en.a +++ b/src/strings/en.a @@ -138,7 +138,7 @@ StringTable ; can be set directly before calling PrintByID. ; .header - !text "Passport by 4am 2018-01-26",$00 + !text "Passport by 4am 2018-01-28",$00 .mainmenu !text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D !text " "