ROM Hacking Discussions
View Single Post
September 3rd, 2011 (6:59 PM).
Join Date: Oct 2007
Originally Posted by
Actually I was referring to
(even though that's not a big difference, for the topic itself).
I have to disagree: if the code is well written, it's pretty easy to find where is the part one's interested in (I gave a look at Gambatte's source, and finding the part I need to edit was pretty fast). Adding a tracing/logging funtion shouldn't take too much time.
Anyway what I really meant was not a program that simply dumps the code in "mnemonics" (BGB and a Pokeanalysis ".c/.h" module do it as well). I was thinking of a program that can actually label every address the code refers to (routines' beginnings, jumps' offsets, and so on), and can format data as "Define Byte", "Define Word" (or in
, but that would be too much, probably), if you get what I mean.
Because, the problem with disassembling code "by hand" is not the difficulty of finding where the stuff is located or figuring out how it works (by the way, I find it the most entertaining part); the problem is instead arranging it in the format that the assembler needs in order to assemble it correctly.
Of course, it would be impossible to get things perfect. But here are some ideas:
Nothing has to be disassembled in order; precede each line with its address so you can sort it later. (Better idea: precede it with address × 2. Then you can precede labels with address × 2 − 1.
Keep around a boolean true/false for each value in memory, so you don’t get in an infinite loop.
Here’s an example of properly labeling things: when you encounter loads to a and hl, put them in a queue before printing them out. If they’re followed by a call to $35CD, replace the constants with the appropriate labels and BANK() macros, then flush the queue.
If you want me, please contact me
If you want to hack Pokémon RBY or GSC, read, read, and read some more.
This has tons of valuable information.
Pokémon Red disassembly project
Rules that should be rethought:
Bad posts are bad posts, regardless of how many words are in them or how old the thread is.
Good posts are good posts, regardless of how old the thread is—and brevity is underrated.
View Public Profile
Send a private message to IIMarckus
Find all posts by IIMarckus
Find threads started by IIMarckus