+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Looking to get some ASM experience
Pages: [1] 2
Author Topic: Looking to get some ASM experience  (Read 983 times)
Kagemusha
Guest
« on: May 24, 2007, 12:47:25 pm »

Well I awhile back I was gonna try to learn how to do ASM on a translation project of mine on the NES. Well it turned out that the game wasn't really suitable for learning that kind of stuff. So now I want to hack a game like SMB. My question is if SMB would be one the easiest games for learning ASM? I imagine it would be, but I'm not really sure. Also if SMB is the easiest game are there any other games for the NES to hack that would require intermediate skills, I suppose?
Disch
Guest
« Reply #1 on: May 24, 2007, 01:29:44 pm »

I don't think the game you pick matters as much as you might think it does.  I mean sure there are a few games where the code is insanely complex (Battletoads comes to mind), but barring those, I think most games are around the same 'difficulty level'.  SMB seems like a fine place to start.

The big points to understanding assembly are:

1)  Understanding language syntax and/or assembly architecture.  In the case of 6502, this equates to knowing what each instruction does, the differences between addressing modes, etc.  This is the kind of thing that you might learn from a reference doc or tutorial.

2)  Understanding programming fundamentals (what a variable is, what arrays are, what loops are used for, conditionals, subroutines, etc, etc).  This is the kind of thing that you can only really learn through hands-on experience and tinkering.  Tutorials can be a great help in guiding you, but ultimately you'll have to get your hands dirty.

3)  Understanding system architecture.  In the case of the NES, this equates to having a basic understanding of PPU registers, PRG swapping, how to perform simple tasks, etc.  This is the kind of thing you'd learn from a technical doc.


#2 is really the biggie.  Once you've been around the block with a few languages, you realize that they're all largely the same.  The same concepts that apply to 6502 also apply to other languages like Java, C, Delphi, and even QB -- they're just performed differently.  This is why people can read 6502 technical docs all day and not learn a thing since they don't pick up on programming concepts.  This is also why people that have experience in one language can pick up another relatively quickly.

#3 can be put off if you're just looking to do minor/moderate engine tweaks.  Game computations can be modified without any understanding of the system at all.  But it definitely may come in handy.


I would suggest (but I'm sure other people wouldn't agree with me) that instead of focusing on hacking 6502, you just focus on understanding it.  That is -- instead of looking at a game with the intention of changing it into something you want, look at it with the intention of understanding it.  Try to figure out what each instruction is doing.  You'll find that once you understand the code, changing it will usually be straightforward.  Whereas when you try to change it without fully understanding it, you'll end up having lots of "why the hell is it doing this?" problems -- which get very frustrating.
Kagemusha
Guest
« Reply #2 on: May 24, 2007, 01:38:35 pm »

Thanks. I sort of know about #1, but I don't have a complete understanding of it yet. I'll try work on that. As for #2 and #3, those never really crossed my mind. I was only thinking about #1.

Quote from: Disch on May 24, 2007, 01:29:44 pm
I don't think the game you pick matters as much as you might think it does.  I mean sure there are a few games where the code is insanely complex (Battletoads comes to mind), but barring those, I think most games are around the same 'difficulty level'.  SMB seems like a fine place to start.

Bongo' said the game I picked out wasn't cool.
« Last Edit: May 24, 2007, 02:09:44 pm by Kagemusha »
tomaitheous
Guest
« Reply #3 on: May 24, 2007, 10:08:51 pm »


 Hey - if you got #1 down or most of it, then I say just dive in and start experimenting/hacking  Wink 

 It'd be nice if there was a forum section just for asm (questions/howto/examples/etc) ... but then again that might be a bad idea if it was a public section  Grin
DaMarsMan
Guest
« Reply #4 on: May 24, 2007, 10:31:49 pm »

The game matters because you want to start on something easy.
snesmaster40
Guest
« Reply #5 on: May 25, 2007, 04:12:38 am »

There's this file called asmlog.txt, which is an irc log. It's somewhere (I think the links are dead) but it's extremely useful and it taught me how to make Mario's lives go up when he dies and some other stuff

Edit: Found it!
« Last Edit: May 25, 2007, 04:33:25 am by snesmaster40 »
Disch
Guest
« Reply #6 on: May 25, 2007, 12:01:36 pm »

Quote from: DaMarsMan on May 24, 2007, 10:31:49 pm
The game matters because you want to start on something easy.

Define easy.

Unless you get into dynamic self modifying code or elaborate compression routines (both are which are extremely rare among NES games) or some really unorthodox event driven game.... most NES game engines tend to all revolve around the same principles and thus are around the same difficulty level.

Sure there could be bad games to start with --  like I say Battletoads comes to mind right away.  Probably Maniac Mansion would be a nightmare too.  But as long as you stay from that small handful of exceptional games -- you'll be fine.  That was my point.

In all honesty -- I don't think a generic platformer like SMB would be any easier (or any more difficult) to study/hack than an "advanced" platformer like Kirby's Adventure (which is essentially just a generic platformer with bells and whistles glued on).


But I could be wrong.  When you've had some experience in an area for a while, you tend to lose perspective on what is hard/easy for people just starting out.
Kagemusha
Guest
« Reply #7 on: May 25, 2007, 12:35:52 pm »

