don't click here

Basic Questions & Answers thread

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

  1. Ravenfreak

    Ravenfreak

    2 Edgy 4 U Tech Member
    3,089
    181
    43
    O'Fallon Mo
    Sonic 1 Game Gear Disassembly
    Here, no joke. This is how I taught myself, by looking at a disassembly of Sonic 1, and referring to the Motorolla 68K Instruction Manual to look up the various operations, what they do, etc. But you could google 68K asm tutorial and see what comes up. There is a program called Easy 68K that is targeted towards beginners and comes with three tutorials IIRC, so you could try that out.
     
  2. MarkeyJester

    MarkeyJester

    Original, No substitute Resident Jester
    2,201
    431
    63
    Japan
    While I echo the above statement, if you "really" need a good starting guide, might I recommend SonicRetro's very own:
    http://info.sonicretro.org/SCHG_How-to:Wor..._68000_assembly by redhotsonic

    It looks very simple, very easy, and very beginner friendly (though I'm using Firefox with skype installed and it's converted some of the values on that page to phone call number tags for some strange reason, someone should look into changing that, I'd do it myself, but I don't want to mess with the guide =%).
     
  3. Spanner

    Spanner

    The Tool Member
    You can easily remove the plugin, it's a waste of resources. =P
     
  4. Learning 68K ASM is probably the easy part, since these old CPUs aren't particularly complex and I'm sure there are lots of documentation around. The problem is learning how to do useful things in the Sonic games, because then you have to study the engine of the games. You have to know what routines do what, the meaning of the variables, and how everything is glued together. I believe that this stuff is documented to some extent, but you will probably only get a hold of it if you dive in.

    It's kinda like driving: Learning how to start a car and move it around an empty parking lot is easy, but in order to be out there with the other cars and actually go places you have to learn all kinds of traffic rules and such, it's a completely different experience.
     
  5. Selbi

    Selbi

    The Euphonic Mess Member
    1,497
    48
    28
    Northern Germany
    Sonic ERaZor
    Pretty much waht tokumaru said: There's a big difference between learning ASM and Sonic Hacking. I have a pretty good ASM 68k experience, but I highly doubt that I'm able to do anything with this experience except for Megadrive releated stuff.

    Knowing what the commands do really is helpful and somehow required of course, but the most important part is to get used to the Sonic games itself, knowing where the code for everything is and knowing what the different RAM adresses are and how you use them.
     
  6. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    You know I have to get in the habit of being specific. I meant in relation to Sonic hacking, after all. Either way, thanks.

    I don't suppose there's an ASM hacking guide for the Sonic games is there? The stickied one below never seems to have been finished.
     
  7. Ravenfreak

    Ravenfreak

    2 Edgy 4 U Tech Member
    3,089
    181
    43
    O'Fallon Mo
    Sonic 1 Game Gear Disassembly
    There is technically no guide that's specifically for the Sonic games, but the guide MJ posted that was written by redhotsonic is a great start since it talks about the basics about 68k asm. Also look at the RAM hacking guides on the wiki, since you'll need to know what data the game stores and where.
     
  8. GT Koopa

    GT Koopa

    Member
    2,021
    18
    18
    Elgin, IL
    Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
    [​IMG]

    So I hit a snag.

    Code (ASM):
    1. loc_2FC68:
    2.     move.l  #Obj52_MapUnc_302BC,mappings(a0)
    3.     move.w  #$3C1,art_tile(a0)
    I want the turret to be on the first palette line. Changing the $3C1 to $63C1 seems to do the trick, however it makes other things wonky.

    [​IMG]

    Is there a way I can have them both? Or should I give up on having the head be the turret?
     
  9. Xenowhirl

    Xenowhirl

    Tech Member
    175
    0
    0
    You can change the palette per mapping piece. In SonMapEd this is done by hitting P while a piece is selected.
     
  10. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    Any clue on how to do this for monitors? I have tried changing the palette line for the one of the contents (Leaf Shield Monitor icon) in SonMapEd, but whenever I load in game it still uses Sonic's palette line.
     
  11. MarkeyJester

    MarkeyJester

    Original, No substitute Resident Jester
    2,201
    431
    63
    Japan
    Hmm, try another method, open obj26.bin with a hex editor (sometimes I wish it were in source code format):

    [​IMG]

    Each of the red words I've hi-lighted there are V-Ram location reads for each of the sprite "Icons", the following will set those icons a certain palette line:

    +0000 = Palette line 0
    +2000 = Palette line 1
    +4000 = Palette line 2
    +6000 = Palette line 3

    If for example I wanted to change the last icon to use palette 2, then 0034 + 4000 = 4034. (infact the one that's set 2024 already uses palette line 1 =P).
     
  12. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    SonMapEd can save mappings to ASM format.

    Code (ASM):
    1. SME_oaN3p_8E:   dc.b 0, 2
    2.         dc.b $F5, 5, $40, $2C, 0, $16, $FF, $F8
    3.         dc.b $EF, $F, 0, 0, 0, 0, $FF, $F0
    Not sure what most of it means, but I did realize that $40, $2C has to do with palette line and art displayed. Thus, I was able to change what was orignally 0, $2C to the $40 (palette line 2) and $2C.

    Thanks for the help Markey. :)
     
  13. 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)
    There is some documentation here.
     
  14. GT Koopa

    GT Koopa

    Member
    2,021
    18
    18
    Elgin, IL
    Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
    I know that. The problem is that Obj52_B, which I assume is the turret, won't load properly. And changing the palette with P on Obj52_A (which is the cover where Robotnik usually is) and saving the mappings nothing happens. This is why I think/thought it was in the asm.
     
  15. Xenowhirl

    Xenowhirl

    Tech Member
    175
    0
    0
    Obj52_B.bin won't load in SonMapEd because the first index entry in it is invalid. Change the first 0000 to 0022 in a hex editor and then it will be able to open it. Like the other bosses, the graphics won't show up unless you load the correct slice of a VRAM dump, but you can edit the palette line without that.
     
  16. Glaber

    Glaber

    Has Beaten Sonic Genesis for GBA Oldbie
    I'm trying to get a Soned 2 hack going only I'm having trouble getting a disassembly to work. The dissambly I'm trying to use is this: Sonic 2 (Split and Text by Xenowhirl). Only when I open up a project file, it's like the rom wasn't dissembled. Is there a way to see what revision of sonic 2 I'm using before attempting to use the wrong disassembly?
     
  17. Xenowhirl

    Xenowhirl

    Tech Member
    175
    0
    0
    You have to put a Sonic 2 ROM in there and name it s2.bin and run split.bat only once. Then you can run build.bat to build a ROM to s2built.bin. But for anyone starting a Sonic 2 hack I would suggest using the newest SVN version of the assembly instead of the 2007 version.
     
  18. Glaber

    Glaber

    Has Beaten Sonic Genesis for GBA Oldbie
    I think my problem was just using the wrong rom. The one I used at first didn't come from Sonic AR, and I did put it in the correct folder as split.bat worked.

    Igot it working now that I used Revision 1 of Sonic 2 From Sonic AR
     
  19. Fwiss

    Fwiss

    Member
    21
    0
    0
    Well, I can't seem to find my old posts, so I gotta ask,
    How do I change the level order?
    My end signpost is glitched up graphically, and it teleports me to the place the signpost used to be, and the level won't end.
    An Egg Prison works, but also is messed up graphically.
    This is Sonic2, in the SVN disassembly.
    Thanks,
    Fwiss.
     
  20. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    Okay, totally gay question.

    How do I download the Sonic 2 SVN disassembly? :psyduck:


    Nevermind answered on IRC.

    Now I have another question. Ain't that great? :specialed:

    The s2.asm file is huge. Very huge. I don't even know where to begin looking to get a handle on things.

    Let's say I want to code in a homing attack. I know exactly how the homing attack works, and can replicate it in any language similar to C, as well as in MMF2. I know how it works.

    Where would the code for a homing attack GO in the asm?