From bbd25c25439702cb5fe53ae17481bb2d1d418251 Mon Sep 17 00:00:00 2001 From: cassidoxa Date: Sat, 10 Jun 2023 12:26:01 -0400 Subject: [PATCH] Fix Bow icon Set dungeon ID to $FF after Aga 2 kill for proper HUD draw --- events.asm | 36 +++++++++++++++++++----------------- hooks.asm | 3 +-- newhud.asm | 1 + vanillalabels.asm | 1 + 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/events.asm b/events.asm index 549889b..f321440 100644 --- a/events.asm +++ b/events.asm @@ -29,19 +29,19 @@ OnPlayerDead: RTL ;-------------------------------------------------------------------------------- OnDungeonExit: - PHA : PHP - SEP #$20 ; set 8-bit accumulator - JSL.l SQEGFix - PLP : PLA + PHA : PHP + SEP #$20 ; set 8-bit accumulator + JSL.l SQEGFix + PLP : PLA - STA.w DungeonID : STZ.w Map16ChangeIndex ; thing we wrote over + STA.w DungeonID : STZ.w Map16ChangeIndex ; thing we wrote over - PHA : PHP - JSL.l HUD_RebuildLong - INC.w UpdateHUD - JSL.l FloodGateResetInner - JSL.l SetSilverBowMode - PLP : PLA + PHA : PHP + JSL.l HUD_RebuildLong + INC.w UpdateHUD + JSL.l FloodGateResetInner + JSL.l SetSilverBowMode + PLP : PLA RTL ;-------------------------------------------------------------------------------- OnQuit: @@ -79,6 +79,7 @@ RTL ;-------------------------------------------------------------------------------- OnAga2Defeated: JSL.l Dungeon_SaveRoomData_justKeys ; thing we wrote over, make sure this is first + LDA.b #$FF : STA.w DungeonID LDA.b #$01 : STA.l Aga2Duck JML.l IncrementAgahnim2Sword ;-------------------------------------------------------------------------------- @@ -195,12 +196,13 @@ OnLinkDamagedFromPitOutdoors: JML.l OHKOTimer ; make sure this is last ;-------------------------------------------------------------------------------- OnOWTransition: - JSL.l FloodGateReset - JSL.l StatTransitionCounter - PHP - SEP #$20 ; set 8-bit accumulator - LDA.b #$FF : STA.l RNGLockIn ; clear lock-in - PLP + JSL.l FloodGateReset + JSL.l StatTransitionCounter + PHP + SEP #$20 ; set 8-bit accumulator + LDA.b #$FF : STA.l RNGLockIn ; clear lock-in + INC.w UpdateHUD + PLP RTL ;-------------------------------------------------------------------------------- OnLoadDuckMap: diff --git a/hooks.asm b/hooks.asm index bcb105f..3685f0a 100644 --- a/hooks.asm +++ b/hooks.asm @@ -368,7 +368,6 @@ STA.l StalfosBombDamage ;-------------------------------------------------------------------------------- org $0AB76E ; <- 5376E - Bank0A.asm : 30 (JSL OverworldMap_InitGfx) JSL.l OnLoadDuckMap -;-------------------------------------------------------------------------------- ;================================================================================ ; Infinite Bombs / Arrows / Magic @@ -1358,7 +1357,7 @@ JSL.l DrawMagicHeader BRA + : NOP #15 : + ;-------------------------------------------------------------------------------- org $0DFB29 ; <- headsup_display.asm : 688 (LDA.b #$86 : STA $7EC71E) -BRA + : NOP #$1C : + +BRA + : NOP #$16 : + ;-------------------------------------------------------------------------------- org $01CF67 ; <- CF67 - Bank01.asm : 11625 (STA $7EF36F) JSL.l DecrementSmallKeys diff --git a/newhud.asm b/newhud.asm index e407a86..876c408 100644 --- a/newhud.asm +++ b/newhud.asm @@ -338,6 +338,7 @@ DrawMapCounts: .done SEP #$20 RTS + ;================================================================================ ; Exits with: ; X - ones place tile diff --git a/vanillalabels.asm b/vanillalabels.asm index ed365e2..004c555 100644 --- a/vanillalabels.asm +++ b/vanillalabels.asm @@ -70,6 +70,7 @@ AddAncillaLong = $099D04 Ancilla_CheckIfAlreadyExistsLong = $099D1A Sprite_SetSpawnedCoords = $09AE64 GiveRupeeGift = $09AD58 +Overworld_LoadOverlayAndMap = $0AB96C OverworldMap_InitGfx = $0ABA4F OverworldMap_DarkWorldTilemap = $0ABA99 OverworldMap_LoadSprGfx = $0ABAB9