Skip to content

Commit c51abf8

Browse files
authored
fix xmode/momentum conservation with sparkbooster (blkerby#321)
1 parent 72d6966 commit c51abf8

4 files changed

Lines changed: 5 additions & 24 deletions

File tree

-17 Bytes
Binary file not shown.

patches/ips/split_speed.ips

3 Bytes
Binary file not shown.

patches/src/momentum_conservation.asm

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
; Patch to conserve Samus' horizontal momentum when landing while running
22
; Author: Scyzer, with updates by Nodever2 & OmegaDragnet7
33
lorom
4-
54
!bank_90_free_space_start = $90F800
65
!bank_90_free_space_end = $90F880
76

8-
!equipped_items = $09A2
9-
!blue_booster = $0040
10-
!spark_booster = $0080
11-
!speed_booster = $2000
12-
!any_booster = !blue_booster|!spark_booster|!speed_booster
13-
14-
lorom
15-
167
; ASM to keep running speed while landing. This is more effective than simply changing the pose table,
178
; as you can have variables, and doesn't move you forward a pixel.
189

@@ -65,15 +56,6 @@ SPEEDKEEP:
6556
LDA $0B40 : BEQ + : LDA #$0003 : JSL $80914D ; resume speed booster sfx if needed
6657
+ ; next two lines of code are mostly only needed because of a dumb vanilla bug with $91DA74
6758

68-
lda !equipped_items
69-
bit #!blue_booster|!speed_booster
70-
bne .skip
71-
sep #$20
72-
lda #$01
73-
sta $0b3e
74-
rep #$20
75-
76-
.skip:
7759
LDA #$0001 : STA $0AD0 ; update samus palette next frame
7860
LDA #$0004 : STA $0ACE ; reset samus speed booster/screw attack palette index
7961
PLP : RTS

patches/src/split_speed.asm

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ org $82C04A
7878
org $82C2A6
7979
list_boots_equip_tilemaps:
8080
dw $BFD2, $BFE4, tilemap_blue_booster, tilemap_spark_booster
81-
warnpc $82C2B7
81+
assert pc() <= $82C2B7
8282

8383
org !bank_82_free_space_start
8484

@@ -97,8 +97,6 @@ list_boots_equip_bitmasks:
9797

9898
list_boots_ram_tilemaps:
9999
dw $3CAA, $3CEA, $3D2A, $3D6A
100-
101-
warnpc !bank_82_free_space_end
102100
assert pc() <= !bank_82_free_space_end
103101

104102
org !bank_82_freespace2_start
@@ -109,7 +107,6 @@ boots_item_selector_positions:
109107
dw $00CC, $00A4
110108
dw $00CC, $00AC
111109

112-
warnpc !bank_82_freespace2_end
113110
assert pc() <= !bank_82_freespace2_end
114111

115112
; Accelerate Samus' animation with any booster item:
@@ -344,8 +341,10 @@ spark_booster_lose_blue:
344341
;sta $0AAE
345342
jsl .remove_echoes
346343

347-
stz $0b3e ; Clear dash counter
348-
344+
;stz $0b3e ; Clear dash counter
345+
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
346+
sta $0b3e
347+
349348
lda #$0000
350349
rtl
351350
.skip_lose_blue:

0 commit comments

Comments
 (0)