Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
890a167
toggable_crash_bugs.
nn357 Mar 22, 2026
e883f3a
Update vanilla_bugfixes.asm
nn357 Mar 22, 2026
2d92cf4
refine code a little
nn357 Mar 23, 2026
f0a0ccb
backend html
nn357 Mar 23, 2026
33f1e98
html
nn357 Mar 23, 2026
af61f4c
backend code
nn357 Mar 23, 2026
d50321d
change a few options (add true vanilla crashes)
nn357 Mar 23, 2026
c81015c
reorder toggles
nn357 Mar 23, 2026
f63df61
move crash handler/ togglable patches out of vanilla bugfixes.
nn357 Mar 24, 2026
a7c33e9
frontend ui fixes
nn357 Mar 24, 2026
f719b1b
fix typo in scripts.
nn357 Mar 24, 2026
e30f5c6
more errors
nn357 Mar 24, 2026
b45aa60
add base crash handler and subpatch for xmode
nn357 Mar 24, 2026
6907dc4
fix xmode handler bug
nn357 Mar 24, 2026
509d115
add crash handler for yapping maw shinespark
nn357 Mar 24, 2026
29106c7
add springball crash handler
nn357 Mar 24, 2026
7734364
update bug in autoreserves patch
nn357 Mar 24, 2026
7703120
updater patcher to apply individual crash patches
nn357 Mar 24, 2026
d70b635
formatting error in settings.rs
nn357 Mar 24, 2026
182104a
update upgrade settings
nn357 Mar 24, 2026
8d2dad0
update patches to use a common springboard.
nn357 Mar 25, 2026
2d44226
update randomize helpers
nn357 Mar 25, 2026
a8f44c0
formatting
nn357 Mar 25, 2026
1a389f3
fix settings upgrade
blkerby Mar 25, 2026
3feec04
implement warn option for x-mode
blkerby Mar 25, 2026
3e1f36e
uncomment silent option for x-mode
blkerby Mar 25, 2026
9813200
adjust crash descriptions, add a bit more detail
blkerby Mar 25, 2026
551576f
Move crash fixes into QoL
blkerby Mar 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added patches/ips/crash_handle_autoreserves.ips
Binary file not shown.
Binary file added patches/ips/crash_handle_base.ips
Binary file not shown.
Binary file added patches/ips/crash_handle_springball.ips
Binary file not shown.
Binary file added patches/ips/crash_handle_xmode.ips
Binary file not shown.
Binary file added patches/ips/crash_handle_yapping.ips
Binary file not shown.
Binary file modified patches/ips/vanilla_bugfixes.ips
Binary file not shown.
2 changes: 1 addition & 1 deletion patches/rom_map/Bank 80.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ D140 - D200: oob_death.asm
D200 - D240: vanilla_bugfixes.asm
D240 - D310: stats.asm
D310 - D330: fast_reload.asm
D330 - D340: [FREE]
D330 - D340: crash_handle_base.asm [also referenced in patch.rs]
D340 - DA00: reserve_hud.asm
DA00 - DD00: msu1.asm
DD00 - E100: Palette pointer table for Mosaic
Expand Down
10 changes: 5 additions & 5 deletions patches/rom_map/Bank 82.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
C262 - C27D: disableable_etanks.asm
C27D - C298:
C2A6 - C2B7:
C27D - C298: vanilla_bugfixes.asm
C2A6 - C2B7: split_speed.asm
C362 - C369:
C37E - C385:
C3B6 - C3BD: map_area.asm
C3C4 - C3D9: map_area.asm
C411 - C42D: map_area.asm
C42D - C465:
C42D - C465: split_speed.asm
F70F - F810: map_area.asm
F810 - F830: vanilla_bugfixes.asm
F810 - F830: crash_handle_springball.asm
F830 - F9E0: disable_etanks.asm
F9E0 - FA00: reserve_backward_fill.asm
FA00 - FA80: alternate_door_colors.asm
FA80 - FA90: fix_water_fx_bug.asm
FA90 - FBB0: seed_hash_display.asm
FBB0 - FBF0: fix_kraid_hud.asm
FBF0 - FC30: vanilla_bugfixes.asm
FBF0 - FC30: crash_handle_autoreserve.asm
FC30 - FC50: fix_transition_bad_tiles.asm
FC50 - FCD0: map_area.asm
FCD0 - FD00: escape.asm
Expand Down
3 changes: 1 addition & 2 deletions patches/rom_map/Bank 83.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ AD66 - AD72: escape_autosave.asm
B000 - B700: [FREE]
B700 - B800: rng_fix.asm
B800 - BA00: Mosaic (Area FX.asm)
BA00 - BA15: vanilla_bugfixes.asm
BA15 - BB00: [FREE]
BA00 - BB00: [FREE]
BB00 - BC40: disableable_etanks.asm
BC40 - E000: [FREE]
E000 - F000: item_dots_disappear.asm
Expand Down
1 change: 1 addition & 0 deletions patches/rom_map/Bank 84.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
$858C - $85B2: vanilla_bugfixes.asm (unused vanilla code, repurposed for main street save station plm check.)
$EFD3 - $EFD7: load_plms_early.asm
$EFD7 - $F000: vanilla_bugfixes.asm
$F000 - $F0E2: walljump_plm.asm
Expand Down
7 changes: 5 additions & 2 deletions patches/rom_map/Bank 85.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ $AA00 - $AAA0: pause_menu_objectives.asm
$AAA0 - $AB00: [FREE]
$AB00 - $ACA0: map_area.asm
$ACA0 - $AD00: load_flash_suit
$AD00 - $AE20: [FREE]
$AD00 - $AD43: crash_handle_springball.asm
$AD43 - $AE20: [FREE]
$AE20 - $B000: reserve_backward_fill.asm
$B000 - $B600: vanilla_bugfixes.asm
$B000 - $B5B4: crash_handle_base.asm
$B5B4 - $B5F1: crash_handle_yapping.asm
$B5F1 - $B600: [free]
$B600 - $BA00: map_area.asm
2 changes: 1 addition & 1 deletion patches/rom_map/Bank 90.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ $F900 - $F910: escape_timer.asm
$F980 - $FA00: respin.asm
$FA00 - $FC00: map_progress_maintain.asm (list of cross-area tiles to reveal)
$FC00 - $FC10: Fake Lava.asm
$FC10 - $FC20: vanilla_bugfixes.asm
$FC10 - $FC20: crash_handle_yapping.asm
$FC20 - $FC40: remove_spikesuit.asm
$FC40 - $FD00: split_speed.asm
4 changes: 2 additions & 2 deletions patches/rom_map/Bank 91.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
95bc - 965a: {unused vanilla code - demo instructions} - crash_handle_xmode.asm
F7F4 - F88C: {unused vanilla code} - split_speed.asm
FC42 - FC66: {unsued vanilla code} - split_speed.asm

