Sonic 2, Super Sonic rotatting palette

Discussion in 'Discussion and Q&A Archive' started by Unspoken, Jun 17, 2008.

Thread Status:
Not open for further replies.
  1. Unspoken

    Unspoken Well-Known Member Member

    Joined:
    Aug 10, 2007
    Messages:
    64
    For my hack I need a rotatting palette for player 2's super form but there where a few diferences between Sonic 2 and Sonic 3-K, based on Shobiz's help and his labeling of S3K's I decided to label Sonic's


    ; Subroutine to handle Super forms cycling palettes


    ; ---------------------------------------------------------------------------


    ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦


    ; sub_213E:


    PalCycle_SuperSonic:


    move.b (SuperPal_flag).w,d0


    beq.s return_2186


    bmi.w PalCycle_SuperSonic_Normal


    subq.b #1,d0


    bne.s PalCycle_Super_Revert


    ; transformation palette


    subq.b #1,(SuperPal_frame_count).w


    bpl.s return_2186


    move.b #3,(SuperPal_frame_count).w


    lea (Pal_2246).l,a0


    move.w (SuperPal_colour_index).w,d0


    addq.w #8,(SuperPal_colour_index).w


    cmpi.w #$30,(SuperPal_colour_index).w


    bcs.s loc_217A


    move.b #-1,(SuperPal_flag).w


    move.b #0,(MainCharacter+obj_control).w


    loc_217A:


    lea (Normal_palette+4).w,a1


    move.l (a0,d0.w),(a1)+


    move.w 4(a0,d0.w),(a1)


    return_2186:


    rts


    ; ===========================================================================


    loc_2188


    PalCycle_Super_Revert:


    subq.b #1,(SuperPal_frame_count).w


    bpl.s return_2186


    move.b #3,(SuperPal_frame_count).w


    lea (Pal_2246).l,a0


    move.w (SuperPal_colour_index).w,d0


    subq.w #8,(SuperPal_colour_index).w


    bcc.s PalCycle_Super_Revert_Underwater


    move.b #0,(SuperPal_colour_index).w


    move.b #0,(SuperPal_flag).w


    loc_21B0


    PalCycle_Super_Revert_Underwater:


    lea (Normal_palette+4).w,a1


    move.l (a0,d0.w),(a1)+


    move.w 4(a0,d0.w),(a1)


    lea (Pal_22C6).l,a0 ; Super Sonic in Chemicals in CPZ PAL


    cmpi.b #$D,(Current_Zone).w ; are we in CPZ?


    beq.s loc_21D8 ; if yes branch


    cmpi.b #$F,(Current_Zone).w ; are we in ARZ?


    bne.s return_2186 ; if yes branch


    lea (Pal_2346).l,a0 ; Super Sonic underwater in ARZ PAL


    loc_21D8:


    lea (Underwater_palette+4).w,a1


    move.l (a0,d0.w),(a1)+


    move.w 4(a0,d0.w),(a1)


    rts


    ; ===========================================================================


    loc_21E6


    PalCycle_SuperSonic_Normal:


    subq.b #1,(SuperPal_frame_count).w


    bpl.s return_2186


    move.b #6,(SuperPal_frame_count).w


    lea (Pal_2246).l,a0


    move.w (SuperPal_colour_index).w,d0


    addq.w #6,(SuperPal_colour_index).w


    cmpi.w #$36,(SuperPal_colour_index).w


    bcs.s PalCycle_Super_SetColours


    move.w #$24,(SuperPal_colour_index).w


    loc_220E


    PalCycle_Super_SetColours:


    lea (Normal_palette+4).w,a1


    move.l (a0,d0.w),(a1)+


    move.w 4(a0,d0.w),(a1)


    lea (Pal_22C6).l,a0 ; Super Sonic in Chemicals in CPZ PAL


    cmpi.b #$D,(Current_Zone).w ; are we in CPZ?


    beq.s loc_2238 ; if yes branch


    cmpi.b #$F,(Current_Zone).w ; are we in ARZ?


    bne.w return_2186 ; if yes branch


    lea (Pal_2346).l,a0 ; Super Sonic underwater in ARZ PAL


    loc_2238:


    lea (Underwater_palette+4).w,a1


    move.l (a0,d0.w),(a1)+


    move.w 4(a0,d0.w),(a1)


    rts


    ; End of function PalCycle_SuperSonic


    Any errors let me know. you can also download the file.

    s2palcycle.txt
     

    Attached Files:

    Last edited by a moderator: Jun 24, 2008
  2. GrandMasterGalvatron

    GrandMasterGalvatron Let's get Legendary Member

    Joined:
    Aug 14, 2007
    Messages:
    53
    Location:
    Hampton, Virginia
    Got a question, been trying to understand this for a while. Is the Super Palette frame count a new flag, or something already called before.
     
  3. shobiz

    shobiz Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    198
    Location:
    Karachi, Pakistan
    Everything seems fine as far as I can tell. Sorry for not replying to your PM earlier, I've been quite busy with RL stuff.

    It's set in the transformation routine, and all it does is functions as a frame counter for when the next colour in the rotating palette should be loaded.
     
  4. GrandMasterGalvatron

    GrandMasterGalvatron Let's get Legendary Member

    Joined:
    Aug 14, 2007
    Messages:
    53
    Location:
    Hampton, Virginia
    You have this several times in there. Should be "ARZ"

    Are those seen anywhere else in the game?
     
  5. Unspoken

    Unspoken Well-Known Member Member

    Joined:
    Aug 10, 2007
    Messages:
    64
    Fixed to ARZ,


    loc_269E has lea (Normal_palette+4).w,a1


    which is part of PalCycle_Sega.


    I can't find, lea (Underwater_palette+4).w,a1 anywhere else.
     
Thread Status:
Not open for further replies.