From fc780ee0daf8121f3fba13ceaaae85d785020292 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Fri, 24 May 2019 11:42:18 -0700 Subject: [PATCH] support Lady Tut --- src/anti-m.a | 8 +++-- src/idprogame.a | 88 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 src/idprogame.a diff --git a/src/anti-m.a b/src/anti-m.a index b1d5137..a387b20 100644 --- a/src/anti-m.a +++ b/src/anti-m.a @@ -185,12 +185,15 @@ Tracer bcc BeginTheBoot jsr IDProDOS bcc BeginTheBoot + jsr IDProgame + bcc BeginTheBoot ; [execution falls through here] ; [and runs anyway] BeginTheBoot - sec ;match boot-time flags and registers lda #1 + pha + plp ;match boot-time flags and registers ldy #0 ldx #$60 jmp $0801 @@ -236,7 +239,7 @@ StringTable !word @mainmenu @header - !text "Anti-M v1.4 by 4am 2019-05-24" + !text "Anti-M v1.5-pre by 4am 2019-05-24" !text "________________________________________",$8D !text $8D,$8D,$8D,$8D,$8D,$8D,$8D,$8D,$00 @mainmenu @@ -251,3 +254,4 @@ StringTable !src "src/idsirius.a" !src "src/idboot.a" !src "src/idprodos.a" + !src "src/idprogame.a" diff --git a/src/idprogame.a b/src/idprogame.a new file mode 100644 index 0000000..3c0b734 --- /dev/null +++ b/src/idprogame.a @@ -0,0 +1,88 @@ +; Progame tracer +; written by qkumba +; +; tested on +; - Lady Tut +; +IDProgame + lda #8 + ldx #1 + ldy #19 + jsr CompareMemory + !byte $20,$4A,$FF ;JSR $FF4A + !byte $29,$FB ;AND #$FB + !byte $EE,$F4,$03 ;INC $03F4 + !byte $85,$2E ;STA $2E + !byte $A0,$FF ;LDY #$FF + !byte $84,$3E ;STY $3E + !byte $84,$42 ;STY $42 + !byte $59,$00,$08 + bcs @exit + +; patch code to regain control after it erases hires screen + ldy #@callback1_e-@callback1 +- lda @callback1-1,y + sta @callback1x-1,y + dey + bne - + lda #$20 + sta $814 + lda #<@callback1x + sta $815 + lda #>@callback1x + sta $816 +@exit + rts + +@callback1 !pseudopc $300 { +@callback1x + sta $800,y + cpy #$fe + bne @checkgs + ldx #<@callback2 + stx $8fe + ldx #>@callback2 + stx $8ff + +@checkgs + cpy #$e4 + bne @resume + +; fix GS compatibility + ldx #$a9 + stx $8e4 + ldx #$f0 + stx $8e5 + ldx #$ea + stx $8e6 + +; restore changes to allow decryption to succeed + ldx #$99 + stx $814 + ldx #$00 + stx $815 + ldx #$08 + stx $816 + +@resume + rts + +@callback2 + lda #<@callback3 + sta $84b + lda #>@callback3 + sta $84c + jmp $81b + +@callback3 +; restore changes to allow decryption to succeed + lda #$17 + sta $44b + lda #$fd + sta $44c + +; simulate what's missing in the IIee and later ROMs + pla + jmp $fd18 +} +@callback1_e