Patching rom-palettes for RC2C03B PPU

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Patching rom-palettes for RC2C03B PPU
by on (#110601)
Hi Everyone.
I just got my dream-setup, that's an rgb-modded av famicom and Krikzz' Everdrive N8.

I was wondering if there's a way to alter a rom's palette to look more like it was intended when there's a RC2C03B PPU sitting in my system.
What would be the right way to do this in your opinion - just patching a game or maybe ask Krikzz to include this type of thing in the Everdrive's OS.

I've found this while searching for an answer, but I'm a n00b and that guy's project is working the other way around...
http://www.raphnet.net/electronique/nes ... tion_id=10


Thanks!
Re: Patching rom-palettes for RC2C03B PPU
by on (#110602)
The 2C03 PPU is the one used in Sharp's Famicom Titler and Famicom TV, which play ordinary Famicom games. Games are supposed to already look right with it, except for games like Just Breed and Felix the Cat that tint the whole screen for more shadow detail. Nintendo broke tint on the RGB PPUs.

What game looks wrong? Do you have a camera with which to take a screenshot?
Re: Patching rom-palettes for RC2C03B PPU
by on (#110619)
All colors look a bit different with the rgb-ppu, well I guess that's normal and it wouldn't bug me if only the skin-tones were so... yellowish.

Taking pics from the running game on a crt-tv will not demonstrate the effect as much as taking screenshots in nestopia while changing the palette from yuv to rgb - it's the exact same thing on the real hardware. Some examples:

Mario Bros. NES PPU:
Image

Mario Bros. RGB PPU:
Image


Super Mario Bros. NES PPU:
Image

Super Mario Bros. RGB PPU:
Image


Maniac Mansion NES PPU:
Image

Maniac Mansion RGB PPU:
Image


Is the 2C03 PPU even capable of displaying the nes color-palette?
Re: Patching rom-palettes for RC2C03B PPU
by on (#110623)
No, you can't modify the RGB PPU palette by modifying the ROM or with Everdrive N8. You would need a fairly complicated external device (that probably doesn't exist) that would grab the video signal and modify the colors so that they more closely represent the original 2C02 colors.

You can of course try patch the ROM to change the colors to something you like better, but you're still limited to the 52 color master palette of the RGB PPU (you can view this in Nestopia).
Some brainstorming about palettes
by on (#110624)
I did some research but since I'm not familiar with hardware programming or the nes system's internals I'll give it a go and just repeat what I've learned.
Please correct me if I'm wrong.

The complete palette within a ppu consists of 4*16 colors.
Colors have addresses like this:
00-0F
10-1F
20-2F
30-3F

The color is generated in the ppu, not in the game. the game only addresses to a certain color.
Depending on what ppu is used the palette varies.
On the RC2C03B the 0D, 1D, 2D and 3D colors are not present or black.
(which explains why Maniac Mansion looks like someone turned off the light inside the house [the dark-grey of the walls is displayed as black])

Which concludes to: There just can't be any patching or rom-modifying method to alter the color palette in any way...
Am I right?

[edit]
Note: Thanks thefox, I was posting this simultaniously to your answer.

Followup:
External Device... hmmm...
What about a PIC controller or something alike...
From where would it get the input signal - directly from the ppu or after picture processing from the AV-Out ?
Re: Patching rom-palettes for RC2C03B PPU
by on (#110625)
You can't modify the translation of a 6-bit color number to an RGB value; that's controlled by a mask ROM within the PPU. But you can patch the ROMs to use different color numbers, such as using $26 or $36 for skin tones where the game uses the more orange $27 or $37, or using $00 and $10 for grays where the game uses $2D and $3D. And you could modify the ROMs not to use color emphasis. But that's about it.
Re: Patching rom-palettes for RC2C03B PPU
by on (#110626)
Yes, I got it sorted out now. Thanks guys.

I wanna give 'use different color numbers' a try.
Any recommendations for a tool for this task?

Thanks again!
Re: Patching rom-palettes for RC2C03B PPU
by on (#110627)
The basic technique for making palette hacks begins by finding everything that writes palettes. Start a debugging emulator and set these breakpoints:
  • PPU writes of value $27, $2D, $37, or $3D to $3F00-$3FFF
  • CPU writes of values greater than or equal to $20 to $2001
Then read a few above the writes to see where the palette values are coming from. If they're coming from ROM, you know what byte to modify. If they're coming from RAM, set write breakpoints on those addresses and repeat the process.

Another way to trace palette values back to their source involves opening FCEUX's PPU viewer, looking at the palette pane at the bottom, writing down the three palette values for a particular object, and searching for those values in the ROM. For example, the palette viewer might tell you a particular sprite is using $0F $16 $27 as its palette, and you want to make the skin tone less yellow. So search the ROM in a hex editor for 0F1627, and change that 27 to 26. Play the modified ROM. If the skin tone has changed, keep it; otherwise, change it back.
Re: Patching rom-palettes for RC2C03B PPU
by on (#110628)
tepples wrote:
The basic technique for making palette hacks begins by finding everything that writes palettes. Start a debugging emulator....


I downloaded No$Nes and ran Super Mario Bros.
:shock:
I get the idea but I'm afraid my knowledge about the system is far too limited to get this done.

Anyways, that was really interesting, thank you!
Re: Patching rom-palettes for RC2C03B PPU
by on (#110659)
Debugging in No$Nes is surely cool if you have the background knowledge -
for me, I really don't know what and how and where I do stuff...

I'm trying a different approach, with some success.

I'm using Tile Layer Pro to get an idea where to look for.
e.g. I used Mario Bros and found the Mario/Luigi Sprite-Tiles starting at offset 3020 (seen from the lower right corner of the tile-viewer)

Then I used NESPaletteEditorv1.0.3 to alter the color from 37->36.

The result is that Mario now has a more healthy tan, but Luigi is still as yellowish in his face as before.
Nestopia and the real hardware both run the game with no problems, but no$nes compains about "invalid cartridge size."

I'd like to dig a bit deeper, as this looks promising and it's exactly what I want.
Could somebody please point me to tutorials, tools or info how to make this process right.

Thanks again guys!