+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Can someone tell me a bit about SNES compression?
Pages: [1]
Author Topic: Can someone tell me a bit about SNES compression?  (Read 276 times)
Rai
Guest
« on: January 04, 2007, 09:29:47 am »

I've always wanted to translate SNES roms, but the thing that's always scared me, is that I hear that SNES compression is hard to crack. Unlike NES games, where it's usually easy to find the text, I hear that finding, and editing the text in an SNES game is very hard. So moving on, what are some common SNES compression schemes, and also, are there any good guides out there on how to find the compressed text?
RedComet
Guest
« Reply #1 on: January 04, 2007, 09:37:08 am »

LZ variations seem to be the most popular. Jay wrote a nice tutorial on the different common compression methods, so you can check that out (it's the database). We've got a lot of stuff in the database, so check there for source code. If you want a working example of a compressor and decompressor, look up the source code I released for V Gundam, which you can get here on RHDN or from my site.

Remember, no game will use the exact same scheme. The concepts are the same, the implementation will most liekly differ. Don't forget, a game doesn't necessarily have to have compressed text just because it's on system XYZ.

If you're dealing with compression, you'll most likely need to know assembly for the target machine, so you can crack it.
Nightcrawler
Guest
« Reply #2 on: January 04, 2007, 10:04:57 am »

Compressed text on the SNES always needs to be decompressed and stored somewhere. Since you can't write to ROM, it's stored in RAM.

That's where you can start to find it. In the very least, the game will have the current string decompressed in RAM. If you're lucky, you may find the entire text block.

Anyway, you'll need to find the address in RAM that the text is decompressed to. Then you can use that when looking in trace files or using a debugger to look at the code and see how it got there. Ultimately, you'll find text is read from the ROM at some location and run through a routine and then stored in that location at RAM before it's printed to the screen.

SOMETIMES you can crack the compression simply by examining the compressed data in the ROM, but more often then not, especially since you're new, you'll probably need to look a trace file of the decompression routine and try and figure out what it's doing.

Also, you don't necessarily need to know how the compression works sometimes. You can hack the routine to read uncompressed text from the ROM. However, depending on your game, this may or may no be easily feasible.

All of this is secondary. The first thing you need to do is find either the location in RAM the uncompressed text is or the place in the ROM where the compressed text is, whichever you can locate first. You need to start somewhere. Wink Relative searching can sometimes find a portion of compressed text in the ROM right off the bat. To have any luck with that, you'd want to look up the first word in the first string of the game. It has a high chance of not being compressed since compression works by eliminating redundancy. However, there is no redundancy yet at the very start of the data stream(Unless the game uses dictionary on top of the main compression routine and the first word happens to be a dictionary entry).
Pages: [1]  


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