Basic Questions and Answers Thread

Discussion in 'Discussion & Q&A' started by Malevolence, Jul 7, 2009.

  1. Greenknight9000

    Greenknight9000 Well-Known Member Member

    Joined:
    Apr 30, 2014
    Messages:
    53
    offsetTableEntry.w SupSonAni_Float ; 14 ; $E
    offsetTableEntry.w SupSonAni_Float2 ; 15 ; $F
    offsetTableEntry.w SonAni_Spring ; 16 ; $10
    offsetTableEntry.w SonAni_Hang ; 17 ; $11
    offsetTableEntry.w SonAni_Dash2 ; 18 ; $12
    offsetTableEntry.w SonAni_Dash3 ; 19 ; $13
    offsetTableEntry.w SonAni_Hang2 ; 20 ; $14
    offsetTableEntry.w SonAni_Bubble ; 21 ; $15
    offsetTableEntry.w SonAni_DeathBW ; 22 ; $16
    offsetTableEntry.w SonAni_Drown ; 23 ; $17
    offsetTableEntry.w SonAni_Death ; 24 ; $18
    offsetTableEntry.w SonAni_Hurt ; 25 ; $19
    offsetTableEntry.w SonAni_Hurt ; 26 ; $1A
    offsetTableEntry.w SonAni_Slide ; 27 ; $1B
    offsetTableEntry.w SonAni_Blank ; 28 ; $1C
    offsetTableEntry.w SonAni_Balance3 ; 29 ; $1D
    offsetTableEntry.w SonAni_Balance4 ; 30 ; $1E
    offsetTableEntry.w SupSonAni_Transform ; 31 ; $1F

    SupSonAni_Walk: dc.b $FF,$77,$78,$79,$7A,$7B,$7C,$75,$76,$FF
    rev02even
    SupSonAni_Run: dc.b $FF,$B5,$B9,$FF,$FF,$FF,$FF,$FF,$FF,$FF
    rev02even
    SupSonAni_Push: dc.b $FD,$BD,$BE,$BF,$C0,$FF,$FF,$FF,$FF,$FF
    rev02even
    SupSonAni_Stand: dc.b 7,$72,$73,$74,$73,$FF
    rev02even
    SupSonAni_Float: dc.b 7,$D6,$59,$FF
    rev02even
    SupSonAni_Float2: dc.b 7,$D6,$55,$56,$57,$58,$FF
    rev02even
    the $D6 is the Super Sonic fan-sprite (facing right)
    Even though I'm Super, It doesn't show - I feel like I missed something, yet I can't put my finger on it
     
  2. Clownacy

    Clownacy Well-Known Member Staff

    Joined:
    Aug 15, 2014
    Messages:
    890
    Er, what? Sonic Open Source Project? Is that the name of your hack or something? It's just, that name's already taken by another hack, which is pretty infamous for having a bunch of stolen content in it.
     
  3. Greenknight9000

    Greenknight9000 Well-Known Member Member

    Joined:
    Apr 30, 2014
    Messages:
    53
    I used STOSP as a practice rom of sorts I used for SonMapEd, It also allowed me to experiment the possibilities I could do with my newfound knowledge
     
  4. Greenknight9000

    Greenknight9000 Well-Known Member Member

    Joined:
    Apr 30, 2014
    Messages:
    53
    Good news, actually - EXTREMELY good news. I've nearly completed the hack I've always wanted, though I've realized that I can't find the corkscrew sprites for Sonic (can you guys tell me where that is in the SonAni section?)- I want to make sure the E V E R Y sprite Super Sonic shares has his own sprites - I wanna go the extra mile! I've used Sonic Mania Plus' sprites for Super Sonic
    Screenshots in the spoiler
    Hanging - [​IMG]
    Horizontal Hanging - [​IMG]
     
  5. Painto

    Painto Samodzierżca Najdłuższego Kija Member

    Joined:
    Mar 24, 2014
    Messages:
    315
    Location:
    Poland
    The part you're interested in it's at SAnim_Tumble: (or loc_1B520), more precisely the
    Code:
    addi.b    #$5F,d0
    parts (there are two, one when going to the right and the other when to the left).
     
  6. Greenknight9000

    Greenknight9000 Well-Known Member Member

    Joined:
    Apr 30, 2014
    Messages:
    53
    Right, how would I make a seperate version to make it work with Super Sonic?
     
  7. Painto

    Painto Samodzierżca Najdłuższego Kija Member

    Joined:
    Mar 24, 2014
    Messages:
    315
    Location:
    Poland
    That would be rather simple. Just under this line add a check for Super Sonic and if you're transformed add some more bytes so it picks up from the correct frame.
    In both cases you should replace that single line with this check, replacing the XX with mapping frame number of the first Super Sonic's sprite that's going to be used here.
    Code:
    
        addi.b    #$5F,d0        ; add $5F, so it picks up a correct regular Sonic frame
        tst.b    (Super_Sonic_flag).w    ; is Sonic super?
        beq.s    +        ; if not, we don't need to alter anything
        addi.b    #($XX-$5F),d0        ; if yes, we need to add some more so it uses Super's frames
    +
    
     
  8. Greenknight9000

    Greenknight9000 Well-Known Member Member

    Joined:
    Apr 30, 2014
    Messages:
    53
    I can't thank you enough, my dude
    You saved me
    I am so grateful, now to finish my job!
     
    Painto likes this.
  9. Greenknight9000

    Greenknight9000 Well-Known Member Member

    Joined:
    Apr 30, 2014
    Messages:
    53
    One last issue
    I'm one animation away from being finished, the problem arose when I did the looking up sprites, whenever Super Sonic looks up, his standing sprite freezes, I don't know what's wrong - but this last piece of help will be what's needed to finish the hack
    Code:
     
    SupSonAni_LookUp:   dc.b   5, $FC, $FA, $FE,  1
       rev02even
    
    [​IMG]
     
  10. Pacca

    Pacca Why succeed when you can profit off of failure? Member

    Joined:
    Jul 5, 2014
    Messages:
    1,149
    Location:
    Triton (Moon)
    You've added too many frames. $FA and $FC are both flags for ending an animation script, which causes this animation to end before it even starts. You'll need to replace some unused frames, and move your new ones over them. Sonic 2 has a couple, although if you added any frames you don't need, I'd suggest replacing those first.
     
  11. Ralakimus

    Ralakimus Sonic is a shit franchise :V Member

    Joined:
    Aug 26, 2013
    Messages:
    1,016
    Location:
    idk hell?
    One suggestion that you may want to consider is to split the Super Sonic art and mappings into their own files like Sonic 3 does to really reduce the risk of having too many frames.
     
  12. Greenknight9000

    Greenknight9000 Well-Known Member Member

    Joined:
    Apr 30, 2014
    Messages:
    53
    Damn, I only had the 2 looking up frames left
    ARGHH
    effort, why must thy curse me
     
  13. Greenknight9000

    Greenknight9000 Well-Known Member Member

    Joined:
    Apr 30, 2014
    Messages:
    53
    How do I do that?
     
  14. Ralakimus

    Ralakimus Sonic is a shit franchise :V Member

    Joined:
    Aug 26, 2013
    Messages:
    1,016
    Location:
    idk hell?
    For the files themselves, you just create new files that contain the Super Sonic frames.

    For the code, you can write the Super Sonic mappings address to mappings(a0) in the Sonic object. You'll want to go to the routine that changes Sonic into Super Sonic and swap the mappings there. Same thing for when Sonic goes back to normal.

    For the rest, that's handled in LoadSonicDynPLC.

    For the DPLCs, you'll want to add a check to load the correct DPLCs to where it loads "MapRUnc_Sonic" to a2.

    For the art, it'll be a little trickier, but not too difficult, I think. This line here
    Code:
    addi.l   #ArtUnc_Sonic,d1
    is what converts the DPLC offsets into the actual addresses of the art to load. What I suggest is around where it loads "MapRUnc_Sonic" into a2, you set the art address in a free data register and also load the Super Sonic art address within the check, and then in the "addi" instruction, change the "#ArtUnc_Sonic" into that data register (and also change the "addi" to "add", since you're no longer adding an immediate value).

    So, basically, something like:
    Code:
        lea   (MapRUnc_Sonic).l,a2
        move.l   #ArtUnc_Sonic,dN
        tst.b   (Super_Sonic_flag).w
        beq.w   +       ; branch if it isn't Super Sonic
        lea   (MapRUnc_SuperSonic).l,a2
        move.l   #ArtUnc_SuperSonic,dN
    
    +
    ................
        add.l   dN,d1
    
    With "dN" being your choice of a data register. Just find one that isn't used by this routine and you should be good.

    And a quick note, you can use that same basic check for setting the mappings when you do something like exit debug mode.
     
  15. Greenknight9000

    Greenknight9000 Well-Known Member Member

    Joined:
    Apr 30, 2014
    Messages:
    53
    It looks quite an intimidating task, if all else fails - I'll use that method
     
  16. Greenknight9000

    Greenknight9000 Well-Known Member Member

    Joined:
    Apr 30, 2014
    Messages:
    53
    The thing is, I only need to add 2 more sprites, and there isn't enough sprites to delete - I'm at a loss here, I just need a quick fix for now, and tidy things up afterwards
     
  17. Ralakimus

    Ralakimus Sonic is a shit franchise :V Member

    Joined:
    Aug 26, 2013
    Messages:
    1,016
    Location:
    idk hell?
    Unfortunately, if you are really out of sprites to remove, then splitting the art and mappings would be your best bet without having to overhaul the entire animation engine, as far as I know.
     
  18. Greenknight9000

    Greenknight9000 Well-Known Member Member

    Joined:
    Apr 30, 2014
    Messages:
    53
    BINGO!!
    I replace the unused vertical-hang sprites with the look-up sprites, it WORKED!!

    The hack is now complete!!
    What should I do now?
     
    RuthlessTheHooman and RyeBread like this.
  19. Pacca

    Pacca Why succeed when you can profit off of failure? Member

    Joined:
    Jul 5, 2014
    Messages:
    1,149
    Location:
    Triton (Moon)
    Release it the mini hack thread? That's what I'd do with it.
     
  20. Greenknight9000

    Greenknight9000 Well-Known Member Member

    Joined:
    Apr 30, 2014
    Messages:
    53
    Sounds good, though I'd like to make a few graphical improvements to Sonic himself, so there won't be any sprite-style anomalies