don't click here

Basic Questions & Answers thread

Discussion in 'Engineering & Reverse Engineering' started by Tweaker, May 29, 2008.

  1. FeliciaVal

    FeliciaVal

    Member
    693
    11
    18
    Spain
    Yeah, I was trying to modify the line you mentioned in sonic1.asm but...for some reason...he turns invisible lol xD (I mean the
    Code (Text):
    1. move.b    #2,$1C(a0); use "jumping"    animation
    line, that's where he turns invisible and he drops down I see a random walking sprite)
    It must be that something is lacking on the _anim sonic.asm Im guessing...since it uses the #2 and I just wrote a $40 that was the spring jumping animation
    And thank you again :)
     
  2. nineko

    nineko

    I am the Holy Cat Tech Member
    6,316
    489
    63
    italy
    Just to be sure, you have to edit the #2, not the $1C.

    For the Spindash, the #2 becomes #$1F. But the $1C stays the same.
    I know it's kinda confusing, #2 should really be written as #$2 for consistency.


    EDIT: you don't write the frame number there. You write the animation number there. And there is no such thing as animation number #$40.
     
  3. FeliciaVal

    FeliciaVal

    Member
    693
    11
    18
    Spain
    oh yeah, I edited the #2, I replaced it with a #$40, because instead of a rolling jump I wanted a "spring" jump (if you have played E-122-Psi's hack Amy in Sonic 1, I wanted that kind of jump she does instead of the common rolling jump, I mean like her Sonic Advance jump) but failed miserably XDDD I think just writting a #$40 instead of a #2 is not enough...and sadly yet I don't have the ASM skills to program a jump like that, but at least I know how to implement animations now so I'm really grateful :)

    EDIT: yeah, my bad T.T I'm mistaking things, as I said I thought the #2 was a sprite and not an animation
     
  4. nineko

    nineko

    I am the Holy Cat Tech Member
    6,316
    489
    63
    italy
    To use that animation, you have to use
    Code (Text):
    1.         move.b    #$10,$1C(a1)
    This is because this line is the 17th line in the animation file:
    Code (Text):
    1.         dc.w SonAni_Spring-SonicAniData
    And 17-1 = 16 = $10
     
  5. FeliciaVal

    FeliciaVal

    Member
    693
    11
    18
    Spain
    oh I see it now, thank you very much! I was getting confused with this stuff, now all I have to make is the landing code and I'll be done with the jump
     
  6. E-122-Psi

    E-122-Psi

    Member
    2,470
    612
    93
    Hayate helped me with this one ('helped' as in basically made the entire code herself), you have to make a branch code within the the MdJump section (I usually put it just after Sonic_JumpHeight's code), something like this to recognise when the character reaches the height of her jump:

    Code (ASM):
    1. ; ---------------------------------------------------------------------------
    2. ; Subroutine for Sonic's landing animation
    3. ; ---------------------------------------------------------------------------
    4.  
    5. ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
    6.  
    7. Sonic_JumpLand:
    8.         cmpi.b  #$10,$1C(a0)        ; is Sonic in the jumping animation?               
    9.         bne.b   Sonic_JumpLand_Return   ; if not, return   
    10.         cmpi.w  #-$100,$12(a0)      ; has Sonic reached the peak of his jump?          
    11.         blt.b   Sonic_JumpLand_Return   ; if not, return   
    12.         move.b  #$21,$1C(a0)        ; use falling animation
    13.  
    14. Sonic_JumpLand_Return: 
    15.         rts
    16. ; End of function Sonic_JumpLand
    You will also have to put a bsr recognition in the MdJump section for the code to be activated:

    Code (ASM):
    1. Obj01_MdJump2:              ; XREF: Obj01_Modes
    2.         bsr.w   Sonic_JumpHeight
    3.         bsr.w   Sonic_JumpLand
    4.         bsr.w   Sonic_ChgJumpDir
    5.         bsr.w   Sonic_LevelBound
    6.         jsr ObjectFall
    7.         btst    #6,$22(a0)
    8.         beq.s   loc_12EA6
    9.         subi.w  #$28,$12(a0)
    *For the above code, replace $21 with whatever number your landing animation is.
     
  7. nineko

    nineko

    I am the Holy Cat Tech Member
    6,316
    489
    63
    italy
    Maybe I confused you because as I said I'm not very good with this stuff, so even if I know how to do it I might not be the best one to explain it.

    Ask me about music sometimes, it'll be much better :v:
     
  8. FeliciaVal

    FeliciaVal

    Member
    693
    11
    18
    Spain
    @nineko: haha sure thing XD but thank you so much anyways

    @Psi: oh I see, thank you. I'll try to do it soon.

    @Ravenfreak: yeah, I'll be careful with that next time, thank you :)

    Btw, is there a way to know the equivalent of numbers in hex? (dumb question time )
     
  9. nineko

    nineko

    I am the Holy Cat Tech Member
    6,316
    489
    63
    italy
    ... no.
    The spring object is $41.
    $40 is the frame ID used by Sonic in the spring animation.
    You can use the Windows calculator in Scientific mode.
     
  10. FeliciaVal

    FeliciaVal

    Member
    693
    11
    18
    Spain
    The windows calculator? Never knew it did that O.o ok, I'll have to look at it eventually if I want this to work.

    Thx for all the help everybody :)

    btw, when I'm done I'd like to publish this hack I'm doing, but I'm not sure how people will react to see an original character in a Sonic 1 hack, so I'm kinda reluctant to post it anywhere and I'm not working on it as much as I would like on it because of that
     
  11. E-122-Psi

    E-122-Psi

    Member
    2,470
    612
    93
    The place is open to all sorts of wacky concepts here, the more diverse it is the more welcome it gets usually. The worst you can get is critism, so as long as you are open to that I don't see why not.

    Go on....Doooooooo it. :D
     
  12. FeliciaVal

    FeliciaVal

    Member
    693
    11
    18
    Spain
    lol ok XDDD I guess will be kinda good? Since making a new character will mean adding new stuff to make it special :) well, I'll think about it when I'm done with it. Also, I don't wanna think people I'm copying you or whatever so I might switch the project and add another character from the franchise. I was thinking on making a hack for Silver since I'm like...obssesed with him lately. We will see, I still have much to learn.
     
  13. Ravenfreak

    Ravenfreak

    2 Edgy 4 U Tech Member
    3,103
    197
    43
    O'Fallon Mo
    Sonic 1 Game Gear Disassembly
    It'd be different, but diversity in hacks is always a plus of course. Like E-122-Psi said, go for it. It'd be interesting to see your fan character, and to play your hack. ^^
     
  14. nineko

    nineko

    I am the Holy Cat Tech Member
    6,316
    489
    63
    italy
    I'm still waiting for someone to make a hack featuring Big the Cat.
    Time for me to dig up the old "Big in Megamix" hoax picture:
    [​IMG]
     
  15. HighFrictionZone

    HighFrictionZone

    Hi. Member
    855
    0
    16
    Katy, Texas
    Nothing
    Alright, I'll take you up on that offer.
    I am trying to do something that ought to be just simple. I am importing a song for use in Sonic 1, as an "extra life" track. Using the default settings, obviously doesn't work as the song would just keep looping. Setting it to not loop obviously means there is no music after playing. However, in both these cases, the track does play. If click on the button with a 1-up monitor icon (or check the relevant checkbox on xm4smps's interface), the in-game result is a short period of silence, followed by the music fading back in. Well, that's the result if I use xm3smps. All attempts to use xm4smps to convert a file result in the application crashing and no conversion taking place.

    Is there some way to manually hex the output file to fix this? Or edit Sonic 1's source to make this work?
    On a slightly off tangent, I'd very much prefer if any proposed solutions enable use of the PSG, but I can work around not having PSG if I can have a custom 1up sound at all.

    I make the following note: I'm using the SVN disassem of sonic 1. The song itself is incredibly fucking simple and has all of one track and one instrument. If necessary, I can provide either the output .bin or the source .xm
     
  16. nineko

    nineko

    I am the Holy Cat Tech Member
    6,316
    489
    63
    italy
    If you send me the XM and the BIN I can give it a closer look, yeah.
    Oh an by the way you can use the psg channels in the 1-up tune, dunno why you thought you couldn't. Actually, if the original level song uses less than 3 psg channels, you'll get trailing psg sounds after the fade-in unless you know how to fix it.
     
  17. FeliciaVal

    FeliciaVal

    Member
    693
    11
    18
    Spain
    I need help again ;_; Well, I have the asm edited and everything, but...still cannot figure which hex number is the new animation I just added. If you want I can copy the _anim sonic1.asm, but I just added a line after the spindash one. Thanks in advance and sorry :(

    EDIT: uh...this is no good. I added the sprites with SonMapEd again, added the code that Psi gave me yesterday, and when I jump on a spring and fall down, I see a bunch of garbled sprites ;_; I wonder what I'm doing wrong...will post a screenshot if needed too
     
  18. nineko

    nineko

    I am the Holy Cat Tech Member
    6,316
    489
    63
    italy
    If you added the dc.w for the new animation right after the one for the Spin Dash, your animation ID is $20.
     
  19. FeliciaVal

    FeliciaVal

    Member
    693
    11
    18
    Spain
    thank you, it kinda works now. Except that the animation doesn't work. I just see a bunch of garbled sprites :(
     
  20. Selbi

    Selbi

    The Euphonic Mess Member
    1,501
    52
    28
    Northern Germany
    Sonic ERaZor
    Did you save, Tiles, Mappings and PLC's? If not, that explains your problem. Also, take a close look at the animation: Is it "acting" like it should? Like is the speed correct? Because this is important to know if the animation script is wrong or the art itself.