9#define EDITOR_PALETTE ((u16 *)0x05000000)
10#define EDITOR_MAP ((u16 *)0x0600205a)
11#define EDITOR_HEX_DIGIT 0xf0e0
42 tile = (palette << 12) + 0xd1;
45 tileEntry = swatchColumn;
48 *tileEntry = 0xf000 |
'R';
50 *tileEntry = 0xf000 |
'G';
52 *tileEntry = 0xf000 |
'B';
54 for (i = 1; i < 16; i++) {
55 tileEntry = swatchColumn;
57 rgb555 = *paletteColor++;
102 rgb555 = *paletteColor;
104 green = (rgb555 >> 5) & 31;
105 blue = (rgb555 >> 10) & 31;
106 if (channel == 1 && red < 31)
108 if (channel == 2 && green < 31)
110 if (channel == 3 && blue < 31)
112 *paletteColor =
RGB(red, green, blue);
117 rgb555 = *paletteColor;
119 green = (rgb555 >> 5) & 31;
120 blue = (rgb555 >> 10) & 31;
121 if (channel == 1 && red != 0)
123 if (channel == 2 && green != 0)
125 if (channel == 3 && blue != 0)
127 *paletteColor =
RGB(red, green, blue);
134 rgb555 = *paletteColor;
141 *paletteColor = 0x7fff;
143 *paletteColor = rgb555;
147 *paletteColor = rgb555;
151 *paletteColor = rgb555;
164#undef EDITOR_HEX_DIGIT
const u8 gDebug_PaletteSwatchTiles[]
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
volatile u32 gFrameCount
Frames WaitFrames has finished.
#define RGB(r, g, b)
A 15-bit colour from its red, green and blue levels (0 to 31 each), as the palette stores it: blue in...
volatile u32 gKeysHeld
Keys down now.
volatile u32 gKeysRepeat
Pressed keys, repeating while held: after 19 frames, then every 6.
What every part of object.c shares: its includes and the macros and types more than one part uses.
#define EDITOR_HEX_DIGIT
the tile of digit 0, in BG palette 15
void Debug_RunPaletteEditor(void)
The debug palette editor (L on the pause menu in debug mode).
void Resource_DecompressHalfwords(const void *source, void *destination)
Decompresses the halfword LZ stream at source to destination, with a copy of the ARM decoder on the s...
void Ui_LoadWindowGraphics(void)
Loads the window font and frame tiles into BG character block 0, the window palette into BG palette 1...
void DebugText_Clear(void)
Blanks the debug text screen, homes the cursor and points BG0 at it.