Quote from: snesmaster40 on May 25, 2007, 04:12:38 am
There's this file called asmlog.txt, which is an irc log. It's somewhere (I think the links are dead) but it's extremely useful and it taught me how to make Mario's lives go up when he dies and some other stuff

Edit: Found it!

Wow! Thanks snesmaster40. This will definitely be helpful.
Nightcrawler
Guest
« Reply #8 on: May 25, 2007, 06:06:09 pm »

Quote from: Disch on May 25, 2007, 12:01:36 pm
But I could be wrong.  When you've had some experience in an area for a while, you tend to lose perspective on what is hard/easy for people just starting out.

You got it. You're expecting WAY too much out of a first timer trying to learn some assembly. There's huge differences between Super Mario Brothers and Kirby. Super Mario brothers is simple enough that you can reverse engineer the entire game line for line. In fact it's been done before and is in our database.

Try doing that to the last Kirby platformer on the SNES which is much more advanced with the same knowledge. There's going to be alot of differences. You'll need more knowledge to be able to do it.

There's little difference to YOU. Come back down to Earth and remember what it was like not to know anything. about assembly, programming, system architecture. Most people on that level are lucky to be able to to identify 10 lines of assembly code and what there purpose in the game actually is.

I can't count the number of people who jump in over their head, have no idea what they're doing and fail, then go down and try a simpler game and start to figure things out. You need to help some more new people. Tongue
Disch
Guest
« Reply #9 on: May 25, 2007, 07:55:46 pm »

Quote from: Nightcrawler on May 25, 2007, 06:06:09 pm
There's huge differences between Super Mario Brothers and Kirby. Super Mario brothers is simple enough that you can reverse engineer the entire game line for line. In fact it's been done before and is in our database.

Smaller does not necessarily mean simpler.

You could reverse engineer Kirby line by line too.  But it's not as popular and is larger so nobody has done it.


Quote
Try doing that to the last Kirby platformer on the SNES which is much more advanced with the same knowledge. There's going to be alot of differences. You'll need more knowledge to be able to do it.

I was specifically speaking in terms of the NES where games were pretty much exclusively written in straight 6502 and are thus organized in a logical manner.  I understand and agree that when you extend to further generation systems like SNES where code has gone through a compiler (not to mention the assembly and architecture is much more complex) -- that things get much hairier.

Quote
I can't count the number of people who jump in over their head, have no idea what they're doing and fail, then go down and try a simpler game and start to figure things out. You need to help some more new people. Tongue

I suppose.  Tongue

I always have had a hard time helping people who are just starting out because I didn't start out with ROM hacking -- I came into it with prior programming experience.  So the methods I used to learn my way around wouldn't be of any help to other people.

So I was wrong about game difficulty.  But I still stand by what I said about focusing on programming concepts first and foremost.
Nightcrawler
Guest
« Reply #10 on: May 25, 2007, 11:40:58 pm »

Quote from: Disch on May 25, 2007, 07:55:46 pm
So I was wrong about game difficulty.  But I still stand by what I said about focusing on programming concepts first and foremost.

I can agree with that. Smiley Programming concepts makes a lot of things make a lot more sense when it comes to ROMhacking, especially when it comes to getting right down to the game code.
DaMarsMan
Guest
« Reply #11 on: May 26, 2007, 12:05:43 am »

You should know at least how to program BASIC and C++.
RedComet
Guest
« Reply #12 on: May 26, 2007, 01:27:01 am »

Quote from: DaMarsMan on May 26, 2007, 12:05:43 am
You should know at least how to program BASIC and C++.

I have to disagree here. I didn't learn C until long after I understood fairly well what I was doing with ASM. In fact, I'd recommend learning ASM first. That way, when you do learn a high level language, the various concepts are easier to understand, like the stack for instance.
creaothceann
Guest
« Reply #13 on: May 26, 2007, 03:16:22 am »

Quote from: Disch on May 25, 2007, 07:55:46 pm
Quote
Try doing that to the last Kirby platformer on the SNES which is much more advanced with the same knowledge. There's going to be alot of differences. You'll need more knowledge to be able to do it.

I was specifically speaking in terms of the NES where games were pretty much exclusively written in straight 6502 and are thus organized in a logical manner.  I understand and agree that when you extend to further generation systems like SNES where code has gone through a compiler (not to mention the assembly and architecture is much more complex) -- that things get much hairier.

Maybe, but with the SNES they didn't use a compiler. Wink
Nightcrawler
Guest
« Reply #14 on: May 26, 2007, 01:33:46 pm »

Quote from: RedComet on May 26, 2007, 01:27:01 am
Quote from: DaMarsMan on May 26, 2007, 12:05:43 am
You should know at least how to program BASIC and C++.

I have to disagree here. I didn't learn C until long after I understood fairly well what I was doing with ASM. In fact, I'd recommend learning ASM first. That way, when you do learn a high level language, the various concepts are easier to understand, like the stack for instance.

I agree here as well. High level languages never clicked well with me until i learned assembly which in turn teaches how microprocessors work. Then all the sudden, everything was clear. All those C statements are effectively just shortcuts to a bunch of assembly code.
Pages: [1] 2  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC