Difference between revisions of "Fix the EHZ Deformation bug"
From Sonic Retro
(Fixing placement of added lines) |
|||
(6 intermediate revisions by 4 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</ | + | 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)+</ | + | 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</ | + | 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]] | ||
− | + | ==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}} | ||
+ | {{S2NAHowtos}} | ||
+ | {{S2BHowtos}} | ||
+ | |Fix the EHZ Deformation bug]] |
Latest revision as of 05:41, 26 June 2023
(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:
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:
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 2 Nick Arcade (16-bit) |
---|
Fixing Bugs |
Fix EHZ Deformation Bug |
Design Choices |
Add final spindash to Sonic 2 Beta | How to port paralax plouds to the Nick Arcade prototype |
SCHG How-To Guide: Sonic 2 Beta (16-bit) |
---|
Fixing Bugs |
Fix EHZ Deformation Bug |
Design Choices |
Add final spindash to Sonic 2 Beta |
|Fix the EHZ Deformation bug]]