From 55939958c18f941c757b497a8f77d3d1244fa9ad Mon Sep 17 00:00:00 2001 From: aquanight Date: Fri, 13 Mar 2026 12:04:07 -0600 Subject: [PATCH 1/6] Split Blue/Spark Booster equipment items --- patches/ips/split_speed.ips | Bin 1129 -> 1203 bytes patches/src/split_speed.asm | 141 +++++++++++++++++++----------------- scripts/build_ips.py | 3 + 3 files changed, 77 insertions(+), 67 deletions(-) diff --git a/patches/ips/split_speed.ips b/patches/ips/split_speed.ips index 0707e81c8e78f731f0c335da524ab9ecdf264291..d84effc3163d5a9e6acd4e89dafe49c457881f8b 100644 GIT binary patch delta 227 zcmaFKv6-_zz%j(xgHcJJfq7-*5k@6j2IifCKsua(dEc@_j7qUkegy;b0S*R6!($B0 zCz+WUO~o0QZGh@bBa{WHv delta 154 zcmdnY`I5sRz%j(xgHiAT1G9p{e@4@FKw9HJqeB`4(*Xs>dIbjlUR8Fbg?}a_$TBck zGBG4fJfg<Jw9ZB(SKV zPgL=w1H%VCrIiyK7#SrP{%&JnY~X?M{s4K83|2Drayw~cZ_Z`3XJo9|yq1ZL2>{D6 BG1dS8 diff --git a/patches/src/split_speed.asm b/patches/src/split_speed.asm index 174e8774d..9db1db1b7 100644 --- a/patches/src/split_speed.asm +++ b/patches/src/split_speed.asm @@ -7,8 +7,11 @@ !bank_91_free_space_start2 = $91FC42 !bank_91_free_space_end2 = $91FC66 -!bank_82_free_space_start = $82FF20 -!bank_82_free_space_end = $82FF30 +!bank_82_free_space_start = $82C42D +!bank_82_free_space_end = $82C465 + +!bank_82_freespace2_start = $82FF20 +!bank_82_freespace2_end = $82FF30 !bank_B6_free_space_start = $B6FC00 !bank_B6_free_space_end = $B6FE00 @@ -22,33 +25,82 @@ !speed_booster = $2000 !any_booster = !blue_booster|!spark_booster|!speed_booster -org $8291D0 - jsr hook_setup_speedbooster_menu_tile_wrapper +org $82A22F + lda #list_boots_ram_tilemaps + +org $82A23D + lda list_boots_equip_bitmasks, y + +org $82A257 + ldx list_boots_equip_tilemaps, y + +org $82A25D + lda list_boots_equip_bitmasks, y + +org $82B1C6 + cmp #$0303 + +org $82B517 + bit list_boots_equip_bitmasks, x + +org $82B545 + bit list_boots_equip_bitmasks, x + +org $82B51E + cpx #$0008 -org $82B5AE - jsr hook_equip_enable +org $82C194 + dw boots_item_selector_positions -org $82C066 -; Speedbooster bitset - dw !any_booster +org $82A278 + cpy #$0008 + +org $82C032 + dw list_boots_ram_tilemaps + +org $82C03A + dw list_boots_equip_bitmasks + +org $82C04A + dw list_boots_equip_tilemaps + +org $82C2A6 +list_boots_equip_tilemaps: + dw $BFD2, $BFE4, tilemap_blue_booster, tilemap_spark_booster +warnpc $82C2B7 org !bank_82_free_space_start -hook_setup_speedbooster_menu_tile_wrapper: - sta $0725 ; run hi-jacked instruction - jsl hook_setup_speedbooster_menu_tile - rts +;Tilemaps +;oBLUE BOOSTER +tilemap_blue_booster: + dw $12FF, $1270, $1271, $1272, $1273, $1274, $1275, $1276, $1277 -hook_equip_enable: - ; X = equipment bitmask - ; Y = equipment bitset - ; A = loaded with previously equipped items - ora $0000,x ; Hijacked code (sets the bitmask) - and $0002,y ; AND with collected items - rts +;oSPARK BOOSTER +tilemap_spark_booster: + dw $12FF, $1278, $1279, $127A, $127B, $127C, $127D, $127E, $127F + +; Replacement boots table +list_boots_equip_bitmasks: + dw $0100, $0200, !blue_booster, !spark_booster +list_boots_ram_tilemaps: + dw $3CEA, $3D2A, $3D6A, $3DAA + +warnpc !bank_82_free_space_end assert pc() <= !bank_82_free_space_end +org !bank_82_freespace2_start + +boots_item_selector_positions: + dw $00CC, $009C + dw $00CC, $00A4 + dw $00CC, $00AC + dw $00CC, $00B4 + +warnpc !bank_82_freespace2_end +assert pc() <= !bank_82_freespace2_end + ; Accelerate Samus' animation with any booster item: org $908502 bit #!any_booster @@ -314,52 +366,6 @@ hook_update_speed_echoes: lda $0b3e ; run hi-jacked instruction rts -hook_setup_speedbooster_menu_tile: - php - - rep #$30 - lda $09A4 - and #!any_booster - beq .no ; No boosters - bit #!speed_booster - bne .no ; Full speedbooster - - cmp #!blue_booster|!spark_booster - beq .no ; Blue+Spark = Speed - - ; Prepare VRAM for copy - ldx #$1240 - stx $2116 - sep #$10 ; X = 8-bit - ldx #$80 ; Auto-increment, 1 word - stx $2115 - - cmp #!blue_booster - beq .blue - - ; Spark booster - jsl $8091A9 - db $01, $01, $18 - dl menu_tiles_spark_booster - dw menu_tiles_spark_booster_end-menu_tiles_spark_booster - - bra .dma - -.blue - jsl $8091A9 - db $01, $01, $18 - dl menu_tiles_blue_booster - dw menu_tiles_blue_booster_end-menu_tiles_blue_booster - -.dma - sep #$30 - lda #$02 - sta $420B ; DMA execute - -.no - plp - rtl - hook_speed_clamp: lda !equipped_items and #!any_booster @@ -375,6 +381,7 @@ assert pc() <= !bank_90_free_space_end org !bank_B6_free_space_start +org $B6CE00 menu_tiles_blue_booster: db $FF, $FF, $FF, $FF, $8D, $FF, $B5, $FF, $8D, $FF, $B5, $FF, $8C, $FF, $FF, $FF db $00, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $FF @@ -413,4 +420,4 @@ menu_tiles_spark_booster: db $00, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $FF .end -assert pc() <= !bank_B6_free_space_end \ No newline at end of file +;assert pc() <= !bank_B6_free_space_end \ No newline at end of file diff --git a/scripts/build_ips.py b/scripts/build_ips.py index 092a03ddf..689496b3b 100644 --- a/scripts/build_ips.py +++ b/scripts/build_ips.py @@ -151,6 +151,9 @@ def check_range(filename, other_filename, overlap_start, overlap_end): 'reserve_backward_fill': [ ['hud_expansion_opaque', 0xB6A940, 0xB6A980] ], + 'split_speed': [ + ['hud_expansion_opaque', 0xB6CE00, 0xB6D000] + ], } failed = False From 0df0c7de3822140cf462872220ffa634e799b5e7 Mon Sep 17 00:00:00 2001 From: aquanight Date: Fri, 13 Mar 2026 12:04:30 -0600 Subject: [PATCH 2/6] Document Bank 82 unused vanilla space (spritemap entries) --- patches/rom_map/Bank 82.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/patches/rom_map/Bank 82.txt b/patches/rom_map/Bank 82.txt index 97d5541af..2d0926b14 100644 --- a/patches/rom_map/Bank 82.txt +++ b/patches/rom_map/Bank 82.txt @@ -1,3 +1,12 @@ +C262 - C27D: disableable_etanks.asm +C27D - C298: +C2A6 - C2B7: +C362 - C369: +C37E - C385: +C3B6 - C3BD: map_area.asm +C3C4 - C3D9: map_area.asm +C411 - C42D: map_area.asm +C42D - C465: F70F - F810: map_area.asm F810 - F830: vanilla_bugfixes.asm F830 - F9E0: disable_etanks.asm @@ -21,4 +30,4 @@ FF30 - FF80: reserve_hud.asm FF80 - FFFA: pause_menu_objectives.asm FFFA - FFFC: room name/map_area FFFC - FFFE: objectives/fast_pause_menu -FFFE - end: custom etank color \ No newline at end of file +FFFE - end: custom etank color From 839ff127b01eb7c6f08d6271e3ec46ac0510967f Mon Sep 17 00:00:00 2001 From: aquanight Date: Fri, 13 Mar 2026 13:00:09 -0600 Subject: [PATCH 3/6] Adjust equipment screen background to make room for four items in BOOTS --- patches/ips/split_speed.ips | Bin 1203 -> 1284 bytes patches/src/split_speed.asm | 11 ++++++++--- scripts/build_ips.py | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/patches/ips/split_speed.ips b/patches/ips/split_speed.ips index d84effc3163d5a9e6acd4e89dafe49c457881f8b..a8fe21b5cfede9e9c0f0ac61691cad123b554333 100644 GIT binary patch delta 92 zcmdnY*}}D9151c>ZU%!`$j|>g1-ym4MZCqlCA_7)WxVCQ4wcfmD;UHaEdTRV@K*9x d@mBNJ@YeFy@z#T-UNDF`?sUR{jz3-f-2iXbAWQ%N delta 11 ScmZqS+RV9O0}HdOzZ(D-aRZD1 diff --git a/patches/src/split_speed.asm b/patches/src/split_speed.asm index 9db1db1b7..fa56c4b78 100644 --- a/patches/src/split_speed.asm +++ b/patches/src/split_speed.asm @@ -379,8 +379,6 @@ hook_speed_clamp: assert pc() <= !bank_90_free_space_end -org !bank_B6_free_space_start - org $B6CE00 menu_tiles_blue_booster: db $FF, $FF, $FF, $FF, $8D, $FF, $B5, $FF, $8D, $FF, $B5, $FF, $8C, $FF, $FF, $FF @@ -420,4 +418,11 @@ menu_tiles_spark_booster: db $00, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $FF .end -;assert pc() <= !bank_B6_free_space_end \ No newline at end of file +org $B6 +; Replace the SPEED BOOSTER row with BLUE/SPARK BOOSTER and move the bottom of the box down one row. +org $B6ED68 + dw $F954, $0CFF, $0D70, $0D71, $0D72, $0D73, $0D74, $0D75, $0D76, $0D77, $7940 +org $B6EDA8 + dw $3940, $0CFF, $0D78, $0D79, $0D7A, $0D7B, $0D7C, $0D7D, $0D7E, $0D7F, $7940 +org $B6EDE8 + dw $B941, $B942, $B942, $B942, $B942, $B942, $B942, $B942, $B942, $B942, $F941 \ No newline at end of file diff --git a/scripts/build_ips.py b/scripts/build_ips.py index 689496b3b..7884b2679 100644 --- a/scripts/build_ips.py +++ b/scripts/build_ips.py @@ -152,7 +152,8 @@ def check_range(filename, other_filename, overlap_start, overlap_end): ['hud_expansion_opaque', 0xB6A940, 0xB6A980] ], 'split_speed': [ - ['hud_expansion_opaque', 0xB6CE00, 0xB6D000] + ['hud_expansion_opaque', 0xB6CE00, 0xB6D000], + ['hud_expansion_opaque', 0xB6E800, 0xB6F000] ], } From 97dd007831df1f7f3eb93d247bae51ca1df41815 Mon Sep 17 00:00:00 2001 From: aquanight Date: Fri, 13 Mar 2026 14:41:02 -0600 Subject: [PATCH 4/6] Adjust right side position to be centered --- patches/ips/split_speed.ips | Bin 1284 -> 1891 bytes patches/src/split_speed.asm | 94 +++++++++++++++++++++++++++++++++--- scripts/build_ips.py | 5 ++ 3 files changed, 92 insertions(+), 7 deletions(-) diff --git a/patches/ips/split_speed.ips b/patches/ips/split_speed.ips index a8fe21b5cfede9e9c0f0ac61691cad123b554333..92206073a36174eea169f8d54fc4631edb2df729 100644 GIT binary patch delta 726 zcmZutJxml)5T0Fuyr*wuMLaKA6Q39pZ;J!<39SfLGx?Irkg{*)+cgbIIwYMHl}yIj;a`7)XJ&CK^@Zm*qNKXN*whCn!- zey8L5?zp?)8r~?FGBUhLNS5Frl;8;A452_6Bn-p7z61Nma|=1A%kMId9R+hHZyY}r zrxWMF{E#bMF1H})u#AE7bE27 z5c%l<^dvKoi$s12$q=l!YSd zEF@?0y~Rkp6tBc<@kUf>O^(sZsqTNmTe1B*wI`{G)MSvV$@N#{nB?1d8{f`1^CWNP zTRCm)KNmY;Z`nKco|S8%DH0r zRDrZ&i@{$m$zy@Usu!6`KTAJP*DMxDOkbn}cj0c_gBje5`{*WmV?|6Xitplw_$hvg z-*l>&8Xz$}bpbEpCA^G-cm;>>D$>-z782`SiNrN5;&r@%!*~;KVGwg;_vahzRVbgz A!TD(0zVh)y*4cWzHUNDF`?sUR{ Jjz3-f-2lpLDp~*l diff --git a/patches/src/split_speed.asm b/patches/src/split_speed.asm index fa56c4b78..db1af44bf 100644 --- a/patches/src/split_speed.asm +++ b/patches/src/split_speed.asm @@ -52,6 +52,14 @@ org $82B51E org $82C194 dw boots_item_selector_positions +org $82C1B2 + dw $00CC, $0044 + dw $00CC, $004C + dw $00CC, $0064 + dw $00CC, $006C + dw $00CC, $0074 + dw $00CC, $007C + org $82A278 cpy #$0008 @@ -61,6 +69,9 @@ org $82C032 org $82C03A dw list_boots_equip_bitmasks +org $82C076 + dw $3A2A, $3A6A, $3B2A, $3B6A, $3BAA, $3BEA + org $82C04A dw list_boots_equip_tilemaps @@ -85,7 +96,7 @@ list_boots_equip_bitmasks: dw $0100, $0200, !blue_booster, !spark_booster list_boots_ram_tilemaps: - dw $3CEA, $3D2A, $3D6A, $3DAA + dw $3CAA, $3CEA, $3D2A, $3D6A warnpc !bank_82_free_space_end assert pc() <= !bank_82_free_space_end @@ -93,10 +104,10 @@ assert pc() <= !bank_82_free_space_end org !bank_82_freespace2_start boots_item_selector_positions: + dw $00CC, $0094 dw $00CC, $009C dw $00CC, $00A4 dw $00CC, $00AC - dw $00CC, $00B4 warnpc !bank_82_freespace2_end assert pc() <= !bank_82_freespace2_end @@ -418,11 +429,80 @@ menu_tiles_spark_booster: db $00, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $FF .end -org $B6 -; Replace the SPEED BOOSTER row with BLUE/SPARK BOOSTER and move the bottom of the box down one row. +; Power Suit Shoulder with line tile (1CF) +org $B6B9E0 + db $0B, $00, $09, $00, $08, $00, $05, $00, $85, $80, $41, $40, $22, $20, $12, $10 + db $00, $00, $00, $00, $00, $00, $00, $00, $80, $80, $40, $40, $20, $20, $10, $10 + +; Power Suit inside line tile (17E) doesn't change + +; Power Suit outside line tile (17F) +org $B6AFE0 + db $10, $10, $20, $20, $40, $40, $80, $80, $00, $00, $00, $00, $80, $00, $C0, $00 + db $10, $10, $20, $20, $40, $40, $80, $80, $00, $00, $00, $00, $00, $00, $00, $00 + +; Varia Suit Shoulder with line tile (1D8) +org $B6BB00 + db $14, $00, $25, $00, $29, $00, $2A, $00, $8A, $80, $4B, $40, $20, $20, $10, $10 + db $00, $00, $00, $00, $00, $00, $00, $00, $80, $80, $40, $40, $20, $20, $10, $10 + +;Varia Suit inside line tile (1E6) +org $B6BCC0 + db $0F, $00, $F0, $00, $06, $00, $00, $00, $FF, $FF, $00, $00, $00, $00, $FF, $00 + db $00, $00, $00, $00, $00, $00, $00, $00, $FF, $FF, $00, $00, $00, $00, $00, $00 + +;Varia Suit outside line tile (1E7) +org $B6BCE0 + db $90, $10, $20, $20, $48, $40, $80, $80, $30, $00, $40, $00, $80, $00, $C0, $00 + db $10, $10, $20, $20, $40, $40, $80, $80, $00, $00, $00, $00, $00, $00, $00, $00 + +org $B6EA66 + dw $65CF + +org $82D54F + dw $65CF + +org $82D65F + dw $65CF + +org $82D76F + dw $65D8 + +org $82D87F + dw $65D8 + +org $B6E9E8 + dw $3941, $3942, $3942, $3943, $2AF6, $2AF7, $2AF8, $7943, $3942, $3942, $7941 +org $B6EA28 + dw $3940, $0CFF, $0D00, $0D01, $0D02, $0D03, $0D04, $0D05, $0CD4, $0CD4, $7940 +org $B6EA68 + dw $7954, $0CFF, $0CD0, $0CD1, $0CD2, $0CD3, $0D03, $0D04, $0D05, $0CD4, $7940 +org $B6EAA8 + dw $B941, $B942, $B942, $B942, $B942, $B942, $B942, $B942, $B942, $B942, $F941 + +org $B6EAE8 + dw $3941, $3942, $3942, $3943, $29B0, $29B1, $29B2, $7943, $3942, $3942, $7941 +org $B6EB28 + dw $3940, $08FF, $0920, $0921, $0922, $0923, $0917, $0918, $090F, $091F, $7940 +org $B6EB68 + dw $3940, $08FF, $08D5, $08D6, $08D7, $08D4, $08D4, $08D4, $08D4, $08D4, $7940 +org $B6EBA8 + dw $7954, $08FF, $0910, $0911, $0912, $0913, $0914, $0915, $0916, $08D4, $7940 +org $B6EBE8 + dw $3940, $08FF, $08E0, $08E1, $08E2, $08E3, $08E4, $08E5, $08E6, $08D4, $7940 +org $B6EC28 + dw $B941, $B942, $B942, $B942, $B942, $B942, $B942, $B942, $B942, $B942, $F941 + +;FIXME: Uses hud_expansion_opaque relocated tiles +org $B6EC68 + dw $3941, $3942, $3942, $3943, $2EB9, $2EBA, $2EBB, $7943, $3942, $3942, $7941 +org $B6ECA8 + dw $3940, $0CFF, $0D30, $0D31, $0D32, $0D33, $0D34, $0D35, $0D36, $0CD4, $7940 +org $B6ECE8 + dw $3940, $0CFF, $0CF0, $0CF1, $0CF2, $0CF3, $0CF4, $0CF5, $0CD4, $0CD4, $7940 +org $B6ED28 + dw $3940, $0CFF, $0D70, $0D71, $0D72, $0D73, $0D74, $0D75, $0D76, $0D77, $7940 org $B6ED68 - dw $F954, $0CFF, $0D70, $0D71, $0D72, $0D73, $0D74, $0D75, $0D76, $0D77, $7940 + dw $F954, $0CFF, $0D78, $0D79, $0D7A, $0D7B, $0D7C, $0D7D, $0D7E, $0D7F, $7940 org $B6EDA8 - dw $3940, $0CFF, $0D78, $0D79, $0D7A, $0D7B, $0D7C, $0D7D, $0D7E, $0D7F, $7940 -org $B6EDE8 dw $B941, $B942, $B942, $B942, $B942, $B942, $B942, $B942, $B942, $B942, $F941 \ No newline at end of file diff --git a/scripts/build_ips.py b/scripts/build_ips.py index 7884b2679..2cc01d01e 100644 --- a/scripts/build_ips.py +++ b/scripts/build_ips.py @@ -152,6 +152,11 @@ def check_range(filename, other_filename, overlap_start, overlap_end): ['hud_expansion_opaque', 0xB6A940, 0xB6A980] ], 'split_speed': [ + ['hud_expansion_opaque', 0x82D521, 0x82D961], + ['hud_expansion_opaque', 0xB6AFE0, 0xB6B000], + ['hud_expansion_opaque', 0xB6B9E0, 0xB6BA00], + ['hud_expansion_opaque', 0xB6BB00, 0xB6BB20], + ['hud_expansion_opaque', 0xB6BCC0, 0xB6BD00], ['hud_expansion_opaque', 0xB6CE00, 0xB6D000], ['hud_expansion_opaque', 0xB6E800, 0xB6F000] ], From a59e851a4c6ea11713549d688746e50f2a9010d4 Mon Sep 17 00:00:00 2001 From: aquanight Date: Fri, 13 Mar 2026 15:20:55 -0600 Subject: [PATCH 5/6] Correct application of split speed items during escape --- rust/maprando/src/patch.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rust/maprando/src/patch.rs b/rust/maprando/src/patch.rs index 6bf72f5bd..26a213fa7 100644 --- a/rust/maprando/src/patch.rs +++ b/rust/maprando/src/patch.rs @@ -507,6 +507,8 @@ impl Patcher<'_> { if self.settings.quality_of_life_settings.all_items_spawn { patches.push("all_items_spawn"); } + + let mut escape_itembits : Option = None; if self.settings.quality_of_life_settings.escape_movement_items || self @@ -515,6 +517,7 @@ impl Patcher<'_> { .stop_item_placement_early { patches.push("escape_items"); + escape_itembits = Some(0xF72F); } if self.settings.quality_of_life_settings.fast_elevators { @@ -555,6 +558,9 @@ impl Patcher<'_> { SpeedBooster::Split => { patches.push("split_speed_plm"); patches.push("split_speed"); + if escape_itembits.is_some() { + escape_itembits = Some((escape_itembits.unwrap() & !0x2000) | 0x00C0); + } } } @@ -694,6 +700,10 @@ impl Patcher<'_> { { self.rom.write_u16(snes2pc(0x82F830), 0x0001)?; } + + if let Some(escape_items) = escape_itembits { + self.rom.write_u16(snes2pc(0xA9FB7B), escape_items)?; + } Ok(()) } From 3f2022c71a1d3948a6bb0af6d053d9107cf828c0 Mon Sep 17 00:00:00 2001 From: aquanight Date: Fri, 13 Mar 2026 15:23:43 -0600 Subject: [PATCH 6/6] cargo fmt --- rust/maprando/src/patch.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/maprando/src/patch.rs b/rust/maprando/src/patch.rs index 26a213fa7..24f200475 100644 --- a/rust/maprando/src/patch.rs +++ b/rust/maprando/src/patch.rs @@ -507,8 +507,8 @@ impl Patcher<'_> { if self.settings.quality_of_life_settings.all_items_spawn { patches.push("all_items_spawn"); } - - let mut escape_itembits : Option = None; + + let mut escape_itembits: Option = None; if self.settings.quality_of_life_settings.escape_movement_items || self @@ -700,7 +700,7 @@ impl Patcher<'_> { { self.rom.write_u16(snes2pc(0x82F830), 0x0001)?; } - + if let Some(escape_items) = escape_itembits { self.rom.write_u16(snes2pc(0xA9FB7B), escape_items)?; }