Color emphasis info??

Discussion about the site's wiki, including bugs/issues encountered

Moderator: Moderators

Post Reply
User avatar
Zepper
Formerly Fx3
Posts: 3190
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Color emphasis info??

Post by Zepper » Sat Jan 21, 2017 3:38 pm

Does the wiki bring color emphasis info? Is available the % of each component (RGB) when there's color emphasis enabled???

I have a few numbers/info in my emulator, but... no clue where they came from...???

Code: Select all

   int emphasis_table[21] = {
/* 001 Red      */  1239,  915,  743,
/* 010 Green    */   794, 1086,  882,
/* 011 Yellow   */  1019,  980,  653,
/* 100 Blue     */   905, 1026, 1277,
/* 101 Magenta  */  1023,  908,  979,
/* 110 Cyan     */   741,  987, 1001,
/* 111 Black    */   750,  750,  750
   };

User avatar
koitsu
Posts: 4214
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Color emphasis info??

Post by koitsu » Sat Jan 21, 2017 4:16 pm

https://wiki.nesdev.com/w/index.php/NTS ... _Tint_Bits

Formulas are there, as well as under "Emulating in C++ code". Also, don't overlook the last line of the "Color Tint Bits" section. These formulas look relevant to actual NTSC emulation and not so much "what values should I add to literal R/G/B space". In other words: how to implement this is going to vary from emulator to emulator. Maybe someone can provide formulas for R/G/B methodology.

For a list of games that use these bits: https://wiki.nesdev.com/w/index.php/Col ... asis_games

lidnariq
Posts: 8690
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Color emphasis info??

Post by lidnariq » Sat Jan 21, 2017 4:34 pm

koitsu wrote:Maybe someone can provide formulas for R/G/B methodology.
Each bit adds nonlinearly, and also most clip in RGB. So: accurate calculation of emphasis colors and brightnesses are really only practical to do via the YIQ or YUV colorspaces.

User avatar
Zepper
Formerly Fx3
Posts: 3190
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: Color emphasis info??

Post by Zepper » Sat Jan 21, 2017 7:57 pm

Hmm... Who told you that color emphasis must be inside a NTSC color/video encoder? After all, it's not true that no math can be done in RGB space! I disagree.

The PPU section covering the emphasis bits must bring information about the color emphasis in RGB color space, since it is/was the default for most of the NES emulators. I'm 19 years working on my emulator for a pixel-perfect PPU output in RGB to be called "inaccurate" due to the lack of a NTSC filtering..!?

Maybe someone can provide formulas for R/G/B methodology.

EDIT: updated the wiki with % values for each RGB component, including the emphasis effect, like red+green=yellow.

User avatar
Zepper
Formerly Fx3
Posts: 3190
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: Color emphasis info??

Post by Zepper » Sun Jan 22, 2017 6:28 am

Sorry.
Bad mood.

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

Re: Color emphasis info??

Post by Dwedit » Mon Feb 13, 2017 10:24 am

It's not so much about NTSC filtering, simulating the weird pixel edges, and getting the cool dot crawl artifacts correct.
It's about how the PPU actually makes a signal, it's a square wave with real voltages, and they get interpreted by TVs as a composite signal. Using the emphasis bits decreases the voltage at specific parts of the wave, and that affects how the solid colors turn out.

So you can either do all the complicated math to turn voltages and square waves into RGB, or rely on someone else who already did the complicated math. If you like, I could extract the 8 Nintendulator NTSC palettes. (I'm a huge Nintendulator palette fanboy here, that palette looks so much nicer than all the other attempts at a TV mode palette)

The problem with multiplying RGB components by a number is that the answer you get is simply wrong.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

User avatar
Zepper
Formerly Fx3
Posts: 3190
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: Color emphasis info??

Post by Zepper » Mon Feb 13, 2017 2:09 pm


User avatar
tokumaru
Posts: 11437
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Color emphasis info??

Post by tokumaru » Mon Feb 13, 2017 4:03 pm

Speaking of color emphasis and the wiki, I was looking the other day and couldn't find any information about the colors that aren't affected by color emphasis. If I remember correctly, columns $xE and $xF aren't affected, while everything else is. Is this in the wiki anywhere? I think this is a pretty big deal (apparently there are even emulators that get this wrong), but I'm not sure what the best place for this information would be, if it isn't already there.

User avatar
tokumaru
Posts: 11437
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Color emphasis info??

Post by tokumaru » Mon Feb 13, 2017 4:06 pm

Zepper wrote:THIS is the answer.
http://bisqwit.iki.fi/utils/nespalette.php

I wish we had access to the script that generates these palettes.

tepples
Posts: 21706
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Color emphasis info??

Post by tepples » Mon Feb 13, 2017 4:38 pm

tokumaru wrote:Speaking of color emphasis and the wiki, I was looking the other day and couldn't find any information about the colors that aren't affected by color emphasis. If I remember correctly, columns $xE and $xF aren't affected, while everything else is. Is this in the wiki anywhere?

Search the wiki for emphasis.

NTSC video states: "A test performed on NTSC NES shows that while emphasis affects color $1D, it does not affect colors $0E, $0F, $1E, $1F, $2E, $2F, $3E, and $3F." PPU registers used to misleadingly state "all colors" were affected, but I just revised it to state $00-$0D, $10-$1D, $20-$2D, $30-$3D.

User avatar
Zepper
Formerly Fx3
Posts: 3190
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: Color emphasis info??

Post by Zepper » Mon Feb 13, 2017 5:57 pm

tokumaru wrote:
Zepper wrote:THIS is the answer.
http://bisqwit.iki.fi/utils/nespalette.php

I wish we had access to the script that generates these palettes.

The worst side is someone having a cow about this. :lol: :lol: :lol:

Post Reply