-
Notifications
You must be signed in to change notification settings - Fork 32
Customizeable crash fixes #322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 20 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
890a167
toggable_crash_bugs.
nn357 e883f3a
Update vanilla_bugfixes.asm
nn357 2d92cf4
refine code a little
nn357 f0a0ccb
backend html
nn357 33f1e98
html
nn357 af61f4c
backend code
nn357 d50321d
change a few options (add true vanilla crashes)
nn357 c81015c
reorder toggles
nn357 f63df61
move crash handler/ togglable patches out of vanilla bugfixes.
nn357 a7c33e9
frontend ui fixes
nn357 f719b1b
fix typo in scripts.
nn357 e30f5c6
more errors
nn357 b45aa60
add base crash handler and subpatch for xmode
nn357 6907dc4
fix xmode handler bug
nn357 509d115
add crash handler for yapping maw shinespark
nn357 29106c7
add springball crash handler
nn357 7734364
update bug in autoreserves patch
nn357 7703120
updater patcher to apply individual crash patches
nn357 d70b635
formatting error in settings.rs
nn357 182104a
update upgrade settings
nn357 8d2dad0
update patches to use a common springboard.
nn357 2d44226
update randomize helpers
nn357 a8f44c0
formatting
nn357 1a389f3
fix settings upgrade
blkerby 3feec04
implement warn option for x-mode
blkerby 3e1f36e
uncomment silent option for x-mode
blkerby 9813200
adjust crash descriptions, add a bit more detail
blkerby 551576f
Move crash fixes into QoL
blkerby File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| ;;; 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) | ||
| ;;; | ||
|
|
||
|
|
||
| ;;; these variable are defined by the crash_handle_base.asm patch and patch.rs | ||
|
|
||
| !crash_toggles = $85AD00 | ||
| !kill_samus = $85b5a0 | ||
| !bug_dialog = $85b000 | ||
|
|
||
| !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 | ||
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,179 @@ | ||
| ;;; 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 | ||
|
|
||
| !bank_85_free_space_start = $85b000 ; be careful if moving this, the subpatches that use this code assume this location (xmode/oob/yappingmaw/autoreserve/springball) | ||
| !bank_85_free_space_end = $85b5a0 | ||
|
|
||
| !bank_85_free_space2_start = $85b5a0 ; kill samus routine, location called by sub patches, as above, be careful if ever moving this code and update subpatches. | ||
| !bank_85_free_space2_end = $85b5b4 | ||
|
|
||
| !msg_crash_timer_override = $7EF596 ; temporary variable used for overriding messagebox close delay times during crash box. | ||
| !crash_toggles = $85ad00 ; this location is looked at by the subpatches to decide if to call the handler etc. | ||
|
|
||
| org !crash_toggles | ||
| dw $0000 ; overwritten by patch.rs if any values are changed, subpatches reference this. default is gameover / death (pre-toggleable setting) | ||
|
|
||
| ;;; 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: | ||
|
|
||
| assert pc() <= !bank_85_free_space_end | ||
|
|
||
| org !bank_85_free_space2_start | ||
| 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_space2_end | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| ;;; Spring ball menu crash fix by strotlog. | ||
| ;;; Fix obscure vanilla bug where: turning off spring ball while bouncing, can crash in $91:EA07, | ||
| ;;; or exactly the same way as well in $91:F1FC. | ||
| ;;; Adapted for map rando by Stag Shot: | ||
| ;;; toggle-modifications nn_357. | ||
|
|
||
| arch snes.cpu | ||
| lorom | ||
|
|
||
| ;;; these variable are defined by the crash_handle_base.asm patch and patch.rs | ||
|
|
||
| !crash_toggles = $85AD00 | ||
| !kill_samus = $85b5a0 | ||
| !bug_dialog = $85b000 | ||
|
|
||
nn357 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| !bank_82_free_space2_start = $82f810 ; hook unpause (springball crash) | ||
| !bank_82_free_space2_end = $82f830 | ||
|
|
||
| !bank_85_free_space_start = $85ad04 | ||
| !bank_85_free_space_end = $85ad45 | ||
|
|
||
| ;;; vanilla hooks | ||
|
|
||
| org $8293bb | ||
| jmp check_unpause | ||
|
|
||
| org $91ea07 | ||
| jsl spring_ball_crash | ||
|
|
||
| org $91f1fc | ||
| jsl spring_ball_crash | ||
|
|
||
| ;;; custom code | ||
|
|
||
|
|
||
| org !bank_82_free_space2_start | ||
| check_unpause: | ||
| php | ||
| sep #$20 | ||
| lda $00cf ; pending crash ID | ||
| stz $00cf | ||
| cmp #$42 ; springball? | ||
| bne .skip | ||
| plp | ||
| jmp $93c1 ; skip changing gamestate | ||
| .skip | ||
| plp | ||
| lda #$0008 ; replaced code | ||
| jmp $93be | ||
|
|
||
| assert pc() <= !bank_82_free_space2_end | ||
|
|
||
|
|
||
| org !bank_85_free_space_start | ||
| spring_ball_crash: | ||
| lda $0B20 ; morph bounce state | ||
| cmp #$0600 ; bugged? | ||
| bcc .skip | ||
| lda !crash_toggles | ||
| and #$000F | ||
| beq .default | ||
| cmp #$0002 | ||
| beq .fix | ||
| .warn | ||
| lda #$0042 | ||
| jsl !bug_dialog | ||
| .fix | ||
| lda #$0000 | ||
| stz $0b20 | ||
| rtl | ||
| .default | ||
| sep #$20 | ||
| lda #$42 ; bug ID | ||
| sta $00cf ; set flag to prevent unpause from resetting gamestate to 8 | ||
| rep #$30 | ||
| jsl !bug_dialog | ||
| jsl !kill_samus | ||
| lda #$0000 | ||
| stz $0B20 | ||
| rtl | ||
| .skip | ||
| lda $0B20 ; replaced code | ||
| asl ; | ||
| rtl | ||
|
|
||
| assert pc() <= !bank_85_free_space_end | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.