+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Mega Man 7 graphics compression
Pages: [1]
Author Topic: Mega Man 7 graphics compression  (Read 892 times)
tc
Guest
« on: July 08, 2007, 01:33:54 pm »

Here it is. My big thread! The main reason I came here: to solve the long-standing mystery of extracting graphics from this game. Grin

As is typical for SNES games, most of it's graphics are compressed. I've asked on other message boards, and Googled with no luck for years. Nothing of use whatsoever comes up. Not even the format's name, let alone a person claiming to have discovered it, or utilities.

I've finally found tiles about a week ago. In a savestate using YY-CHR. But, copying and pasting thousands of tiles that way would be quite tedious to say the least. It'd be actually quicker to find out what format they're in, then write a batch script to dump them all to a file. I know that kind of program exists for Super Mario World, Yoshi's Island, and ZeldaLTTP, among others.

Note the word "extracting" above. I don't want to edit and reinsert them, just get the tiles out so they can be used in other projects.
It shouldn't be hard either. The data for related games like Rockman & Forte is known, it's fan translation proves that.

So, does anyone have any information on the graphics compression format in Mega Man 7?
Ryusui
Guest
« Reply #1 on: July 08, 2007, 02:06:31 pm »

The best way to handle it is to do your own research. Compression is easy: you just have to know what you're looking at.

You'll need an app like Geiger's Snes9x Debugger, and some knowledge of what the hell breakpoints are. If you know where the compressed data is stored, congratulations: set a breakpoint for a sample location and step through the code, paying close attention to what the game does with the data. You'll figure it out.
tc
Guest
« Reply #2 on: July 08, 2007, 02:45:16 pm »

Um... Huh? I doubt they would design an entirely new format for just one game, then never use it again.

Well, let's see where to begin. I don't know where the compressed data is stored. I'd used a savestate to view a few tiles. While it is possible to achieve my intention that way, that'll take far too long.

Do keep in mind I'm most definitely not a programmer. Finding the data's address and compression scheme might be within my ability. But writing a way to get them dumped to file isn't.
Ryusui
Guest
« Reply #3 on: July 08, 2007, 03:13:15 pm »

Quote from: tc on July 08, 2007, 02:45:16 pm
Um... Huh? I doubt they would design an entirely new format for just one game, then never use it again.

You'd think that, but it's typically the case. Most games use their own unique compression implementations: thankfully, most of them are variants of LZ, which is a simple routine to work out. GBA is an odd duck among cartridge systems in that its BIOS has built-in support for a particular LZ scheme, used by many titles for the system (notably the Pocket Monsters games).

Finding the compressed data is simple. If the graphics are compressed, then they are extracted to work RAM before being DMA'd to VRAM: use a tool like VSNES to examine a save state and figure out where in RAM the graphics are being compressed to, then set a write breakpoint in Geiger's to that location. Now you have the location of the compression routine. Run through the code and watch what happens. It should load a byte from somewhere in the ROM (likely the second byte of the compression data; this gives you the compressed data's location), and then do some complex math to it to figure out whether it's "plaintext" or compression code and handle it appropriately.
Nightcrawler
Guest
« Reply #4 on: July 09, 2007, 09:04:28 am »

Quote from: tc on July 08, 2007, 02:45:16 pm
Um... Huh? I doubt they would design an entirely new format for just one game, then never use it again.

Out of all the SNES games I've looked at, I've never seen any two not made by the same company that had the exact same compression routine. Wink Even then, sometimes games made by the same company still use different routines.

They're often times similar because the system was unable to handle any advanced compression algorithms, but rarely ever the same. There was no such thing as a 'standard' to use for compression on that platform. It'll generally be an LZ variant, a variant of Run length encoding, in some cases huffman, or a unique/custom blend of more than one of those.

Ryusui has you on the right track. It probably won't be easy for someone at your level and no programming experience, but don't sell yourself short. Everybody starts somewhere. Facing challenges is the only way we grow in our ability.
KingMike
Guest
« Reply #5 on: July 09, 2007, 09:42:11 am »

Quote from: Nightcrawler on July 09, 2007, 09:04:28 am
Quote from: tc on July 08, 2007, 02:45:16 pm
Um... Huh? I doubt they would design an entirely new format for just one game, then never use it again.

Out of all the SNES games I've looked at, I've never seen any two not made by the same company that had the exact same compression routine. Wink Even then, sometimes games made by the same company still use different routines.

Nadia for Genesis (made by Namco) and Jelly Boy 2 (by Game Freak and Sony, for the SNES). Only difference is the endian of the decompressed size.
Though Jelly Boy 2 incorrectly detected bank boundaries. (It was a "HiROM" game, but it would increment the bank pointer if the ROM address was $7FFF, resulting in the compression byte being read from 32KB later. So, like if the decompression routine was reading from $77FFF, the next byte decompressed would be read from $80000, instead of $78000).
Ryusui
Guest
« Reply #6 on: July 09, 2007, 01:15:24 pm »

In January 2006, I thought I was fully incapable of such advanced feats as VWF or tackling compression. In March of 2006, I did both.

You never know until you try.
Dan
Guest
« Reply #7 on: July 09, 2007, 03:22:56 pm »

Parasyte wrote a graphics decompressor before he quit rom hacking or whatever. Before panicus.org disappeared, gavin had it archived on his website.

I have a copy of the program here, I just don't have anywhere to upload it. (or can't be arsed signing up for a free host tonight)
Ryusui
Guest
« Reply #8 on: July 09, 2007, 03:26:09 pm »

Googlepages is good. 100MB of ad-free, direct-linking storage space for absolutely nada.

Problem is, it's a pain in the ass to actually make a webpage using Googlepages. ^_^;
Spikeman
Guest
« Reply #9 on: July 09, 2007, 04:26:05 pm »

You mean this?

http://www.romhacking.net/utils/433/
Piotyr
Guest
« Reply #10 on: July 10, 2007, 09:05:42 am »

Theres a few megaman 7 graphics hacks on this very site I suggest tracking down the auther and sending him an email asking how they did it.
tc
Guest
« Reply #11 on: July 10, 2007, 10:43:12 pm »

Oh yeah... I see that. And something about Rockman 7 is in the help wanted section too. Maybe someone does know the compression format after all.

What's this about a SNES9x dubugger? Don't have a clue how to debug though. I guess the worst that could happen is crashing the emu, or having to replace the ROM used with a backup copy. Cheesy
Pages: [1]  


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