FFEE - FFFE: mosaic\fake lava.asm
FFEE - FFFE: mosaic\fake lava.asm
4 changes: 3 additions & 1 deletion patches/rom_map/RAM.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
$95: temporary variable (unused debug location) - used by extended messageboxes, safe to use outside message boxes.
$9B: decompression.asm
$CF: vanilla_bugfixes.asm (used by crash dialogues to prevent unpause from resetting gamestate.)
$09EC: number of disabled ETanks (saved to SRAM)
$0A1A: previous reserve health (reserve_hud.asm)
$1F5B: map area (like $079F)
Expand Down Expand Up @@ -44,7 +45,8 @@ $7EF594-$7EF596: fix_transition_bad_tiles.asm
$7EF596: vanilla_bugfixes.asm
$7EF597-$7EF599: split_speed.asm
$7EF59A-$7EF59C: reserve_backward_fill.asm
$7EF59C-$7EFE00: [FREE]
$7EF59C-$7EF59E: crash_handle_xmode.asm
$7EF59E-$7EFE00: [FREE]
$7EFE00: map area (copy of $1F5B to be saved to SRAM)
$7EFE02: map area explored mask
$7EFE04: copy of $1F5D (to be saved to SRAM for escape autosave)
Expand Down
1 change: 1 addition & 0 deletions patches/rom_map/vanilla_hooks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,7 @@ $909e88 - walljump_plm.asm

