Need help removing colour emphasis from roms

A place for your artistic side. Discuss techniques and tools for pixel art on the NES, GBC, or similar platforms.

Moderator: Moderators

User avatar
Drakon
Posts: 183
Joined: Mon Aug 16, 2010 4:48 am
Contact:

Need help removing colour emphasis from roms

Post by Drakon » Fri Feb 01, 2013 1:39 pm

Just breed on the famicom turns out to use colour emphasis bits. I'm curious how difficult it is to remove that from the rom and what's involved. Since I'm using a rgb chip the game won't display graphics unless I remove that. Any help is greatly appreciated.

User avatar
thefox
Posts: 3141
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Re: Need help removing colour emphasis from roms

Post by thefox » Fri Feb 01, 2013 1:52 pm

Set a memory write breakpoint on register $2001 (PPU mask). Then find out where the written value originated from (could be an LDA instruction right before the write, or something else). Then make changes to the ROM to ensure that the top 3 bits of that value are always 0 (the top 3 bits control the emphasis).
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi

User avatar
Drakon
Posts: 183
Joined: Mon Aug 16, 2010 4:48 am
Contact:

Re: Need help removing colour emphasis from roms

Post by Drakon » Fri Feb 01, 2013 2:18 pm

thefox wrote:Set a memory write breakpoint on register $2001 (PPU mask). Then find out where the written value originated from (could be an LDA instruction right before the write, or something else). Then make changes to the ROM to ensure that the top 3 bits of that value are always 0 (the top 3 bits control the emphasis).
I'm new to the whole breakpoint thing. Is there some sort of guide out there on how to do something like this in (I assume) fceux? Or if you have the time could you please explain the process to a beginner like myself? If you're too busy that's totally fine I bet it's kind of a pain to explain this to a beginner.

User avatar
thefox
Posts: 3141
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Re: Need help removing colour emphasis from roms

Post by thefox » Fri Feb 01, 2013 2:26 pm

Drakon wrote:
thefox wrote:Set a memory write breakpoint on register $2001 (PPU mask). Then find out where the written value originated from (could be an LDA instruction right before the write, or something else). Then make changes to the ROM to ensure that the top 3 bits of that value are always 0 (the top 3 bits control the emphasis).
I'm new to the whole breakpoint thing. Is there some sort of guide out there on how to do something like this in (I assume) fceux? Or if you have the time could you please explain the process to a beginner like myself?
You can do it with FCEUX or Nintendulator.

In FCEUX, press "Add" under Breakpoints, write 2001 as Address (you can leave the other field empty), tick "Write", then OK. Now the debugger will break every time the game writes to $2001. The instruction that writes to $2001 is usually STA, but could be STX or STY too (or in some obscure cases maybe something else). Then it's up to you to find out how that value got loaded to A (or X, or Y) register. Often it's just an LDA/LDX/LDY instruction somewhere before the STA/STX/STY.

In Nintendulator the process is very similar.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi

User avatar
Dwedit
Posts: 4272
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Need help removing colour emphasis from roms

Post by Dwedit » Fri Feb 01, 2013 2:30 pm

This game was easy, look for writes to 2001, and you see that every time it writes to 2001, it will also read address 0001 to see what the color emphasis bytes should be set to, and the game only ever sets the upper 3 bits of 0001 once.

original code:
1F:E0AE:A9 E8 LDA #$E8
1F:E0B0:85 01 STA $0001 = #$18
change to:
1F:E0AE:A9 08 LDA #$08
1F:E0B0:85 01 STA $0001 = #$18

address = E0AF, compare = E8, value = 08
Game genie code: AEXVYEEV
rom file address: 070EBF
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

User avatar
Drakon
Posts: 183
Joined: Mon Aug 16, 2010 4:48 am
Contact:

Re: Need help removing colour emphasis from roms

Post by Drakon » Fri Feb 01, 2013 2:35 pm

You guys are the greatest! Thanks for taking the time to explain all this. Dwedit, I went to that hex address in the rom, what value(s) am I changing? Also how did you figure out the address in the rom file?
Last edited by Drakon on Fri Feb 01, 2013 2:42 pm, edited 1 time in total.

User avatar
Dwedit
Posts: 4272
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Need help removing colour emphasis from roms

Post by Dwedit » Fri Feb 01, 2013 2:42 pm

Looks like FCEUX's game genie encoder/decoder screwed up here, and 07E0BF is not the correct address.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

User avatar
Drakon
Posts: 183
Joined: Mon Aug 16, 2010 4:48 am
Contact:

Re: Need help removing colour emphasis from roms

Post by Drakon » Fri Feb 01, 2013 2:42 pm

Dwedit wrote:Looks like FCEUX's game genie encoder/decoder screwed up here, and 07E0BF is not the correct address.
*edit*

07E0BF, change from E8 to 08

Done, thanks people! Now the famicom version of just breed runs great in rgb.

