+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  How do you change a palette on a NES game? (Read)
Pages: [1]
Author Topic: How do you change a palette on a NES game? (Read)  (Read 435 times)
Kitsune Sniper
Guest
« on: September 05, 2007, 05:05:36 pm »

Okay, so I'm almost done with Armadillo. I've got two things left: The intro, and the title screen.

BMF54123 hacked the title screen ages ago so it would use a nifty title screen. He sent me an IPS file and I remember it looked great, but ... there's a problem with the palette: The bottom row, and the right most side, use another palette. So instead of being blue and chalk-colored, those two areas are red.

Edit:


The palette docs on this site mention how to change the palettes for the entire game; they don't tell you how to change what palettes are assigned to each tile. I changed the palette for the affected area, but it ended up changing the color of the floor in certain stages, so that's entirely out of the question.

Does anyone have any idea if what I want to do is possible?
« Last Edit: September 05, 2007, 06:50:08 pm by Kitsune Sniper »
KingMike
Guest
« Reply #1 on: September 05, 2007, 10:44:44 pm »

There's likely an "attribute" table for the title logo.
Check out FCE Ultra XD SP. More than likely, PPU memory $23C0-23FF is the data. While on the title screen, play around with that in the built-in hex editor and see if the colors screw up. If so, do a hex search for some of the original data in the ROM.
Also, note that the NES hardware dictates that every 2 BITS in that $40-byte region affects a 16x16-pixel (2 tile x 2 tile) region of the screen (going left to right, then top to bottom). But that's probably getting a bit ahead.
Kitsune Sniper
Guest
« Reply #2 on: September 05, 2007, 11:15:47 pm »

Quote from: KingMike on September 05, 2007, 10:44:44 pm
There's likely an "attribute" table for the title logo.
Check out FCE Ultra XD SP. More than likely, PPU memory $23C0-23FF is the data. While on the title screen, play around with that in the built-in hex editor and see if the colors screw up. If so, do a hex search for some of the original data in the ROM.
Also, note that the NES hardware dictates that every 2 BITS in that $40-byte region affects a 16x16-pixel (2 tile x 2 tile) region of the screen (going left to right, then top to bottom). But that's probably getting a bit ahead.

It's not ahead. What you're basically telling me is that depending on what value I input, different tiles in a certain area will use a different palette?

I was futzing around with $23D6 and I noticed the value affected more than one 2x2 tileset. And I also made everything use the same byte combination (in my example, FF) and everything turned grayscale. I'm kinda getting it, but this is a bit annoying because the game plays a demo after a few seconds. Ugh.

I'll get it eventually, though. Thanks.

Edit: GOT IT!



The changes have been made to the rom. All that's left is some signs and the intro. Wow. Thanks!
« Last Edit: September 05, 2007, 11:54:34 pm by Kitsune Sniper »
Disch
Guest
« Reply #3 on: September 06, 2007, 02:12:46 am »

Quote from: Kitsune Sniper on September 05, 2007, 11:15:47 pm
I was futzing around with $23D6 and I noticed the value affected more than one 2x2 tileset.

Welcome to the hell that is NES attribute tables.  Each byte covers a 32x32 pixel block -- each bit pair assigns a palette to a 16x16 block.

Code:
  E. Attribute Tables
  -------------------
    Each byte in an Attribute Table represents a 4x4 group of tiles on the
    screen. There's multiple ways to describe what the function of one (1)
    byte in the Attribute Table is:

      * Holds the upper two (2) bits of a 32x32 pixel grid, per 16x16 pixels.
      * Holds the upper two (2) bits of sixteen (16) 8x8 tiles.
      * Holds the upper two (2) bits of four (4) 4x4 tile grids.

    It's quite confusing; two graphical diagrams may help:

      +------------+------------+
      |  Square 0  |  Square 1  |  #0-F represents an 8x8 tile
      |   #0  #1   |   #4  #5   |
      |   #2  #3   |   #6  #7   |  Square X represents four (4) 8x8 tiles
      +------------+------------+   (i.e. a 16x16 pixel grid)
      |  Square 2  |  Square 3  |
      |   #8  #9   |   #C  #D   |
      |   #A  #B   |   #E  #F   |
      +------------+------------+

    The actual format of the attribute byte is the following (and corris-
    ponds to the above example):

       Attribute Byte
         (Square #)
      ----------------
          33221100
          ||||||+--- Upper two (2) colour bits for Square 0 (Tiles #0,1,2,3)
          ||||+----- Upper two (2) colour bits for Square 1 (Tiles #4,5,6,7)
          ||+------- Upper two (2) colour bits for Square 2 (Tiles #8,9,A,B)
          +--------- Upper two (2) colour bits for Square 3 (Tiles #C,D,E,F)

I know you solved it already but I felt like copy/pasting this anyway.

BTW:  I've played a bit of Armadillo.  That game might be really fun if it weren't crippled by such horrible slowdown.  At any rate I'm really glad to see a translation  ^^
Kitsune Sniper
Guest
« Reply #4 on: September 06, 2007, 02:11:25 pm »

Quote from: Disch on September 06, 2007, 02:12:46 am
I know you solved it already but I felt like copy/pasting this anyway.

BTW:  I've played a bit of Armadillo.  That game might be really fun if it weren't crippled by such horrible slowdown.  At any rate I'm really glad to see a translation  ^^


I don't think it's that difficult. Learning how to do this will be useful for Samurai Pizza Cats. I was having issues with the title screen's colors, but now that I know how to change those values, I can do this more easily.

And yeah, Armadillo's slowdown sucks badly. The game was programmed very half-assedly, and there's tons of unused text and stuff in the game for some reason... but it's also very easy to localize. Good to see someone's looking forward to it.
Googie
Guest
« Reply #5 on: September 06, 2007, 03:22:15 pm »

I can't wait until you finish this too, this'll be sweet to play in English regardless of the slow gameplay.  :cookie: 
Pages: [1]  


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