Actions

SCHG How-to

Difference between revisions of "Fix the EHZ Deformation bug"

From Sonic Retro

(Created page with '{{GuideBy|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: [[File:S2-EHZ-Deform-Bug…')
 
(Fixing placement of added lines)
Line 28: Line 28:
 
<asm> move.w #($B4)/12-1,d1 ; $B4 bytes
 
<asm> move.w #($B4)/12-1,d1 ; $B4 bytes
 
- move.w d4,(a1)+
 
- move.w d4,(a1)+
move.w d3,(a1)+
 
move.w d4,(a1)+
 
move.w d3,(a1)+
 
move.w d4,(a1)+
 
 
move.w d3,(a1)+
 
move.w d3,(a1)+
 
move.w d4,(a1)+
 
move.w d4,(a1)+
Line 43: Line 39:
 
swap d3
 
swap d3
 
dbf d1,-
 
dbf d1,-
 +
move.w d4,(a1)+
 +
move.w d3,(a1)+
 +
move.w d4,(a1)+
 +
move.w d3,(a1)+
  
 
rts</asm>
 
rts</asm>

Revision as of 11:17, 26 May 2010

(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: <asm> 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</asm> Copy and paste this code twice into it: <asm> move.w d4,(a1)+ move.w d3,(a1)+</asm> In the end it should look like this: <asm> 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</asm>

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

S2-EHZ-Deform-Fixed.png