Actions

SCHG How-to

Restore the Beta Victory Animation

From Sonic Retro

Revision as of 08:19, 29 November 2019 by Iso Kilo (talk | contribs)

(Original guide by Iso Kilo) This tutorial is targeted towards Hivebrain's 2005 Sonic 1 disassembly

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. GD Sonic1 GHZ Act1End.jpg

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:

		dc.w Obj0D_SonicRun-Obj0D_Index

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:

		dc.w GotThroughAct-Obj0D_Index

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

With this:

Result_Check:
        tst.w   ($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:

Beta Victory Restored.png

SCHG How-To Guide: Sonic the Hedgehog (16-bit)
Fixing Bugs
Fix Demo Playback | Fix a Race Condition with Pattern Load Cues | Fix the SEGA Sound | Display the Press Start Button Text | Fix the Level Select Menu | Fix the Hidden Points Bug | Fix Accidental Deletion of Scattered Rings | Fix Ring Timers | Fix the Walk-Jump Bug | Correct Drowning Bugs | Fix the Death Boundary Bug | Fix the Camera Follow Bug | Fix Song Restoration Bugs | Fix the HUD Blinking | Fix the Level Select Graphics Bug | Fix a remember sprite related bug
Changing Design Choices
Change Spike Behavior | Collide with Water After Being Hurt | Fix Special Stage Jumping Physics | Improve the Fade In\Fade Out Progression Routines | Fix Scattered Rings' Underwater Physics | Remove the Speed Cap | Port the REV01 Background Effects | Port Sonic 2's Level Art Loader | Retain Rings Between Acts | Add Sonic 2 (Simon Wai Prototype) Level Select | Improve ObjectMove Subroutines | Port Sonic 2 Level Select
Adding Features
Add Spin Dash ( Part 1 / Part 2 / Part 3 / Part 4 ) | Add Eggman Monitor | Add Super Sonic | Add the Air Roll
Sound Features
Expand the Sound Index | Play Different Songs Per Act | Port Sonic 2 Final Sound Driver | Port Sonic 3's Sound Driver | Port Flamewing's Sonic 3 & Knuckles Sound Driver | Change The SEGA Sound
Extending the Game
Load Chunks From ROM | Add Extra Characters | Make an Alternative Title Screen | Use Dynamic Tilesets | Make GHZ Load Alternate Art | Make Ending Load Alternate Art | Add a New Zone | Set Up the Goggle Monitor | Add New Moves | Add a Dynamic Collision System | Dynamic Special Stage Walls System | Extend Sprite Mappings and Art Limit | Enigma Credits | Use Dynamic Palettes
Miscellaneous
Convert the Hivebrain 2005 Disassembly to ASM68K
Split Disassembly Guides
Set Up a Split Disassembly | Basic Level Editing | Basic Art Editing | Basic ASM Editing (Spin Dash)