Restore the Beta Victory Animation
From Sonic Retro
Revision as of 21:29, 24 July 2020 by Pmowery
In Sonic 1 pre-release screenshots, it was shown that Sonic used to have a victory animation at the end of the level, in which he would pump his fist.
However, in the final game it got scrapped, most likely due to the animation looking similar to the way a certain rival character jumped. Thankfully, the victory can be restored quite easily.
Step 1: Modifying the Signpost
Most of the work will be done in the signpost, as it handles most of the code when it comes to the end of the act.
First, go to Obj0D_Index and find:
This points to a routine that forces Sonic off screen after the signpost has finished spinning. However, that's not what we want. Sonic needs to stay on screen so he can jump around. So, replace this line with:
This will make it so instead of forcing Sonic off screen once the signpost has finished spinning, the tally will simply pop up, instead of waiting for Sonic to leave.
Now, you can go to Obj0D_SonicRun, and delete, or comment out all of this:
Obj0D_SonicRun: ; XREF: Obj0D_Index tst.w ($FFFFFE08).w ; is debug mode on? bne.w locret_ECEE ; if yes, branch btst #1,($FFFFD022).w bne.s loc_EC70 move.b #1,($FFFFF7CC).w ; lock controls move.w #$800,($FFFFF602).w ; make Sonic run to the right loc_EC70: tst.b ($FFFFD000).w beq.s loc_EC86 move.w ($FFFFD008).w,d0 move.w ($FFFFF72A).w,d1 addi.w #$128,d1 cmp.w d1,d0 bcs.s locret_ECEE loc_EC86: addq.b #2,$24(a0)
If you were to build the ROM now, after completing a level, Sonic can stay on screen while the results count down. However, Sonic can still run off the right of the screen. While it's not a major issue, it's inconsistent with the fact that you can't run off the left of the screen. And the lack of a right side lock was meant to be there so Sonic could run off screen as he does in the original game, and we're removing that functionality, so it only makes sense to add a right side lock.
Go to the label Obj0D_Touch and just under:
bcs.s locret_EBBA cmpi.w #$20,d0 ; is Sonic within $20 pixels of the signpost? bcc.s locret_EBBA ; if not, branch
Place down this command:
move.b #1,($FFFFF7AA).w ; Lock the screen
Both sides of the screen will now lock once you reach the end of the level.
Now for the final step, setting up the animation.
Just under the GotThroughAct label, place this:
move.b #1,($FFFFF5C0).w ; Set victory animation flag
This is a new flag for the victory animation. It should be noted that it uses an unused RAM address, so feel free to modify it to whatever RAM address you need.
However, as is, the flag will always be set after you complete a level. Meaning after finishing, say Green Hill Zone Act 1, in Act 2, Sonic would continue to be pumping his fist. To fix this, go to Level_ClrVars3 and above the check for Labyrinth Zone, clear ($FFFFF5C0).w or whatever RAM address you chose.
Step 2: Making the Animation Work
This part is pretty short, thankfully. Simply go to Sonic_Jump and replace:
move.b #2,$1C(a0) ; use "jumping" animation
Result_Check: tst.b ($FFFFF5C0).w ; Has the victory animation flag been set? beq.s NormalJump ; If not, branch move.b #$13,$1C(a0) ; Play the victory animation bra.s cont ; Continue NormalJump: move.b #2,$1C(a0) ; use "jumping" animation cont:
The logic of this is as follows: If the victory flag has been set, play the victory animation when Sonic jumps, elsewise, use the normal animation in which Sonic curls into a ball.
If you followed the steps correctly, you should have something that resembles this: