From fe014b502f4cadcf33cd3c1a8041a327e0feafcf Mon Sep 17 00:00:00 2001 From: ElectroDeoxys Date: Thu, 27 Jun 2024 01:18:39 -0700 Subject: [PATCH] Label HRAM addresses and tidy hram.asm --- src/data/object_groups.asm | 236 +++++++++--------- src/engine/level/block_functions.asm | 50 ++-- src/engine/level/object_interactions.asm | 24 +- src/engine/level/objects/big_leaf.asm | 2 +- src/engine/level/objects/bubble.asm | 12 +- src/engine/level/objects/coin.asm | 6 +- .../level/objects/count_richtertoffen.asm | 2 +- src/engine/level/objects/haridama.asm | 2 +- src/engine/level/objects/hebarii.asm | 2 +- src/engine/level/objects/mizuuo.asm | 2 +- src/engine/level/objects/muddee.asm | 6 +- src/engine/level/objects/para_goom.asm | 2 +- src/engine/level/objects/pesce.asm | 4 +- src/engine/level/objects/pneumo.asm | 6 +- src/engine/level/objects/scowler.asm | 8 +- src/engine/level/objects/tadpole.asm | 2 +- src/engine/level/objects/water_drop.asm | 2 +- src/engine/level/update_objects.asm | 112 ++++----- src/engine/level/wario_states_3.asm | 24 +- src/home/home1.asm | 2 +- src/home/start.asm | 6 +- src/hram.asm | 94 +++---- src/macros/audio.asm | 8 +- src/wram.asm | 2 +- 24 files changed, 302 insertions(+), 314 deletions(-) diff --git a/src/data/object_groups.asm b/src/data/object_groups.asm index 3fcbeb2..88ee917 100644 --- a/src/data/object_groups.asm +++ b/src/data/object_groups.asm @@ -1,5 +1,5 @@ ObjectGroup0: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -14,7 +14,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup1: - db $00 + db $00 ; GFX bank offset dw SilkyGfx dw CountRichtertoffenGfx @@ -33,7 +33,7 @@ INCLUDE "gfx/pals/doughnuteer.pal" INCLUDE "gfx/pals/beam_bot.pal" ObjectGroup2: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw BirdGfx @@ -52,7 +52,7 @@ INCLUDE "gfx/pals/futamogu1.pal" INCLUDE "gfx/pals/torch.pal" ObjectGroup3: - db $00 + db $00 ; GFX bank offset dw SilkyGfx dw CountRichtertoffenGfx @@ -71,7 +71,7 @@ INCLUDE "gfx/pals/clear_gate.pal" INCLUDE "gfx/pals/omodonmeka.pal" ObjectGroup4: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -90,7 +90,7 @@ INCLUDE "gfx/pals/omodon.pal" INCLUDE "gfx/pals/omodonmeka.pal" ObjectGroup5: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -109,7 +109,7 @@ INCLUDE "gfx/pals/omodon.pal" INCLUDE "gfx/pals/omodonmeka.pal" ObjectGroup6: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw KushimushiGfx @@ -129,7 +129,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup7: - db $00 + db $00 ; GFX bank offset dw MizuuoGfx dw WebberGfx @@ -145,7 +145,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup8: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw KushimushiGfx @@ -165,7 +165,7 @@ INCLUDE "gfx/pals/big_leaf.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup9: - db $00 + db $00 ; GFX bank offset dw MizuuoGfx dw WebberGfx @@ -183,7 +183,7 @@ INCLUDE "gfx/pals/big_leaf.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup10: - db $00 + db $00 ; GFX bank offset dw SilkyGfx dw BirdGfx @@ -201,7 +201,7 @@ INCLUDE "gfx/pals/doughnuteer.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup11: - db $00 + db $00 ; GFX bank offset dw SnakeGfx dw ParaGoomGfx @@ -220,7 +220,7 @@ INCLUDE "gfx/pals/doughnuteer.pal" INCLUDE "gfx/pals/fire_bot.pal" ObjectGroup12: - db $00 + db $00 ; GFX bank offset dw SnakeGfx dw ParaGoomGfx @@ -239,7 +239,7 @@ INCLUDE "gfx/pals/zombie.pal" INCLUDE "gfx/pals/fire_bot.pal" ObjectGroup13: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -258,7 +258,7 @@ INCLUDE "gfx/pals/futamogu1.pal" INCLUDE "gfx/pals/small_leaf.pal" ObjectGroup14: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw ApplebyGfx @@ -277,7 +277,7 @@ INCLUDE "gfx/pals/futamogu1.pal" INCLUDE "gfx/pals/torch.pal" ObjectGroup15: - db $00 + db $00 ; GFX bank offset dw PrinceFroggyGfx dw HammerBotGfx @@ -296,7 +296,7 @@ INCLUDE "gfx/pals/spear_bot.pal" INCLUDE "gfx/pals/barrel.pal" ObjectGroup16: - db $00 + db $00 ; GFX bank offset dw MadSciensteinGfx dw ParaGoomGfx @@ -316,7 +316,7 @@ INCLUDE "gfx/pals/futamogu1.pal" INCLUDE "gfx/pals/teruteru.pal" ObjectGroup17: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw PneumoGfx @@ -335,7 +335,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/clear_gate.pal" ObjectGroup18: - db $00 + db $00 ; GFX bank offset dw MadSciensteinGfx dw ParaGoomGfx @@ -355,7 +355,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/electric_lamp.pal" ObjectGroup19: - db $00 + db $00 ; GFX bank offset dw Sun1Gfx dw Sun2Gfx @@ -372,7 +372,7 @@ INCLUDE "gfx/pals/clear_gate.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup20: - db $00 + db $00 ; GFX bank offset dw Moon1Gfx dw Moon2Gfx @@ -389,7 +389,7 @@ INCLUDE "gfx/pals/clear_gate.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup21: - db $00 + db $00 ; GFX bank offset dw UnusedFlowerGfx dw HammerBotGfx @@ -408,7 +408,7 @@ INCLUDE "gfx/pals/spear_bot.pal" INCLUDE "gfx/pals/torch.pal" ObjectGroup22: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -427,7 +427,7 @@ INCLUDE "gfx/pals/hand1.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup23: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -443,7 +443,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup24: - db $00 + db $00 ; GFX bank offset dw HaridamaGfx dw WebberGfx @@ -462,7 +462,7 @@ INCLUDE "gfx/pals/bubble.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup25: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -481,7 +481,7 @@ INCLUDE "gfx/pals/kobatto.pal" INCLUDE "gfx/pals/water_drop.pal" ObjectGroup26: - db $00 + db $00 ; GFX bank offset dw SnakeGfx dw ClearGate1Gfx @@ -501,7 +501,7 @@ INCLUDE "gfx/pals/cart.pal" INCLUDE "gfx/pals/fire_bot.pal" ObjectGroup27: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw ClearGate1Gfx @@ -521,7 +521,7 @@ INCLUDE "gfx/pals/cart.pal" INCLUDE "gfx/pals/fire_bot.pal" ObjectGroup28: - db $00 + db $00 ; GFX bank offset dw SnakeGfx dw ClearGate1Gfx @@ -541,7 +541,7 @@ INCLUDE "gfx/pals/cart.pal" INCLUDE "gfx/pals/fire_bot.pal" ObjectGroup29: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -560,7 +560,7 @@ INCLUDE "gfx/pals/cart.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup30: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw ParaGoomGfx @@ -580,7 +580,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/nobiiru.pal" ObjectGroup31: - db $00 + db $00 ; GFX bank offset dw SilkyGfx dw ParaGoomGfx @@ -599,7 +599,7 @@ INCLUDE "gfx/pals/clear_gate.pal" INCLUDE "gfx/pals/beam_bot.pal" ObjectGroup32: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw ApplebyGfx @@ -618,7 +618,7 @@ INCLUDE "gfx/pals/clear_gate.pal" INCLUDE "gfx/pals/electric_lamp.pal" ObjectGroup33: - db $00 + db $00 ; GFX bank offset dw RoboMouse1Gfx dw RoboMouse2Gfx @@ -635,7 +635,7 @@ INCLUDE "gfx/pals/spear_bot.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup34: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw ParaGoomGfx @@ -654,7 +654,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/togeba.pal" ObjectGroup35: - db $00 + db $00 ; GFX bank offset dw HaridamaGfx dw WebberGfx @@ -673,7 +673,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/brrr_bear.pal" ObjectGroup36: - db $00 + db $00 ; GFX bank offset dw HaridamaGfx dw WebberGfx @@ -693,7 +693,7 @@ INCLUDE "gfx/pals/bubble.pal" INCLUDE "gfx/pals/nobiiru.pal" ObjectGroup37: - db $00 + db $00 ; GFX bank offset dw OwlGfx dw WebberGfx @@ -712,7 +712,7 @@ INCLUDE "gfx/pals/omodon.pal" INCLUDE "gfx/pals/omodonmeka.pal" ObjectGroup38: - db $00 + db $00 ; GFX bank offset dw OwlGfx dw PneumoGfx @@ -731,7 +731,7 @@ INCLUDE "gfx/pals/clear_gate.pal" INCLUDE "gfx/pals/omodonmeka.pal" ObjectGroup39: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw ParaGoomGfx @@ -754,7 +754,7 @@ INCLUDE "gfx/pals/zip_line.pal" INCLUDE "gfx/pals/beam_bot.pal" ObjectGroup40: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw ParaGoomGfx @@ -773,7 +773,7 @@ INCLUDE "gfx/pals/spear_bot.pal" INCLUDE "gfx/pals/fire_bot.pal" ObjectGroup41: - db $04 + db $04 ; GFX bank offset dw Anonster1Gfx dw Anonster2Gfx @@ -787,7 +787,7 @@ ObjectGroup41: INCLUDE "gfx/pals/anonster.pal" ObjectGroup42: - db $00 + db $00 ; GFX bank offset dw StoveGfx dw ParaGoomGfx @@ -807,7 +807,7 @@ INCLUDE "gfx/pals/flame_block.pal" INCLUDE "gfx/pals/torch.pal" ObjectGroup43: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw BirdGfx @@ -826,7 +826,7 @@ INCLUDE "gfx/pals/kobatto.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup44: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw HammerBotGfx @@ -844,7 +844,7 @@ INCLUDE "gfx/pals/zombie.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup45: - db $04 + db $04 ; GFX bank offset dw DollBoy1Gfx dw DollBoy2Gfx @@ -861,7 +861,7 @@ ObjectGroup45: INCLUDE "gfx/pals/doll_boy.pal" ObjectGroup46: - db $00 + db $00 ; GFX bank offset dw MadSciensteinGfx dw ParaGoomGfx @@ -881,7 +881,7 @@ INCLUDE "gfx/pals/zombie.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup47: - db $04 + db $04 ; GFX bank offset dw Wormwould1Gfx dw Wormwould2Gfx @@ -895,7 +895,7 @@ ObjectGroup47: INCLUDE "gfx/pals/wormwould.pal" ObjectGroup48: - db $00 + db $00 ; GFX bank offset dw OwlGfx dw ParaGoomGfx @@ -912,7 +912,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup49: - db $00 + db $00 ; GFX bank offset dw HaridamaGfx dw ParaGoomGfx @@ -933,7 +933,7 @@ INCLUDE "gfx/pals/futamogu2.pal" INCLUDE "gfx/pals/pillar_platform.pal" ObjectGroup50: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw ParaGoomGfx @@ -952,7 +952,7 @@ INCLUDE "gfx/pals/doughnuteer.pal" INCLUDE "gfx/pals/fire_bot.pal" ObjectGroup51: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw ParaGoomGfx @@ -971,7 +971,7 @@ INCLUDE "gfx/pals/zombie.pal" INCLUDE "gfx/pals/fire_bot.pal" ObjectGroup52: - db $04 + db $04 ; GFX bank offset dw YellowBelly1Gfx dw YellowBelly2Gfx @@ -985,7 +985,7 @@ ObjectGroup52: INCLUDE "gfx/pals/yellow_belly.pal" ObjectGroup53: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw ApplebyGfx @@ -1004,7 +1004,7 @@ INCLUDE "gfx/pals/kobatto.pal" INCLUDE "gfx/pals/water_drop.pal" ObjectGroup54: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -1023,7 +1023,7 @@ INCLUDE "gfx/pals/doughnuteer.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup55: - db $00 + db $00 ; GFX bank offset dw PrinceFroggyGfx dw ParaGoomGfx @@ -1042,7 +1042,7 @@ INCLUDE "gfx/pals/zip_line.pal" INCLUDE "gfx/pals/brrr_bear.pal" ObjectGroup56: - db $04 + db $04 ; GFX bank offset dw Pesce1Gfx dw Pesce2Gfx @@ -1059,7 +1059,7 @@ ObjectGroup56: INCLUDE "gfx/pals/pesce.pal" ObjectGroup57: - db $00 + db $00 ; GFX bank offset dw StoveGfx dw WebberGfx @@ -1077,7 +1077,7 @@ INCLUDE "gfx/pals/doughnuteer.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup58: - db $00 + db $00 ; GFX bank offset dw StoveGfx dw WebberGfx @@ -1096,7 +1096,7 @@ INCLUDE "gfx/pals/zombie.pal" INCLUDE "gfx/pals/fire_bot.pal" ObjectGroup59: - db $00 + db $00 ; GFX bank offset dw SnakeGfx dw BirdGfx @@ -1116,7 +1116,7 @@ INCLUDE "gfx/pals/hebarii.pal" INCLUDE "gfx/pals/nobiiru.pal" ObjectGroup60: - db $00 + db $00 ; GFX bank offset dw HaridamaGfx dw WebberGfx @@ -1135,7 +1135,7 @@ INCLUDE "gfx/pals/tadpole.pal" INCLUDE "gfx/pals/barrel.pal" ObjectGroup61: - db $00 + db $00 ; GFX bank offset dw PrinceFroggyGfx dw WebberGfx @@ -1154,7 +1154,7 @@ INCLUDE "gfx/pals/kobatto.pal" INCLUDE "gfx/pals/water_drop.pal" ObjectGroup62: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw PneumoGfx @@ -1174,7 +1174,7 @@ INCLUDE "gfx/pals/doughnuteer.pal" INCLUDE "gfx/pals/spark.pal" ObjectGroup63: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw PneumoGfx @@ -1193,7 +1193,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/beam_bot.pal" ObjectGroup64: - db $00 + db $00 ; GFX bank offset dw Sun1Gfx dw Sun2Gfx @@ -1211,7 +1211,7 @@ INCLUDE "gfx/pals/spear_bot.pal" INCLUDE "gfx/pals/brrr_bear.pal" ObjectGroup65: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw BirdGfx @@ -1230,7 +1230,7 @@ INCLUDE "gfx/pals/bubble.pal" INCLUDE "gfx/pals/barrel.pal" ObjectGroup66: - db $00 + db $00 ; GFX bank offset dw PrinceFroggyGfx dw PneumoGfx @@ -1249,7 +1249,7 @@ INCLUDE "gfx/pals/wall_crack.pal" INCLUDE "gfx/pals/barrel.pal" ObjectGroup67: - db $00 + db $00 ; GFX bank offset dw SnakeGfx dw ParaGoomGfx @@ -1268,7 +1268,7 @@ INCLUDE "gfx/pals/fire.pal" INCLUDE "gfx/pals/fire_bot.pal" ObjectGroup68: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -1288,7 +1288,7 @@ INCLUDE "gfx/pals/kobatto.pal" INCLUDE "gfx/pals/nobiiru.pal" ObjectGroup69: - db $00 + db $00 ; GFX bank offset dw SnakeGfx dw ApplebyGfx @@ -1307,7 +1307,7 @@ INCLUDE "gfx/pals/wall_crack.pal" INCLUDE "gfx/pals/barrel.pal" ObjectGroup70: - db $04 + db $04 ; GFX bank offset dw Scowler1Gfx dw Scowler2Gfx @@ -1321,7 +1321,7 @@ ObjectGroup70: INCLUDE "gfx/pals/scowler.pal" ObjectGroup71: - db $00 + db $00 ; GFX bank offset dw WaterSparkGfx dw WebberGfx @@ -1340,7 +1340,7 @@ INCLUDE "gfx/pals/spear_bot.pal" INCLUDE "gfx/pals/fire_bot.pal" ObjectGroup72: - db $00 + db $00 ; GFX bank offset dw HaridamaGfx dw WebberGfx @@ -1359,7 +1359,7 @@ INCLUDE "gfx/pals/bubble.pal" INCLUDE "gfx/pals/octohon.pal" ObjectGroup73: - db $00 + db $00 ; GFX bank offset dw HaridamaGfx dw WebberGfx @@ -1378,7 +1378,7 @@ INCLUDE "gfx/pals/bubble.pal" INCLUDE "gfx/pals/octohon.pal" ObjectGroup74: - db $00 + db $00 ; GFX bank offset dw PrinceFroggyGfx dw WebberGfx @@ -1397,7 +1397,7 @@ INCLUDE "gfx/pals/hand2.pal" INCLUDE "gfx/pals/fire_bot.pal" ObjectGroup75: - db $00 + db $00 ; GFX bank offset dw OwlGfx dw WebberGfx @@ -1417,7 +1417,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/spark.pal" ObjectGroup76: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -1436,7 +1436,7 @@ INCLUDE "gfx/pals/rock.pal" INCLUDE "gfx/pals/brrr_bear.pal" ObjectGroup77: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -1455,7 +1455,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/falling_snow.pal" ObjectGroup78: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw ApplebyGfx @@ -1474,7 +1474,7 @@ INCLUDE "gfx/pals/clear_gate.pal" INCLUDE "gfx/pals/barrel.pal" ObjectGroup79: - db $00 + db $00 ; GFX bank offset dw SilkyGfx dw ApplebyGfx @@ -1493,7 +1493,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/barrel.pal" ObjectGroup80: - db $00 + db $00 ; GFX bank offset dw StoveGfx dw HammerBotGfx @@ -1510,7 +1510,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup81: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw HammerBotGfx @@ -1529,7 +1529,7 @@ INCLUDE "gfx/pals/fire.pal" INCLUDE "gfx/pals/fire_bot.pal" ObjectGroup82: - db $04 + db $04 ; GFX bank offset dw Jamano1Gfx dw Jamano2Gfx @@ -1544,7 +1544,7 @@ ObjectGroup82: INCLUDE "gfx/pals/jamano.pal" ObjectGroup83: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -1563,7 +1563,7 @@ INCLUDE "gfx/pals/omodon.pal" INCLUDE "gfx/pals/omodonmeka.pal" ObjectGroup84: - db $00 + db $00 ; GFX bank offset dw SnakeGfx dw WebberGfx @@ -1582,7 +1582,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/fire_bot.pal" ObjectGroup85: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -1601,7 +1601,7 @@ INCLUDE "gfx/pals/hebarii.pal" INCLUDE "gfx/pals/barrel.pal" ObjectGroup86: - db $04 + db $04 ; GFX bank offset dw Muddee1Gfx dw Muddee2Gfx @@ -1616,7 +1616,7 @@ ObjectGroup86: INCLUDE "gfx/pals/muddee.pal" ObjectGroup87: - db $04 + db $04 ; GFX bank offset dw Wolfenboss1Gfx dw Wolfenboss2Gfx @@ -1630,7 +1630,7 @@ ObjectGroup87: INCLUDE "gfx/pals/wolfenboss.pal" ObjectGroup88: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw CountRichtertoffenGfx @@ -1649,7 +1649,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/barrel.pal" ObjectGroup89: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw ApplebyGfx @@ -1668,7 +1668,7 @@ INCLUDE "gfx/pals/omodon.pal" INCLUDE "gfx/pals/omodonmeka.pal" ObjectGroup90: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw BirdGfx @@ -1688,7 +1688,7 @@ INCLUDE "gfx/pals/hebarii.pal" INCLUDE "gfx/pals/nobiiru.pal" ObjectGroup91: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw BirdGfx @@ -1705,7 +1705,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup92: - db $00 + db $00 ; GFX bank offset dw SilkyGfx dw BirdGfx @@ -1723,7 +1723,7 @@ INCLUDE "gfx/pals/doughnuteer.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup93: - db $00 + db $00 ; GFX bank offset dw SilkyGfx dw WebberGfx @@ -1742,7 +1742,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/brrr_bear.pal" ObjectGroup94: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -1761,7 +1761,7 @@ INCLUDE "gfx/pals/zombie.pal" INCLUDE "gfx/pals/brrr_bear.pal" ObjectGroup95: - db $04 + db $04 ; GFX bank offset dw Shoot1Gfx dw Shoot2Gfx @@ -1778,7 +1778,7 @@ ObjectGroup95: INCLUDE "gfx/pals/shoot.pal" ObjectGroup96: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw ApplebyGfx @@ -1798,7 +1798,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/spark.pal" ObjectGroup97: - db $00 + db $00 ; GFX bank offset dw MadSciensteinGfx dw WebberGfx @@ -1818,7 +1818,7 @@ INCLUDE "gfx/pals/tadpole.pal" INCLUDE "gfx/pals/brrr_bear.pal" ObjectGroup98: - db $00 + db $00 ; GFX bank offset dw SilkyGfx dw WebberGfx @@ -1837,7 +1837,7 @@ INCLUDE "gfx/pals/hebarii.pal" INCLUDE "gfx/pals/fire_bot.pal" ObjectGroup99: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -1854,7 +1854,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup100: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -1873,7 +1873,7 @@ INCLUDE "gfx/pals/clear_gate.pal" INCLUDE "gfx/pals/brrr_bear.pal" ObjectGroup101: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw BirdGfx @@ -1893,7 +1893,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/spark.pal" ObjectGroup102: - db $00 + db $00 ; GFX bank offset dw PrinceFroggyGfx dw BirdGfx @@ -1912,7 +1912,7 @@ INCLUDE "gfx/pals/zombie.pal" INCLUDE "gfx/pals/clear_gate.pal" ObjectGroup103: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -1931,7 +1931,7 @@ INCLUDE "gfx/pals/rock.pal" INCLUDE "gfx/pals/togeba.pal" ObjectGroup104: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw BirdGfx @@ -1950,7 +1950,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/barrel.pal" ObjectGroup105: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -1969,7 +1969,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/beam_bot.pal" ObjectGroup106: - db $00 + db $00 ; GFX bank offset dw Moon1Gfx dw Moon2Gfx @@ -1987,7 +1987,7 @@ INCLUDE "gfx/pals/spear_bot.pal" INCLUDE "gfx/pals/fire_bot.pal" ObjectGroup107: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw ParaGoomGfx @@ -2006,7 +2006,7 @@ INCLUDE "gfx/pals/hebarii.pal" INCLUDE "gfx/pals/brrr_bear.pal" ObjectGroup108: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw ParaGoomGfx @@ -2025,7 +2025,7 @@ INCLUDE "gfx/pals/doughnuteer.pal" INCLUDE "gfx/pals/togeba.pal" ObjectGroup109: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -2044,7 +2044,7 @@ INCLUDE "gfx/pals/spear_bot.pal" INCLUDE "gfx/pals/omodonmeka.pal" ObjectGroup110: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw HammerBotGfx @@ -2063,7 +2063,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/fire_bot.pal" ObjectGroup111: - db $00 + db $00 ; GFX bank offset dw SnakeGfx dw ParaGoomGfx @@ -2082,7 +2082,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/fire_bot.pal" ObjectGroup112: - db $00 + db $00 ; GFX bank offset dw PrinceFroggyGfx dw PneumoGfx @@ -2101,7 +2101,7 @@ INCLUDE "gfx/pals/wall_crack.pal" INCLUDE "gfx/pals/barrel.pal" ObjectGroup113: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -2120,7 +2120,7 @@ INCLUDE "gfx/pals/rock.pal" INCLUDE "gfx/pals/torch.pal" ObjectGroup114: - db $00 + db $00 ; GFX bank offset dw StoveGfx dw WebberGfx @@ -2138,7 +2138,7 @@ INCLUDE "gfx/pals/hebarii.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup115: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -2156,7 +2156,7 @@ INCLUDE "gfx/pals/hebarii.pal" INCLUDE "gfx/pals/dummy.pal" ObjectGroup116: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw WebberGfx @@ -2175,7 +2175,7 @@ INCLUDE "gfx/pals/dummy.pal" INCLUDE "gfx/pals/teruteru.pal" ObjectGroup117: - db $00 + db $00 ; GFX bank offset dw SpearheadGfx dw ParaGoomGfx diff --git a/src/engine/level/block_functions.asm b/src/engine/level/block_functions.asm index 30be304..d310201 100644 --- a/src/engine/level/block_functions.asm +++ b/src/engine/level/block_functions.asm @@ -1,7 +1,7 @@ ; processes the block function of wBlockPtrBank:wBlockPtr ProcessBlock: xor a ; FALSE - ld [wc0dd], a + ld [wIsInWaterOrSand], a ld a, [wBlockPtrBank] sramswitch ld hl, wBlockPtr @@ -239,7 +239,7 @@ LeftSlopeCollision: BlockFunc_Water: ld a, TRUE - ld [wc0dd], a + ld [wIsInWaterOrSand], a ld a, [wBlockFuncWarioFlag] and a jp z, BlockFunc_Free @@ -323,7 +323,7 @@ BlockFunc_WaterSurface: jp BlockFunc_Floor .asm_1825a ld a, TRUE - ld [wc0dd], a + ld [wIsInWaterOrSand], a jp BlockFunc_Solid BlockFunc_18262: @@ -1005,7 +1005,7 @@ BlockFunc_LightSource: BlockFunc_Sand: ld a, TRUE - ld [wc0dd], a + ld [wIsInWaterOrSand], a ld a, [wBlockFuncWarioFlag] and a jp z, BlockFunc_Free @@ -1062,7 +1062,7 @@ BlockFunc_188ba: BlockFunc_NonSubmersibleWater: ld a, TRUE - ld [wc0dd], a + ld [wIsInWaterOrSand], a ld a, [wBlockFuncWarioFlag] and a jp z, BlockFunc_Free @@ -3156,13 +3156,13 @@ YarnBlockCollision: BreakBlock: ; temporarily store hPos ldh a, [hYPosHi] - ldh [hffad], a + ldh [hYPosHiBackup], a ldh a, [hYPosLo] - ldh [hffae], a + ldh [hYPosLoBackup], a ldh a, [hXPosHi] - ldh [hffaf], a + ldh [hXPosHiBackup], a ldh a, [hXPosLo] - ldh [hffb0], a + ldh [hXPosLoBackup], a ld b, PARTICLE_DEBRIS farcall CreateParticleInBlock @@ -3182,7 +3182,7 @@ BreakBlock: ; backup CurObj ld hl, wCurObjUnk01 - ld de, hffa0 + ld de, hCurObjBackup ld b, OBJ_UNK_07 - OBJ_UNK_01 call CopyHLToDE @@ -3202,7 +3202,7 @@ BreakBlock: farcall _CreateObjectFromCurObjPos ; restore CurObj - ld hl, hffa0 + ld hl, hCurObjBackup ld de, wCurObjUnk01 ld b, OBJ_UNK_07 - OBJ_UNK_01 call CopyHLToDE @@ -3211,26 +3211,26 @@ BreakBlock: .done ; restore hPos - ldh a, [hffad] + ldh a, [hYPosHiBackup] ldh [hYPosHi], a - ldh a, [hffae] + ldh a, [hYPosLoBackup] ldh [hYPosLo], a - ldh a, [hffaf] + ldh a, [hXPosHiBackup] ldh [hXPosHi], a - ldh a, [hffb0] + ldh a, [hXPosLoBackup] ldh [hXPosLo], a ret BreakBlockWithColourCoin: ; temporarily store hPos ldh a, [hYPosHi] - ldh [hffad], a + ldh [hYPosHiBackup], a ldh a, [hYPosLo] - ldh [hffae], a + ldh [hYPosLoBackup], a ldh a, [hXPosHi] - ldh [hffaf], a + ldh [hXPosHiBackup], a ldh a, [hXPosLo] - ldh [hffb0], a + ldh [hXPosLoBackup], a ld b, PARTICLE_DEBRIS farcall CreateParticleInBlock @@ -3241,7 +3241,7 @@ BreakBlockWithColourCoin: ; backup CurObj ld hl, wCurObjUnk01 - ld de, hffa0 + ld de, hCurObjBackup ld b, OBJ_UNK_07 - OBJ_UNK_01 call CopyHLToDE @@ -3261,7 +3261,7 @@ BreakBlockWithColourCoin: farcall _CreateObjectFromCurObjPos ; restore CurObj - ld hl, hffa0 + ld hl, hCurObjBackup ld de, wCurObjUnk01 ld b, OBJ_UNK_07 - OBJ_UNK_01 call CopyHLToDE @@ -3269,12 +3269,12 @@ BreakBlockWithColourCoin: ldh [rSVBK], a ; restore hPos - ldh a, [hffad] + ldh a, [hYPosHiBackup] ldh [hYPosHi], a - ldh a, [hffae] + ldh a, [hYPosLoBackup] ldh [hYPosLo], a - ldh a, [hffaf] + ldh a, [hXPosHiBackup] ldh [hXPosHi], a - ldh a, [hffb0] + ldh a, [hXPosLoBackup] ldh [hXPosLo], a ret diff --git a/src/engine/level/object_interactions.asm b/src/engine/level/object_interactions.asm index c469c5a..0b6e80c 100644 --- a/src/engine/level/object_interactions.asm +++ b/src/engine/level/object_interactions.asm @@ -931,13 +931,13 @@ SetState_Stung: ld [wCollisionBoxTop], a ldh a, [hYPosHi] - ldh [hffad], a + ldh [hYPosHiBackup], a ldh a, [hYPosLo] - ldh [hffae], a + ldh [hYPosLoBackup], a ldh a, [hXPosHi] - ldh [hffaf], a + ldh [hXPosHiBackup], a ldh a, [hXPosLo] - ldh [hffb0], a + ldh [hXPosLoBackup], a farcall CheckUpCollision ld a, b @@ -946,13 +946,13 @@ SetState_Stung: xor a ld [wIsCrouching], a - ldh a, [hffad] + ldh a, [hYPosHiBackup] ldh [hYPosHi], a - ldh a, [hffae] + ldh a, [hYPosLoBackup] ldh [hYPosLo], a - ldh a, [hffaf] + ldh a, [hXPosHiBackup] ldh [hXPosHi], a - ldh a, [hffb0] + ldh a, [hXPosLoBackup] ldh [hXPosLo], a .asm_20774 @@ -968,13 +968,13 @@ SetState_Stung: xor a ; JUMP_VEL_NONE ld [wJumpVelTable], a - ldh a, [hffad] + ldh a, [hYPosHiBackup] ldh [hYPosHi], a - ldh a, [hffae] + ldh a, [hYPosLoBackup] ldh [hYPosLo], a - ldh a, [hffaf] + ldh a, [hXPosHiBackup] ldh [hXPosHi], a - ldh a, [hffb0] + ldh a, [hXPosLoBackup] ldh [hXPosLo], a .asm_20799 diff --git a/src/engine/level/objects/big_leaf.asm b/src/engine/level/objects/big_leaf.asm index 10418c3..fa8bb28 100644 --- a/src/engine/level/objects/big_leaf.asm +++ b/src/engine/level/objects/big_leaf.asm @@ -184,7 +184,7 @@ BigLeaf2Func: ld a, [hl] ldh [hXPosHi], a call Func_352b - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a ret z ld a, NO_ACTIONS_FOR 1 diff --git a/src/engine/level/objects/bubble.asm b/src/engine/level/objects/bubble.asm index ad5f37e..5e3fe45 100644 --- a/src/engine/level/objects/bubble.asm +++ b/src/engine/level/objects/bubble.asm @@ -119,8 +119,8 @@ BubbleFunc: call Func_358b and a jp nz, .set_burst - ld a, [wc0dd] - ldh [hffa0], a + ld a, [wIsInWaterOrSand] + ldh [hIsInWaterOrSandBackup], a ld hl, wCurObjYPos ld a, [hli] @@ -134,12 +134,12 @@ BubbleFunc: ld a, [hli] ldh [hXPosHi], a call Func_358b - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a - ret nz - ldh a, [hffa0] + ret nz ; still underwater + ldh a, [hIsInWaterOrSandBackup] and a - ret nz + ret nz ; still underwater jp .set_burst .asm_47ce0 diff --git a/src/engine/level/objects/coin.asm b/src/engine/level/objects/coin.asm index 5f033d9..6f90644 100644 --- a/src/engine/level/objects/coin.asm +++ b/src/engine/level/objects/coin.asm @@ -310,7 +310,7 @@ CoinFunc: call Func_352b and a jr nz, .asm_63680 - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr z, .asm_6365d ld [wCurObjFramesetOffset], a @@ -420,7 +420,7 @@ CoinFunc: call Func_352b and a jr nz, .asm_63729 - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr z, .asm_63706 ld [wCurObjFramesetOffset], a @@ -765,7 +765,7 @@ CoinFunc: ld a, $12 ld [wCurObjState], a .asm_6392d - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a ret z ld [wCurObjFramesetOffset], a diff --git a/src/engine/level/objects/count_richtertoffen.asm b/src/engine/level/objects/count_richtertoffen.asm index a4ef1a8..d934f93 100644 --- a/src/engine/level/objects/count_richtertoffen.asm +++ b/src/engine/level/objects/count_richtertoffen.asm @@ -427,7 +427,7 @@ CountRichtertoffenFunc: jp DoGroundShake .continue_fall - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jp nz, VanishObject2 ld bc, Data_603e0 diff --git a/src/engine/level/objects/haridama.asm b/src/engine/level/objects/haridama.asm index 7b12364..1c0be00 100644 --- a/src/engine/level/objects/haridama.asm +++ b/src/engine/level/objects/haridama.asm @@ -277,7 +277,7 @@ HaridamaFunc: call Func_358b and a jr nz, .asm_490d5 - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr z, .asm_490d5 ld hl, wCurObjYPos diff --git a/src/engine/level/objects/hebarii.asm b/src/engine/level/objects/hebarii.asm index aa837b9..c6f4419 100644 --- a/src/engine/level/objects/hebarii.asm +++ b/src/engine/level/objects/hebarii.asm @@ -338,7 +338,7 @@ HebariiFunc: call Func_352b and a jr nz, .asm_4a204 - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jp nz, VanishObject2 ld bc, FallingYVel_Light diff --git a/src/engine/level/objects/mizuuo.asm b/src/engine/level/objects/mizuuo.asm index 09bcf1a..5e2757c 100644 --- a/src/engine/level/objects/mizuuo.asm +++ b/src/engine/level/objects/mizuuo.asm @@ -180,7 +180,7 @@ MizzouProjectileFunc: call Func_3543 and a jr nz, .asm_488b5 - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr nz, .asm_488c8 ld bc, Data_60740 diff --git a/src/engine/level/objects/muddee.asm b/src/engine/level/objects/muddee.asm index 5e9cac6..00471bb 100644 --- a/src/engine/level/objects/muddee.asm +++ b/src/engine/level/objects/muddee.asm @@ -243,7 +243,7 @@ MuddeeFunc: ld a, [hl] ldh [hXPosHi], a call Func_352b - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr nz, .asm_557ed ld bc, Data_60d40 @@ -381,7 +381,7 @@ MuddeeFunc: ld a, [hli] ldh [hXPosHi], a call Func_352b - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr nz, .asm_55910 call .Func_55c2b @@ -761,7 +761,7 @@ MuddeeFunc: ld a, [hli] ldh [hXPosHi], a call Func_352b - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr nz, .asm_55b9a jp MoveObjectDown_Slow diff --git a/src/engine/level/objects/para_goom.asm b/src/engine/level/objects/para_goom.asm index 425f2ac..636515c 100644 --- a/src/engine/level/objects/para_goom.asm +++ b/src/engine/level/objects/para_goom.asm @@ -761,7 +761,7 @@ ParaGoomFunc: call Func_352b and a jr nz, .asm_41857 - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a ret z ld a, $0a diff --git a/src/engine/level/objects/pesce.asm b/src/engine/level/objects/pesce.asm index ba90fea..f73eb13 100644 --- a/src/engine/level/objects/pesce.asm +++ b/src/engine/level/objects/pesce.asm @@ -285,7 +285,7 @@ PesceFunc: ld a, [hli] ldh [hXPosHi], a call Func_358b - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr z, .asm_51f46 ld a, [wWarioScreenYPos] @@ -1311,7 +1311,7 @@ CheeseFunc: ld a, [hl] ldh [hXPosHi], a call Func_352b - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr nz, .asm_5263d ld hl, wCurObjFlags diff --git a/src/engine/level/objects/pneumo.asm b/src/engine/level/objects/pneumo.asm index 5835a92..8819ba8 100644 --- a/src/engine/level/objects/pneumo.asm +++ b/src/engine/level/objects/pneumo.asm @@ -267,7 +267,7 @@ PneumoFunc: jr z, .asm_45801 jr .asm_457ed .asm_457e7 - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr nz, .asm_45801 .asm_457ed @@ -478,7 +478,7 @@ PneumoFunc: ld a, [wWarioYPos + 1] and $fc ld l, a - ld de, hffb0 + ld de, hXPosLoBackup add hl, de ld d, h ld e, l @@ -528,7 +528,7 @@ PneumoFunc: jp nz, MoveObjectDown_Slow jp .Func_456fe .asm_4599f - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jp z, MoveObjectDown jp .Func_456fe diff --git a/src/engine/level/objects/scowler.asm b/src/engine/level/objects/scowler.asm index 7175812..236ebad 100644 --- a/src/engine/level/objects/scowler.asm +++ b/src/engine/level/objects/scowler.asm @@ -272,7 +272,7 @@ ScowlerFunc: ld a, [hli] ldh [hXPosHi], a call Func_358b - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jp nz, MoveObjectUp ld hl, wCurObjSubState @@ -504,7 +504,7 @@ ScowlerFunc: ld a, [hli] ldh [hXPosHi], a call Func_358b - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a ret z ld bc, Data_60a70 @@ -569,7 +569,7 @@ ScowlerFunc: ld a, [hli] ldh [hXPosHi], a call Func_358b - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a ld bc, Data_60a70 jp nz, ApplyObjYMovement @@ -1012,7 +1012,7 @@ InkFunc: ld a, [hli] ldh [hXPosHi], a call Func_358b - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr z, .asm_54be6 ld a, [wGlobalCounter] diff --git a/src/engine/level/objects/tadpole.asm b/src/engine/level/objects/tadpole.asm index b19e9fd..2aa6c62 100644 --- a/src/engine/level/objects/tadpole.asm +++ b/src/engine/level/objects/tadpole.asm @@ -180,7 +180,7 @@ TadpoleFunc: ld a, [hl] ldh [hXPosHi], a call Func_352b - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr nz, .asm_49f85 ld bc, Data_60a40 diff --git a/src/engine/level/objects/water_drop.asm b/src/engine/level/objects/water_drop.asm index a84ca4f..7e8d320 100644 --- a/src/engine/level/objects/water_drop.asm +++ b/src/engine/level/objects/water_drop.asm @@ -110,7 +110,7 @@ WaterDropFunc: call Func_352b and a jr nz, .asm_49e26 - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr nz, .asm_49e26 ld bc, FallingYVel_Light diff --git a/src/engine/level/update_objects.asm b/src/engine/level/update_objects.asm index f5ab478..cc6db80 100644 --- a/src/engine/level/update_objects.asm +++ b/src/engine/level/update_objects.asm @@ -731,7 +731,7 @@ ENDR add OBJ_INTERACTION_TYPE - OBJ_FLAGS ld l, a ld a, [hli] ; OBJ_INTERACTION_TYPE - ldh [hffa0], a + ldh [hThrownObjInteractionType], a ld a, [hli] ; OBJ_COLLBOX_TOP ld b, a ld a, [hli] ; OBJ_COLLBOX_BOTTOM @@ -774,7 +774,7 @@ ENDR .full_throw ; >= OBJSTATE_FULL_THROW_LEFT_START rra - ld hl, hffa0 + ld hl, hThrownObjInteractionType ld a, [hli] jr c, .thrown_right @@ -782,66 +782,66 @@ ENDR rla jr c, .is_heavy1 ld a, OBJSTATE_28 - ld [hli], a ; hffa1 + ld [hli], a ; hCollidedObjState_Light ld a, OBJSTATE_29 - ld [hli], a ; hffa2 + ld [hli], a ; hThrownObjState_Light ld a, OBJSTATE_WOBBLE_RIGHT_START - ld [hli], a ; hffa3 + ld [hli], a ; hCollidedObjState_Heavy ld a, OBJSTATE_29 - ld [hli], a ; hffa4 + ld [hli], a ; hThrownObjState_Heavy jr .check_objs .is_heavy1 ld a, OBJSTATE_28 - ld [hli], a ; hffa1 + ld [hli], a ; hCollidedObjState_Light ld a, OBJSTATE_WOBBLE_LEFT_START - ld [hli], a ; hffa2 + ld [hli], a ; hThrownObjState_Light ld a, OBJSTATE_28 - ld [hli], a ; hffa3 + ld [hli], a ; hCollidedObjState_Heavy ld a, OBJSTATE_29 - ld [hli], a ; hffa4 + ld [hli], a ; hThrownObjState_Heavy jr .check_objs .thrown_right rla jr c, .is_heavy2 ld a, OBJSTATE_29 - ld [hli], a ; ; hffa1 + ld [hli], a ; ; hCollidedObjState_Light ld a, OBJSTATE_28 - ld [hli], a ; ; hffa2 + ld [hli], a ; ; hThrownObjState_Light ld a, OBJSTATE_WOBBLE_LEFT_START - ld [hli], a ; ; hffa3 + ld [hli], a ; ; hCollidedObjState_Heavy ld a, OBJSTATE_28 - ld [hli], a ; ; hffa4 + ld [hli], a ; ; hThrownObjState_Heavy jr .check_objs .is_heavy2 ld a, OBJSTATE_29 - ld [hli], a ; hffa1 + ld [hli], a ; hCollidedObjState_Light ld a, OBJSTATE_WOBBLE_RIGHT_START - ld [hli], a ; hffa2 + ld [hli], a ; hThrownObjState_Light ld a, OBJSTATE_29 - ld [hli], a ; hffa3 + ld [hli], a ; hCollidedObjState_Heavy ld a, OBJSTATE_28 - ld [hli], a ; hffa4 + ld [hli], a ; hThrownObjState_Heavy jr .check_objs .asm_61992 ; OBJSTATE_48 <= action <= OBJSTATE_4B rra - ld hl, hffa1 + ld hl, hCollidedObjState_Light jr c, .asm_619a0 ld a, OBJSTATE_WOBBLE_RIGHT_START - ld [hli], a ; hffa1 + ld [hli], a ; hCollidedObjState_Light ld a, OBJSTATE_WOBBLE_LEFT_START - ld [hli], a ; hffa2 + ld [hli], a ; hThrownObjState_Light jr .check_objs .asm_619a0 ld a, OBJSTATE_WOBBLE_LEFT_START - ld [hli], a ; hffa1 + ld [hli], a ; hCollidedObjState_Light ld a, OBJSTATE_WOBBLE_RIGHT_START - ld [hli], a ; hffa2 + ld [hli], a ; hThrownObjState_Light .check_objs @@ -889,7 +889,7 @@ FOR n, 1, NUM_OBJECTS + 1 rla jp c, .CollideWithHeavyObject{u:n} ; heavy - ldh a, [hffa2] + ldh a, [hThrownObjState_Light] ld [hl], a ; OBJ_STATE ld l, LOW(wObj{u:n}State) ld a, [hl] @@ -902,7 +902,7 @@ FOR n, 1, NUM_OBJECTS + 1 xor a ld [wGrabState], a .skip_reset_grab_{u:n}_1 - ldh a, [hffa1] + ldh a, [hCollidedObjState_Light] ld [hl], a ; OBJ_STATE ld l, LOW(wObj{u:n}Flags) set OBJFLAG_NO_COLLISION_F, [hl] @@ -915,16 +915,16 @@ ENDR FOR n, 1, NUM_OBJECTS + 1 ; hl = state of thrown object -; hffa2 = new state for thrown object +; hThrownObjState_Light = new state for thrown object ; n = index of collided object -; hffa1 = new state for collided object +; hCollidedObjState_Light = new state for collided object .CollideWithObject{u:n} xor a ld [wGrabState], a - ldh a, [hffa2] + ldh a, [hThrownObjState_Light] ld [hl], a ; OBJ_STATE ld l, LOW(wObj{u:n}State) - ldh a, [hffa1] + ldh a, [hCollidedObjState_Light] ld [hl], a ld l, LOW(wObj{u:n}Flags) set OBJFLAG_NO_COLLISION_F, [hl] @@ -934,11 +934,11 @@ ENDR FOR n, 1, NUM_OBJECTS + 1 ; hl = state of thrown object -; hffa4 = new state for thrown object +; hThrownObjState_Heavy = new state for thrown object ; n = index of collided object -; hffa3 = new state for collided object +; hCollidedObjState_Heavy = new state for collided object .CollideWithHeavyObject{u:n} - ldh a, [hffa4] + ldh a, [hThrownObjState_Heavy] ld [hl], a ld l, LOW(wObj{u:n}State) ld a, [hl] @@ -951,7 +951,7 @@ FOR n, 1, NUM_OBJECTS + 1 xor a ld [wGrabState], a .skip_reset_grab_{u:n}_2 - ldh a, [hffa3] + ldh a, [hCollidedObjState_Heavy] ld [hl], a ld l, LOW(wObj{u:n}Flags) set OBJFLAG_NO_COLLISION_F, [hl] @@ -1110,7 +1110,7 @@ Func_61f54:: ld a, h ld [wCurObjVar3], a - ld hl, hffa0 + ld hl, hPickedUpObjPos ld a, c cp $80 ld a, [wWarioYPos + 1] @@ -1150,7 +1150,7 @@ Func_61f54:: .got_hi_x ld [hl], a - ld hl, hffa0 + ld hl, hPickedUpObjPos ld a, [hli] sub 4 ldh [hYPosLo], a @@ -1172,7 +1172,7 @@ Func_61f54:: cpl inc a ld b, a - ld hl, hffa0 + ld hl, hPickedUpObjPos ld a, [hli] sub b ldh [hYPosLo], a @@ -1187,7 +1187,7 @@ Func_61f54:: call Func_358b and $0f jr nz, .asm_62091 - ld hl, hffa0 + ld hl, hPickedUpObjPos ld de, wCurObjYPos ld a, [hli] ld [de], a @@ -1317,7 +1317,7 @@ Func_620a6:: ld a, h ld [wCurObjVar3], a - ld hl, hffa0 + ld hl, hPickedUpObjPos ld a, c cp $80 ld a, [wWarioYPos + 1] @@ -1357,7 +1357,7 @@ Func_620a6:: .got_hi_x ld [hl], a - ld hl, hffa0 + ld hl, hPickedUpObjPos ld a, [hli] sub 4 ldh [hYPosLo], a @@ -1382,7 +1382,7 @@ Func_620a6:: cpl inc a ld b, a - ld hl, hffa0 + ld hl, hPickedUpObjPos ld a, [hli] sub b ldh [hYPosLo], a @@ -1397,7 +1397,7 @@ Func_620a6:: call Func_358b and $0f jr nz, .asm_621e6 - ld hl, hffa0 + ld hl, hPickedUpObjPos ld de, wCurObjYPos ld a, [hli] ld [de], a @@ -1688,7 +1688,7 @@ Func_62382:: jp HomeJumpRet .HoldFullCharge - ld hl, hffa0 + ld hl, hPickedUpObjPos ld a, [wWarioYPos + 1] sub 30 ld [hli], a @@ -1701,7 +1701,7 @@ Func_62382:: ld a, [wWarioXPos + 0] adc 0 ld [hli], a - ld hl, hffa0 + ld hl, hPickedUpObjPos ld a, [hli] sub 4 ldh [hYPosLo], a @@ -1721,7 +1721,7 @@ Func_62382:: jr .asm_6239e .asm_62415 - ld hl, hffa0 + ld hl, hPickedUpObjPos ld de, wCurObjYPos ld a, [hli] ld [de], a @@ -1834,7 +1834,7 @@ Func_6247b:: jp HomeJumpRet .HoldFullCharge - ld hl, hffa0 + ld hl, hPickedUpObjPos ld a, [wWarioYPos + 1] sub 30 ld [hli], a @@ -1847,7 +1847,7 @@ Func_6247b:: ld a, [wWarioXPos + 0] sbc 0 ld [hli], a - ld hl, hffa0 + ld hl, hPickedUpObjPos ld a, [hli] sub 4 ldh [hYPosLo], a @@ -1867,7 +1867,7 @@ Func_6247b:: jr .asm_62497 .asm_6250e - ld hl, hffa0 + ld hl, hPickedUpObjPos ld de, wCurObjYPos ld a, [hli] ld [de], a @@ -1956,7 +1956,7 @@ Func_62574:: ld a, $03 ldh [hffa0], a jp nz, Func_62d34 - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr z, .asm_625aa ld a, OBJSTATE_VANISH_TOUCH @@ -2037,7 +2037,7 @@ Func_62605:: ld a, $03 ldh [hffa0], a jp nz, Func_62e0f - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr z, .asm_6263b ld a, OBJSTATE_VANISH_TOUCH @@ -2170,7 +2170,7 @@ Func_626da:: ld a, $03 ldh [hffa0], a jp nz, Func_62d34 - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr z, .asm_62710 .vanish @@ -2249,7 +2249,7 @@ Func_62768:: ld a, $03 ldh [hffa0], a jp nz, Func_62e0f - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr z, .asm_6279e .vanish @@ -2570,7 +2570,7 @@ Func_62926:: call Func_352b and a jr nz, .asm_62980 - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jp z, HomeJumpRet ld a, OBJSTATE_VANISH_TOUCH @@ -2694,7 +2694,7 @@ _ObjState_StandingFall:: call Func_352b and a jr nz, .asm_62a35 - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jp z, HomeJumpRet ld a, OBJSTATE_VANISH_TOUCH @@ -2769,7 +2769,7 @@ _ObjState_Fall:: call Func_352b and a jr nz, .land - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jp z, HomeJumpRet ld a, OBJSTATE_VANISH_TOUCH @@ -3119,7 +3119,7 @@ Func_62ca8:: call Func_352b and a jr nz, Func_62d34 - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr nz, .vanish @@ -3264,7 +3264,7 @@ Func_62d86:: call Func_352b and a jr nz, Func_62e0f - ld a, [wc0dd] + ld a, [wIsInWaterOrSand] and a jr nz, .vanish diff --git a/src/engine/level/wario_states_3.asm b/src/engine/level/wario_states_3.asm index def1790..b12be65 100644 --- a/src/engine/level/wario_states_3.asm +++ b/src/engine/level/wario_states_3.asm @@ -2120,13 +2120,13 @@ UpdateState_ElectricStart: ld a, -27 ld [wCollisionBoxTop], a ldh a, [hYPosHi] - ldh [hffad], a + ldh [hYPosHiBackup], a ldh a, [hYPosLo] - ldh [hffae], a + ldh [hYPosLoBackup], a ldh a, [hXPosHi] - ldh [hffaf], a + ldh [hXPosHiBackup], a ldh a, [hXPosLo] - ldh [hffb0], a + ldh [hXPosLoBackup], a farcall CheckUpCollision ld a, [wWarioState] cp WST_ELECTRIC @@ -2138,13 +2138,13 @@ UpdateState_ElectricStart: xor a ld [wIsCrouching], a - ldh a, [hffad] + ldh a, [hYPosHiBackup] ldh [hYPosHi], a - ldh a, [hffae] + ldh a, [hYPosLoBackup] ldh [hYPosLo], a - ldh a, [hffaf] + ldh a, [hXPosHiBackup] ldh [hXPosHi], a - ldh a, [hffb0] + ldh a, [hXPosLoBackup] ldh [hXPosLo], a .asm_2946e ld a, -27 @@ -2157,13 +2157,13 @@ UpdateState_ElectricStart: ld [wCollisionBoxTop], a xor a ld [wJumpVelTable], a - ldh a, [hffad] + ldh a, [hYPosHiBackup] ldh [hYPosHi], a - ldh a, [hffae] + ldh a, [hYPosLoBackup] ldh [hYPosLo], a - ldh a, [hffaf] + ldh a, [hXPosHiBackup] ldh [hXPosHi], a - ldh a, [hffb0] + ldh a, [hXPosLoBackup] ldh [hXPosLo], a .asm_29493 diff --git a/src/home/home1.asm b/src/home/home1.asm index 7983a7e..8d63849 100644 --- a/src/home/home1.asm +++ b/src/home/home1.asm @@ -1725,7 +1725,7 @@ ClearSaveData:: call WriteAToHL_BTimes ld a, $00 - ldh [hfffd], a + ldh [hUnused_fffd], a jp Init OpenActionHelp:: diff --git a/src/home/start.asm b/src/home/start.asm index 124dada..d8a3aae 100644 --- a/src/home/start.asm +++ b/src/home/start.asm @@ -8,7 +8,7 @@ Start:: .not_cgb ldh [hCGB], a ld a, $00 - ldh [hfffd], a + ldh [hUnused_fffd], a ; fallthrough Init:: @@ -258,9 +258,9 @@ UnreferencedUnmuteSound: ld [wSoundMuted], a ldh [hSFXID + 0], a ldh [hSFXID + 1], a - ldh a, [hffb3] + ldh a, [hMusicIDBackup + 0] ld b, a - ldh a, [hffb4] + ldh a, [hMusicIDBackup + 1] ld c, a call PlayNewMusic_SetNoise ret diff --git a/src/hram.asm b/src/hram.asm index 3765cb6..607233f 100644 --- a/src/hram.asm +++ b/src/hram.asm @@ -1,83 +1,71 @@ SECTION "HRAM", HRAM -hCallFunc:: ; ff80 - ds $5 - -hCallFuncBank:: ; ff85 - ds $1 - +hCallFunc:: ds $5 +hCallFuncBank:: db ds $7 - -hCallFuncPointer:: ; ff8d - ds $2 +hCallFuncPointer:: dw ds $11 -hffa0:: ; ffa0 - ds $1 +UNION -hffa1:: ; ffa1 - ds $1 +hThrownObjInteractionType:: +hIsInWaterOrSandBackup:: +hffa0:: + db -hffa2:: ; ffa2 - ds $1 +hCollidedObjState_Light:: db +hThrownObjState_Light:: db +hCollidedObjState_Heavy:: db +hThrownObjState_Heavy:: db -hffa3:: ; ffa3 - ds $1 +NEXTU -hffa4:: ; ffa4 - ds $1 - - ds $3 - -hPos:: -hYPosHi:: ds $1 ; ffa8 -hYPosLo:: ds $1 ; ffa9 -hXPosHi:: ds $1 ; ffaa -hXPosLo:: ds $1 ; ffab - -hffac:: ; ffac - ds $1 - -hffad:: ; ffad - ds $1 +hCurObjBackup:: + ds $6 -hffae:: ; ffae - ds $1 +NEXTU -hffaf:: ; ffaf - ds $1 +hPickedUpObjPos:: + ds $4 -hffb0:: ; ffb0 - ds $1 +ENDU -hMusicID:: ; ffb1 ds $2 -hffb3:: ; ffb3 - ds $1 +hPos:: +hYPosHi:: db +hYPosLo:: db +hXPosHi:: db +hXPosLo:: db -hffb4:: ; ffb4 - ds $1 +hffac:: + db -hSFXID:: ; ffb5 - ds $2 +hYPosHiBackup:: db +hYPosLoBackup:: db +hXPosHiBackup:: db +hXPosLoBackup:: db + +hMusicID:: dw +hMusicIDBackup:: dw +hSFXID:: dw ds $31 -hTransferVirtualOAM:: ; ffe8 +hTransferVirtualOAM:: ds $e ds $6 ; which Power Up to show in the next ; Action Help demo in the Title Screen -hDemoPowerUp:: ; fffc - ds $1 +hDemoPowerUp:: + db -hfffd:: ; fffd - ds $1 +hUnused_fffd:: + db ; whether system is CGB or not -hCGB:: ; fffe - ds $1 +hCGB:: + db diff --git a/src/macros/audio.asm b/src/macros/audio.asm index be3cf45..bbe9cc2 100644 --- a/src/macros/audio.asm +++ b/src/macros/audio.asm @@ -7,10 +7,10 @@ ENDM MACRO play_music2 ld a, HIGH(\1) - ldh [hffb3], a + ldh [hMusicIDBackup + 0], a ldh [hMusicID + 0], a ld a, LOW(\1) - ldh [hffb4], a + ldh [hMusicIDBackup + 1], a ldh [hMusicID + 1], a ENDM @@ -23,10 +23,10 @@ ENDM MACRO stop_music2 ld a, $ff - ldh [hffb3], a + ldh [hMusicIDBackup + 0], a ldh [hMusicID + 0], a ld a, $00 - ldh [hffb4], a + ldh [hMusicIDBackup + 1], a ldh [hMusicID + 1], a ENDM diff --git a/src/wram.asm b/src/wram.asm index 370696b..27c73a6 100644 --- a/src/wram.asm +++ b/src/wram.asm @@ -208,7 +208,7 @@ wWaterInteraction:: wc0dc:: db -wc0dd:: +wIsInWaterOrSand:: db wIsOnSlipperyGround::