News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Palette values for NES  (Read 1504 times)

Arima

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Palette values for NES
« on: September 27, 2020, 08:46:58 pm »
I learned from someone that when trying to make palette values for Super Nintendo (SNES), the values must always be divisible by 8 and always rounded down to the next value of 8.
But when I looked at some palette values for NES (Nintendo Entertainment System), this standard did not apply. (An NES palette color that I looked at had a value of 116 which is not divisible by 8.)
So what then are the divisibility and rounding standard for NES Palette values?

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7019
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Palette values for NES
« Reply #1 on: September 28, 2020, 12:54:35 am »
NES does not use an RGB encoding.

As I have read, the actual encoding is based on analog data.
Especially on NTSC consoles, which is why even the real hardware could display different colors on different TVs.

The reason people said "divisible by 8" is because SNES uses five bits per channel, for a total of 32 intensities each of red/green/blue.

Conversion from standard 24 bit (8 bit, or 256 intensities per channel) = 256/32 = 8.
Though for more accurate conversion from SNES 15-bit to RGB 24-bit, I think byuu recommended duplicate the lowest three bits, to retain proper white and black values. I can't remember for sure.
"My watch says 30 chickens" Google, 2018

Arima

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Palette values for NES
« Reply #2 on: September 28, 2020, 10:59:31 am »
NES does not use an RGB encoding.

As I have read, the actual encoding is based on analog data.
Especially on NTSC consoles, which is why even the real hardware could display different colors on different TVs.

The reason people said "divisible by 8" is because SNES uses five bits per channel, for a total of 32 intensities each of red/green/blue.

Conversion from standard 24 bit (8 bit, or 256 intensities per channel) = 256/32 = 8.
Though for more accurate conversion from SNES 15-bit to RGB 24-bit, I think byuu recommended duplicate the lowest three bits, to retain proper white and black values. I can't remember for sure.

Well, I've noticed that the maximum RGB value for an NES palette color is 252.
So does that mean NES palette colors are divisible by 4?

(Edit)
"The system has an available color palette of 48 colors and 6 grays." Which would imply that the palette values would be divisible by 4 but are very limited by the hardware to transition between each other at a number that is higher than 8. (such as 12, 16, 20, 24)
« Last Edit: September 28, 2020, 01:42:47 pm by Arima »

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 517
  • I am the baldest romhacker
    • View Profile
Re: Palette values for NES
« Reply #3 on: September 28, 2020, 02:36:17 pm »
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

Arima

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Palette values for NES
« Reply #4 on: October 06, 2020, 01:40:29 am »
https://wiki.nesdev.com/w/index.php/PPU_palettes

But what if a modder wanted to alter the palette to implement their own custom colors according to their specific designs?
What divisibility and rounding standards would they have to follow from an RGB encoding perspective towards designing an NES palette?

NES Boy

  • Full Member
  • ***
  • Posts: 167
    • View Profile
Re: Palette values for NES
« Reply #5 on: October 06, 2020, 05:07:55 am »
Conversion from standard 24 bit (8 bit, or 256 intensities per channel) = 256/32 = 8.
Though for more accurate conversion from SNES 15-bit to RGB 24-bit, I think byuu recommended duplicate the lowest three bits, to retain proper white and black values. I can't remember for sure.

Here's byuu's article on color emulation.

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 517
  • I am the baldest romhacker
    • View Profile
Re: Palette values for NES
« Reply #6 on: October 06, 2020, 07:41:54 am »
@Arima, you want to hack nes hardware or what?
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

nesrocks

  • Hero Member
  • *****
  • Posts: 685
    • View Profile
    • nesrocks.com
Re: Palette values for NES
« Reply #7 on: October 06, 2020, 08:34:16 am »
Most emulators allow you to load a palette file so you can have any color you want. I often thought about creating a game or hack made for a specific palette like this using very different colors. I haven't done a lot of testing, but I imagine it can have interesting results, though it would be something akin to using HD textures. Not something the actual hardware can do.