[BANK 91]
$9181f4 - aim_anything.asm
$91cafe - crash_handle_xmode.asm
$91e164 - fast_reload.asm
$91e604 - fix_hyper_slowlock.asm
$91deba - gravity_palette.asm
Expand Down
7 changes: 7 additions & 0 deletions patches/src/constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,10 @@
; target number of frames for the pause menu black screen to lag
; (to compensate for VRAM decompression being faster):
!unpause_black_screen_lag_frames = $dfff07

; crash handler / sub patches variables

!crash_toggles = $80D330 ; overwritten by patch.rs , defined in crash_handle_base.asm

!kill_samus = $80D337 ; defined in crash_handle_base.asm
!bug_dialog = $80D332 ; defined in crash_handle_base.asm
45 changes: 45 additions & 0 deletions patches/src/crash_handle_autoreserves.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
;;; Fix auto-reserve / pause bug
;;;
;;; This patch will initiate the death sequence if pause hit with auto-reserve enabled
;;; on exact frame that leads to crash.
;;;
;;; (thanks to Benox50 for his initial patch, nn44/aquanight for the light pillar fix)
;;;


incsrc "constants.asm"

!bank_82_free_space_start = $82fbf0 ; pause / reserve bug
!bank_82_free_space_end = $82fc30


;;; vanilla hooks

org $828b3f
jsr pause_func : nop ; gamestate 1Ch (unused) handler


;;; custom code

org !bank_82_free_space_start
pause_func:
lda !crash_toggles
and #$00F0
beq .default
cmp #$0020
beq .fix
.warn
lda #$0041 ; "fix" leaves the screen black like any pause close to fadeout, warning will relight the screen due to showing the dialog, could be changed to darken the screen again but it might be confusing.
jsl !bug_dialog
.fix
lda #$0008
sta $0998
rts
.default
lda #$0041 ; msg ID
jsl !bug_dialog
jsl !kill_samus
stz $9d6 ; clear reserve health
rts

assert pc() <= !bank_82_free_space_end
186 changes: 186 additions & 0 deletions patches/src/crash_handle_base.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
;;; crash handler (displays a custom message box explaining the crash)
;;; StagShot, toggle modifications - nn_357
;;;
;;; Implementation of custom dialog boxes
;;; Requires hooking multiple functions to support extended msg IDs (0x40+)
;;; and additional lookup tables
;;;
;;; This code is used by other patches that handle hardlocks caused by the unequip springball, frame perfect pause on autoreserve trigger, yappingmaw shinespark
;;; X-mode solid tile collision.

arch snes.cpu
lorom

incsrc "constants.asm"

!bank_80_free_space_start = $80D332 ; springboard for the sub patches.. They all point here for the crash loader / kill samus
!bank_80_free_space_end = $80D340 ; if moving the crash handler base patch then this needs to be changed too.

!bank_85_free_space_start = $85b000 ;
!bank_85_free_space_end = $85b5b4

!msg_crash_timer_override = $7EF596 ; temporary variable used for overriding messagebox close delay times during crash box.

;;; global code.
org !crash_toggles ; default at 80d330, srpringboard follows.
dw $0000 ; overwritten by patch.rs

org !bank_80_free_space_start
jsl bug_dialog
rtl
jsl kill_samus
rtl

assert pc() <= !bank_80_free_space_end

;;; hooks into vanilla code

org $858493 ; override messagebox delay if crash dialog
jsr hook_msgbox_delay

org $858093
jsr hook_message_box

org $8582e5
jsr hook_index_lookup

org $8582ee
jsr hook_message_table

org $85840c ; hook unpause to prevent resetting gamestate to 8 if crash ID set
jsr hook_button_lookup

;;; custom code

org !bank_85_free_space_start
bug_dialog: ; A = msg ID
and #$00ff
pha
sep #$20
lda #$0f ; restore screen brightness to full
sta $51
sta !msg_crash_timer_override ; messagebox timer will check if this is 0 (if its non zero load a longer time)
rep #$30
jsl $808338 ; wait for NMI

