From 04aabc8bd8de73bf755751befad7e16c93772777 Mon Sep 17 00:00:00 2001 From: aerinon Date: Mon, 13 Mar 2023 15:54:19 -0600 Subject: [PATCH 1/4] Clear standing item data on transition to overworld Standard+retro no arrow filler unless you have the bow --- darkworldspawn.asm | 14 ++++++++++---- keydrop/standing_items.asm | 9 +++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/darkworldspawn.asm b/darkworldspawn.asm index 31bc730..84ae763 100644 --- a/darkworldspawn.asm +++ b/darkworldspawn.asm @@ -114,17 +114,23 @@ RefreshRainAmmo: + CMP.b #$03 : BNE + ; Uncle %SetMinimum(CurrentMagic,MagicFiller,RainDeathRefillMagic_Uncle) %SetMinimum(BombsEquipment,BombsFiller,RainDeathRefillBombs_Uncle) - %SetMinimum(CurrentArrows,ArrowsFiller,RainDeathRefillArrows_Uncle) - BRA .done + LDA.l ArrowMode : BEQ ++ + LDA.l BowEquipment : BEQ +++ + ++ %SetMinimum(CurrentArrows,ArrowsFiller,RainDeathRefillArrows_Uncle) + +++ BRA .done + CMP.b #$02 : BNE + ; Cell %SetMinimum(CurrentMagic,MagicFiller,RainDeathRefillMagic_Cell) %SetMinimum(BombsEquipment,BombsFiller,RainDeathRefillBombs_Cell) - %SetMinimum(CurrentArrows,ArrowsFiller,RainDeathRefillArrows_Cell) + LDA.l ArrowMode : BEQ ++ + LDA.l BowEquipment : BEQ .done + ++ %SetMinimum(CurrentArrows,ArrowsFiller,RainDeathRefillArrows_Cell) BRA .done + CMP.b #$04 : BNE + ; Mantle %SetMinimum(CurrentMagic,MagicFiller,RainDeathRefillMagic_Mantle) %SetMinimum(BombsEquipment,BombsFiller,RainDeathRefillBombs_Mantle) - %SetMinimum(CurrentArrows,ArrowsFiller,RainDeathRefillArrows_Mantle) + LDA.l ArrowMode : BEQ ++ + LDA.l BowEquipment : BEQ .done + ++ %SetMinimum(CurrentArrows,ArrowsFiller,RainDeathRefillArrows_Mantle) + .done RTL diff --git a/keydrop/standing_items.asm b/keydrop/standing_items.asm index 99349a3..c2c9023 100644 --- a/keydrop/standing_items.asm +++ b/keydrop/standing_items.asm @@ -9,6 +9,10 @@ org $829C25 org $89C2BB JSL ClearSpriteData +; underworld -> overworld transition +org $8282D1 + JSL ClearSpriteData2 + org $89C327 JSL LoadSpriteData @@ -303,6 +307,7 @@ RTS ClearSpriteData: STZ.b $02 : STZ.b $03 ; what we overrode +ClearSpriteData_Shared: PHX LDA #$00 : LDX #$00 .loop @@ -312,6 +317,10 @@ ClearSpriteData: PLX RTL +ClearSpriteData2: + LDA.b #$82 : STA.b $99 + JMP ClearSpriteData_Shared + ; Runs during sprite load of the room LoadSpriteData: INY : INY From 69a6e7f9189ab21b0c7c6910bb6cbcdf84bf9091 Mon Sep 17 00:00:00 2001 From: aerinon Date: Tue, 14 Mar 2023 16:06:32 -0600 Subject: [PATCH 2/4] Version area reservation --- doorrando/doorrando.asm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doorrando/doorrando.asm b/doorrando/doorrando.asm index 2a2ff56..6511dd2 100644 --- a/doorrando/doorrando.asm +++ b/doorrando/doorrando.asm @@ -41,6 +41,11 @@ DRScroll: db 0 OffsetTable: dw -8, 8 +org $A78010 +DRVersionInfo: +dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000 + +org $A78020 incsrc normal.asm incsrc scroll.asm From b10dff8a30382233da39095353bfbc85fa2d376b Mon Sep 17 00:00:00 2001 From: aerinon Date: Tue, 14 Mar 2023 16:33:02 -0600 Subject: [PATCH 3/4] Minor clean up --- keydrop/standing_items.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keydrop/standing_items.asm b/keydrop/standing_items.asm index c2c9023..f6c88c3 100644 --- a/keydrop/standing_items.asm +++ b/keydrop/standing_items.asm @@ -307,7 +307,7 @@ RTS ClearSpriteData: STZ.b $02 : STZ.b $03 ; what we overrode -ClearSpriteData_Shared: + .shared: PHX LDA #$00 : LDX #$00 .loop @@ -319,7 +319,7 @@ ClearSpriteData_Shared: ClearSpriteData2: LDA.b #$82 : STA.b $99 - JMP ClearSpriteData_Shared + JMP ClearSpriteData_shared ; Runs during sprite load of the room LoadSpriteData: From bd2432d2cef52fe73bd2d91f1bac2466434d898d Mon Sep 17 00:00:00 2001 From: codemann8 Date: Fri, 17 Mar 2023 20:06:56 -0500 Subject: [PATCH 4/4] Moving some hijacked DR code to new location --- LTTP_RND_GeneralBugfixes.asm | 3 +++ doorrando/drhooks.asm | 7 +++---- doorrando/normal.asm | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index 8ebfb5e..5da2f9a 100644 --- a/LTTP_RND_GeneralBugfixes.asm +++ b/LTTP_RND_GeneralBugfixes.asm @@ -510,6 +510,9 @@ Module_PreDungeon: org $028296 .setAmbientSfx +org $828AD9 +Underworld_SetBossOrSancMusicUponEntry: + org $02A0A8 Dungeon_SaveRoomData: diff --git a/doorrando/drhooks.asm b/doorrando/drhooks.asm index 8904c29..8f7816a 100644 --- a/doorrando/drhooks.asm +++ b/doorrando/drhooks.asm @@ -192,10 +192,9 @@ JSL.l Underworld_DoorDown_Entry : CPX #$FF BEQ + : db $80, $1C ; BRA $028B04 NOP #6 : + -org $82C3F2 ; <- Bank02.asm:10521 Unused call -Underworld_DoorDown_Call: -org $82C3F3 -dw $8AD9 ; address of Bank02.asm:2085 +org $82FD00 ; unreachable code +Underworld_SetBossOrSancMusicUponEntry_long: +JSR Underworld_SetBossOrSancMusicUponEntry : RTL org $81AA90 JSL BigKeyDoorCheck : NOP diff --git a/doorrando/normal.asm b/doorrando/normal.asm index e1fc8ee..2f45420 100644 --- a/doorrando/normal.asm +++ b/doorrando/normal.asm @@ -412,7 +412,7 @@ StraightStairsTrapDoor: .animateTraps lda #$05 : sta $11 inc $0468 : stz $068e : stz $0690 - ++ JSL Underworld_DoorDown_Call : rtl + ++ JML Underworld_SetBossOrSancMusicUponEntry_long + JML Dungeon_ApproachFixedColor ; what we wrote over }