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 *)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_RED, EDITOR_GREEN, EDITOR_BLUE }The channel up and down choose, by its row under the swatch.

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 *)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 7 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 8 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 12 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 15 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 17 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 19 of file field_engine_palette_editor.c.

Enumerations in detail

EDITOR_CHANNEL

enum EDITOR_CHANNEL

The channel up and down choose, by its row under the swatch.

EnumeratorValueDescription
EDITOR_RED1
EDITOR_GREEN2
EDITOR_BLUE3

Definition at line 22 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, PerData, PerRepeat, Sint32, syDecompressHalfwords(), syPrintClear(), sySynch(), syWindowLoadGraphics() and TickCount.

Referenced by fdEngineRun().

Definition at line 31 of file field_engine_palette_editor.c.