Actions

SCHG How-to

How to port paralax plouds to the Nick Arcade prototype

From Sonic Retro

Revision as of 04:34, 26 June 2023 by JGMR (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

(Original guide by Shadow05)

In this short guide, I'm going to show you how to port the parallax scrolling clouds in Hill Top Zone to the Nick Arcade prototype.

First of all, get the Sonic 2 Nick Arcade disassembly (text or split) and the Neto Esrael Assembler and then replace everything from Deform_HTZ: to the end of loc_63CC: with this.

Deform_HTZ:				; DATA XREF: ROM:Deform_Index�o 
        tst.w   ($FFFFFFD8).w
        bne     loc_62B4
        tst.b   ($FFFFEEBC).w
        bne     loc_6236
        move.w  ($FFFFEE0C).w,($FFFFF618).w
        lea     ($FFFFE000).w,a1
        move.w  ($FFFFEE00).w,d0
        neg.w   d0
        move.w  d0,d2
        swap.w  d0
        move.w  d2,d0
        asr.w   #$3,d0
        move.w  #$7F,d1
loc_6134:
        move.l  d0,(a1)+
        dbra    d1, loc_6134
        move.l  d0,d4
        move.w  ($FFFFA822).w,d0
        addq.w  #$4,($FFFFA822).w
        sub.w   d0,d2
        move.w  d2,d0
        move.w  d0,d1
        asr.w   #$1,d0
        asr.w   #$4,d1
        sub.w   d1,d0
        ext.l   d0
        asl.l   #$8,d0
        divs.w  #$70,d0
        ext.l   d0
        asl.l   #$8,d0
        lea     ($FFFFA800).w,a2
        moveq	#0,d3
        move.w  d1,d3
        swap.w  d3
        add.l   d0,d3
        swap.w  d3
        move.w  d3,(a2)+
        swap.w  d3
        add.l   d0,d3
        swap.w  d3
        move.w  d3,(a2)+
        swap.w  d3
        add.l   d0,d3
        swap.w  d3
        move.w  d3,(a2)+
        move.w  d3,(a2)+
        swap.w  d3
        add.l   d0,d3
        add.l   d0,d3
        swap.w  d3
        moveq   #$3,d1

loc_642C:				; CODE XREF: ROM:0000642E�j
        move.w  d3,(a2)+
        move.w  d3,(a2)+
        move.w  d3,(a2)+
        swap.w  d3
        add.l   d0,d3
        add.l   d0,d3
        add.l   d0,d3
        swap.w  d3
        dbra    d1, loc_642C
        add.l   d0,d0
        add.l   d0,d0
        move.w  d3,d4
        move.l  d4,(a1)+
        move.l  d4,(a1)+
        move.l  d4,(a1)+
        swap.w  d3
        add.l   d0,d3
        swap.w  d3
        move.w  d3,d4
        move.l  d4,(a1)+
        move.l  d4,(a1)+
        move.l  d4,(a1)+
        move.l  d4,(a1)+
        move.l  d4,(a1)+
        swap.w  d3
        add.l   d0,d3
        swap.w  d3
        move.w  d3,d4
        move.w  #$6,d1

loc_61C6:
        move.l  d4,(a1)+
        dbra    d1, loc_61C6
        swap.w  d3
        add.l   d0,d3
        add.l   d0,d3
        swap.w  d3
        move.w  d3,d4
        move.w  #$7,d1

loc_61DA:
        move.l  d4,(a1)+
        dbra    d1, loc_61DA
        swap.w  d3
        add.l   d0,d3
        add.l   d0,d3
        swap.w  d3
        move.w  d3,d4
        move.w  #$9,d1

loc_61EE:
        move.l  d4,(a1)+
        dbra    d1, loc_61EE
        swap.w  d3
        add.l   d0,d3
        add.l   d0,d3
        add.l   d0,d3
        swap.w  d3
        move.w  d3,d4
        move.w  #$E,d1

loc_6204:
        move.l  d4,(a1)+
        dbra    d1, loc_6204
        swap.w  d3
        add.l   d0,d3
        add.l   d0,d3
        add.l   d0,d3
        swap.w  d3
        move.w  #$2,d2

loc_6218:
        move.w  d3,d4
        move.w  #$F,d1

loc_621E:
        move.l  d4,(a1)+
        dbra    d1, loc_621E
        swap.w  d3
        add.l   d0,d3
        add.l   d0,d3
        add.l   d0,d3
        add.l   d0,d3
        swap.w  d3
        dbra    d2, loc_6218 
        rts
        loc_6236:
        move.w  ($FFFFEEB4).w,d4
        ext.l   d4
        lsl.l   #$8,d4
        moveq   #$2,d6
        move.w  ($FFFFEEB6).w,d5
        ext.l   d5
        lsl.l   #$8,d5
        moveq	#0,d6
        move.w  ($FFFFEE0C).w,($FFFFF618).w
        move.w  ($FFFFEE04).w,($FFFFF616).w
        move.w  ($FFFFEE0C).w,($FFFFF618).w
        moveq	#0,d2
        tst.b   ($FFFFEEBD).w
        beq.s   loc_6292
        move.w  ($FFFFFE04).w,d0
        andi.w  #$3F,d0
 
        lea     $00(a1,d0), a1
        moveq	#0,d0
        move.b  (a1)+, d0
        add.w   d0,($FFFFF616).w
        add.w   d0,($FFFFF618).w
        add.w   d0,($FFFFEEF4).w
        move.b  (a1)+,d2
        add.w   d2,($FFFFEEF0).w
loc_6292:
        lea     ($FFFFE000).w,a1
        move.w  #$DF,d1
        move.w  ($FFFFEE00).w,d0
        add.w   d2,d0
        neg.w   d0
        swap.w  d0
        move.w  ($FFFFEE08).w,d0
        add.w   d2,d0
        neg.w   d0
loc_62AB:
        move.l  d0,(a1)+
        dbra    d1, loc_62AB
        rts
        
loc_62B4:
        move.w  ($FFFFEEB0).w,d4
        ext.l   d4
        asl.l   #$6,d4
        move.w  ($FFFFEEB2).w,d5
        ext.l   d5
        asl.l   #$2,d5
        moveq	#0,d5
        move.b  #$00,($FFFFEE52).w
        move.w  ($FFFFEE0C).w,($FFFFF618).w
        andi.l  #$FFFEFFFE,($FFFFF616).w
        lea     ($FFFFE000).w,a1
        move.w  #$6F,d1
        move.w  ($FFFFEE00).w,d0
        neg.w   d0
        swap.w  d0
        move.w  ($FFFFEE08).w,d0
        neg.w   d0
        
loc_62F4:
        move.l  d0,(a1)+
        dbra    d1, loc_62F4
        move.w  ($FFFFEEB8).w,d4
        ext.l   d4
        asl.l   #$6,d4
        add.l   d4,($FFFFEE28).w
        moveq	#0,d0
        move.w  d0,($FFFFF620).w
        subi.w  #$E0,($FFFFF620).w
        move.w  ($FFFFEE24).w,($FFFFF61E).w
        subi.w  #$E0,($FFFFF61E).w
        andi.l  #$FFFEFFFE,($FFFFF61E).w
        lea     ($FFFFE1B0).w,a1
        move.w  #$73,d1
        move.w  ($FFFFEE20).w,d0
        neg.w   d0
        swap.w  d0
        move.w  ($FFFFEE28).w,d0
        neg.w   d0
        
loc_633C:
        move.l  d0,(a1)+
        dbra    d1, loc_633C
        rts

That's it! Now you have ported the parallax scrolling clouds in Hill Top Zone to the Sonic 2 Nick Arcade prototype!

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