From 196c564002b494c97099d21aa5c98ef019b6477c Mon Sep 17 00:00:00 2001 From: nn <53490794+nn357@users.noreply.github.com> Date: Sat, 24 Oct 2026 06:27:20 +0900 Subject: [PATCH 1/2] check over free space in bank 82, rewrite ui fix for boots only item found some mosaic code hiding in an unused vanilla instruction that wasn't documented clearly. --- patches/ips/vanilla_bugfixes.ips | Bin 328 -> 281 bytes patches/rom_map/Bank 82.txt | 11 ++++- patches/rom_map/vanilla_hooks.txt | 1 - patches/src/vanilla_bugfixes.asm | 72 ++++++++++-------------------- 4 files changed, 34 insertions(+), 50 deletions(-) diff --git a/patches/ips/vanilla_bugfixes.ips b/patches/ips/vanilla_bugfixes.ips index 3a5f2768900505f31c3fb8ec4e074fc624c15a0e..97aad0bd32951e7e900f91dd3e7bf6f2ea064c3e 100644 GIT binary patch delta 86 zcmX@XG?U3Mz%j(xgHe7015;)VqYeXus13`P3tTT=Jm6w5_|m}sYA@fH-cWW%0|o}B p2`P*wM;MqN@GvlzurP=)FfuSPC^#@QFfcPPGcq#)A@juA(*Q9O6>$In delta 135 zcmbQqbb_fqz%j(xgHe7015;)VqYeXusEy*b3tTT=Jm6w5_~IkF#^=S>SFc_%8Za<0 zO-NxhIl{pFfQNz6^aX?S12%>aoDVpFM3+|s$4VxK2IiH_46iwv8G1w6fjWWOumc80 R1||jt2Zja)CgzC&CjnDyIBWm_ diff --git a/patches/rom_map/Bank 82.txt b/patches/rom_map/Bank 82.txt index 08390977d..1ec619be6 100644 --- a/patches/rom_map/Bank 82.txt +++ b/patches/rom_map/Bank 82.txt @@ -1,4 +1,13 @@ -B5E8 - B62B: ; vanilla_bugfixes.asm [boots ui fix, overwrites unused vanilla instruction.] +[unused vanilla code] +8B18 - 8B20: [free] [unused vanilla code] - 9 bytes +A3D9 - A425: [free] [unused vanilla code] - 77 bytes +B5E8 - B62B: [free] [unused vanilla code] - 68 bytes +B650 - B672: [free] [unused vanilla code] - 35 bytes +BE5A - BF04: [free] [unused vanilla code] - 171 bytes +E675 - E6A2: [mosaic] Area Palettes.asm [uses 16 bytes / 30 bytes free] +F404 - F419: ; vanilla_bugfixes.asm + +[bank free space] 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 49932a090..9a3c78bf3 100644 --- a/patches/rom_map/vanilla_hooks.txt +++ b/patches/rom_map/vanilla_hooks.txt @@ -238,7 +238,6 @@ 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 750034770..527e182b6 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 = $82B5E8 ; reserve icon ui fix. [;;; $B5E8: Unused. Convert [A] to three decimal digits ;;;] -!bank_82_free_space_end = $82B62B +!bank_82_free_space_start = $82f404 ; reserve icon ui fix. ;;; $F404: Unused. Pre-instruction ;;; +!bank_82_free_space_end = $82f419 !bank_86_free_space_start = $86F4B0 ; powamp projectile fix !bank_86_free_space_end = $86F4D0 @@ -223,53 +223,29 @@ org $84B7EF ; PLM $B8AC (speed booster escape) LDA $09A4 [$7E:09A4] ; 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. +; updated for split_speed compatibility, now fits in vanilla location with external table. +; ; -nn357 -org $82ac15 ;;; $AB47: Equipment screen - set up reserve mode and determine initial selection ;;; ; $82:AC15 BRANCH_RETURN -bootsfinish: - -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 #$000a - bmi .loop - jmp bootsfinish -.foundboots - jmp found_boots - nop #3 - -assert pc() <= $82ac15 - -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 - +org $82ac00 + .loop + bit bootstable,x + bne .found + inx + inx + cpx #$000a + bmi .loop + bra .ret ; skip the padding byte if no items found. + nop ; padding that never runs. + .found + lda bootscat,x + sta $0755 + .ret ; = $AC15, BRANCH_RETURN +assert pc() == $82ac15 + +org !bank_82_free_space_start 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 - + dw $0100, $0200, $2000, $0040, $0080 +bootscat: + dw $0003, $0103, $0203, $0203, $0303 assert pc() <= !bank_82_free_space_end \ No newline at end of file From 87a784b109802f6d602e7fc8b2c4f966e08a473c Mon Sep 17 00:00:00 2001 From: Brent Kerby Date: Sat, 24 Oct 2026 09:29:12 -0600 Subject: [PATCH 2/2] Small fixes to free space ranges --- patches/rom_map/Bank 82.txt | 14 +++++++------- patches/src/vanilla_bugfixes.asm | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/patches/rom_map/Bank 82.txt b/patches/rom_map/Bank 82.txt index 1ec619be6..5ca9c5edb 100644 --- a/patches/rom_map/Bank 82.txt +++ b/patches/rom_map/Bank 82.txt @@ -1,11 +1,11 @@ [unused vanilla code] -8B18 - 8B20: [free] [unused vanilla code] - 9 bytes -A3D9 - A425: [free] [unused vanilla code] - 77 bytes -B5E8 - B62B: [free] [unused vanilla code] - 68 bytes -B650 - B672: [free] [unused vanilla code] - 35 bytes -BE5A - BF04: [free] [unused vanilla code] - 171 bytes -E675 - E6A2: [mosaic] Area Palettes.asm [uses 16 bytes / 30 bytes free] -F404 - F419: ; vanilla_bugfixes.asm +8B18 - 8B1F: [free] [unused vanilla code] - 8 bytes +A3D9 - A424: [free] [unused vanilla code] - 76 bytes +B5E8 - B62A: [free] [unused vanilla code] - 67 bytes +B650 - B671: [free] [unused vanilla code] - 34 bytes +BE5A - BF03: [free] [unused vanilla code] - 170 bytes +E675 - E6A1: [mosaic] Area Palettes.asm [uses 16 bytes / 29 bytes free] +F404 - F417: ; vanilla_bugfixes.asm [bank free space] F70F - F808: ; map_area.asm diff --git a/patches/src/vanilla_bugfixes.asm b/patches/src/vanilla_bugfixes.asm index 527e182b6..4c99ef01c 100644 --- a/patches/src/vanilla_bugfixes.asm +++ b/patches/src/vanilla_bugfixes.asm @@ -11,7 +11,7 @@ lorom incsrc "constants.asm" !bank_82_free_space_start = $82f404 ; reserve icon ui fix. ;;; $F404: Unused. Pre-instruction ;;; -!bank_82_free_space_end = $82f419 +!bank_82_free_space_end = $82f418 !bank_86_free_space_start = $86F4B0 ; powamp projectile fix !bank_86_free_space_end = $86F4D0