don't click here

Basic Questions & Answers thread

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

  1. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,587
    10
    18
    United Kingdom
    YouTuber
    Sonic 1. Okay, I'm not so good with this as never touched it, but I will give it a shot.


    If you're coding is in Sonic's coding, then try this:

    Code (ASM):
    1.     tst.w   $10(a0)         ; Is Sonic's x_vel 0?
    2.     beq.s   Wherever        ; If so, branch

    If you're coding is not in Sonic's code (like you're programming another object or whatever), then try this:

    Code (ASM):
    1.     lea ($FFFFD000).w,a1    ; Load Sonc into a1
    2.     tst.w   $10(a1)         ; Is Sonic's x_vel 0?
    3.     beq.s   Wherever        ; If so, branch

    EDIT: I think that's the right RAM address for Sonic in Sonic 1, but you will know what it is, right? =P
     
  2. E-122-Psi

    E-122-Psi

    Member
    2,470
    612
    93
    Thanx. Astonishingly, I actually seem to have found the programming for the ending I need. :D

    Code (ASM):
    1. loc_5E412:
    2.         lea (Player_1).w,a1
    3.         tst.b   $2E(a1)
    4.         bne.s   locret_5E440
    5.         cmpi.w  #2,(Player_mode).w
    6.         beq.s   loc_5E442
    7.         move.b  #$C,5(a0)
    8.         move.b  #$81,$2E(a1)
    9.         clr.b   $20(a1)
    10.         move.w  #$800,$18(a1)
    11.         move.w  #$800,$1C(a1)
    12.  
    13. locret_5E440:
    14.         rts
    15. ; ---------------------------------------------------------------------------
    16.  
    17. loc_5E442:
    18.         jsr (Create_New_Sprite).l
    19.         bne.s   loc_5E450
    20.         move.l  #loc_5FCDC,(a1)
    21.  
    22. loc_5E450:
    23.         bset    #0,4(a0)
    24.         bra.w   loc_5E3C0
    Branching over to the 2 player coding seems to make Sonic perform the correct animations (albeit with Tails' Super pallette). I also have to edit it to load Sonic's normal sprites on both occasions.

    Code (ASM):
    1. loc_5E412:
    2.         lea (Player_1).w,a1
    3.         tst.b   $2E(a1)
    4.         bne.s   locret_5E440
    5.         cmpi.w  #2,(Player_mode).w
    6.         bne.s   loc_5E442
    7.         beq.s   loc_5E442
    8.         move.b  #$C,5(a0)
    9.         move.b  #$81,$2E(a1)
    10.         clr.b   $20(a1)
    11.         move.w  #$800,$18(a1)
    12.         move.w  #$800,$1C(a1)
    13.  
    14. locret_5E440:
    15.         rts
    16. ; ---------------------------------------------------------------------------
    17.  
    18. loc_5E442:
    19.         jsr (Create_New_Sprite).l
    20.         bne.s   loc_5E450
    21.         cmpi.w  #2,(Player_mode).w
    22.         bne.s   loc_5E450
    23.         move.l  #loc_5FCDC,(a1)
    24.  
    25. loc_5E450:
    26.         bset    #0,4(a0)
    27.         bra.w   loc_5E3C0
    With this edit I can get Sonic to load the right animations and almost the correct pallette. It's super, but it doesn't rotate. I'm guessing there is something in the Super ending coding to load the rotating pallette but nothing seems to work. Anyone know what to add there?

    EDIT: Never mind. Fixed.
     
  3. Jimmy Hedgehog

    Jimmy Hedgehog

    Member
    1,728
    8
    18
    England - Slough
    Getting the motivation to continue old projects
    I'm probably messing up somewhere but I can't seem to get this working, and can't seem to remember Sonic's RAM address...oops, haha. Though I was looking in the SCHG at Object Status Table, and noticed this in Sonic Specific:

    Code (Text):
    1. Sonic-specific variables
    2. Offset     Size
    3. $22        byte
    4.  
    5. Bit     Hex     Description
    6. 0   $01     Orientation. Clear is left and set is right.
    7. 1   $02     Set if Sonic is in the air (jump counts).
    8. 2   $04     Set if jumping or rolling.
    9. 3   $08     Set if Sonic isn't on the ground but shouldn't fall. (Usually when he is on a object that should stop him falling, like a platform or a bridge.)
    10. 4   $10     Set if jumping after rolling.
    11. [b]5    $20     Set if pushing something.[/b]
    12. 6   $40     Set if underwater.
    13. 7   $80     Unused.
    14.  
    $20 seems interesting as it's "set if pushing something". Am I right in thinking this can be somehow used for this, or is that something else completely?
     
  4. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,587
    10
    18
    United Kingdom
    YouTuber
    Like I said before, Sonic's RAM address is $FFFFD000. I just wanted you to double check that as I don't do Sonic 1 and I may of been wrong.



    Again, I'm not Sonic 1 minded. I'm not sure if this is set when Sonic is in his pushing animation, or is only set when he's pushing objects, say, that green block in Marble Zone. In Sonic 2, it seems to happen whenever he's in his pushing animation, so I guess Sonic 1 works the same way. So, you can do this:

    Again, if your coding is in Sonic's coding, then try this:

    Code (ASM):
    1.         btst    #5,$22(a0)  ; Is Sonic pushing?
    2.         bne.s   whatever    ; If so, branch

    Or if you're coding is not in Sonic's code (like you're programming another object or whatever), then try this:

    Code (ASM):
    1.         lea ($FFFFD000).w,a1    ; Load Sonc into a1
    2.         btst    #5,$22(a1)      ; Is Sonic pushing?
    3.         bne.s   whatever        ; If so, branch
     
  5. Moogle!

    Moogle!

    Member
    229
    5
    18
    Woah, this place has changed a bit. Kind of funky. :p

    Is it just my imagination, or do many hacks run and scroll smoother than the original games? This has puzzled me for ahwile.

    (I should note that I used Kega Fusion for playing)
     
  6. RetroKoH

    RetroKoH

    Member
    1,662
    22
    18
    Project Sonic 8x16
    Sonic's jump velocity in the games is 6 (Variable jump height being 4)

    Does anyone know what Knuckles' jump velocity/var. height is???
     
  7. Mercury

    Mercury

    His Name Is Sonic Tech Member
    1,740
    21
    18
    Location Location
    AeStHete
    Sonic's (and Tails') initial jump velocity is actually 6.5, not 6. Knuckles' lower jump is because his initial jump velocity is 6. The release velocity ("variable jump height") is 4 in all cases.

    Also, I updated the SPG with this info.

    EDIT: For underwater, Sonic and Tails use 3.5 and Knuckles uses 3. Release velocity is 2.
     
  8. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    OK, this is not exactly a question about hacking as much as it is about compiling.

    I am planning to possibly switch over to Ubuntu Linux (which is a very new experience for me). However, in my current test run, I cannot seem to find a way to compile my hack (Using the 2007 version of Sonic 2). I downloaded the Linux build tools, and attempted to run them through the terminal... but all it ended up doing is opening the .sh file in a text editor.

    So the question is, how can I compile my hack in the new version of Ubuntu, if possible?
     
  9. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,161
    65
    28
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    Up until 12.04, I have been using the Windows tools under Wine and it worked (the Linux version of the tools work for S3&K, but not for S2 due to the use of macros; I have no idea regarding S1). However, some changes in 12.04 mean you will only be able to assemble your hack under Wine on 32-bit Ubuntu for the time being. Or in a Windows VM.
     
  10. E-122-Psi

    E-122-Psi

    Member
    2,470
    612
    93
    I've been working on putting in flags so other characters can break Knuckles' walls in S3+K. I've succeeding in activating all of them, except for Ice Cap's. I've tried editing the ICZbreakablewall routine but I can't find the coding to break the wall anywhere. Anyone know about this?

    This will very likely lead to a whole load of other questions regarding refining Knuckles' routes to work for others but I'll leave it at this for now.
     
  11. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    I guess this means I will be uninstalling the 64-bit version that was installed using the windows installer, and actually make a 32-bit install CD. fun.

    Thanks for the quick reply flamewing. :)


    Edit: I have installed 32-bit Ubuntu, Wine, and I was presented with this when I tried to build.
    [​IMG]
     
  12. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,161
    65
    28
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    Hm. It is the same error I am getting; it seems I was wrong about it being due to a component that is bugged in Wine on 64-bit Ubuntu. This means it is a bug (relative to Windows) recently added to Wine. And after looking at some logs, it is due to overlapping strcpy calls, which asw uses a lot.

    Which means the enormous joy of performing regression testing in Wine to submit a bug report...
     
  13. E-122-Psi

    E-122-Psi

    Member
    2,470
    612
    93
    Does anyone know of any flags or objects that recongise when a character is in Sonic or Knuckles' exclusive areas in S3+K. I've figured some coding to make certain areas compatable with both characters but I would need a flag to recognise where the character is to choose between them.
     
  14. Tiddles

    Tiddles

    Diamond Dust Tech Member
    471
    0
    0
    Leicester, England
    Get in an accident and wake up in 1973
    I don't think there's anything defined like that. The best way is probably to check the X and Y player or camera coordinates (along with the player ID if necessary) as in the CNZ sample I PMed a minute ago.

    I meant to have a look at the ICZ breakable wall deal for you too if it's still an issue, but I haven't got to it yet.
     
  15. E-122-Psi

    E-122-Psi

    Member
    2,470
    612
    93
    Okay then, I'll give it a shot.

    Thank you very much for your time, Tiddles. I don't think this project would have gotten far without you. You don't have to work yourself over making the fix, though if you find anything it would be appreciated.
     
  16. Machenstein

    Machenstein

    Member
    830
    0
    0
    I've never ported music to Sonic 2 before, so I want start simple and port Azure Lake's music to Sky Chase Zone. What methods should I use to do that?
     
  17. Truner

    Truner

    Member
    I have a not so basic, but still not topic-worthy question here.
    How would you guys go about remaking the old games?
    By remakes, I mean redesigning stages (that's the only thing I'm good at/concept arts at most), with remixed music (I can also manage this one myself) and probably more moves.

    The thing is, if I ever tackle such a project, I have to learn something. And here comes the question:
    If I want the games to be able to work on many devices, should I go with ROM hacking, or Stealth's E02?
    Which one is more compatible with the things I want to do?
    - Super Peel Out (actual gimmick, faster than Spindash)
    - Homing Attack (not actual gimmick, no chaining, just classic Sonic gameplay with the ability to use it)
    - Shields (From Sonic 3)
    - Basic cutscenes (pretty much like the cutscenes from Sonic 3 or maybe even pictures, like the ending in Sonic 2)
    - Stage selection (like in SAGE '10 Sonic 1)
    - Challanges (kinda like Sonic VR)

    This doesn't exactly means that I'll start on such a project, but if I were to (and I really want to) I want to know which route is better to take.
    There's also the matter of stages. Sonic 1 and 2 would probably have entire zones / plus acts for already 16-bit zones remade...

    With ROM hacking, I can go as close to the originals as humanly possible, but it'll require emulation.
    If I go with the E02 Engine, it would natively work on systems like the Wii or the PSP (the reason I can't decide, since I want it to be playable on a PSP).

    Many of the features I want have been made by others through ROM hacking, so I believe it would be much easier to insert them and actually focus on the design/music side of the project.
    E02 would probably allow limitless number of stages and functions, but the only thing I know about the engine is that it has a pretty spot on replica of the basic Sonic gameplay.

    However, I don't know how many help could I get if I ever needed assist with the project...

    Please help me decide on this matter.
     
  18. ManicRemix

    ManicRemix

    Fact: You're reading this Member
    17
    0
    0
    I love everything you listed but the homing attack, it feel very unnatural. If it could be turned off by option, then great.

    I'm a bit torn... While Rom hacks are fun, Fan game engines are near limitless, but harder to get perfect physics. It really depends on what you want. Everything you listed above sounds like it'd be much easier to make with a Rom hack (Except maybe the cut scenes, which I'm not sure if that is possible to do with Sonic 1/2. I've been interested in that however...). Now if you wanted Sonic XG Style graphics, then you'd obviosuly go with an engine. It all depends on your personal terms, and I wish you luck.

    ---

    Now on to my own problems...

    I'm apparently getting that "Overflow" glitch, where the Ram isn't prepared to hold that much art or something, I end up with this:

    [​IMG]

    I've seen the solution to this problem before, but I cannot recall where. As you can see, I've replaced Egg Man's image with that of Tails'. Eggman's Image was merely one side of a image doubled & flipped over to make one large image, since both halves of him are the same. However, since I replaced it with Tails image (Obviously larger), it casued these weird graphical glitches. Solutions?

    And then another thing... Would anybody here happen to know where exactly it it does not allow the act to end until Sonic moves to the right? I've set up a Sonic 3 type ending where he poses at the end of an act, but since he does not move to the right to the right, the act does not end because the Final score counting & "Has passed Act X" hasn't been triggered yet.
     
  19. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    A quick question. Is it possible to show something like that "Sonic Got Through" texts mid level? Like say...the name of the boss you're about to fight sliding in and sliding out again? Well I suppose it's definitely possible. But...how feasible is it to do in Sonic 1, for instance?
     
  20. Selbi

    Selbi

    The Euphonic Mess Member
    1,497
    48
    28
    Northern Germany
    Sonic ERaZor
    You would have to temporarily load the font art into VRAM, move the text in and out, and then reload any art you may have overwritten in the first process (which is usually the explosion patterns). It certainly possible, but you need to keep many things in mind when doing it.