.pal: Difference between revisions

From NESdev Wiki
Jump to navigationJump to search
m (1 revision: Rest of pages not related to reference)
(→‎External links: GIMP editing instructions)
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
'''.pal''' is an extension used by [[palette]] files for NES emulators. Before [[NTSC Video]] was fully understood, emulators used palette files to translate [[NES PPU]]'s HSV color values into sRGB values for the PC display. Palette files are still required for emulation of the RGB PPUs of the VS Unisystem and PlayChoice 10 systems.
'''.pal''' is an extension used by palette files for NES emulators.
Palette files are required for emulation of the RGB PPUs of the VS Unisystem, PlayChoice 10, and Famicom Titler systems.
Before [[NTSC video]] was fully understood, emulators also used palette files to translate the [[PPU palettes|PPU's color values]] into sRGB values for the PC display.


Most palette files used by NES emulators are 192 bytes in size.
Most palette files used by NES emulators are 192 bytes in size, consisting of 64 3-byte entries, one for each of 64 NES color values.


The .pal file MUST contain at least 64 entries, one for each of 64 NES color values. Emulators MUST ignore entries beyond the first 64.
Each entry consists of three unsigned 8-bit bytes, in this order:
# red intensity
# green intensity
# blue intensity


Each entry MUST consist of three unsigned 8-bit bytes, in the order red intensity, green intensity, and blue intensity. The intensity values SHOULD represent the color used by a flat area of this NES color value, using the sRGB color space. The value 0 MUST represent black, and the highest intensity value in the file MUST represent full intensity.
Intensity is most commonly ranged from 0 (black) to 255 (full intensity), presuming the [[wikipedia:sRGB|sRGB]] color space used by most monitors.


A program that writes .pal files SHOULD use the range 0-255 or 0-63 depending on the emulator that will use the file. (The original VGA used only 64 intensity levels, but modern video cards use 256.)
Most emulators will ignore any entries past the first 64, but an optional extension of the .pal format (currently only known to be supported by Nintendulator 0.965 and later, and FCEUX 2.3.0) lengthens the file to 1536 bytes in order to store each palette value when colour (de-)emphasis bits are applied. This allows customization of the emphasis behaviour, and is particularly useful for representing the alternative emphasis behaviour of the RGB PPU used in the [[Vs. System]] and PlayChoice.


An optional extension of the .pal format (currently only known to be supported by Nintendulator 0.965 beta) lengthens the file to 1536 bytes in order to store each palette value when colour (de-)emphasis bits are applied. For the VS Unisystem and Playchoice-10, this is vital, as their RGB PPUs actually perform colour emphasis by forcing the specified color channels to maximum intensity.
== See Also ==
* [[PPU palettes]]


[[Category:File Formats]]
== External links ==
*[http://www.shikadi.net/moddingwiki/VGA_Palette VGA Palette on ModdingWiki]
[[Category:File formats]]
*[https://forums.libretro.com/t/editing-custom-nes-palettes-in-linux/6733/6 Editing custom NES palettes in Linux] instructions on editing .pal files in GIMP

Latest revision as of 00:59, 12 February 2023

.pal is an extension used by palette files for NES emulators. Palette files are required for emulation of the RGB PPUs of the VS Unisystem, PlayChoice 10, and Famicom Titler systems. Before NTSC video was fully understood, emulators also used palette files to translate the PPU's color values into sRGB values for the PC display.

Most palette files used by NES emulators are 192 bytes in size, consisting of 64 3-byte entries, one for each of 64 NES color values.

Each entry consists of three unsigned 8-bit bytes, in this order:

  1. red intensity
  2. green intensity
  3. blue intensity

Intensity is most commonly ranged from 0 (black) to 255 (full intensity), presuming the sRGB color space used by most monitors.

Most emulators will ignore any entries past the first 64, but an optional extension of the .pal format (currently only known to be supported by Nintendulator 0.965 and later, and FCEUX 2.3.0) lengthens the file to 1536 bytes in order to store each palette value when colour (de-)emphasis bits are applied. This allows customization of the emphasis behaviour, and is particularly useful for representing the alternative emphasis behaviour of the RGB PPU used in the Vs. System and PlayChoice.

See Also

External links