From 44b014fc656b896c9f02ca343afdf5cd8e26c91e Mon Sep 17 00:00:00 2001 From: aerinon Date: Fri, 31 Oct 2025 10:29:29 -0600 Subject: [PATCH 1/4] fix: fix for pot drops at sprite limit --- enemizer/hooks/bushes_hooks.asm | 6 +++- keydrop/standing_items.asm | 54 ++++++++++++++++++++++++++++++++- ram.asm | 8 +++++ vanillalabels.asm | 1 + 4 files changed, 67 insertions(+), 2 deletions(-) diff --git a/enemizer/hooks/bushes_hooks.asm b/enemizer/hooks/bushes_hooks.asm index e610bbb..a9e860b 100644 --- a/enemizer/hooks/bushes_hooks.asm +++ b/enemizer/hooks/bushes_hooks.asm @@ -2,7 +2,11 @@ ; New bush mob randomization ;-------------------------------------------------------------------------------- org $868279 -NOP #$0A +BRA + +MaybeSkipTerrainDebris: +JSL MaybeSkipTerrainDebris_long : RTS ; sticking this here, no other free space in bank 06 +NOP #3 ++ JSL sprite_bush_spawn NOP ; we keep the branch ;-------------------------------------------------------------------------------- diff --git a/keydrop/standing_items.asm b/keydrop/standing_items.asm index 491a4e8..0ffcfda 100644 --- a/keydrop/standing_items.asm +++ b/keydrop/standing_items.asm @@ -1,4 +1,7 @@ ; hooks +org $81DB19 + JSL MaybeSkipSmashTerrain : BCS $81DB11 + org $81E6B0 JSL RevealPotItem RTS @@ -43,6 +46,9 @@ org $86d180 org $86d18d ; <- 3518D - sprite_absorbable.asm : 274 (LDA $7EF36F : INC A : STA $7EF36F) JSL KeyGet +org $86E24A + JSR MaybeSkipTerrainDebris + org $86f9f3 ; bank06.asm : 6732 (JSL SpritePrep_LoadProperties) JSL LoadProperties_PreserveCertainProps @@ -50,6 +56,12 @@ org $86828A Sprite_SpawnSecret_SpriteSpawnDynamically: JSL CheckSprite_Spawn +org $87B114 + JSL MaybeUnableToLiftPotSfx + NOP #4 + db $30 ; BMI + + org $87B169 JSL PreventPotSpawn : NOP @@ -757,7 +769,9 @@ RTL LDA.b #$00 : STZ.w SpriteAITable, X LDA.b #$E4 : JSL Sprite_SpawnDynamically BMI .error - LDA.b #$40 : TSB.w AButtonAct : RTL + LDA.w UseY1 : AND.b #$02 : BNE ++ + LDA.b #$40 : TSB.w AButtonAct + ++ RTL .error LDA.b #$3C ; SFX2_3C - error beep @@ -776,6 +790,44 @@ PreventPotSpawn2: LDA.b #$01 : TSB.b LinkStrafe ; what we wrote over + RTL +MaybeSkipTerrainDebris_long: + STZ.w SecretId ; what we wrote over + LDA.w SpriteTypeTable, X : CMP.b #$EC + BEQ .return + PLA : PLA : PLA : PLA : PLA + LDA.b #Sprite_ScheduleForBreakage_exit>>16 : PHA + PEA.w Sprite_ScheduleForBreakage_exit-1 +.return +RTL + +MaybeSkipSmashTerrain: + STY.w ManipIndex : LDA.w ManipTileMapX, Y ; what we wrote over + PHA + SEP #$30 + LDX.b #$0F + - LDA.w SpriteAITable, X : BEQ .continue + DEX + BPL - + .skip + PLA : PLA + LDA.b #$3C : STA.w SFX2 ; error beep + SEC + RTL + .continue + REP #$30 + PLA + CLC +RTL + +MaybeUnableToLiftPotSfx: + - LDA.w SpriteAITable,X : BEQ .return + DEX + BPL - + LDA.b #$3C : STA.w SFX2 ; error beep + LDA.b #$FF +.return +RTL + CheckIfPotIsSpecial: TXA ; give index to A so we can do a CMP.l CMP.l $018550 ; see if our current index is that of object 230 diff --git a/ram.asm b/ram.asm index 0dfa15b..693fe5b 100644 --- a/ram.asm +++ b/ram.asm @@ -263,6 +263,8 @@ DungeonID = $7E040C ; High byte mostly unused but sometimes read. ; TransitionDirection = $7E0418 ; OW: 0=N 1=S 2=W 3=E UW: 0=S 1=N 2=E 3=W ; +ManipIndex = $7E042C ; Index of manipulable tile. Word length. + ; TrapDoorFlag = $7E0468 ; Flag that is set when trap doors are down. 2 bytes ; LayerAdjustment = $7E047A ; Flags layer adjustments. Arms EG. @@ -276,6 +278,8 @@ OWEntranceCutscene = $7E04C6 ; ; HeartBeepTimer = $7E04CA ; ; +ManipTileMapX = $7E0540 ; Tilemap X position of manipulable tile. $10 x 2 bytes + ; CameraTargetN = $7E0610 ; Camera scroll target for directions NSEW CameraTargetS = $7E0612 ; CameraTargetW = $7E0614 ; @@ -344,6 +348,7 @@ EnemyStunTimer = $7E0B58 ; Auto-decrementing timer for stunned enemies. ; BowDryFire = $7E0B9A ; If set, arrows are deleted immediately ; +SecretId = $7E0B9C ; Controls the secret spawned from bushes, pots, rocks, etc. SaveFileIndex = $7E0B9D ; ; SpriteAncillaInteract = $7E0BA0 ; If nonzero, ancillae do not interact with the sprite. $10 bytes. @@ -836,6 +841,7 @@ endmacro %assertRAM(OverworldIndexMirror, $7E040A) %assertRAM(DungeonID, $7E040C) %assertRAM(TransitionDirection, $7E0418) +%assertRAM(ManipIndex, $7E042C) %assertRAM(TrapDoorFlag, $7E0468) %assertRAM(LayerAdjustment, $7E047A) %assertRAM(RoomIndexMirror, $7E048E) @@ -843,6 +849,7 @@ endmacro %assertRAM(Map16ChangeIndex, $7E04AC) %assertRAM(OWEntranceCutscene, $7E04C6) %assertRAM(HeartBeepTimer, $7E04CA) +%assertRAM(ManipTileMapX, $7E0540) %assertRAM(CameraTargetN, $7E0610) %assertRAM(CameraTargetS, $7E0612) %assertRAM(CameraTargetW, $7E0614) @@ -885,6 +892,7 @@ endmacro %assertRAM(OverlordYHigh, $7E0B20) %assertRAM(EnemyStunTimer, $7E0B58) %assertRAM(BowDryFire, $7E0B9A) +%assertRAM(SecretId, $7E0B9C) %assertRAM(SaveFileIndex, $7E0B9D) %assertRAM(SpriteAncillaInteract, $7E0BA0) %assertRAM(AncillaVelocityY, $7E0C22) diff --git a/vanillalabels.asm b/vanillalabels.asm index 1611fef..b2ee2a2 100644 --- a/vanillalabels.asm +++ b/vanillalabels.asm @@ -192,6 +192,7 @@ Sprite_BagOfPowder = $85F644 MagicShopAssistant_Main = $85F893 Sprite_SpawnSecret_SetCoords = $8682A5 Chicken_SpawnAvengerChicken = $86A7DB +Sprite_ScheduleForBreakage_exit = $86E273 Link_PerformRead = $87B4DB Link_PerformOpenChest_no_replacement = $87B59F Link_CheckNewAPress = $87B5A9 From b24e4405978caab945be77298fed43f7fc5d7a97 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Tue, 19 Aug 2025 10:10:08 -0500 Subject: [PATCH 2/4] Fix issue with music silence in DR when straight stairs lead to pre-Aga room --- hooks.asm | 4 ++++ music.asm | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/hooks.asm b/hooks.asm index e045cca..5e5c224 100644 --- a/hooks.asm +++ b/hooks.asm @@ -2206,6 +2206,10 @@ dl Overworld_FinishMirrorWarp ;-------------------------------------------------------------------------------- org $8AB949 ; <- Bank0A.asm:270 (Different from US ROM) JSL BirdTravel_LoadTargetAreaMusic : NOP #16 +;-------------------------------------------------------------------------------- +org $8292D9 +BRA + : NOP #4 : + +JSL FixPreAgaMusicFadeOut : db $B0 ; BCS ;================================================================================ ;================================================================================ diff --git a/music.asm b/music.asm index 2b2b91a..be6b1e4 100644 --- a/music.asm +++ b/music.asm @@ -293,3 +293,12 @@ FallingMusicFadeOut: .return RTL ;-------------------------------------------------------------------------------- +FixPreAgaMusicFadeOut: + LDA.l DRMode : TAX : CPX.b #$01 : BCS .exit_no_fade+1 + LDA.b RoomIndex : CMP.w #$0030 : BEQ .exit_and_fade ; what we + CMP.w #$0040 : BEQ .exit_and_fade ; wrote over +.exit_no_fade + SEC : RTL +.exit_and_fade + CLC : RTL +;-------------------------------------------------------------------------------- From fa72adb53d0ba076936d011cce5281c1eda36d41 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sun, 13 Jul 2025 00:27:22 -0500 Subject: [PATCH 3/4] Restore Kodongo AI when in vanilla rooms --- enemizer/kodongo_fixes.asm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/enemizer/kodongo_fixes.asm b/enemizer/kodongo_fixes.asm index b803f94..14041ed 100644 --- a/enemizer/kodongo_fixes.asm +++ b/enemizer/kodongo_fixes.asm @@ -2,8 +2,7 @@ pushpc org $9EC147 JSL NewKodongoCollision -JMP .continue : NOP #2 -.continue +BRA + : NOP #3 : + org $9EC152 Kodongo_SetDirection: @@ -12,8 +11,18 @@ pullpc NewKodongoCollision: LDA.w SpriteMoveDirection, X : INC A : AND.b #$03 : STA.w SpriteMoveDirection, X + JSL Kodongo_InVanillaRoom : BEQ .continue ;If they collide more than 4 times just set direction LDA.w SpriteAuxTable, X : INC A : STA.w SpriteAuxTable, X : CMP.b #$04 : BCC .continue PLA : PLA : PEA.w Kodongo_SetDirection-1 .continue -RTL \ No newline at end of file +RTL + +Kodongo_InVanillaRoom: + LDA.b RoomIndex+1 : BNE .return + LDA.b RoomIndex : CMP.b #$19 : BEQ .return + CMP.b #$27 : BEQ .return + CMP.b #$77 : BEQ .return +.return +RTL +nop #10 \ No newline at end of file From 7334dd02db6ae7d830662f65458d0f05fecc916c Mon Sep 17 00:00:00 2001 From: codemann8 Date: Wed, 12 Nov 2025 02:29:01 -0600 Subject: [PATCH 4/4] Fix to allow VRAM corruption in Blind fight --- maidencrystals.asm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/maidencrystals.asm b/maidencrystals.asm index ff01c60..fed155a 100644 --- a/maidencrystals.asm +++ b/maidencrystals.asm @@ -2,6 +2,13 @@ ; Maiden Crystal Fixes ;================================================================================ +pushpc + +org $9ECE25 +STZ.w $1F00 : NOP : NOP ; fix to allow VRAM corruption during Blind fight + +pullpc + ;-------------------------------------------------------------------------------- ; MaidenCrystalScript ;--------------------------------------------------------------------------------