pla ; dlg box parameter
jsl $858080 ; dlg box
cmp #$0044
bne .skipkill ; oob death (dlg 44) is removable via major glitches patch, if its thrown then the intent is to kill as it isn't toggleable.
jsl kill_samus
.skipkill
rtl

hook_message_box:
rep #$30
lda $1c1f
cmp #$0040 ; custom boxes >= 0x40
bcs .custom
jmp $8241 ; original func

.custom
ldx #(new_message_boxes-$869b) ; ptr for extended lookup table
jmp $824f

hook_index_lookup:
lda $1c1f
cmp #$0040
bcs .custom
rts

.custom
sec
sbc #$0040
rts

hook_message_table:
adc $34 ; replaced code
tax ;
lda $1c1f
cmp #$0040
bcs .custom
rts

.custom
txa
clc
adc #(new_message_boxes-$869b) ; adjust ptr for extended table
tax
rts

hook_button_lookup:
lda $1c1f
cmp #$0040
bcs .custom
rts

.custom
lda #$0001 ; blank button tilemap
ldy #(reserve_pause_msg-$8426) ; blank button letter
rts

hook_msgbox_delay:
pha
lda !msg_crash_timer_override
beq .nochange
ldx #$005a ; (put 1.5 seconds on the clock)
lda #$00
sta !msg_crash_timer_override ; clear our special variable so then next msgbox will have whatever timer was set on generation
.nochange
pla
jsr $8136 ; hi-jacked instruction.
rts

; custom messages start at 0x41
new_message_boxes:
dw $83c5, $825a, reserve_pause_msg ; 0x41
dw $83c5, $825a, springball_msg ; 0x42
dw $83c5, $825a, yapping_maw_msg ; 0x43
dw $83c5, $825a, oob_msg ; 0x44
dw $83c5, $825a, xmode_msg ; 0x45
dw $0000, $0000, msg_end

table "tables/dialog_chars.tbl",RTL

reserve_pause_msg:
dw $000e,$000e,$000e, " GAME CRASH! ", $000e,$000e,$000e
dw $000e,$000e,$000e, " ", $000e,$000e,$000e
dw $000e,$000e,$000e, " PAUSED ON EXACT FRAME ", $000e,$000e,$000e
dw $000e,$000e,$000e, " AUTO-REFILL STARTED! ", $000e,$000e,$000e

springball_msg:
dw $000e,$000e,$000e, " GAME CRASH! ", $000e,$000e,$000e
dw $000e,$000e,$000e, " ", $000e,$000e,$000e
dw $000e,$000e,$000e, " UNEQUIPPED SPRING BALL ", $000e,$000e,$000e
dw $000e,$000e,$000e, " IN NEUTRAL BOUNCE! ", $000e,$000e,$000e

yapping_maw_msg:
dw $000e,$000e,$000e, " GAME CRASH! ", $000e,$000e,$000e
dw $000e,$000e,$000e, " ", $000e,$000e,$000e
dw $000e,$000e,$000e, " YAPPING MAW SHINESPARK ", $000e,$000e,$000e
dw $000e,$000e,$000e, " END WITH NO INPUTS HELD! ", $000e,$000e,$000e

oob_msg:
dw $000e,$000e,$000e, " ", $000e,$000e,$000e
dw $000e,$000e,$000e, " SAMUS OUT-OF-BOUNDS! ", $000e,$000e,$000e
dw $000e,$000e,$000e, " ", $000e,$000e,$000e
dw $000e,$000e,$000e, " ", $000e,$000e,$000e

xmode_msg:
dw $000e,$000e,$000e, " GAME CRASH! ", $000e,$000e,$000e
dw $000e,$000e,$000e, " ", $000e,$000e,$000e
dw $000e,$000e,$000e, " X-MODE TILE COLLISION ", $000e,$000e,$000e
dw $000e,$000e,$000e, "COLLIDED WITH A SOLID TILE", $000e,$000e,$000e

msg_end:

kill_samus:
lda #$8000 ; init death sequence (copied from $82db80)
sta $a78
lda #$0011
jsl $90f084
lda #$0013 ; set gamestate
sta $998
rtl

assert pc() <= !bank_85_free_space_end
Loading
Loading