don't click here

How to port animations from Sonic 2 Nick Arcade to Sonic 1?

Discussion in 'Engineering & Reverse Engineering' started by Puto, Dec 22, 2006.

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

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    I ported Sonic's art, mappings, and dynamic PLCs from Sonic 2 Nick Arcade to Sonic 1. However, if I try a plain copy-paste of the S2NA Animations on Sonic 1, the animations use the wrong sprites. Can anyone please tell me how I can fix this?
     
  2. Stealth

    Stealth

    Tech Member
    594
    30
    28
    Sonic Mania, HCGE, Sonic Megamix, SonED2, [...]
    If all of the data was replaced correctly, you still need to correct the animation routine to choose the correct sprites for the walking/running animations. The animation data only contains data for the flat surface versions, and part of that routine manipulates those values to get the angled versions. The Sonic 1 routine will create the wrong frame ID values because Sonic 2 uses more walking frames
     
  3. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    Those aren't the only ones that are broken. Practically every single animation is using the wrong sprites, with things such as wall recoil sprites in the middle of running.
     
  4. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    Also, apparently, for whatever reason, the game doesn't read any sprite with a value above $80.
     
  5. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    General rule of frames: if one is broken somehow, chances are it will break the rest unless you're very clever.

    Fix the walking and running animations (it's a simple case of dropping in the code for SAnim_WalkRun in S2NA) and I have a feeling the others will fix themselves.
     
  6. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    Not without fixing the $80 thing though.
     
  7. jman2050

    jman2050

    Teh Sonik Haker Tech Member
    634
    4
    18
    The $80 thing is simple. At loc_D700 there's an add.b d1,d1 statement. Obviously, the designers didn't intend for any more than 128 mappings for any given sprite, else they would've used add.w like they were supposed to. Change it to that and the $80 problem should go away.
     
  8. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,678
    0
    16
    Manchester, UK
    Quackshot Disassembly
    When I ported the Wai beta sprites to S1 for Megamix, I had to knock the first frame off the mappings set for Sonic. As soon as I did this and fixed the hardcoded animation data, it all worked out fine.
     
  9. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    No, that didn't work.
     
  10. jman2050

    jman2050

    Teh Sonik Haker Tech Member
    634
    4
    18
    Hmm, I said that because that was the fix I used when Cinossu had the same problem. Unless I'm forgetting something else...

    EDIT - Ah, excuse me. There was something else. At SAnim_Do2:

    Code (Text):
    1. moveq   #0,d1
    2. move.b  $1B(a0),d1; load current frame number
    3. move.b  1(a1,d1.w),d0; read sprite number from script
    4. bmi.s   SAnim_End_FF; if animation is complete, branch
    Similar code in S2 looks like this.

    Code (Text):
    1. moveq   #0,d1
    2. move.b  $1B(a0),d1
    3. move.b  1(a1,d1.w),d0
    4. cmpi.b  #$F0,d0
    5. bcc.s   loc_1B3C4
    As yuou can see, in S1, any sprite number above $80 will end the animation. In s2, that number was increased further. I imagine the limit in S3 was increased also.
     
  11. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    <!--quoteo(post=155960:date=Dec 22 2006, 08:18 AM:name=Quickman)--><div class='quotetop'>QUOTE (Quickman @ Dec 22 2006, 08:18 AM) [​IMG]
     
  12. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    Anybody else has any idea on how to fix the angle problem? (Now I'm trying to port Tails instead, and from S2F, but the general idea remains)
     
  13. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    I seem to recall I had the same problem with Sonic's walking/running animations. The problem was I'd ported too much code from SAnim_WalkRun and it was reading too many sprites for the animation.
     
  14. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    And the fix for that would be...?
     
  15. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    Well, considering I wasn't porting anything from Nick Arcade my solution was to put back some of the original code. =P
     
Thread Status:
Not open for further replies.