+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Any tips for a newbie 6502 ASM hacker?
Pages: [1]
Author Topic: Any tips for a newbie 6502 ASM hacker?  (Read 342 times)
Stabwound
Guest
« on: October 28, 2006, 12:13:08 am »

For the past week or so I've been reading up on 6502 ASM and messing around with FCEUXDSP and a few roms, just trying to figure out what I could. My two main resources have been http://dahrkdaiz.panicus.org/asmlog.txt (6502 walkthrough IRC log) and http://www.obelisk.demon.co.uk/6502/ as a reference guide.

I know about basic things like the opcodes, how branches/jumps work, somewhat understand the stack. I've made a few minor gameplay hacks in SMB, Zelda and Castlevania, but nothing complicated; I just wanted to see what I could figure out. The coolest thing I figured out on my own was in Zelda 2: making enemies get hurt instead of Link when you run into them.

Basically, I'm just looking for any tips or resources that I might not know about. Really, anything is appreciated. I know there are a lot of great ASM hackers here, and you guys are what inspired me to learn this. I'm determined to learn to ASM hack!
tomaitheous
Guest
« Reply #1 on: October 28, 2006, 02:37:58 am »

If you know the basics, then try stepping through random parts of game code to see how some more complex routines or optimized code work. Take a look at how each instruction effects the flag register - For example LDA effects the Z flag as well as AND and INC.

 LDA <operand>
 BNE <signed short> ; branch if REG A is not zero

 instead of

 LDA <operand>
 CMP #$00
 BNE <signed short>

 or

 INC <operand>
 BNE <signed short>  ; branch If no roller over

 instead of

 LDA <operand>
 INC A
 STA <operand>
 CMP #$00
 BNE <signed short>
 

 Some functions modify the carry flag at the end of a function(SEC) and have a branch instruction right after the function call. This means you can pass 1bit value from the function with little overhead - no memory or REG needed.

« Last Edit: October 28, 2006, 02:43:19 am by tomaitheous »
RedComet
Guest
« Reply #2 on: October 28, 2006, 06:13:59 am »

http://www.rpgclassics.com/subsites/twit/docs/text/

That might be useful for getting familiar with using some of FCEUXD SP's features. Let me know if you use it and what you liked/disliked about it, so I can improve it. Smiley
Pages: [1]  


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