Skip to Content
The Alchemy Project

src/field/field_engine_palette_editor.c

The debug palette editor. More…

Included by field_engine.c.

Macros

NameDescription
#defineEDITOR_PALETTE ((Uint16 *)BG_PLTT)The palettes, as plain halfwords, and where the editor draws: from column 13 of row 1 of screen block 4.
#defineEDITOR_MAP ((Uint16 *)BG_SCREEN_BLOCK(4) + BG_SCREEN_WIDTH + 13)
#defineEDITOR_SWATCH_TILE 208The swatch tile sheet's tiles, from tile 208 of character block 0: colour n is drawn with EDITOR_SWATCH_TILE + n, and the 32 tiles after the swatches show the numbers 0 to 31.
#defineEDITOR_NUMBER_TILE WINDOW_TILE(EDITOR_SWATCH_TILE + PALETTE_COLORS)The map entry of the tile showing the number 0, in WINDOW_PALETTE: number n is EDITOR_NUMBER_TILE + n.
#defineEDITOR_PALETTES 14The editor cycles through the map's 14 background palettes.
#defineEDITOR_BLINK_TICKS 10START blinks the colour every 10 ticks: white, the colour, black, the colour.

Enumerations

NameDescription
enumEDITOR_CHANNEL { EDITOR_CHANNEL_RED, EDITOR_CHANNEL_GREEN, EDITOR_CHANNEL_BLU … }The colour channel UP and DOWN choose, which A raises and B lowers.

Functions

NameDescription
voidfdPaletteEditorRun (void)The debug palette editor (L on the Pause menu in debug mode).

Description

The debug palette editor. Part of field_engine.c.

Macros in detail

EDITOR_PALETTE

#define EDITOR_PALETTE ((Uint16 *)BG_PLTT)

The palettes, as plain halfwords, and where the editor draws: from column 13 of row 1 of screen block 4.

Referenced by fdPaletteEditorRun().

Definition at line 5 of file field_engine_palette_editor.c.

EDITOR_MAP

#define EDITOR_MAP ((Uint16 *)BG_SCREEN_BLOCK(4) + BG_SCREEN_WIDTH + 13)

Referenced by fdPaletteEditorRun().

Definition at line 6 of file field_engine_palette_editor.c.

EDITOR_SWATCH_TILE

#define EDITOR_SWATCH_TILE 208

The swatch tile sheet's tiles, from tile 208 of character block 0: colour n is drawn with EDITOR_SWATCH_TILE + n, and the 32 tiles after the swatches show the numbers 0 to 31.

Referenced by fdPaletteEditorRun().

Definition at line 10 of file field_engine_palette_editor.c.

EDITOR_NUMBER_TILE

#define EDITOR_NUMBER_TILE WINDOW_TILE(EDITOR_SWATCH_TILE + PALETTE_COLORS)

The map entry of the tile showing the number 0, in WINDOW_PALETTE: number n is EDITOR_NUMBER_TILE + n.

Referenced by fdPaletteEditorRun().

Definition at line 13 of file field_engine_palette_editor.c.

EDITOR_PALETTES

#define EDITOR_PALETTES 14

The editor cycles through the map's 14 background palettes.

Referenced by fdPaletteEditorRun().

Definition at line 15 of file field_engine_palette_editor.c.

#define EDITOR_BLINK_TICKS 10

START blinks the colour every 10 ticks: white, the colour, black, the colour.

Referenced by fdPaletteEditorRun().

Definition at line 17 of file field_engine_palette_editor.c.

Enumerations in detail

EDITOR_CHANNEL

enum EDITOR_CHANNEL

The colour channel UP and DOWN choose, which A raises and B lowers.

EnumeratorValueDescription
EDITOR_CHANNEL_RED1
EDITOR_CHANNEL_GREEN
EDITOR_CHANNEL_BLUE

Definition at line 20 of file field_engine_palette_editor.c.

Functions in detail

fdPaletteEditorRun

void fdPaletteEditorRun(void)

The debug palette editor (L on the Pause menu in debug mode). Shows colours 1 to 15 of a palette with their red, green and blue levels, 0 to 31.

References DebugPaletteSwatchTiles, PerWork, Sint32, syDecompressHalfwords(), syPrintClear(), sySynch(), syWindowLoadGraphics() and TickCount.

Referenced by fdEngineRun().

Definition at line 29 of file field_engine_palette_editor.c.