+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Mode 7 Color Palettes
Pages: [1]
Author Topic: Mode 7 Color Palettes  (Read 2 times)
Kitsune Sniper
Guest
« on: September 18, 2009, 05:11:04 pm »

Does anyone have any information on how they're stored? I'm messing around with a game, but I need to change some colors around.
smkd
Guest
« Reply #1 on: September 18, 2009, 07:15:39 pm »

The same -bbbbbgg gggrrrrr format used for everything else.  unless direct color gets involved then it's up to the tile data to decide what color to display.
Kitsune Sniper
Guest
« Reply #2 on: September 18, 2009, 08:38:13 pm »

Quote from: smkd on September 18, 2009, 07:15:39 pm
The same -bbbbbgg gggrrrrr format used for everything else.  unless direct color gets involved then it's up to the tile data to decide what color to display.
Um.

What?

Seriously, what? Are the palettes stored in the map data? On separate offsets?
smkd
Guest
« Reply #3 on: September 18, 2009, 10:44:41 pm »

What answer are you looking for?

I am assuming you are talking about SNES BG Mode 7, unless there is a game called "Mode 7" that I don't know of.  The actual color data used with mode7 that makes up the color you see on screen is no different from any other mode.  You didn't put a game in the OP so I assume it's a general question.

Palettes are stored in ROM wherever the devs decided to place them, I don't know what game this is so that's the best answer I can give.  The format is 16bits per color(only 15 bits used) in the above post.  We're not on the same page for sure so what exactly are you asking?
creaothceann
Guest
« Reply #4 on: September 18, 2009, 10:48:01 pm »

When you read a pixel from a BG layer, you get the resulting palette index. That index is combined with the 3 "palette subgroup" bits of the pixel's tilemap entry. Usually it's subgroup*colordepth+index, but in Mode0 it's subgroup*colordepth+index+(BG-1)*32.

When colordepth is 256 (that applies to BG1 in Mode3, Mode4 or Mode7), subgroup would be useless since there are only 256 colors in the global palette.

Therefore, in DirectColor mode ($2130.0=1) the bits are combined like this:

Code:
   index (8-bit) = BBGGGRRR
subgroup (3-bit) = bgr

 result (15-bit) = BBb00GGGg0RRRr0

Note that in Mode7 there are no subgroup bits, so it still uses only 256 colors. (Or 255, since index=0 means "transparent pixel".)
Kitsune Sniper
Guest
« Reply #5 on: September 18, 2009, 10:57:51 pm »

Uh.

So it's nothing like NES palettes, then.

Okay.

I uh, was able to adapt the graphics to use the palette that was loaded / saved with the ZSNES savestates I used to hack the image. I couldn't edit it, which is a shame, because some of the colors were too dark, but oh well.

Thanks anyway.
creaothceann
Guest
« Reply #6 on: September 18, 2009, 11:05:48 pm »

Are the Mode7 tiles compressed? If not they should be editable.
Kitsune Sniper
Guest
« Reply #7 on: September 18, 2009, 11:10:56 pm »

Quote from: creaothceann on September 18, 2009, 11:05:48 pm
Are the Mode7 tiles compressed? If not they should be editable.
They're not, my problem was the palette.

And I have no idea how to edit it without going into the actual bytes and changing them.
Pages: [1]  


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