Smooth Rotation in Special Stages
From Sonic Retro
Revision as of 10:22, 11 June 2022 by XPointZPoint (talk | contribs)
Revision as of 10:22, 11 June 2022 by XPointZPoint (talk | contribs)
You may have seen a game genie code online to make the special stage's rotation much smoother. But how do you do that in ASM for your ROM hack? I'll show you. It's really simple.
The fix
This targets the hivebrain disassembly. The Github disassembly has the exact same steps so it can apply there too. Open up sonic1.asm (sonic.asm for Git) and find SS_ShowLayout. Replace everything from their to move.w #$F,d7 with this:
SS_ShowLayout: ; XREF: SpecialStage
bsr.w SS_AniWallsRings
bsr.w SS_AniItems
move.w d5,-(sp)
lea ($FFFF8000).w,a1
move.b ($FFFFF780).w,d0
jsr (CalcSine).l
move.w d0,d4
move.w d1,d5
muls.w #$18,d4
muls.w #$18,d5
moveq #0,d2
move.w ($FFFFF700).w,d2
divu.w #$18,d2
swap d2
neg.w d2
addi.w #-$B4,d2
moveq #0,d3
move.w ($FFFFF704).w,d3
divu.w #$18,d3
swap d3
neg.w d3
addi.w #-$B4,d3
move.w #$F,d7
Written by XPointZPoint