(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
04-27-24 10:21 AM
0 users currently in ROM Hacking.
Acmlm's Board - I3 Archive - ROM Hacking - 6502 ASM newbie looking for a bit of info New poll | |
Add to favorites | Next newer thread | Next older thread
User Post
Stabwound

Goomba








Since: 05-11-06

Last post: 6386 days
Last view: 6386 days
Posted on 10-25-06 05:44 AM Link | Quote
Hey!

I've recently took it upon myself to figure out 6502 ASM. I've been into emulation for a while and after witnessing some of the amazing hacks to come out of these boards, I had to try my hand at it.

Over the past few days I've been reading up a lot on ASM. I've scoured these boards and the archives for links and tutorials. I've read most of http://dahrkdaiz.panicus.org/asmlog.txt (which is an excellent read, in my opinion) and I've done the Mario Bros and Castlevania hacks that it walks you through.

I have a solid understanding of general programming concepts. By now I have a basic understanding of some of the ASM opcodes and what they do/how they work, as well as basic understanding of the registers and the stack.

Basically, I'm just looking for some more info and reading material that you think might be useful. I've been using http://www.obelisk.demon.co.uk/6502/ as a reference guide, and I've mostly just been messing around with the FCEUXDSP debugger and a few roms, trying to decipher how certain routines work in various games, to some success depending on the game. Admittedly, I have been pretty confused at times.

Also, I was really hoping that someone could give me some suggestions of basic ASM hacks that a newbie could figure out. It doesn't matter which game; I just want some basic hacks that you know are possible and wouldn't be too complicated for a newbie to figure out. I've done the easy SMB ones in the walkthroughs (INC deaths when you die, changing the number of coins needed for 1UP) and the Castlevania ones in the walkthroughs (changing the damage routine for 1-hit-kill and afterwards changing the whip strength). I want to try doing some stuff on my own, without a walkthrough, but I don't want to jump headlong into stuff that I have little hope of figuring out with my basic knowledge.

I've mostly been trying to figure this out on my own, but I guess asking for help never hurts.

P.S: Are there any IRC channels that deal with ASM hacking? I've been hanging out in #rom-hacking on EsperNet, but it seems like the channels I see mentioned in older threads don't exist anymore.


(edited by Stabwound on 10-25-06 04:45 AM)
(edited by Stabwound on 10-25-06 04:50 AM)
Simon Belmont
Except I'm totally fucking hyped about Dracula X: Chronicles.








Since: 11-18-05
From: Pittsburgh

Last post: 6277 days
Last view: 6277 days
Posted on 10-25-06 05:52 AM Link | Quote
Someone who reads, I don't believe it

you might want to read through some documents on romhacking.net or zophar's domain.

I use this text as a great reference while writing code. This should be useful as it lists a nice chunk of data.

One of the first ASM hacks I've done was for zelda; to make the arrows load from a different ram value, have it error-check so it doesn't shoot an arrow if you have less than 1 arrows in stock, and I re-wrote the bomb item to increment arrows instead of bombs. not really all that useful as it doesn't display to the screen, but writing the routines will help.

As for IRC channels, you can try #rom-hacking on irc.esper.net or #romhacking.net on irc.darkmyst.org

Hope I've been helpful

[edit] #rom-hacking still exists on esper, I"m there constantly ;p


(edited by setz on 10-25-06 04:54 AM)
Euclid



 





Since: 11-17-05
From: Australia
hmm...

Last post: 6283 days
Last view: 6277 days
Posted on 10-25-06 08:48 AM Link | Quote
The easiest asm hacks out there is to disable stuff.

For example, disabling the code which reduces the amount of lives when you die in SMB.

These hacks are usually the first step, sure there are codes out there but some rely on freezing the amount of lives ram value, use those to help you pinpoint the branch or dec you need to disable.

The next step is to do mini asm hacks which extend the work by a bit. Like inserting code to to other funny things as you die in SMB etc.

Then further along the line you have to learn about how to interact the vram, controller inputs, interruptes etc.
Reshaper256

190


 





Since: 11-17-05
From: United States

Last post: 6320 days
Last view: 6277 days
Posted on 10-25-06 12:10 PM Link | Quote
You're on the right track, from the sound of it. FCEUXDSP is a wonderful tool to give you a visual representation of how everything is laid out in RAM. I wish you were working with SNES ASM, I could help out a little more there, and easy ROM expansion makes things a bit easier (in my opinion).

As for where to go next, I'd try to find a game's (full) disassembly and RAM map, if they exist for the game you're dealing with, as well as an assembler to insert any ASM patches you create. You don't absolutely *need* all these things just yet, but they'll become immensely helpful as your understanding of the game you're working on grows, and as the things you're trying to change become more complex.

Things you could try to change? Honestly I think it's better if you think of these sorts of things yourself, it's a lot more gratifying when you actually accomplish them. I remember being thrilled back when I started, and actually managed to make Link's sword beam go *all* the way across the screen in Zelda 2. To be vague, I'd look for some "limitation" in the original game, and get rid of it.

And don't be afraid to ask questions if you get stumped. As long as you don't sound like an idiot (if you can coherently *begin* to discuss ASM around here, you're near the top of the food chain already) you'll likely get an answer from someone who knows what they're talking about.
Stabwound

Goomba








Since: 05-11-06

Last post: 6386 days
Last view: 6386 days
Posted on 10-25-06 07:28 PM Link | Quote
Yeah, it is definately a great feeling to attempt a hack and have it work correctly. So far I've only done a few basic things. I figured out how to change the # of coins for a 1up in SMB myself. It only required changing a single byte, but I was pretty happy when I figured it out myself and it actually worked. I just was looking at the routine that ran when you collected a coin, and noticed it did a CMP $64 (which I guessed to be 100 coins) then jumped to a routine that gave you a 1up. I just changed the $64 to $01 and it worked, giving me a 1up every time I collected 1 coin, although it didn't update the visual coin counter correctly.

I'm slowly but surely getting the hang of this. I have tried a few hacks that didn't work, and I was pretty disappointed, but I'll keep trying.

Also, is there an easy way to tell which subroutine is branching to the one you are currently looking at? I haven't really done much hacking since learning about how the stack works, but could you just tell by looking at the first two bytes in the stack? How about if it is only JMP'ing to your subroutine?


(edited by Stabwound on 10-25-06 07:11 PM)
Simon Belmont
Except I'm totally fucking hyped about Dracula X: Chronicles.








Since: 11-18-05
From: Pittsburgh

Last post: 6277 days
Last view: 6277 days
Posted on 10-25-06 10:47 PM Link | Quote
as far as I know, you'd want to use a tracer for that.

Also if you list the hacks, and your code, where you inserted it, perhaps we can help you understand why it doesn't work, and thus help you improve while we have fun little 6502 excersizes
Stabwound

Goomba








Since: 05-11-06

Last post: 6386 days
Last view: 6386 days
Posted on 10-26-06 04:39 AM Link | Quote
I'm having a lot of fun with this, even if the things I'm doing aren't really that complex. I grew up playing these games and it blows my mind that I can actually edit them and change how things work in this way. I've always been a fan of cheat finders and codes (GameGenie, GameShark) but this blows them out of the water with the kinds of things that are possible.

If anyone is familliar with Zelda 2, I have a chunk of code here that runs when Link hits an enemy. I'm not sure if this is 100% correct, so the comments etc are just educated guesses. If anyone knows this to be wrong, please let me know.
$E72F:B5 C2    LDA $C2,X @ $00C6 = #$0  3 ;load enemy current hp into A

$E731:38 SEC
$E732:F9 6C E6 SBC $E66C,Y @ $E66D = #$02 ;subtract #$02 points of damage from hp
$E735:95 C2 STA $C2,X @ $00C6 = #$03 ;store enemy new hp into memory
$E737:F0 13 BEQ $E74C ;jump to death subroutine if hp = 0
$E739:90 11 BCC $E74C ;jump to death subroutine if hp < 0

I tried changing the following line in an attempt to make an instadeath hack.
$E72F:20 4C E7 JSR $E74C                  ;jump directly into death subroutine
It seems to work as intended; all enemies die in 1 hit. I know this is probably not the best way to accomplish this, but I was happy that it worked. It's also possible that I just got lucky; I just made an educated guess that $E74C was the death subroutine when I saw it checking if A <= 0. Please comment if you are familliar with Zelda 2 or have something useful to tell me.

I hope I am not being too annoying. I'm really anxious to learn this stuff and I know you guys probably get annoyed by the stupid newbie.

EDIT: Hahahahaha. I found the subroutine that runs when Link gets hurt, and I made it jump into the enemy hitting routine instead. Now when an enemy hurts Link, the enemy gets hurt instead of Link. This is awesome.


(edited by Stabwound on 10-26-06 02:00 PM)
(edited by Stabwound on 10-26-06 02:03 PM)
Reshaper256

190


 





Since: 11-17-05
From: United States

Last post: 6320 days
Last view: 6277 days
Posted on 10-26-06 11:55 PM Link | Quote
Originally posted by Stabwound
I hope I am not being too annoying. I'm really anxious to learn this stuff and I know you guys probably get annoyed by the stupid newbie.
Absolutely not, this is the kind of thing we need to see more of around here. And yes, "stupid" newbies are quite annoying, but you're obviously not one of them. Keep posting your accomplishments if you want, most of us enjoy working through these kinds of problems or we wouldn't be here.

As for determining what subroutine is JMPing to the current one, setz is correct about the tracing. You'll have to trace until the debugger snaps on your breakpoint, then go and check the trace file to see what caused the jump. I wish there was a faster way of doing it, but I can't think of one off the top of my head. For JSRs, I suppose you could check the stack to see what "return" address just got stored there. Anyway, good luck! It's good to see someone making this kind of progress.


(edited by Reshaper256 on 10-26-06 11:03 PM)
HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6278 days
Last view: 6278 days
Posted on 10-29-06 03:16 AM Link | Quote
Heh, my first ASM hack was for Pokémon Silver, making you not take any damage from most hits. Simple stuff with no real point to it, but I learned from there until now I'm doing things like bigger tilesets and new intro screens. Just keep reading, experimenting, and documenting what you find. Don't be afraid to ask questions; from what I've seen people respond positively except to really, really dumb questions ("how i can hack a room of gba").
Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - ROM Hacking - 6502 ASM newbie looking for a bit of info |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.016 seconds; used 399.14 kB (max 489.75 kB)