From 62c6978cf878606e790c9f4a639bde345ea3d90f Mon Sep 17 00:00:00 2001 From: 4am Date: Fri, 28 Sep 2018 15:54:24 -0400 Subject: [PATCH] add AA nibble count patcher [fixes Battle Group, Moebius] --- src/passport.a | 1 + src/patchers/aacount.a | 36 ++++++++++++++++++++++++++++++++++++ src/patchers/ssi.a | 18 +----------------- src/strings/en.a | 3 +++ src/strings/enid.a | 3 ++- 5 files changed, 43 insertions(+), 18 deletions(-) create mode 100644 src/patchers/aacount.a diff --git a/src/passport.a b/src/passport.a index 1ebbeb3..1072622 100755 --- a/src/passport.a +++ b/src/passport.a @@ -801,6 +801,7 @@ _applyToAll !source "patchers/davidsonasm.a" ; gIsDavidson only !source "patchers/ssi.a" ; gIsRDOS13 only !source "patchers/rdosfmt.a" ; gIsRDOS13 only + !source "patchers/aacount.a" lda gPatchCount beq .nopatches diff --git a/src/patchers/aacount.a b/src/patchers/aacount.a new file mode 100644 index 0000000..50379f9 --- /dev/null +++ b/src/patchers/aacount.a @@ -0,0 +1,36 @@ +;------------------------------- +; #AACount +; self-decrypting and re-encrypting nibble count +; +; tested on +; Battle Group (SSI) +; Moebius (Origin) +;------------------------------- +!zone { + bit gMode ; nothing to do here in verify-only mode + bpl .exit + + lda #$0F + sta gDisplayBytes +.loop lda gDisplayBytes + ldx #$04 + ldy #$0E + jsr compare + !byte $CE,$07,$02; DEC $0207 + !byte $EF,$07,$02; ??? $0207 (becomes INC) + !byte $A0,$27 ; LDY #$27 + !byte $D0,$02 ; BNE *+4 + !byte $00 ; BRK + !byte $6C,$B9,$00; JMP ($00B9) + bcs + + lda #s_aacount + jsr PrintByID + lda gDisplayBytes + ldy #$01 + jsr modify + !byte $60 ; RTS ++ + dec gDisplayBytes + bpl .loop +.exit +} diff --git a/src/patchers/ssi.a b/src/patchers/ssi.a index e0c2694..019bc57 100644 --- a/src/patchers/ssi.a +++ b/src/patchers/ssi.a @@ -20,7 +20,7 @@ !byte $C1,$00 ; CMP ($00,X) !byte $EA ; NOP !byte $EA ; NOP - bcs + + bcs .exit sta gDisplayBytes pha @@ -30,21 +30,5 @@ ldy #$01 jsr modify !byte $A9 ; LDA #$.. - bvc .exit - -+ - ldy #$0E - jsr SearchTrack - !byte $CE,$07,$02; DEC $0207 - !byte $EF,$07,$02; ??? $0207 - !byte $A0,$27 ; LDY #$27 - !byte $D0,$02 ; BNE *+4 - !byte $00 ; BRK - !byte $6C,$B9,$00; JMP ($00B9) - bcs .exit - ldy #1 - jsr modify - !byte $60 ; RTS - .exit } diff --git a/src/strings/en.a b/src/strings/en.a index 3337255..95b7a7c 100755 --- a/src/strings/en.a +++ b/src/strings/en.a @@ -121,6 +121,7 @@ StringTable !word .davidson !word .rdos13 !word .ssi + !word .aacount ; ; Text can contain substitution strings, which ; are replaced by current values at runtime. Each @@ -452,4 +453,6 @@ StringTable !text "T00,S00 Found RDOS 13-sector bootloader",$8D,$00 .ssi !text "T%t,S%0 Found SSI protection check",$8D,$00 +.aacount + !text "T%t,S%0 Found AA nibble count",$8D,$00 } diff --git a/src/strings/enid.a b/src/strings/enid.a index a5391fb..b1f75ed 100644 --- a/src/strings/enid.a +++ b/src/strings/enid.a @@ -108,4 +108,5 @@ s_gathering = $66 s_davidson = $67 s_rdos13 = $68 s_ssi = $69 -STRINGCOUNT = $6A +s_aacount = $6A +STRINGCOUNT = $6B