From 4089623577686db617b41ac9fd84f196ff3c1451 Mon Sep 17 00:00:00 2001 From: nn <53490794+nn357@users.noreply.github.com> Date: Sat, 21 Mar 2026 16:49:46 +0900 Subject: [PATCH] fix xmode/momentum conservation with sparkbooster stz to b3e was causing it to underflow as its automatically decremented by 90857d. this reverts the previous fix to momentum conservation too as this fixes both. --- patches/ips/momentum_conservation.ips | Bin 116 -> 99 bytes patches/ips/split_speed.ips | Bin 1891 -> 1894 bytes patches/src/momentum_conservation.asm | 18 ------------------ patches/src/split_speed.asm | 11 +++++------ 4 files changed, 5 insertions(+), 24 deletions(-) diff --git a/patches/ips/momentum_conservation.ips b/patches/ips/momentum_conservation.ips index 17f7a73e1053bf9299cb4c356e58c843fac69f1a..94c36e072c8c19af1cf31637b128d529065f3c78 100644 GIT binary patch delta 42 ycmXR(77B0-arWR)KE=T7!|;Qnf`P$rqL72&N=Am>3tTH%7<$ifX(YJ%y8!_AIt$$Z delta 59 zcmYc;5eje&arWR)KE=T7!|;Qnf`K7^qL72q+C`k54hk1IA1SP4?6u=Q1f&>xFL147 OVdy=_rIFz3?*;%BC=z`D diff --git a/patches/ips/split_speed.ips b/patches/ips/split_speed.ips index 92206073a36174eea169f8d54fc4631edb2df729..b6c978125afc71c7aeb22879df96aee14e2f6f09 100644 GIT binary patch delta 66 zcmaFN_l$3Y38T`IKOB;h3~UPRe>xo$I3!mxFoWp4=M2mWJ%2cA92hDlhcRmM39q%` U{=lcy_-DdOMuy(aU5qzb0ni5(`v3p{ delta 63 zcmaFH_n2>k38T`&KOB;h3~UN5e>xo$I3!mxFoWp4=M2mWoqsrL92iO`hcRk$3#_%_ R{=ltN_h-VK&Ap5_Spkq66-xjB diff --git a/patches/src/momentum_conservation.asm b/patches/src/momentum_conservation.asm index fc1b22d329..192f8bbd9e 100644 --- a/patches/src/momentum_conservation.asm +++ b/patches/src/momentum_conservation.asm @@ -1,18 +1,9 @@ ; Patch to conserve Samus' horizontal momentum when landing while running ; Author: Scyzer, with updates by Nodever2 & OmegaDragnet7 lorom - !bank_90_free_space_start = $90F800 !bank_90_free_space_end = $90F880 -!equipped_items = $09A2 -!blue_booster = $0040 -!spark_booster = $0080 -!speed_booster = $2000 -!any_booster = !blue_booster|!spark_booster|!speed_booster - -lorom - ; ASM to keep running speed while landing. This is more effective than simply changing the pose table, ; as you can have variables, and doesn't move you forward a pixel. @@ -65,15 +56,6 @@ SPEEDKEEP: LDA $0B40 : BEQ + : LDA #$0003 : JSL $80914D ; resume speed booster sfx if needed + ; next two lines of code are mostly only needed because of a dumb vanilla bug with $91DA74 - lda !equipped_items - bit #!blue_booster|!speed_booster - bne .skip - sep #$20 - lda #$01 - sta $0b3e - rep #$20 - -.skip: LDA #$0001 : STA $0AD0 ; update samus palette next frame LDA #$0004 : STA $0ACE ; reset samus speed booster/screw attack palette index PLP : RTS diff --git a/patches/src/split_speed.asm b/patches/src/split_speed.asm index db1af44bf7..b46c42e7eb 100644 --- a/patches/src/split_speed.asm +++ b/patches/src/split_speed.asm @@ -78,7 +78,7 @@ org $82C04A org $82C2A6 list_boots_equip_tilemaps: dw $BFD2, $BFE4, tilemap_blue_booster, tilemap_spark_booster -warnpc $82C2B7 +assert pc() <= $82C2B7 org !bank_82_free_space_start @@ -97,8 +97,6 @@ list_boots_equip_bitmasks: list_boots_ram_tilemaps: dw $3CAA, $3CEA, $3D2A, $3D6A - -warnpc !bank_82_free_space_end assert pc() <= !bank_82_free_space_end org !bank_82_freespace2_start @@ -109,7 +107,6 @@ boots_item_selector_positions: dw $00CC, $00A4 dw $00CC, $00AC -warnpc !bank_82_freespace2_end assert pc() <= !bank_82_freespace2_end ; Accelerate Samus' animation with any booster item: @@ -344,8 +341,10 @@ spark_booster_lose_blue: ;sta $0AAE jsl .remove_echoes - stz $0b3e ; Clear dash counter - + ;stz $0b3e ; Clear dash counter + lda #$0001 ; reset speed booster timer to 1 (should fix xmode and momenutm conservation), $90857D automatically decrements this, if its at 0 it underflows causing animation issues with xmode/mc + sta $0b3e + lda #$0000 rtl .skip_lose_blue: