don't click here

ASM Help

Discussion in 'Engineering & Reverse Engineering' started by Elektro-Omega, Mar 9, 2010.

Thread Status:
Not open for further replies.
  1. Elektro-Omega

    Elektro-Omega

    Mushroom Hill'in Member
    400
    2
    0
    UK
    -
    Before I joined Retro I had been lurking for about a year on and off and I noticed lots of nice hacks. I read a lot about ASM hacking but couldnt understand it, however now I am at university and studying computer architecture I now know a little more about the ASM language.

    So I opened the 2007 Xenowhirl dissassembly of Sonic 2 and had a look (did a tiny bit of experimentation) but I still know literally nothing about ASM.

    I have had a look around the HOW-To's on the wiki (which provided some nice demonstrations but not much explanation as to how you know where the data is, why it does whatever it does and how you know what to do to it ((at least not to a complete newcomer to ASM like me)) and I have looked in the archives but the majority of the links in the threads are broken now (bummer).

    I was wondering if anyone could maybe create me some step by step walkthroughs (with pictures preferably) of how to add new objects / new characters / new moves etc. (in Sonic 2).

    If this is too much to ask I completely understand but could you please point me in the right direction as to how some of you guys learned how to ASM hack. But if someone can do this I will be eternally greatful for your effort.

    Sorry if this is posted in the wrong place.

    Thank you all in advance
     
  2. Malevolence

    Malevolence

    Tech Member
    274
    0
    16
    Well I mostly learned by first coming to understand how the commands worked and how ram worked and then I would analyze objects and figure out how they used code in order to do the things they did. Perhaps this will help you out (although accordingly you've probably seen this) http://info.sonicretro.org/SCHG_How-to:Work_with_Objects
     
  3. ColinC10

    ColinC10

    Tech Member
    I'm pretty sure we all learned to ASM hack exactly the same way, and that's by experimentation. Don't start by thinking "how do I make a new object?" Pick an existing object and play around with it. Find the line that makes the Buzzbomber fire missiles, for example. What happens if you swap the missiles for lava balls? Or Motobugs? Try making it faster, or invincible, or drain rings whenever it's on screen, anything. The semicolon is your friend - put it in front of important-looking stuff and see what breaks. This is by far the best and, in my opinion, the only way to learn. It's also the most fun!
     
  4. Elektro-Omega

    Elektro-Omega

    Mushroom Hill'in Member
    400
    2
    0
    UK
    -
    Thank you for all the help.

    I guess some I read and some I skimmed (Very bad of me).

    So now I am going to go an read all the How-Tos and pay full attention and detail.

    and then experiment around with the ASM. I think I was trying to jump in at the deep end.

    Thank you again Malevolence and ColinC10.
     
  5. Selbi

    Selbi

    The Euphonic Mess Member
    1,497
    48
    28
    Northern Germany
    Sonic ERaZor
    I can only agree with this, because it's basically what I've done with this.

    But instead of just commenting things out, you could also switch things to look what happens, for example changing a beq to a bne. Really, experimenting is the ONLY way to learn ASM or any language. If you work on something every here and then, you might get pretty good skills even within a year (I know, this sounds like a long time, but for me it's like nothing).
    The only thing you should keep in mind: Enjoy it. If you are like "Uh, making some ASM (Home-)work so I can finally start my awesome hack. >.>" you won't get anywhere.

    So that's what I can add to this.
     
  6. Tidbit

    Tidbit

    Member
    I learned the bit of ASM that I know by learning it with a friend. Also I've found that to learn and get the hand of it, you have to change the way your mind processes it. The way was able to understand the blasted stuff was by understanding that ASM (for me)is basically this

    What do I have to do?

    First
    Second
    Check something some where else
    Third

    Done

    Of course ASM isn't really that, but its a very simple programing language, once you understand how it works. So my over all advice is to just take it slow and not dive in head first. Other wise you'll be rewarded with one baad headache.
     
  7. FraGag

    FraGag

    Tech Member
    When I started to learn ASM, I tried to apply my prior programming knowledge to it (which was mainly comprised of Visual Basic, javascript and C++). If you've programmed in C or C++ before, or just understand pointers in general, this will already a great start. However, the most useful tool for me in the learning process was the M68000 Family Programmer's Reference Manual. This manual describes every instruction and a lot of other details you need to know to efficiently program the 68000 (note: the Megadrive has a 68000 processor, so anything that applies to a later revision will not be usable). If you don't find an instruction in the manual, it's likely that it's one of the conditional instructions; in that case, search for Bcc, DBcc or Scc. There are also other directives, like dc, that are not processor instructions but do something else; for dc, this declares a constant in the code (I.e. it puts the bytes straight in the ROM). There are other instructions lists available, like 68k.hax.com and this list from the wiki.
     
  8. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    This is the best Badnik ever.
     
  9. nineko

    nineko

    I am the Holy Cat Tech Member
    6,308
    486
    63
    italy
    I remember a very old post where someone posted a screenshot of Buzzbombers shooting other Buzzbombers, recursively. I don't remember who, nor where, and the search engine can't really help me this time, but I'm sure I saw it.
     
  10. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    19,237
    969
    93
    Long-term happiness
    I remember that as well, for what it's worth. Also cannot help finding it, sorry =P
     
  11. Jimmy Hedgehog

    Jimmy Hedgehog

    Member
    1,728
    8
    18
    England - Slough
    Getting the motivation to continue old projects
    I was curious to see how this would look so I decided to have a look for myself, awesome stuff. Even moreso since I forgot that in the source I used I edited the buzzbomber sprite into 8bit Megaman...XD
     
  12. ColinC10

    ColinC10

    Tech Member
    I just tried this, and Buzzbombers shooting Motobugs is pretty cool! But that's the whole fun of "learning" ASM in this way. It was a tiny change that I just thought up randomly, but already we're discussing it and trying things out. It also opens up more questions and forces you to explore further. Why do the Motobugs teleport to the ground instead of firing out like the missile did? Why do they forever vanish once they go off the screen? (Rhetorical questions - I know the answers! :eng101: ) Once you start getting sidetracked like this it isn't long before you start building up a decent amount of knowledge. Enough to blag a green Tech Member label, anyway! ;)
     
  13. Malevolence

    Malevolence

    Tech Member
    274
    0
    16
    Oh, btw, crabmeats shooting crabmeats is where the action's at.
     
  14. Namagem

    Namagem

    Member
    388
    0
    16
    USA
    This thread has got me interested. I am definitely going to take this approach when I have some free time.
     
Thread Status:
Not open for further replies.