+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  How do I edit Mode 7 graphics?
Pages: [1]
Author Topic: How do I edit Mode 7 graphics?  (Read 447 times)
Kitsune Sniper
Guest
« on: June 19, 2007, 12:54:07 am »

I just realized that one of my old projects uses Mode 7 for its title screen. So uh, I'm trying to figure out how to extract and hack said graphics. :p

How can I do this?
Ryusui
Guest
« Reply #1 on: June 19, 2007, 01:11:15 am »

Well, for starters, mode 7 graphics are 256-color (or, IIRC, 128-color + transparency). They're also funky in that the graphics and tilemap data are interleaved; that is, every other byte is graphics data, and the bytes in between are the tilemap data.

I've had experience with this precisely once, and that was with Patlabor's title screen (which I figured out how to decompress/recompress but never quite fully hacked), so my memory is a little fuzzy.
creaothceann
Guest
« Reply #2 on: June 19, 2007, 02:48:55 am »

Mode7 data takes the first half of VRAM.

Quote from: anomie's register doc
The tilemap and charactermap are interleaved, with the character data being in
the high byte of each word and the tilemap data being in the low byte (note
that in hardware, VRAM is set up such that odd bytes are in one RAM chip and
even in another, and each RAM chip has a separate address bus. The Mode 7
renderer probably accesses the two chips independantly). The tilemap is 128x128
entries of one byte each, with that one byte being simply a character map
index. The character data is stored packed pixel rather than bitplaned, with
one pixel per byte.

[...]

When bit 6 of $2133 is set, you get a related mode known as Mode 7 EXTBG. In
this mode, you get a BG2 with 128 colors, which uses the same tilemap and
character data as BG1 but interprets the high bit of the pixel as a priority
bit.

[...]

Note that BG1, being a 256-color BG, can do Direct Color mode (in this case, of
course, there is no palette value so you're limited to 256 colors instead of
2048). BG2 does not do direct color mode, since it is only 7-bit.
Jonny
Guest
« Reply #3 on: June 19, 2007, 05:01:36 am »

I've done this for the full SlayersRPG mode 7 intro.

Neviksti's Pcx2Snes program can convert input images to mode7 format.

You could then write a transfer routine (eg lda $b08000, sta $7f4b00) to copy the uncompressed mode 7 title logo map+pixel data from rom to ram.  The transfer routine if I remember right would transfer first a map byte, then a pixel byte.  Once its created in ram, transfer to vram with a dma routine. 
Kitsune Sniper
Guest
« Reply #4 on: June 19, 2007, 08:32:38 am »

...

Er. What? I don't understand anything about SNES ASM. If there isn't a simple way to edit it at all, then I think I'll just leave it alone. It's got an English title but most of it is made up of four kanji so I wanted to try to hack the title screen. Guess I won't. :p
creaothceann
Guest
« Reply #5 on: June 19, 2007, 08:42:54 am »

Have you checked the tile editors?

(Maybe I could throw something together... might try later.)
Pages: [1]  


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