Actions

SCHG How-to

Difference between revisions of "Fix the EHZ Deformation bug"

From Sonic Retro

(Fixing placement of added lines)
m (Text replacement - "\[\[Category:SCHG How-tos.*" to "")
(5 intermediate revisions by 3 users not shown)
Line 7: Line 7:
  
 
To fix this, go to '''SwScrl_EHZ:'''. Scroll down until you see '''SwScrl_RippleData:'''. Above it you should have this piece of code:
 
To fix this, go to '''SwScrl_EHZ:'''. Scroll down until you see '''SwScrl_RippleData:'''. Above it you should have this piece of code:
<asm> move.w #($B4)/12-1,d1 ; $B4 bytes
+
<syntaxhighlight lang="asm"> move.w #($B4)/12-1,d1 ; $B4 bytes
 
- move.w d4,(a1)+
 
- move.w d4,(a1)+
 
move.w d3,(a1)+
 
move.w d3,(a1)+
Line 21: Line 21:
 
dbf d1,-
 
dbf d1,-
  
rts</asm>
+
rts</syntaxhighlight>
 
Copy and paste this code twice into it:
 
Copy and paste this code twice into it:
<asm> move.w d4,(a1)+
+
<syntaxhighlight lang="asm"> move.w d4,(a1)+
move.w d3,(a1)+</asm>
+
move.w d3,(a1)+</syntaxhighlight>
 
In the end it should look like this:
 
In the end it should look like this:
<asm> move.w #($B4)/12-1,d1 ; $B4 bytes
+
<syntaxhighlight lang="asm"> move.w #($B4)/12-1,d1 ; $B4 bytes
 
- move.w d4,(a1)+
 
- move.w d4,(a1)+
 
move.w d3,(a1)+
 
move.w d3,(a1)+
Line 44: Line 44:
 
move.w d3,(a1)+
 
move.w d3,(a1)+
  
rts</asm>
+
rts</syntaxhighlight>
 
 
 
And that's it! Now it should look fixed:
 
And that's it! Now it should look fixed:
Line 50: Line 50:
 
[[File:S2-EHZ-Deform-Fixed.png|500px]]
 
[[File:S2-EHZ-Deform-Fixed.png|500px]]
  
[[Category:SCHG How-tos|Fix the EHZ Deformation bug]]
+
==Sonic 2 Beta==
 +
This bug can also be fixed in the Sonic 2 Beta.
 +
 
 +
Just replace the code with this:
 +
 
 +
<syntaxhighlight lang="asm">
 +
move.w d4,(a1)+
 +
move.w d3,(a1)+
 +
move.w d4,(a1)+
 +
move.w d3,(a1)+
 +
move.w d4,(a1)+
 +
move.w d3,(a1)+
 +
swap d3
 +
add.l d0,d3
 +
add.l d0,d3
 +
add.l d0,d3
 +
swap d3
 +
dbf d1,loc_61B2
 +
move.w d4,(a1)+
 +
move.w d3,(a1)+
 +
move.w d4,(a1)+
 +
move.w d3,(a1)+
 +
 
 +
rts
 +
</syntaxhighlight>
 +
 
 +
 
 +
{{S2Howtos}}
 +
|Fix the EHZ Deformation bug]]

Revision as of 11:11, 25 August 2018

(Original guide by qiuu)

In Sonic 2 is in EHZ a small deformation bug, the lowest two layers don't scroll as they are not affected by the deformation code:

S2-EHZ-Deform-Bug.png


To fix this, go to SwScrl_EHZ:. Scroll down until you see SwScrl_RippleData:. Above it you should have this piece of code:

	move.w	#($B4)/12-1,d1 ; $B4 bytes
-	move.w	d4,(a1)+
	move.w	d3,(a1)+
	move.w	d4,(a1)+
	move.w	d3,(a1)+
	move.w	d4,(a1)+
	move.w	d3,(a1)+
	swap	d3
	add.l	d0,d3
	add.l	d0,d3
	add.l	d0,d3
	swap	d3
	dbf	d1,-

	rts

Copy and paste this code twice into it:

	move.w	d4,(a1)+
	move.w	d3,(a1)+

In the end it should look like this:

	move.w	#($B4)/12-1,d1 ; $B4 bytes
-	move.w	d4,(a1)+
	move.w	d3,(a1)+
	move.w	d4,(a1)+
	move.w	d3,(a1)+
	move.w	d4,(a1)+
	move.w	d3,(a1)+
	swap	d3
	add.l	d0,d3
	add.l	d0,d3
	add.l	d0,d3
	swap	d3
	dbf	d1,-
	move.w	d4,(a1)+
	move.w	d3,(a1)+
	move.w	d4,(a1)+
	move.w	d3,(a1)+

	rts

And that's it! Now it should look fixed:

S2-EHZ-Deform-Fixed.png

Sonic 2 Beta

This bug can also be fixed in the Sonic 2 Beta.

Just replace the code with this:

	move.w	d4,(a1)+
	move.w	d3,(a1)+
	move.w	d4,(a1)+
	move.w	d3,(a1)+
	move.w	d4,(a1)+
	move.w	d3,(a1)+
	swap	d3
	add.l	d0,d3
	add.l	d0,d3
	add.l	d0,d3
	swap	d3
	dbf	d1,loc_61B2
	move.w	d4,(a1)+
	move.w	d3,(a1)+
	move.w	d4,(a1)+
	move.w	d3,(a1)+

	rts


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

|Fix the EHZ Deformation bug]]