From 5d9bc2243f9f9ebd0838376dffe8fe9f839af61d Mon Sep 17 00:00:00 2001 From: 4am Date: Tue, 26 Dec 2017 13:13:11 -0500 Subject: [PATCH] NEW: patchers/f7f6 for F7F6 protections not contained in SSPROT startup program --- src/apicode.a | 6 +++++- src/apidefs.a | 3 ++- src/passport.a | 1 + src/patchers/diskvol.a | 10 ++++++++++ src/patchers/f7f6.a | 40 ++++++++++++++++++++++++++++++++++++++++ src/patchers/ssprot.a | 2 -- src/strings/en.a | 3 --- src/strings/enid.a | 3 +-- 8 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 src/patchers/f7f6.a diff --git a/src/apicode.a b/src/apicode.a index 4c3384b..80f296f 100644 --- a/src/apicode.a +++ b/src/apicode.a @@ -49,10 +49,14 @@ ; compile-time flag, no way to change at runtime FIRSTFILTER +;gForceDiskVol + !byte FALSE ; 0=true, 1=false + ; reset before each operation + ; set in patchers/f7f6 ;gIsF7F6 !byte FALSE ; 0=true, 1=false ; reset before each operation - ; set in analyze/SetupF7F6SecondRound + ; set in analyze (SetupF7F6SecondRound) ; used to avoid an expensive search ;gIsSierra13 !byte FALSE ; 0=true, 1=false diff --git a/src/apidefs.a b/src/apidefs.a index 1c2367b..c2bdcd0 100644 --- a/src/apidefs.a +++ b/src/apidefs.a @@ -84,9 +84,10 @@ gIsDatasoft = gIsLaureate-$01 ; byte gIsSierra = gIsDatasoft-$01 ; byte gIsSierra13 = gIsSierra-$01 ; byte gIsF7F6 = gIsSierra13-$01 ; byte +gForceDiskVol = gIsF7F6-$01 ; byte ;LASTFILTER ; add new gIs* above this line -gOnAClearDayYouCanReadForever = gIsF7F6-$01 ; byte +gOnAClearDayYouCanReadForever = gForceDiskVol-$01 ; byte gUsingRAMDisk = gOnAClearDayYouCanReadForever-$01 ; byte gRAMDiskRef = gUsingRAMDisk-$01 ; byte gDisplayBytes = gRAMDiskRef-$0A ; 10 bytes diff --git a/src/passport.a b/src/passport.a index 12d71ab..0e368ee 100755 --- a/src/passport.a +++ b/src/passport.a @@ -757,6 +757,7 @@ _applyToAll !source "patchers/sra.a" ; gIsDOS32 or gIsRWTS only !source "patchers/sierra13.a" ; gIsDOS32 only !source "patchers/ssprot.a" ; gIsF7F6 only + !source "patchers/f7f6.a" ; gIsF7F6 only lda gPatchCount beq .nopatches diff --git a/src/patchers/diskvol.a b/src/patchers/diskvol.a index c93fc0e..7820f1f 100755 --- a/src/patchers/diskvol.a +++ b/src/patchers/diskvol.a @@ -6,26 +6,34 @@ !zone { lda gIsRWTS ; if DOS 3.3 RWTS bne .exit + lda #$01 ldx #$EE ldy #$01 jsr compare ; and T00,S01,$EE == !byte $FB bcs .exit + ldx #$FB ldy #$04 jsr compare ; and T00,S01,$FB == !byte $00,$01,$EF,$D8 bcs .exit + + lda gForceDiskVol + beq .yes + ldx #$EB ldy #$01 jsr compare ; and T00,S01,$EB != !byte $FE bcc .exit + ldy #$01 jsr compare ; and T00,S01,$EB != !byte $00 bcc .exit +.yes lda #$08 ldx #$10 ldy #$05 @@ -34,8 +42,10 @@ !byte $B1,$48 ; LDA ($48),Y !byte $48 ; PHA bcs .exit + lda #s_diskvol jsr PrintByID + lda #$08 ldx #$12 ldy #$02 diff --git a/src/patchers/f7f6.a b/src/patchers/f7f6.a new file mode 100644 index 0000000..4d87025 --- /dev/null +++ b/src/patchers/f7f6.a @@ -0,0 +1,40 @@ +;------------------------------- +; #F7F6 +; protection check that counts groups of F7F6EFEEAB nibbles +; +; hidden behind a global flag (gIsF7F6) +; because it relies on an expensive search +; +; tested on +; I, Damiano (1985, Bantam) +; Might and Magic (1986, New World Computing) +; Sherlock Holmes in Another Bow (1985, Bantam) +; Chipwits (1984, Brain Power) +; The Complete Scarsdale Medical Diet (1985, Bantam) +; Create With Garfield Deluxe Edition (1987, DLM) +; Teddy Bearrels of Fun (1987, DLM) +;------------------------------- +!zone { + lda gIsF7F6 + bne .exit + + ldy #$08 + jsr SearchTrack + !byte $A9,$40 ; LDA #$40 + !byte $85,$FA ; STA $FA + !byte $A2,$60 ; LDX #$60 + !byte $BD,$8E ; LDA $..8E,X + bcs .exit + + inx + inx + inx + inx + ldy #$01 + jsr modify + !byte $18 ; CLC + + lda #TRUE ; needed for Might & Magic + sta gForceDiskVol +.exit +} diff --git a/src/patchers/ssprot.a b/src/patchers/ssprot.a index 5b14f70..b7f3554 100644 --- a/src/patchers/ssprot.a +++ b/src/patchers/ssprot.a @@ -42,8 +42,6 @@ jsr compare !byte $23,$2A,$28 bcs .nextsector - lda #s_f7f6 - jsr PrintByID lda .sector+1 ldx #$20 ldy #$03 diff --git a/src/strings/en.a b/src/strings/en.a index a41c3e8..4aebfd8 100755 --- a/src/strings/en.a +++ b/src/strings/en.a @@ -112,7 +112,6 @@ StringTable !word .origin !word .volumename !word .dinkeydos - !word .f7f6 ; ; Text can contain substitution strings, which ; are replaced by current values at runtime. Each @@ -429,6 +428,4 @@ StringTable !text "T%t,S%0 Volume name is ",$00 .dinkeydos !text "T00,S0B Found Dinkey-DOS",$8D,$00 -.f7f6 - !text "T%t,S%0 Found F7F6 protection check",$8D,$00 } diff --git a/src/strings/enid.a b/src/strings/enid.a index e2e4b10..28378b6 100644 --- a/src/strings/enid.a +++ b/src/strings/enid.a @@ -100,5 +100,4 @@ s_muse = $5E s_origin = $5F s_volumename = $60 s_dinkeydos = $61 -s_f7f6 = $62 -STRINGCOUNT = $63 +STRINGCOUNT = $62