diff --git a/CHANGELOG.md b/CHANGELOG.md index 4504ddc..35d30d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## Unreleased - 2026-03-?? +- Fixed: Low-Health alarm now plays correctly when using the alternative Health Display. ## 0.12.0 - 2026-02-20 - Changed: The hatch graphics have been changed to be more accessible to color blind people. diff --git a/Makefile b/Makefile index 736a511..d28f6ac 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ ifeq ($(BUILD_TYPE), debug) SYMBOL_DATA_ARMIPS_OPTION := -sym $(BIN_DIR)/$(OUT)-symbols.sym else BUILD_SYMBOL = -definelabel DEBUG 0 - SYMBOL_DATA_ARMIPS_OPTION := + SYMBOL_DATA_ARMIPS_OPTION := -sym $(BIN_DIR)/$(OUT)-base-symbols.sym endif QOL := true @@ -59,7 +59,7 @@ $(OBJ_DIR)/base.gba: $(BIN_DIR)/$(OUT).gba | $(OBJ_DIR) cp $< $@ $(OBJ_DIR)/%.gba: check | $(OBJ_DIR) - $(AS) $(SYMBOL_DATA_ARMIPS_OPTION) $(ALL_SYMBOLS) -definelabel $* 1 src/main.s + $(AS) -sym $(BIN_DIR)/$(OUT)-$*-symbols.sym $(ALL_SYMBOLS) -definelabel $* 1 src/main.s mv $(OBJ_DIR)/$(OUT).gba $@ $(BIN_DIR)/%.ips: $(OBJ_DIR)/%.gba $(OBJ_DIR)/base.gba diff --git a/src/nonlinear/hud-edits.s b/src/nonlinear/hud-edits.s index 9361536..ec9980c 100644 --- a/src/nonlinear/hud-edits.s +++ b/src/nonlinear/hud-edits.s @@ -302,8 +302,7 @@ ForceExcessHealthDisplay: @@start_draw_max_digits: ; Check if we need to reload max digits graphics ldr r0, [sp] - mov r1, #1111b - bic r1, r0 + cmp r0, #00h beq @@skip_drawing_max_digits ; Load "Max" graphics pointers @@ -468,6 +467,7 @@ ForceExcessHealthDisplay: .pool @@curr_energy: + mov r4, #00h ; Store Bitflag for if current energy changes ldr r5, =EnergyDigits ldr r6, =DMA3 ldr r7, =EnergyDigitsGfx @@ -492,6 +492,8 @@ ForceExcessHealthDisplay: ldrb r1, [r5, EnergyDigits_Thousands] cmp r0, r1 beq @@curr_hundreds ; if thousands digit doesn't change, skip DMA + mov r3, #1 << EnergyDigits_Thousands + orr r4, r3 ; Store flag if digit changes strb r0, [r5, EnergyDigits_Thousands] @@load_curr_thousands_gfx: lsl r0, #05h ; r0 * 20h (length of 8x8 tile) @@ -523,6 +525,8 @@ ForceExcessHealthDisplay: ldrb r1, [r5, EnergyDigits_Hundreds] cmp r0, r1 beq @@curr_tens ; if hundreds digit doesn't change, skip DMA + mov r3, #1 << EnergyDigits_Hundreds + orr r4, r3 ; Store flag if digit changes strb r0, [r5, EnergyDigits_Hundreds] @@load_curr_hundreds_gfx: lsl r0, #05h ; r0 * 20h (length of 8x8 tile) @@ -554,6 +558,8 @@ ForceExcessHealthDisplay: ldrb r1, [r5, EnergyDigits_Tens] cmp r0, r1 beq @@curr_ones ; if tens digit doesn't change, skip DMA + mov r3, #1 << EnergyDigits_Tens + orr r4, r3 ; Store flag if digit changes strb r0, [r5, EnergyDigits_Tens] @@load_curr_tens_gfx: lsl r0, #05h ; r0 * 20h (length of 8x8 tile) @@ -580,7 +586,9 @@ ForceExcessHealthDisplay: @@check_curr_ones_digit_is_same: ldrb r1, [r5, EnergyDigits_Ones] cmp r0, r1 - beq @@return ; if ones digit doesn't change, skip DMA + beq @@update_lowhealth_flag ; if ones digit doesn't change, skip DMA + mov r3, #1 << EnergyDigits_Ones + orr r4, r3 ; Store flag if digit changes strb r0, [r5, EnergyDigits_Ones] @@load_curr_ones_gfx: lsl r0, #05h ; r0 * 20h (length of 8x8 tile) @@ -592,6 +600,25 @@ ForceExcessHealthDisplay: str r2, [r6, DMA_CNT] ldr r0, [r6, DMA_CNT] + ; Check if we had to update graphics +@@update_lowhealth_flag: + cmp r4, #00h + beq @@return + + ; If graphics updated, set low-health flag + ldr r4, =SamusUpgrades + mov r1, r8 + cmp r1, #1Dh + bhi @@clear_lowhealth_flag + +@@set_lowhealth_flag: + mov r1, #01h + strb r1, [r4, SamusUpgrades_LowHealthFlag] + b @@return + +@@clear_lowhealth_flag: + mov r1, #00h + strb r1, [r4, SamusUpgrades_LowHealthFlag] @@return: ldr r0, =ExcessEnergyFlag diff --git a/src/nonlinear/nerf-geron-weakness.s b/src/nonlinear/nerf-geron-weakness.s index f4a7824..f52606a 100644 --- a/src/nonlinear/nerf-geron-weakness.s +++ b/src/nonlinear/nerf-geron-weakness.s @@ -81,7 +81,7 @@ mov r0, ClipdataAction_MakeSolid -; Increases the sideways hitbox of each Geron, so that +; Increases the sideways hitbox of each Geron, so that ; you can shinespark/speedboost through them without bonking against the solid collision ; These are all modified in their respective Init functions. ; FIXME: Instead of increasing hitboxes, create a new speedboostable clipdata type @@ -124,12 +124,16 @@ .endarea -; Make Super Missile Geron passable if it hasn't formed yet, but impassable once it has formed. +.org 08041FA0h ; in SuperMissileGeronInit +.area 6, 0 + bl @SuperGeronInitHijack +.endarea -; Changes the function in SuperMissileGeronInit, to only set collision if pose is not Spawning_From_X .autoregion .align 2 .func @SuperGeronInitHijack +; Make Super Missile Geron passable if it hasn't formed yet, but impassable once it has formed. +; Changes the function in SuperMissileGeronInit, to only set collision if pose is not Spawning_From_X push { lr } ldr r1, =CurrentSprite add r1, Sprite_Pose @@ -142,17 +146,9 @@ pop { pc } .endfunc .pool -.endautoregion -.org 08041FA0h ; in SuperMissileGeronInit -.area 6, 0 - bl @SuperGeronInitHijack -.endarea - -; Call GeronSetCollision at the end of SuperMissileGeronIdleInit -.autoregion -.align 2 .func @SuperGeronIdleInitHijack +; Call GeronSetCollision at the end of SuperMissileGeronIdleInit push { lr } mov r0, ClipdataAction_MakeSolid bl GeronSetCollision