(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
05-08-24 12:24 PM
0 users currently in ROM Hacking.
Acmlm's Board - I3 Archive - ROM Hacking - Genesis - Data Finding Process New poll | |
Add to favorites | Next newer thread | Next older thread
User Post
BigNailCow
Newcomer


 





Since: 05-22-06

Last post: 6561 days
Last view: 6561 days
Posted on 05-22-06 02:53 AM Link | Quote
I'm new to /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 and some of the keywords in the game like ATT, DEF, HP, ITEM, EQUIPMENT, SPELLS, etc. 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 e
xperience?

(A sort of related question: what's a good genesis ROM disassembler? I've tried this program called dasm86, but the code comes out with unknown symbols and things that, well, don't look exactly like asm.)

Thanks!
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6288 days
Last view: 6288 days
Posted on 05-22-06 11:00 AM Link | Quote
I don't really know jackshit about Genesis... but is it possible you are using windows XP and the file that is being dumped is using Notepad? That might explain your garbage symbols problem. I had to remap all my text like files to Wordpad to view them correctly.

Also, this is a primarily Nintendo oriented community, as you can probably tell from the header image... either way, Sega knowledge is scarce here. Though, I know someone who is hacking Genesis code, I can ask if he can help you or not.
DarkPhoenix

Red Goomba


 





Since: 12-27-05

Last post: 6293 days
Last view: 6293 days
Posted on 05-22-06 11:24 AM Link | Quote
Well, first thing's first. If you're looking for text, it's generally stored uncompressed, but not in ASCII. (ever written a Caeser Cypher type program? No? well, wikipedia is your friend) The way most people seem to find it is with relative searching. (e.g. if the game contains the string "mario", search for any set of strings where the difference between the 2nd character and the 1st is 12, and the difference between the 3rd and 4th is 17) You'll want a good hex editor for that.
Moreover, not to get all "RTFM" on you, but find yourself a good Intro to ROM Hacking document. This issue is covered in quite a bit of depth.

For the more Assembly inclined, a more complicated way to find data would be to use differences in RAM (think save states - like before and after the event occurs) to find where the information is stored in RAM. Then, one could possibly search for it in the ROM and try changing it (a little more elegant than random corruption), or, if you have a good debugger and disassembler/tracer, you could break at writes to that RAM address, and disassemble the associacted subroutine, figure out what it does, and see where it gets its data. (useful, for example, if you have a subroutine that copies data from one area of memory to another, or addresses another component, like a PPU - memory maps are your friend)

As for dasm86, as far as I know, that's an x86 disassembler (that is, for IBM compatible processors, i.e. Intel, AMD, and Cyrix - like what's probably in the computer you're using, unless of course it's a Mac) Genesis uses the Motorala 68000 processor, so you need a disassembler that supports that instruction set. A quick google search offers some help -
http://emureview.ztnet.com/sega/gentechnt.htm.
http://www.sws2b.com/forums/index.php?s=7251b347599c9bcdbc9558cf73682728&showtopic=1866
BigNailCow
Newcomer


 





Since: 05-22-06

Last post: 6561 days
Last view: 6561 days
Posted on 05-22-06 12:06 PM Link | Quote
but is it possible you are using windows XP and the file that is being dumped is using Notepad? That might explain your garbage symbols problem. I had to remap all my text like files to Wordpad to view them correctly.

Well, the "garbage" occurs in the output of dasm68. I just pipe it to a file, because it prints out onscreen by default. (And I'm running Win2k.) So I don't think that's the problem.

I had a thought that the garbage symbols could be the unrecognized labels, but then I remembered that those don't really exist once the code is compiled. Are there two variants of 68k?

Also, this is a primarily Nintendo oriented community, as you can probably tell from the header image... either way, Sega knowledge is scarce here. Though, I know someone who is hacking Genesis code, I can ask if he can help you or not.

Yeah, I noticed that after browsing around a bit more (I kinda wish there were more than mario/metroid/zelda/castlevania/megaman mods though, but I know platformers are the most straightforward so it makes sense. That FF1 system clone looks great though, and so do all the other projects, but yeah, irrelevant) I posted here because it was the most active ROMhacking board I could find, but I also posted two other places, even though the community is small so members are pretty much universal across forums.

If it's not too much trouble, you could ask him. However I think this is more of a game-specific thing. I can't think of another game that uses variable-width fonts off the top of my head.

not to get all "RTFM" on you

It's ok, I probably deserve to get RTFM'd upon.

(See below for why I don't think TFM can help me out here)

Well, first thing's first. If you're looking for text, it's generally stored uncompressed, but
not in ASCII. (ever written a Caeser Cypher type program? No? well, wikipedia is your friend) The way most people seem to find it is with relative searching. (e.g. if the game contains the string "mario", search for any set of strings where the difference between the 2nd character and the 1st is 12, and the difference between the 3rd and 4th is 17) You'll want a good hex editor for that.


Already tried a relative search (using the "latest" RC for Hexecute (whose search is buggy, but oh well)). I looked in both the ROM and several RAM dumps, and can't find example strings. Maybe Hexecute just sucks.

As I said before, the font is variable-width so it's probably not tile references.

For the more Assembly inclined, a more complicated way to find data would be to use differences in RAM (think save states - like before and after the event occurs) to find where the information is stored in RAM. Then, one could possibly search for it in the ROM and try changing it (a little more elegant than random corruption)

I've done this and found several places where it's changed a great deal even after just running forward a few frames and letting the next character be printed. I can't find how the changes relate to the text, because most of those bytes are like FF 1F FF FF F1 1F 1F and variants like that. They're not really close to each other.

I haven't tried searching for that result in the ROM, so I'll try that.

if you have a good debugger and disassembler/tracer, you could break at writes to that RAM address, and disassemble the associacted subroutine, figure out what it does, and see where it gets its data.

That's what I would be doing... if I had a good debugger/disassembler/tracer. The only debugger/tracer I have is Gens KMod, and that doesn't seem to be robust enough. What would you guys suggest? I have MSVS on another computer which I will probably start using for this. If I can't get my current disassembler working, I'll check out your links (thanks).

As for dasm86, as far as I know, that's an x86 disassembler

Yet again, my haste in posting shows itself. It's called dasm68 (I'm used to x86 obviously so it came out that way). I disassemble it with the flag to use 68000.

Thanks for the responses. Didn't realize how long this post was...

EDIT:
Thanks to someone on another forum, I found out how SF2 does it. I have a screenshot, but I can't post it because I was the last replier and I can't attach a file now or something and I don't have storage right now... so uh yeah, once someone replies I'll attach it. It's pretty self-explanatory.

This is a breakthrough, so even though this community is primarily Nintendo and probably doesn't care, I'll keep you posted with my progress. (Maybe the community should branch out, hint hint. There are lots of good consoles. )


(edited by BigNailCow on 05-22-06 11:54 AM)
Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - ROM Hacking - Genesis - Data Finding Process |


ABII

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

Page rendered in 0.021 seconds; used 373.41 kB (max 453.01 kB)