Data Finding Process

I'm new to Genesis dev/ROM hacking, but not to ASM and programming in general. I'm embarking on something somewhat ambitious, but not too bad: I want to do some text hacks to Shining Force II for GEN.

But the only text that seems to be stored as ASCII is the characters names. All of the dialogue seems to be compressed or worked into the script or something like that.

I was just wondering: when you guys do things like this, how do you extract data? How do you even determine where it's stored? I'm using Gens KMod, and I've done several ROM dumps, including dumps between changes of only a few characters in a textbox, and when diffing the two dumps, the changes seem to be nondeterministic. But that brings up the question: would the currently loaded dialogue be stored in the RAM?

I'm not really sure how these things would be organized, if it would be compressed some way, if it's stored in one giant block or if it's totally spread out, if the text is encoded in the scripts or if it's in referenced tiles, etc.

So my question is: what can I do to find out how and where the data is stored? What techniques should I use? Maybe some of you could share your solution to a similar experience?
 
PROGRESS (even though no one's interested it seems):

I found where the variable width font is rendered into the tile list. I just recently learned that this could be done, so that explains why I overlooked it.

[attachmentid=1856]
 

Attachments

  • sf2_ss_font.jpg
    sf2_ss_font.jpg
    39 KB · Views: 130
  • sf2_ss_font.jpg
    sf2_ss_font.jpg
    39 KB · Views: 129
Originally posted by BigNailCow@Sun, 2006-05-21 @ 08:22 PM

So my question is: what can I do to find out how and where the data is stored? What techniques should I use? Maybe some of you could share your solution to a similar experience?

[post=146369]Quoted post[/post]​


Basically you work backwards. You've found where the variable width text is rendered into VRAM; next you need to locate the code that writes to VRAM which will certainly be using the text/script data as it's input. Probably the game renders the text bitmap in to *RAM*, and then copies the entire RAM block or bigger chunks to VRAM though it may directly write the text bitmap to VRAM as well - in the former case you'd also want to check VDP DMA operations incase the CPU isn't used to manually copy data from RAM to VRAM.

Going further back you may find a decompression routine that unpacks the text into RAM or similar for processing. Probably back another step is the code that picks out chunks of the script for use, which will show how all the game's text is stored.

Having a debugger helps since you can simply set watchpoints on memory locations and find when games access them. However I don't know which (if any) Genesis emulators have this feature. If the Genesis emulation in MESS is any better than it used to be and Shining Force runs, MESS has a great debugger. Maybe Gens has one too.

Otherwise you can do a disassembly of the game and sift through the code in a text editor, though it's a lot more work. Once you do it a few hundered times, it's not so bad. ;)
 
I would also recommend making a few RAM dumps at points with text on-screen - that way, you might be able to find uncompressed text and have an address to use when searching through code.

For disassembly, I recommend IDA. I think there's a version of Gens somewhere that will log 68k execution to an .idc, which you can load into IDA (after loading the ROM) to separate data and code, although you have to exercise the game extensively to make full use of this, and it still won't catch code that's been deliberately skipped by the original programmers (although it probably wouldn't be hard for someone who knows the hardware to handle such a situation).
 
Back
Top