Table of Contents

  1. Introduction
  2. Requirements
  3. Usage
    1. File Menu
    2. Navigation Menu
    3. Import/Export Menu
  4. Palette File Format Information
    1. .ngpal (NGFX)
    2. .neopal (NGPalTool)
  5. Hardware Palette Format
  6. Credits

Introduction

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.


Requirements

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.


Usage

The NGPalTool main user interface consists of a menu bar with four options:
File, Navigation, Import/Export, and Help. The top portion of the interface
contains navigation for palette sets and indices. Below that is a field for
the palette set name (only used when saving in .neopal format). Under the name
is a palette preview pane. In this screenshot, the entire palette is black.
There are three sections below the palette preview. The left side contains
inputs for Red, Green, and Blue (0-255), as well as a Color Picker button.
The middle portion is a preview swatch of the current palette index.
The right side contains the output color information. Red, green, and blue
are given as 0-31 values, with an optional prime (') if the dark bit is set.
The dark bit has its own check box, which cannot be modified. Finally, there
is a Hex box with the hardware-ready palette value.

how to use!!

File Menu

New Palette File

Resets all 256 entries to the default values (all black).

Open Palette File

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.

Save Palette File

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.

Navigation Menu

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.

Import/Export Menu

NGPalTool provides some useful import/export options.

Import from PNG

NGPalTool allows you to import palettes from PNG files, with a few caveats.

Export Current Set as ASM

Exports the current active palette set in assembler-ready text format.

Export Set Range as ASM

The Export Set Range as ASM dialog. There are two numeric up/down controls,
one for Range Start, and one for Range End. OK and Cancel buttons are below the
values.

Export a range of palette sets in assembler-ready text format.


Palette File Format Information

NGPalTool supports multiple palette file formats.

.ngpal (NGFX)

.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 (NGPalTool)

.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:


Hardware Palette Format

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):

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.


Credits