Program Manual for v1.0.0.0
Written by freem
https://ajworld.net/neogeodev/
https://github.com/freem/NGPalTool/
NGPalTool is (as you might expect) a Neo-Geo palette tool. Since the Neo-Geo has a non-standard palette format, converting from RGB 0-255 values is not as straightforward. That's where this program comes in.
This is a .NET Framework v4.7 Windows Forms program, so you'll possibly need a way to run it. On Windows, this is relatively easy. Elsewhere, not so much. While Mono exists, it's not guaranteed to run every Windows Forms-using program. However, it's worth a shot.
Further complicating matters is the program's dynamically updating icon,
which is likely non-portable outside of Windows. A second version without this
functionality is also available, as NGPalTool_NoIcon.exe
.
how to use!!
Resets all 256 entries to the default values (all black).
NGPalTool supports loading two types of palette files, dependent on the file extension. This is important to keep in mind, as behavior depends on file type.
.ngpal
files only contain a single palette set and
will be loaded into the current palette set.
.neopal
files contain 256 palette sets. Loading one
will replace all active palette sets with the file contents.
As with opening palette files, NGPalTool supports saving two file types. Behavior depends on file type.
When saving in .ngpal
format, only the current active
palette set will be saved.
.neopal
files will contain all 256 palette sets when saved.
The Navigation menu is straightforward, but it also enables the use of keyboard shortcuts to move through the palette sets and indices.
When using the keyboard shortcuts, the palette set and index will wrap around when attempting to go past the minimum or maximum value.
NGPalTool provides some useful import/export options.
NGPalTool allows you to import palettes from PNG files, with a few caveats.
Exports the current active palette set in assembler-ready text format.
Export a range of palette sets in assembler-ready text format.
NGPalTool supports multiple palette file formats.
.ngpal
is the "standard" binary format from blastar's NGFX program.
It consists of a single palette set (16 colors) as big endian hex values,
ready to be .incbin
'd.
.neopal
is a text-based format best explained with a comment
from the source code:
"freem wants to store multiple named palettes in a file for some reason"
.neopal
files store all 256 palette sets with labels, one entry per line.
The entry format is:
label:color1,color2,
...color16
Each color (color1
-color16
) is stored as Neo-Geo hardware-ready
hex values (sans any prefix, such as $
or 0x
).
See the Hardware Palette Format section for more details.
label
has a few character restrictions.
The following characters cannot be a part of the palette set label:
As mentioned in the introduction, the Neo-Geo's palette format is not straightforward. Each value is one word (two bytes), big endian.
F | E | D | C | B | A | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Dark | Red LSB bit 0 |
Green LSB bit 0 |
Blue LSB bit 0 |
Red MSB bits 4321 |
Green MSB bits 4321 |
Blue MSB bits 4321 |
The Dark bit subtracts 1 from each color channel when non-zero.
To obtain each color channel's value (without taking the Dark bit into account):
(value&0x40)>>14|(value&0x0F00)>>7
(value&0x20)>>13|(value&0x00F0)>>3
(value&0x10)>>12|(value&0x000F)<<1
It's important to note that the colors are not exactly linear, as the Neo-Geo uses a resistor network to generate the colors. MAME appears to emulate this. NGPalTool's conversions may be off from hardware.