From 2d1b5116ec682590cc74dec2c7f1c0f23dcc7c09 Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Mon, 25 Nov 2024 12:28:08 -0600 Subject: [PATCH] Open GT by killing deadrocks --- LTTP_RND_GeneralBugfixes.asm | 1 + deadrocks.asm | 50 ++++++++++++++++++++++++++++++++++++ sram.asm | 3 ++- tables.asm | 2 +- 4 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 deadrocks.asm diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index 6e51a8e..40413a0 100644 --- a/LTTP_RND_GeneralBugfixes.asm +++ b/LTTP_RND_GeneralBugfixes.asm @@ -165,6 +165,7 @@ incsrc zoom_on_carry.asm incsrc iframes.asm incsrc improve_items.asm incsrc 2waymirror.asm +incsrc deadrocks.asm warnpc $A58000 org $A28000 diff --git a/deadrocks.asm b/deadrocks.asm new file mode 100644 index 0000000..7bbcd17 --- /dev/null +++ b/deadrocks.asm @@ -0,0 +1,50 @@ +pushpc + +org $86EDD1 +JSL CheckTransform +BRA + : NOP : + + +org $86EF9A +JSL SpriteDeath +NOP + +pullpc + +CheckTransform: + CMP.b #$8F + BNE .skip + + LDA.w $0E20, X + PHA + LDA.b #$8F + STA.w $0E20, X + JSL.l $8DB818 + + PLA + STA.w $0DE0, X + LDA.b #$8F + RTL + +.skip + STA.w $0E20, X + JSL.l $8DB818 + RTL + +SpriteDeath: + LDA.w $0E20, X + CMP.b #$8F + BNE .done; not blob + LDA.w $0DE0, X + CMP.b #$27 + BNE .done; blob that was formerly not a deadrock + LDA.l DeadrockCounter + CMP.b #$FF + BEQ .done ; deadrock counter maxed + INC + STA.l DeadrockCounter + +.done + ; what we wrote over + LDY.w $0E20, X + CPY.b #$1B +RTL diff --git a/sram.asm b/sram.asm index bde76ce..3d0cfb5 100644 --- a/sram.asm +++ b/sram.asm @@ -321,7 +321,8 @@ DungeonsCompleted: skip 2 ; Bitfield indicating whether a dungeon's prize ; This has the same shape as the dungeon item bitfields. MapCountDisplay: skip 2 ; CrystalCounter: skip 2 ; Total Number of crystals collected (integer) -skip 40 ; Unused +DeadrockCounter: skip 2 ; Number of deadrocks killed +skip 38 ; Unused ServiceSequence: ; See servicerequest.asm ServiceSequenceRx: skip 8 ; Service sequence receive ServiceSequenceTx: skip 8 ; Service sequence transmit diff --git a/tables.asm b/tables.asm index ccddf77..262a466 100644 --- a/tables.asm +++ b/tables.asm @@ -922,7 +922,7 @@ dw $00D8 ; 216 org $B08198 ; PC 0x180198-0x1801A9 GanonsTowerOpenAddress: ; 0x180198-0x180199 -dw CrystalCounter ; Target address for GT open check +dw DeadrockCounter ; Target address for GT open check GanonsTowerOpenTarget: ; 0x18019A-0x18019B dw $0007 ; Target amount for GT open modes to compare GanonsTowerOpenMode: ; 0x18019C-0x18019D