Page 1 of 1

ripping sprites, backgrounds, etc

Posted: Tue Sep 07, 2010 9:45 pm
by counterp
does snes have a common image format?

are there tools to dump all backgrounds and sprites of a rom?

if not, how would i go about getting all the images from a super mario world rom.

Posted: Wed Sep 08, 2010 1:22 am
by Bregalad
SNES graphics works with tiles.
You should look into tile editors, such as YY-CHR or Tile Layer.

Many SNES games have compressed graphics though, so you won't see them with those unfortunately.

Re: sprites, backgrounds, etc

Posted: Wed Sep 08, 2010 5:19 am
by tokumaru
counterp wrote:does snes have a common image format?
Depends on what you mean. Game graphics are made of several 8x8 blocks/tiles put together, and the format for these tiles is constant (at least when in use by the video hardware, when stored in the ROM they can be compressed, and the exact format used will vary from game to game).
are there tools to dump all backgrounds and sprites of a rom?
I doubt it, unless these tools are game specific. That's because even though the format for the 8x8 tiles follows a standard, in order to build the images we see on the screen a lot more information is needed: which palettes these tiles must use, where in the screen each one goes, etc, and there is no standard for that kind of information.
if not, how would i go about getting all the images from a super mario world rom.
What exactly do you want to do? When you say all the "images" do you mean all the individual blocks so that you can build your own maps (for example) or do you mean complete level maps?

Posted: Wed Sep 08, 2010 5:41 am
by tepples
If you're willing to work with proprietary software on Windows, you can play with Lunar Magic, which has "a lot more information" built into it and can export a lot of this.

Posted: Wed Sep 08, 2010 7:06 am
by TmEE
doesn't SNES use planar GFX setup ?

On MD, each byte of VRAM contains 2 pixels, 4 bits for one pixel. In planar setup you got one pixel spread across bytes. So if a pixel needs 4 bits you got the pixel spread between 4 bytes... ?

Posted: Wed Sep 08, 2010 7:16 am
by mic_
Yes. Byte0 holds bit0 for row0, byte1 holds bit1 for row0, byte2 holds bit0 for row1, and so on down to byte15. Then byte16 and on continues with bit2/bit3 (if needed), all the way up to the necessary number of bits for the currently used map type.

Posted: Wed Sep 08, 2010 7:18 am
by tepples
A 16-color tile on Super NES is 32 bytes long and looks like two Game Boy tiles one after another. The pixel rows start on bytes 0, 2, 4, 6, 8, 10, 12, and 14. The bit planes for one "sliver" of 8x1 pixels are at offsets 17, 16, 1, and 0 from the start of the rows. The number made from the most significant bits of all these bytes determines the color index pixel on the left side; the number made from the least significant bits determines the color index of the pixel on the right side.

I *think* 4-color tiles are the same as Game Boy tiles, or the same as the first 16 bytes of a 16-color tile.

Mode 7 tiles are packed pixels.

Fixed bit-rate compression typically reduces the number of colors available to each tile. Super Mario World assumes plane 3 is either all zeroes or equal to planes 0-2 OR'd together, so that a single tile uses colors 0-7 or 0 and 9-15. The Mode 7 tiles in F-Zero look like Genesis tiles (4-bit packed MSB-first) with a little header that apparently controls which colors are used.

Variable bit-rate compression most often uses either "Lempel-Ziv" family techniques, in which runs of bytes are copied from earlier in the decompressed data (of which RLE is a special case), or "Huffman" family techniques, which assign shorter bit codes to more common bytes and longer codes to less common ones, or both.

Posted: Wed Sep 08, 2010 6:24 pm
by counterp
What I want to do is dump all sprites + maps, didn't realize it was all split up in 8x8 tiles

And i just downloaded lunar magic, checking it out.

Posted: Wed Sep 08, 2010 7:32 pm
by tokumaru
counterp wrote:didn't realize it was all split up in 8x8 tiles
All old games (and new 2D games too, and even 3D games reuse textures and polygons) draw their maps by reusing the same blocks over and over and over again... It's a form of image compression actually. The same kind of grass shows up over and over, the same "?" blocks, the same clouds... everything repeats, so it makes sense to have a few tiles representing those objects and a tile map where you can place those tiles, and reuse the same ones as much as you like. It's a much more compact way to represent graphics, and fits perfectly the kinds of games from the 80's and 90's.

Posted: Thu Sep 09, 2010 12:08 pm
by counterp
Lunar magic is working wonders, thanks.