In the fceux debugger I entered E0AE in PC and hit "seek to pc". The command there matched what dwedit says needs to be changed. Then I checked "rom offsets" and it lists where it is in the rom. I wish I knew before you can get the rom offeset in a debugger.

Also I'm curious, how do you know it only sets the upper 3 bits once?

User avatar
Dwedit
Posts: 4272
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Need help removing colour emphasis from roms

Post by Dwedit » Fri Feb 01, 2013 5:12 pm

I don't know if the upper bits will ever be changed, but it wasn't changing them after seeing the title screen and starting the game, so I think they shouldn't change after that. Didn't test battles though. If battles ever use any color-emphasis effects (don't know whether they use them or not), you might need to track down those too.

Also (unrelated), Final Fantasy I uses color emphasis bits for color effects when you enter/exit the menu, and before battles.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

User avatar
Drakon
Posts: 183
Joined: Mon Aug 16, 2010 4:48 am
Contact:

Re: Need help removing colour emphasis from roms

Post by Drakon » Fri Feb 01, 2013 5:34 pm

Dwedit wrote:I don't know if the upper bits will ever be changed, but it wasn't changing them after seeing the title screen and starting the game, so I think they shouldn't change after that. Didn't test battles though. If battles ever use any color-emphasis effects (don't know whether they use them or not), you might need to track down those too.

Also (unrelated), Final Fantasy I uses color emphasis bits for color effects when you enter/exit the menu, and before battles.
Gotcha. So the only way to know for sure is set nestopia to rgb mode and play the game and see if it ever loses picture.

User avatar
Drakon
Posts: 183
Joined: Mon Aug 16, 2010 4:48 am
Contact:

Re: Need help removing colour emphasis from roms

Post by Drakon » Tue Feb 05, 2013 6:59 am

Thanks again people! The english fanslated / rgb compatible roms running on a rgb system:

Image

Looks and sounds excellent.

User avatar
Drakon
Posts: 183
Joined: Mon Aug 16, 2010 4:48 am
Contact:

Re: Need help removing colour emphasis from roms

Post by Drakon » Fri Jun 21, 2013 8:04 pm

*bump*

Came across another game that needs this treatment. The megaman 4 minus infinity romhack the brightman stage (lightbulb dude) has colour emphasis on every part of the screen except a horizontal bar where megaman is. I'm looking to disable that if possible.

In the debugger the code I think is this:

"0FC288:99 00 20 STA $2000,Y @ $2001 = #$E8'

Except, I really don't know nes asm well enough to know how to change that e8 to 08.

Here's the link to the hack:

http://www.romhacking.net/hacks/910/

Version I have is probably newer but the fix should be the same if it gets worked out.

User avatar
mikejmoffitt
Posts: 1348
Joined: Sun May 27, 2012 8:43 pm

Re: Need help removing colour emphasis from roms

Post by mikejmoffitt » Fri Jun 21, 2013 10:04 pm

Just curious, do we have a database of games that use color emphasis? I've just never known if I am seeing it or not on a game; I don't think I've seen it enough to really know, aside from a time when screwing around with bare fingers on the famicom PCB caused the blue emphasis to kick in for Super Mario Bros...

User avatar
Drakon
Posts: 183
Joined: Mon Aug 16, 2010 4:48 am
Contact:

Re: Need help removing colour emphasis from roms

Post by Drakon » Sat Jun 22, 2013 6:15 am

mikejmoffitt wrote:Just curious, do we have a database of games that use color emphasis? I've just never known if I am seeing it or not on a game; I don't think I've seen it enough to really know, aside from a time when screwing around with bare fingers on the famicom PCB caused the blue emphasis to kick in for Super Mario Bros...
Haha are you sure that's what happened?

Color emphasis makes everything look dark, like it's night time. The first scene in just breed when you're walking around the town at night time is color emphasis it's a perfect example. Try the megaman 4 minus infinity hack the brightman stage has both regular and colour emphasis modes displaying on the screen at the same time. With a composite ppu the emphasis parts of the screen look darker, with my rgb ppu they turn solid white.

Here's a lazy emulator snapshot demonstration. Composite ppu showing color emphasis:

Image

How it looks on my system using a rgb ppu

Image

Otherwise the game looks fine:

https://www.youtube.com/watch?v=JDPJCJValDs

A few romhacks like to "show off" and use funky ppu effects. If such a list gets made we should include romhacks as well.

Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: Need help removing colour emphasis from roms

Post by Sik » Sat Jun 22, 2013 7:20 am

RGB emphasis can be set separately for each of the components, so it's possible to end with a blue tint (I think there's a game that uses this to make translucent water).

But yeah, as far as I know that's a PPU register and not something that can be modified from outside (it should affect the signal the PPU itself generates), so messing with the PCB shouldn't cause emphasis to kick in. Probably something else screwed up.

Post Reply