don't click here

Basic Questions & Answers thread

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

  1. Amethyst

    Amethyst

    Member
    A few problems with compiling my ROM.

    [​IMG]

    I'm a noob when it comes to this kind of thing, any help would be appreciated! I've spent the last two hours going through the wiki and internet, no help.
     
  2. Not defined means the game doesn't know what this is.

    In your case,

    something asks for SonicAni_Push, but that doesn't exist—It's probably named something else.
     
  3. c1owd

    c1owd

    Previously 'CarrascoZX0' Member
    183
    0
    16
    Sorry but I have another quick question...
    [​IMG]
    ^ I totally forgot how to fix that... I know it has something to do with the animations... But I forgot how to fix it though... Can someone help me on this one?

    Thanks ^^

    P.S. Also don't mind his palletes... I fixed that already... I just need to fix his animations... And make the animations load to their proper place...

    Edit: Also don't mind the life icon... I'll fix that later...
     
  4. Hanoch

    Hanoch

    Also known as TheKnock, Birashot Member
    491
    0
    0
    Israel
    everything
    Go to SAnim_Do2 and replace with:

    Code (ASM):
    1.  
    2.                                 moveq   #0,d1
    3.         move.b  $1B(a0),d1  ; load current frame number
    4.         move.b  1(a1,d1.w),d0   ; read sprite number from script
    5.         cmpi.b      #$F0,d0
    6.         bcc.s   SAnim_End_FF    ; if animation is complete, branch
    7.  
    Not sure what it does, but it pretty much fixes this.
    If that wont work, get the animation script from the S3K ASM file I think its called AniKnux or AniKnuckles.
     
  5. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    I would recommend against offering advice on fixing a problem if you don't understand the problem or the solution.

    It's pretty obvious that your animations are broken; from what I can see I suspect you're using too many or too few frames for the running animations, which are handled slightly differently in Sonic 1 to the other animations. Check out the code at SAnim_WalkRun. (If Hanoch's code and advice are anything to go by, you're also using animations in the wrong format; you should rewrite them to use Sonic 1's format, which isn't difficult. Reading Sonic_Animate will inform you on what Sonic 1 expects, but I'll see what I can do to help by documenting the format on the wiki in a more readable form.)
     
  6. c1owd

    c1owd

    Previously 'CarrascoZX0' Member
    183
    0
    16
    Its not just the running animations... Its basically everything... Jumping, spin dash, rolling, standing, etc. Some suggested to me that I load all the files of Knuckles in SonMapED and move his sprites around so they are like the Sonic 1 format... It probably will work... But I remember I was able to load it all without moving all the sprites around... God if I can only remember how... :argh:
     
  7. amphobius

    amphobius

    doing more important things with my life Member
    2,120
    0
    16
    life
    Use the S2K UpMem for animations—rip the rest from a S3K rom.
     
  8. Spanner

    Spanner

    The Tool Member
    If you want the stuff to be properly ripped from S3K...
    Code (ASM):
    1. SK_ArtUnc_Knux: equ $1200E0
    2. SK_Map_Knuckles: equ $14A8D6
    3. SK_PLC_Knuckles: equ $14BD0A
    [​IMG]
     
  9. c1owd

    c1owd

    Previously 'CarrascoZX0' Member
    183
    0
    16
    Its alright I got it working... But I have another problem... When I loaded up the palletes for Knuckles it came out perfect... The thing is that when you beat an act for example... Beating Act 1 and going into Act 2... In Act 2 for some reason Knuckles uses Sonic's pallete instead of his... Someone told me it may be because I use Dynamic Palletes... I don't know... Any Ideas on how to fix this?
     
  10. Amethyst

    Amethyst

    Member
    Got it working!

    One more problem:

    Whenever I spindash and release, after a few seconds it plays the end flagpost spin sound over and over, then randomly stops for a few more seconds, then repeats.

    Any tips on how to remove it?
     
  11. Selbi

    Selbi

    The Euphonic Mess Member
    1,501
    52
    28
    Northern Germany
    Sonic ERaZor
    While I have sadly no idea how to fix it, I can tell you what's going on there:
    The waterfall sound object in GHZ plays the wrong sound. I once had the problem as well, but that was years ago.
    Doing the part with the spindash sound in the tutorial again and checking for anything wrong might help you.
     
  12. Amethyst

    Amethyst

    Member
    The error occurs from adding the spindash sound into the game.

    I can't fully follow the wiki.

    This is what I've done:

    Code (Text):
    1. ; ---------------------------------------------------------------------------
    2.  
    3. Sound_D1toDF:
    4.         tst.b    $27(a6)
    5.         bne.w    loc_722C6
    6.         tst.b    4(a6)
    7.         bne.w    loc_722C6
    8.         tst.b    $24(a6)
    9.         bne.w    loc_722C6
    10.         movea.l    (Go_SoundIndex).l,a0
    11.         sub.b    #$A1,d7
    12.         bra    SoundEffects_Common
    13. Sound_A0toCF:            ; XREF: Sound_ChkValue
    14.         tst.b    $27(a6)
    15.         bne.w    loc_722C6
    16.         tst.b    4(a6)
    17.         bne.w    loc_722C6
    18.         tst.b    $24(a6)
    19.         bne.w    loc_722C6
    20.         cmpi.b    #$B5,d7    ; is ring sound    effect played?
    21.         bne.s    Sound_notB5; if not, branch
    22.         tst.b    $2B(a6)
    23.         bne.s    loc_721EE
    24.         move.b    #$CE,d7    ; play ring sound in left speaker
    25.  
    26. loc_721EE:
    27.         bchg    #0,$2B(a6); change speaker
    28.  
    29. Sound_notB5:
    30.         cmpi.b    #$A7,d7    ; is "pushing" sound played?
    31.         bne.s    Sound_notA7; if not, branch
    32.         tst.b    $2C(a6)
    33.         bne.w    locret_722C4
    34.         move.b    #$80,$2C(a6)
    35.  
    36. Sound_notA7:
    37.         movea.l    (Go_SoundIndex).l,a0
    38.         subi.b    #$A0,d7
    39. SoundEffects_Common:
    40.          lsl.w    #2,d7
    41.         movea.l    (a0,d7.w),a3
    42.         movea.l    a3,a1
    43.         moveq    #0,d1
    44.         move.w    (a1)+,d1
    45.         add.l    a3,d1
    46.         move.b    (a1)+,d5
    47.         move.b    (a1)+,d7
    48.         subq.b    #1,d7
    49.         moveq    #$30,d6
    50.  
    51. loc_72228:
    52.         moveq    #0,d3
    53.         move.b    1(a1),d3
    54.         move.b    d3,d4
    55.         bmi.s    loc_72244
    56.         subq.w    #2,d3
    57.         lsl.w    #2,d3
    58.         lea    dword_722CC(pc),a5
    59.         movea.l    (a5,d3.w),a5
    60.         bset    #2,(a5)
    61.         bra.s    loc_7226E
    62. ; ===========================================================================
     
  13. Selbi

    Selbi

    The Euphonic Mess Member
    1,501
    52
    28
    Northern Germany
    Sonic ERaZor
    It seems like you missed some steps in that part, like trashing unnecesary things. Due to lack of motivation, I'll just c/p the code how it should look in the end:

    Code (ASM):
    1. Sound_D1toDF:
    2.         tst.b   $27(a6)
    3.         bne.w   loc_722C6
    4.         tst.b   4(a6)
    5.         bne.w   loc_722C6
    6.         tst.b   $24(a6)
    7.         bne.w   loc_722C6
    8.         movea.l (Go_SoundIndex).l,a0
    9.         sub.b   #$A1,d7
    10.         bra SoundEffects_Common
    11.  
    12. Sound_A0toCF:               ; XREF: Sound_ChkValue
    13.         tst.b   $27(a6)
    14.         bne.w   loc_722C6
    15.         tst.b   4(a6)
    16.         bne.w   loc_722C6
    17.         tst.b   $24(a6)
    18.         bne.w   loc_722C6
    19.         cmpi.b  #$B5,d7     ; is ring sound effect played?
    20.         bne.s   Sound_notB5 ; if not, branch
    21.         tst.b   $2B(a6)
    22.         bne.s   loc_721EE
    23.         move.b  #$CE,d7     ; play ring sound in left speaker
    24.  
    25. loc_721EE:
    26.         bchg    #0,$2B(a6)  ; change speaker
    27.  
    28. Sound_notB5:
    29.         cmpi.b  #$A7,d7     ; is "pushing" sound played?
    30.         bne.s   Sound_notA7 ; if not, branch
    31.         tst.b   $2C(a6)
    32.         bne.w   locret_722C4
    33.         move.b  #$80,$2C(a6)
    34.  
    35. Sound_notA7:
    36.         movea.l (Go_SoundIndex).l,a0
    37.         subi.b  #$A0,d7
    38. SoundEffects_Common:       
    39.         lsl.w   #2,d7
    40.         movea.l (a0,d7.w),a3
    41.         movea.l a3,a1
    42.         moveq   #0,d1
    43.         move.w  (a1)+,d1
    44.         add.l   a3,d1
    45.         move.b  (a1)+,d5
    46.         move.b  (a1)+,d7
    47.         subq.b  #1,d7
    48.         moveq   #$30,d6
    49.  
    50. loc_72228:
    51.         moveq   #0,d3
    52.         move.b  1(a1),d3
    53.         move.b  d3,d4
    54.         bmi.s   loc_72244
    55.         subq.w  #2,d3
    56.         lsl.w   #2,d3
    57.         lea dword_722CC(pc),a5
    58.         movea.l (a5,d3.w),a5
    59.         bset    #2,(a5)
    60.         bra.s   loc_7226E
    I don't guaranty that it'll work, but since your code had mistakes anyway, I that it will.
     
  14. Amethyst

    Amethyst

    Member
    It didn't work :(
    I have no idea why it's not working.
     
  15. Hanoch

    Hanoch

    Also known as TheKnock, Birashot Member
    491
    0
    0
    Israel
    everything
    Go to SoundD0Index and it should look like this:

    Code (ASM):
    1. SoundD0Index:   dc.l SoundD0
    and before that, add a pointer to SoundD1 like this:

    Code (ASM):
    1. dc.l SoundD1
    That should fix it.
     
  16. Amethyst

    Amethyst

    Member
    I've done that already.
    I followed all the steps up to where the see-saw bug gets fixed.
     
  17. GT Koopa

    GT Koopa

    Member
    2,021
    18
    18
    Elgin, IL
    Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
    I know there are more important things that I SHOULD ask that I am having trouble with, but here goes anyway.


    In the Port the REV01 Background Effects tutorial, the "?" always show up as a question mark diamond no matter what computer I am on, Mac or away PC. I say this because whenever I try to port them, the "?" get in the way, as in they cause an error message. Find and Replace doesn't help as there seems to be too many variations. Must be symbols on higher computers, right? Since it is only in the ";comment text" anyway, would it be easier to fix the guide so those don't come up? I would even set aside time to do it myself if given the ok.
     
  18. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    Done. I also prettified the text by getting rid of the AAAAAAAAAAA and UUUUUUUUUU. All of them were caused by IDA Pro living in the year 1990 with regard to character sets.
     
  19. GT Koopa

    GT Koopa

    Member
    2,021
    18
    18
    Elgin, IL
    Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
    Thank you. I wanted to learn how the deformation works and the REV 01 is a good example for this.
     
  20. Selbi

    Selbi

    The Euphonic Mess Member
    1,501
    52
    28
    Northern Germany
    Sonic ERaZor
    While we are talking about deformation:
    With just 2 lines in the deformaton code, I got GHZ using the LZ Deformation code, and it seems like anything works fine (I mean the waving and stuff). However, since it get's told to use LZ's instead of GHZ's deformation, the background is not constantly fixed to the screen, like the normal GHZ does.
    Since I don't get like anything of the deformation code, I don't know how to do it, but I don't think it'll be "too" hard. Any ideas?