From 66e4e91bebb86d455bbe647812136093ac56a764 Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Sun, 9 Mar 2025 16:42:54 -0500 Subject: [PATCH] Dashing mimics and crystal books --- LTTP_RND_GeneralBugfixes.asm | 2 ++ crystalswitchbook.asm | 52 ++++++++++++++++++++++++++++++++++++ hooks.asm | 7 +++++ mimicdash.asm | 22 +++++++++++++++ tables.asm | 8 +++++- 5 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 crystalswitchbook.asm create mode 100644 mimicdash.asm diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index 5b1ebf0..e3860b6 100644 --- a/LTTP_RND_GeneralBugfixes.asm +++ b/LTTP_RND_GeneralBugfixes.asm @@ -181,6 +181,8 @@ incsrc dungeonmap.asm incsrc hextodec.asm incsrc multiworld.asm incsrc textrenderer.asm +incsrc crystalswitchbook.asm +incsrc mimicdash.asm warnpc $A58000 org $A28000 diff --git a/crystalswitchbook.asm b/crystalswitchbook.asm new file mode 100644 index 0000000..b8e56e0 --- /dev/null +++ b/crystalswitchbook.asm @@ -0,0 +1,52 @@ +pushpc + +org $87A46E +JSL CheckBookTriggerSwitch +BCS + +skip 15 ++ + +org $8296A8 +JSL FinishPegChange + +pullpc + +FinishPegChange: + LDA.b #$20 + TRB.w $037A + + STZ.b $B0 + STZ.b $11 +RTL + +CheckBookTriggerSwitch: + LDA.l CrystalSwitchBook + BEQ + + + LDA.b $10 + CMP.b #$07 + BNE + + + LDA.l $7EC172 + EOR.b #$01 + STA.l $7EC172 + + LDA.b #$16 + STA.b $11 + + LDA.b #$20 + TSB.w $037A + + LDA.b #$25 + JSL $8DBB8A + + SEC + BRA .done + ++ CLC +.done + ; what we wrote over + LDA.b $3A + AND.b #$BF + STA.b $3A +RTL diff --git a/hooks.asm b/hooks.asm index d33ff4a..ad25e68 100755 --- a/hooks.asm +++ b/hooks.asm @@ -2740,3 +2740,10 @@ NOP #2 ; this fixes Link's direction after mirroring and falling after entering ;-------------------------------------------------------------------------------- org $81B5E6 LDA.b #$30 + +;=================================================================================================== +;-------------------------------------------------------------------------------- +; Mimic dash changes +;-------------------------------------------------------------------------------- +org $9EC7BE +JSL MimicDirection diff --git a/mimicdash.asm b/mimicdash.asm new file mode 100644 index 0000000..41dc717 --- /dev/null +++ b/mimicdash.asm @@ -0,0 +1,22 @@ +;================================================================================ +; Mimic Direction Check +;-------------------------------------------------------------------------------- +; Output: 0 for darkness, 1 for lamp cone +;-------------------------------------------------------------------------------- +MimicDirection: + LDA.b $F0 + AND.b #$0F + BNE .done + LDA.l MimicDash + BEQ .done + LDA.w $0372 + BEQ .done + LDA.w $0374 + BNE .make_zero + LDA.b $67 +.done + RTL +.make_zero + LDA.b #$00 + RTL + diff --git a/tables.asm b/tables.asm index c3feb2d..664b5d6 100644 --- a/tables.asm +++ b/tables.asm @@ -420,7 +420,13 @@ db $01 ; #$00 = Original Behavior - #$01 = Randomizer Behavior (Default) Bugfix_PodEG: db $01 ; #$00 = Original Behavior - #$01 = Randomizer Behavior (Default) ;-------------------------------------------------------------------------------- -; 0x1800A5 - 0x1800AF (unused) +org $B080A5 ; PC 0x1800A5 +MimicDash: +db $00 ; #$00 = Original Behavior (default) - #$01 = Mimics move when link dashes +CrystalSwitchBook: +db $00 ; #$00 = Original Behavior (default) - #$01 = Book can flip crystal switch +;-------------------------------------------------------------------------------- +; 0x1800A7 - 0x1800AF (unused) ;-------------------------------------------------------------------------------- org $B080B0 ; 0x1800B0-0x1800BF StaticDecryptionKey: