From 694310521c7c499c5a1591151afe5951c39752b2 Mon Sep 17 00:00:00 2001 From: 4am Date: Sun, 26 Mar 2017 15:33:22 -0400 Subject: [PATCH] add bootcounter.a for MECC limited backup disks --- src/passport.a | 1 + src/patchers/bootcounter.a | 31 +++++++++++++++++++++++++++++++ src/strings/en.a | 9 +++++++-- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 src/patchers/bootcounter.a diff --git a/src/passport.a b/src/passport.a index e33a7ed..5af4d1b 100755 --- a/src/passport.a +++ b/src/passport.a @@ -707,6 +707,7 @@ _applyToAll !source "patchers/ea.a" !source "patchers/gamco.a" !source "patchers/optimum.a" + !source "patchers/bootcounter.a" lda gPatchCount beq .nopatches diff --git a/src/patchers/bootcounter.a b/src/patchers/bootcounter.a new file mode 100644 index 0000000..34a80ca --- /dev/null +++ b/src/patchers/bootcounter.a @@ -0,0 +1,31 @@ +;------------------------------- +; #BOOTCOUNTER +; MECC "limited backup" disks +; contain code to self-destruct +; after a certain number of boots +;------------------------------- +!zone { +_bootcounter + lda gTrack + cmp #$01 + bne .exit + lda #$00 + ldx #$00 + ldy #$23 + jsr compare ; if T01,S00,$00 != + !byte $AD,$F3,$03,$8D,$F4,$03,$20,$2F + !byte $FB,$20,$93,$FE,$20,$89,$FE,$20 + !byte $58,$FC,$A9,$0A,$85,$25,$2C,WILDCARD + !byte WILDCARD,$CE,$17,$18,$D0,$05,$A9,$80 + !byte $8D,$18,$18 + bcs .exit + sta gDisplayBytes + pha + lda #s_bootcounter + jsr PrintByID + pla + ldy #$03 + jsr modify ; then set T01,S00,$00 = + !byte $4C,$03,$1B +.exit +} diff --git a/src/strings/en.a b/src/strings/en.a index 014a10e..327387a 100755 --- a/src/strings/en.a +++ b/src/strings/en.a @@ -89,7 +89,8 @@ s_eab0 = $46 s_eatrk6 = $47 s_eeef = $48 s_poke = $49 -STRINGCOUNT = $4A +s_bootcounter = $4A +STRINGCOUNT = $4B !zone { StringTable @@ -167,6 +168,7 @@ StringTable !word .eatrk6 !word .eeef !word .poke + !word .bootcounter ; ; Text can contain substitution strings, which ; are replaced by current values at runtime. Each @@ -192,7 +194,7 @@ StringTable ; can be set directly before calling PrintByID. ; .header - !text "Passport by 4am 2017-03-08",00 + !text "Passport by 4am 2017-03-26",00 .mainmenu !text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D !text " " @@ -427,4 +429,7 @@ StringTable .poke !text "T%t,S%0 BASIC program POKEs protection",$8D !text "check into memory and CALLs it.",$8D,$00 +.bootcounter + !text "T%t,S%0 Original disk destroys itself",$8D + !text "after a limited number of boots.",$8D,$00 }