Difference between revisions of "Fix Rexon crash"
From Sonic Retro
KingofHarts (talk | contribs) m (Added footers) |
Inferno Gear (talk | contribs) m (Made the guide have no subsections, due to the tutorial being the same for both Xenowhirl and Github versions of the Sonic 2 disasm.) |
||
(9 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
− | ( | + | (Original guide by [[User:Redhotsonic|redhotsonic]]) |
On [[Hill Top Zone]], it is possible to crash the game when hitting Rexon (the plesiosaur-like badnik that sits in the lava). Conflicts in the code cause it to jump to a section of code earlier than it was meant to jump to. This results in invalid opcodes being processed and an eventual crash. | On [[Hill Top Zone]], it is possible to crash the game when hitting Rexon (the plesiosaur-like badnik that sits in the lava). Conflicts in the code cause it to jump to a section of code earlier than it was meant to jump to. This results in invalid opcodes being processed and an eventual crash. | ||
Line 5: | Line 5: | ||
Go to "loc_37454:" and you should see this: | Go to "loc_37454:" and you should see this: | ||
− | <asm> | + | <syntaxhighlight lang="asm"> |
loc_37454: | loc_37454: | ||
bsr.w loc_3750C | bsr.w loc_3750C | ||
Line 11: | Line 11: | ||
bmi.s loc_37462 | bmi.s loc_37462 | ||
bra.w JmpTo39_MarkObjGone | bra.w JmpTo39_MarkObjGone | ||
− | </ | + | </syntaxhighlight> |
That "branch to subroutine - loc_3750C" is what is causing the problem. It's happening too early. We need to move that command down a little bit. So change it to this: | That "branch to subroutine - loc_3750C" is what is causing the problem. It's happening too early. We need to move that command down a little bit. So change it to this: | ||
− | <asm> | + | <syntaxhighlight lang="asm"> |
loc_37454: | loc_37454: | ||
subq.b #1,objoff_2A(a0) | subq.b #1,objoff_2A(a0) | ||
Line 21: | Line 21: | ||
bsr.w loc_3750C ; Now moved here to fix Rexon crash | bsr.w loc_3750C ; Now moved here to fix Rexon crash | ||
bra.w JmpTo39_MarkObjGone | bra.w JmpTo39_MarkObjGone | ||
− | </ | + | </syntaxhighlight> |
One more, go to "loc_37488:" and you should see this: | One more, go to "loc_37488:" and you should see this: | ||
− | <asm> | + | <syntaxhighlight lang="asm"> |
loc_37488: | loc_37488: | ||
bsr.w loc_3750C | bsr.w loc_3750C | ||
Line 34: | Line 34: | ||
bsr.w JmpTo26_ObjectMove | bsr.w JmpTo26_ObjectMove | ||
bra.w JmpTo39_MarkObjGone | bra.w JmpTo39_MarkObjGone | ||
− | </ | + | </syntaxhighlight> |
Again, "branch to subroutine - loc_3750C" is too early. So change it to this: | Again, "branch to subroutine - loc_3750C" is too early. So change it to this: | ||
− | <asm> | + | <syntaxhighlight lang="asm"> |
loc_37488: | loc_37488: | ||
moveq #$10,d0 | moveq #$10,d0 | ||
Line 47: | Line 47: | ||
bsr.w JmpTo26_ObjectMove | bsr.w JmpTo26_ObjectMove | ||
bra.w JmpTo39_MarkObjGone | bra.w JmpTo39_MarkObjGone | ||
− | </ | + | </syntaxhighlight> |
Done! The rexon crash will no longer happen. | Done! The rexon crash will no longer happen. | ||
{{S2Howtos}} | {{S2Howtos}} | ||
− | + | |{{PAGENAME}}]] |
Latest revision as of 10:18, 6 March 2019
(Original guide by redhotsonic)
On Hill Top Zone, it is possible to crash the game when hitting Rexon (the plesiosaur-like badnik that sits in the lava). Conflicts in the code cause it to jump to a section of code earlier than it was meant to jump to. This results in invalid opcodes being processed and an eventual crash.
Go to "loc_37454:" and you should see this:
loc_37454:
bsr.w loc_3750C
subq.b #1,objoff_2A(a0)
bmi.s loc_37462
bra.w JmpTo39_MarkObjGone
That "branch to subroutine - loc_3750C" is what is causing the problem. It's happening too early. We need to move that command down a little bit. So change it to this:
loc_37454:
subq.b #1,objoff_2A(a0)
bmi.s loc_37462
bsr.w loc_3750C ; Now moved here to fix Rexon crash
bra.w JmpTo39_MarkObjGone
One more, go to "loc_37488:" and you should see this:
loc_37488:
bsr.w loc_3750C
moveq #$10,d0
add.w d0,x_vel(a0)
subq.b #1,objoff_2A(a0)
bmi.s loc_374A0
bsr.w JmpTo26_ObjectMove
bra.w JmpTo39_MarkObjGone
Again, "branch to subroutine - loc_3750C" is too early. So change it to this:
loc_37488:
moveq #$10,d0
add.w d0,x_vel(a0)
subq.b #1,objoff_2A(a0)
bmi.s loc_374A0
bsr.w loc_3750C ; Now moved here to fix Rexon crash
bsr.w JmpTo26_ObjectMove
bra.w JmpTo39_MarkObjGone
Done! The rexon crash will no longer happen.
|Fix Rexon crash]]