diff --git a/patches/ips/vanilla_bugfixes.ips b/patches/ips/vanilla_bugfixes.ips index 1ca83b2e7..3a5f27689 100644 Binary files a/patches/ips/vanilla_bugfixes.ips and b/patches/ips/vanilla_bugfixes.ips differ diff --git a/patches/rom_map/Bank 82.txt b/patches/rom_map/Bank 82.txt index 7bc8a5696..08390977d 100644 --- a/patches/rom_map/Bank 82.txt +++ b/patches/rom_map/Bank 82.txt @@ -1,3 +1,4 @@ +B5E8 - B62B: ; vanilla_bugfixes.asm [boots ui fix, overwrites unused vanilla instruction.] F70F - F808: ; map_area.asm F810 - F827: ; crash_handle_springball.asm F830 - F9DE: ; disableable_etanks.asm diff --git a/patches/rom_map/vanilla_hooks.txt b/patches/rom_map/vanilla_hooks.txt index 9ebda04c6..49932a090 100644 --- a/patches/rom_map/vanilla_hooks.txt +++ b/patches/rom_map/vanilla_hooks.txt @@ -206,7 +206,7 @@ A7E4 - A7E6: ; map_area.asm A802 - A804: ; map_area.asm A820 - A822: ; pause_menu_objectives.asm A83E - A840: ; pause_menu_objectives.asm -AC03 - AC07: ; vanilla_bugfixes.asm +AC00 - AC15: ; vanilla_bugfixes.asm AC5A - AC5C: ; disableable_etanks.asm AC7C - AC7E: ; reserve_backward_fill.asm AC87 - AC8A: ; reserve_backward_fill.asm @@ -238,6 +238,7 @@ B51E - B520: ; split_speed.asm B545 - B547: ; split_speed.asm B56B - B56F: ; disableable_etanks.asm B585 - B587: ; disable_major_glitches.asm +B5E8 - B62B: ; vanilla_bugfixes.asm B672 - B676: ; map_area.asm B924 - B92F: ; fast_pause_menu.asm B9A0 - B9C7: ; fast_pause_menu.asm diff --git a/patches/src/vanilla_bugfixes.asm b/patches/src/vanilla_bugfixes.asm index 06190906f..750034770 100644 --- a/patches/src/vanilla_bugfixes.asm +++ b/patches/src/vanilla_bugfixes.asm @@ -10,8 +10,8 @@ lorom incsrc "constants.asm" -!bank_82_free_space_start = $82C27D ; reserve icon ui fix. -!bank_82_free_space_end = $82C298 +!bank_82_free_space_start = $82B5E8 ; reserve icon ui fix. [;;; $B5E8: Unused. Convert [A] to three decimal digits ;;;] +!bank_82_free_space_end = $82B62B !bank_86_free_space_start = $86F4B0 ; powamp projectile fix !bank_86_free_space_end = $86F4D0 @@ -221,20 +221,55 @@ org $829f90 org $84B7EF ; PLM $B8AC (speed booster escape) LDA $09A4 [$7E:09A4] lda $09A2 -; vanilla bugfix, ui shows reserve icon when only boots item is equipped. -; this is due to a missing conditional branch instruction. +; vanilla bugfix, ui shows the reserve tank select icon when only a boots item is available. +; this is due to a missing conditional branch instruction in the vanilla code. +; updated for split_speed compatibility. +; -nn357 -org $82AC03 - jmp $c27d ; !bank_82_free_space_start [bankless form of this] - nop #2 +org $82ac15 ;;; $AB47: Equipment screen - set up reserve mode and determine initial selection ;;; ; $82:AC15 BRANCH_RETURN +bootsfinish: -org !bank_82_free_space_start - bne .found - inx +org $82ac00 ;;; $AB47: Equipment screen - set up reserve mode and determine initial selection ;;; ; $82:AC00 LOOP_BOOTS +.loop + bit bootstable, x + bne .foundboots + inx inx - cpx #$0006 - jmp $AC08 -.found - jmp $AC0C + cpx #$000a + bmi .loop + jmp bootsfinish +.foundboots + jmp found_boots + nop #3 + +assert pc() <= $82ac15 -assert pc() <= !bank_82_free_space_end +org !bank_82_free_space_start +found_boots: + cpx #$0006 + beq .bluebooster + cpx #$0008 + beq .sparkbooster + txa + lsr a + bra .store +.bluebooster + lda #$0002 + bra .store +.sparkbooster + lda #$0003 +.store + xba + ora #$0003 + sta $0755 + jmp bootsfinish + nop #25 + +bootstable: + dw $0100 ; boots - hi-jump boots + dw $0200 ; boots - space jump + dw $2000 ; boots - speed booster + dw $0040 ; boots - blue booster + dw $0080 ; boots - spark booster + +assert pc() <= !bank_82_free_space_end \ No newline at end of file