SCHG How-to

Add final spindash to Sonic 2 Beta

From Sonic Retro

Hello everyone, Shadow05 here. Have you ever been playing a Sonic 2 Beta and have been annoyed about the incomplete spindash? Well, this guide is for people who can do basic asm editing! This guide was inspired by the Sonic 1 spindash guide. I will be using the Super Egg disassembly, but this should work on the original Esrael disassembly.

Directly copying the object code

First we'll have to get a slightly modified version of the Sonic 1 Spindash code.

Replace the entire routine with this:

		tst.b	$39(a0)
		bne.s	loc_1AC8E
		cmpi.b	#8,$1C(a0)
		bne.s	locret_1AC8C
		move.b	($FFFFF603).w,d0
		andi.b	#$70,d0
		beq.w	locret_1AC8C
		move.b	#9,$1C(a0)
		move.w	#$E0,d0
                jsr     (Play_Sfx)
		addq.l	#4,sp
		move.b	#1,$39(a0)
		move.w	#0,$3A(a0)
		cmpi.b	#$C,$28(a0)
		bcs.s	loc_1AC84
		move.b	#2,($FFFFD11C).w
; ---------------------------------------------------------------------------

		move.b	($FFFFF602).w,d0
		btst	#1,d0
		bne.w	loc_1AD30
		move.b	#$E,$16(a0)
		move.b	#7,$17(a0)
		move.b	#2,$1C(a0)
		addq.w	#5,$C(a0)
		move.b	#0,$39(a0)
		moveq	#0,d0
		move.b	$3A(a0),d0
		add.w	d0,d0
		move.w	Dash_Speeds(pc,d0.w),$14(a0)
		move.w	$14(a0),d0
		subi.w	#$800,d0
		add.w	d0,d0
		andi.w	#$1F00,d0
		neg.w	d0
		addi.w	#$2000,d0
		move.w	d0,($FFFFEED0).w
		btst	#0,$22(a0)
		beq.s	loc_1ACF4
		neg.w	$14(a0)

		bset	#2,$22(a0)
		move.b	#0,($FFFFD11C).w
		move.w	#$BC,d0
		jsr     (Play_Sfx)
		bra.s	loc_1AD78
; ===========================================================================
Dash_Speeds:	dc.w  $800		; 0
		dc.w  $880		; 1
		dc.w  $900		; 2
		dc.w  $980		; 3
		dc.w  $A00		; 4
		dc.w  $A80		; 5
		dc.w  $B00		; 6
		dc.w  $B80		; 7
		dc.w  $C00		; 8
; ===========================================================================

loc_1AD30:				; If still charging the dash...
		tst.w	$3A(a0)
		beq.s	loc_1AD48
		move.w	$3A(a0),d0
		lsr.w	#5,d0
		sub.w	d0,$3A(a0)
		bcc.s	loc_1AD48
		move.w	#0,$3A(a0)

		move.b	($FFFFF603).w,d0
		andi.b	#$70,d0	; 'p'
		beq.w	loc_1AD78
		move.w	#$900,$1C(a0)
		move.w	#$E0,d0  ; changed from #$E0
                jsr     (Play_Sfx)
		addi.w	#$200,$3A(a0)
		cmpi.w	#$800,$3A(a0)
		bcs.s	loc_1AD78
		move.w	#$800,$3A(a0)

		addq.l	#4,sp
		cmpi.w	#$60,($FFFFEED8).w
		beq.s	loc_1AD8C
		bcc.s	loc_1AD88
		addq.w	#4,($FFFFEED8).w

		subq.w	#2,($FFFFEED8).w

; End of subroutine Sonic_SpinDash

Fixing an error

When you get to building it, you most likely will have an error. To fix the error, go to line 25863.

        bra     loc_FBF4

See this line? Delete it!

If you are doing this on the Nick Arcade text disassembly, the error won't happen.

Also if I was doing a part 2, a lot of steps for the Nick Arcade disassembly would be the same as in the Sonic 1 tutorial for adding the Spindash like fixing the Monitor Bug, and adding the sound.

Thank you for reading this guide, and hopefully you'll be less annoyed by the incomplete spindash.

SCHG How-To Guide: Sonic 2 Beta (16-bit)
Design Choices
Add final spindash to Sonic 2 Beta | SCHG How-to:How to port paralax plouds to the Nick Arcade prototype

SCHG How-To Guide: Sonic the Hedgehog 2 (16-bit)
Fixing Bugs
Fix Demo Playback | Fix a Race Condition with Pattern Load Cues | Fix Super Sonic Bugs | Use Correct Height When Roll Jumping | Fix Jump Height Bug When Exiting Water | Fix Screen Boundary Spin Dash Bug | Correct Drowning Bugs | Fix Camera Y Position for Tails | Fix Tails Subanimation Error | Fix Tails' Respawn Speeds | Fix Accidental Deletion of Scattered Rings | Fix Ring Timers | Fix Rexon Crash | Fix Monitor Collision Bug | Fix EHZ Deformation Bug | Correct CPZ Boss Attack Behavior | Fix Bug in ARZ Boss Arrow's Platform Behavior | Fix ARZ Boss Walking on Air Glitch | Fix ARZ Boss Sprite Behavior | Fix Multiple CNZ Boss Bugs | Fix HTZ Background Scrolling Mountains | Fix OOZ Launcher Speed Up Glitch | Fix DEZ Giant Mech Collision Glitch | Fix Boss Deconstruction Behavior | Fix Speed Bugs | Fix 14 Continues Cheat | Fix Debug Mode Crash | Fix 99+ Lives | Fix Sonic 2's Sega Screen
Design Choices
Remove the Air Speed Cap | Disable Floor Collision While Dying | Modify Super Sonic Transformation Methods & Behavior | Enable/Disable Tails in Certain Levels | Collide with Water After Being Hurt | Retain Rings When Returning at a Star Post | Improve the Fade In\Fade Out Progression Routines | Fix Scattered Rings' Underwater Physics | Insert LZ Water Ripple Effect | Restore Lost CPZ Boss Feature | Prevent SCZ Tornado Spin Dash Death | Improve ObjectMove Subroutines | Port S3K Rings Manager | Port S3K Object Manager | Port S3K Priority Manager | Edit Level Order with ASM‎ | Alter Ring Requirements in Special Stages | Make Special Stage Characters Use Normal DPLCs | Speed Up Ring Loss Process | Change spike behaviour in Sonic 2
Adding Features
Create Insta-kill and High Jump Monitors | Create Clone and Special Stage Monitors | Port Knuckles
Sound Features
Expand Music Index to Start at $00 | Port Sonic 1 Sound Driver | Port Sonic 2 Clone Driver | Port Sonic 3 Sound Driver | Port Flamewing's Sonic 3 & Knuckles Sound Driver | Expand the Music Index to Start at $00 (Sonic 2 Clone Driver Version) | Play Different Songs Per Act
Extending the Game
Extend the Level Index Past $10 | Extend the Level Select | Extend Water Tables | Add Extra Characters | Free Up 2 Universal SSTs