Alchemy
Loading...
Searching...
No Matches

debug.c

Go to the documentation of this file.
1/// @file
2/// The debug menus (scenes, flags, icon browsers) and the system menu's
3/// choices.
4/// Part of battle_command.c, the menu object, compiled only through it.
5
7
8/// Schedules the debug scene and entrance selector; 0xc80 is a scheduler order,
9/// not a number of frames to wait. Nothing in the game calls it.
11#ifdef UBFIX
13#else
15#endif
16}
17
18/// Draws the debug scene and entrance numbers with their category/area labels.
19void Menu_DrawSelectionRow(struct UiWindow *work, s32 scene,
20 const s16 *entrance) {
21 s16 sceneIndex = scene;
22 s32 label =
23 Scene_GetAreaNameIndexFar(sceneIndex, *entrance) + MsgDebugEntryName;
25 UiText_DrawNumber(sceneIndex, 3, work, 0, 14);
26 UiText_DrawNumber(*entrance, 3, work, MENU_LABEL_X, 14);
28 UiText_DrawResource(sceneIndex + MsgDebugCategoryName, work, 0, 0);
30 UiText_DrawResource(label, work, MENU_LABEL_X, 0);
31}
32
33// The scheduler and the debug menu's far call ignore this selection result.
34// Plain void removes two result moves (252 to 248 bytes in tbs-en) and
35// reorders Event_SetDestinationFar's argument setup.
36#ifdef UBFIX
37void Menu_RunSelection(void) {
38#else
40#endif
41 s32 cursorSlot;
42 s16 selectedField;
43 s16 entrance;
44 struct MenuSprite cursor;
45 s16 scene;
46 struct UiWindow *window;
47 s16 result;
48
49 window = 0;
50 selectedField = 0;
52 entrance = gGameState.defaultEntrance;
53 window = UiWindow_Create(0, 7, 30, 5, 2);
54 Menu_DrawSelectionRow(window, scene, &entrance);
55 UiTextResource_Initialize(&cursor, &cursorSlot);
56
57 while (gKeysHeld != 0)
58 WaitFrames(1);
59
60 for (;;) {
61 result =
62 Menu_HandleSelectionRowInput(window, scene, &entrance, &selectedField);
63 if (result == -1) {
64 UiTextResource_Release(cursorSlot);
65 UiWork_Finalize(window, 2);
66 Event_SetDestinationFar(scene, entrance);
67#ifdef UBFIX
68 return;
69#else
70 return result;
71#endif
72 }
73 if (result == -2) {
74 UiTextResource_Release(cursorSlot);
75 UiWork_Finalize(window, 2);
76#ifdef UBFIX
77 return;
78#else
79 return result;
80#endif
81 }
82
84 selectedField * 14 + MENU_TEXT_Y);
85 scene = result;
86 WaitFrames(1);
87 }
88}
89
90/// Edits the debug scene or entrance, returning -1 to warp and -2 to cancel.
91/// Shoulder buttons step by ten; it keeps the original 99-step entrance wrap.
93 s16 *entrance, s16 *selectedField) {
94 if (gKeysRepeat & KEY_A)
95 return -1;
96 if (gKeysRepeat & KEY_B)
97 return -2;
98 if (gKeysRepeat & KEY_DOWN) {
99 *selectedField ^= 1;
100 } else if (gKeysRepeat & KEY_UP) {
101 *selectedField ^= 1;
102 } else if (gKeysRepeat & KEY_RIGHT) {
103 if (*selectedField == 0) {
104 scene++;
105 } else {
106 (*entrance)++;
107 if (*entrance > 99)
108 *entrance = 0;
109 }
110 if (scene > 200)
111 scene = 0;
112 Menu_DrawSelectionRow(window, scene, entrance);
113 } else if (gKeysRepeat & KEY_LEFT) {
114 if (*selectedField == 0) {
115 scene--;
116 } else {
117 (*entrance)--;
118 if (*entrance < 0)
119 *entrance = 99;
120 }
121 if (scene < 0)
122 scene = 200;
123 Menu_DrawSelectionRow(window, scene, entrance);
124 } else if (gKeysRepeat & KEY_R) {
125 if (*selectedField == 0) {
126 *entrance = 0;
127 scene += 10;
128 } else {
129 *entrance += 10;
130 if (*entrance > 99)
131 *entrance -= 99;
132 }
133 if (scene > 200)
134 scene = 0;
135 Menu_DrawSelectionRow(window, scene, entrance);
136 } else if (gKeysRepeat & KEY_L) {
137 if (*selectedField == 0) {
138 *entrance = 0;
139 scene -= 10;
140 } else {
141 *entrance -= 10;
142 if (*entrance < 0)
143 *entrance += 99;
144 }
145 if (scene < 0)
146 scene = 200;
147 Menu_DrawSelectionRow(window, scene, entrance);
148 }
149 return scene;
150}
151
152/// Shows a 16x16 flag grid per page and processes input until closed.
153/// Starts on page 8 and always returns 0.
155 struct MenuSprite cursorSprite; // Cursor object
156 s32 cursor[2]; // Cursor column and row
157 s32 cursorSlot;
158 s32 page;
159 struct UiWindow *window;
160 s32 change;
161
162 page = 8;
163 window = 0;
164 cursor[0] = 0;
165 cursor[1] = 0;
166 window = UiWindow_Create(1, 0, 28, 20, 2);
167 Menu_DrawFlagBitTable(window, page);
168 UiTextResource_Initialize(&cursorSprite, &cursorSlot);
169 for (;;) {
170 WaitFrames(1);
171 change = Menu_HandleFlagGridInput(window, &page, cursor);
172 // B closes the table; a change of flag or page redraws it.
173 if (change == -1)
174 break;
175 if (change == 1)
176 Menu_DrawFlagBitTable(window, page);
177 UiTextResource_SetPosition(&cursorSprite, cursor[0] * 8 + 58,
178 cursor[1] * 8 + 20);
179 }
180 UiTextResource_Release(cursorSlot);
181 UiWork_Finalize(window, 2);
182 return 0;
183}
184
185/// Writes the lowest count digits of value, up to five, most significant first
186/// as uppercase hexadecimal in out, without a null terminator.
187void Text_FormatHex(u32 value, u32 count, u8 *out) {
188 u8 digits[8];
189 u32 i;
190
191 if (count > 5)
192 count = 5;
193
194 for (i = 0; i != count; i++) {
195 u32 digit = value & 15;
196 if (digit <= 9)
197 digits[i] = digit + '0';
198 else
199 digits[i] = digit + 'A' - 10;
200 value >>= 4;
201 }
202
203 for (i = count - 1; (s32)i >= 0; i--)
204 *out++ = digits[i];
205}
206
207/// Draws one page of 256 flags as sixteen rows of hexadecimal labels and bits.
208void Menu_DrawFlagBitTable(struct UiWindow *window, s32 page) {
209 s32 row;
210 s32 y;
211 s32 flag;
212 char label[5];
213 char bits[17];
214
217
218 flag = page << 8;
219 for (row = 0; row != 16; row++) {
220 s32 i;
221
222 y = row * 8 + 16;
223
224 for (i = 0; i != 5; i++) {
225 label[i] = 0;
226 }
227 Text_FormatHex(flag, 3, label);
228 UiText_DrawStringInWindow((u8 *)label, window, 0, y);
230
231 for (i = 0; i < 16; i++) {
232 s32 set = GameFlag_TestFar(flag);
233 bits[i] = (set != 0) + 48;
234 flag++;
235 }
236 bits[i] = 0;
237 UiText_DrawStringInWindow((u8 *)bits, window, 48, y);
238 }
239}
240
241/// Moves within the flag grid, changes pages, or toggles the selected flag.
242/// Returns 1 when flags/page need redrawing, -1 to close, and 0 otherwise.
243s32 Menu_HandleFlagGridInput(struct UiWindow *window, s32 *page, s32 *cursor) {
244 s32 *row = &cursor[1];
245
246 if (gKeysRepeat & KEY_A) {
247 s32 flag = (((*page << 4) + *row) << 4) + cursor[0];
248
249 if (GameFlag_TestFar(flag))
251 else
252 GameFlag_SetBitFar(flag);
253 return 1;
254 }
256 return -1;
257 if (gKeysRepeat & KEY_UP) {
258 if (--*row < 0)
259 *row = 15;
260 } else if (gKeysRepeat & KEY_DOWN) {
261 if (++*row > 15)
262 *row = 0;
263 } else if (gKeysRepeat & KEY_LEFT) {
264 if (--cursor[0] < 0)
265 cursor[0] = 15;
266 } else if (gKeysRepeat & KEY_RIGHT) {
267 if (++cursor[0] > 15)
268 cursor[0] = 0;
269 } else if ((gKeysRepeat & KEY_L) && (gKeysRepeat & KEY_START)) {
270 *page -= 10;
271 if (*page < 0)
272 *page = 15;
273 return 1;
274 } else if ((gKeysRepeat & KEY_R) && (gKeysRepeat & KEY_START)) {
275 *page += 10;
276 if (*page > 15)
277 *page = 0;
278 return 1;
279 } else if (gKeysRepeat & KEY_L) {
280 if (--*page < 0)
281 *page = 15;
282 return 1;
283 } else if (gKeysRepeat & KEY_R) {
284 if (++*page > 15)
285 *page = 0;
286 return 1;
287 }
288 return 0;
289}
290
291/// Reserved menu entry.
292void Menu_ReservedNoOp(void) {}
293
294/// Sets the Djinni's collected flag, then adds it to the specified owner.
295void Djinn_SetFoundFlagAndAdd(s32 owner, s32 element, s32 index) {
296 GameFlag_SetBitFar((element * 0x14) + index + FLAG_DJINNI_0);
297 Djinn_AddToOwnerFar(owner, element, index);
298}
299
300/// Handles Save, Sleep and Options from the field workspace. A cancelled save
301/// or options screen reopens the workspace; cancelling the workspace returns
302/// -1.
304 s32 result;
305
307 if (result == -1) {
308 return -1;
309 }
310 if (result == 0) {
311 if (Save_WriteSelectedSlot() == -1) {
313 }
314 } else if (result == 1) {
316 gSleepRequested = result;
317 } else if (result == 2) {
318 if (Menu_RunWorkspaceOptions() == -1) {
320 }
321 }
322 return 0;
323}
324
325/// Browses pages of item, Psynergy and status-pattern icons, suspending the
326/// menu controller while the browser owns its window and cache entries.
328 s32 redraw;
329 s32 tile;
330 s32 page;
331 s32 mode;
332 struct UiWindow *window;
333 s32 slot;
334 s32 base;
335 s32 i;
336 s32 row;
337 s32 x;
338 s32 y;
339
340 window = NULL;
341 page = 0;
342 mode = 0;
343 redraw = 1;
344 gMenuCtrlWork->suspended = redraw;
345 WaitFrames(1);
346
347 while (1) {
348 if (gKeysRepeat & KEY_LEFT) {
349 page--;
350 redraw = 1;
351 }
352 if (gKeysRepeat & KEY_RIGHT) {
353 redraw = 1;
354 page++;
355 }
356 if (gKeysRepeat & KEY_L) {
357 mode--;
358 redraw = 1;
359 }
360 if (gKeysRepeat & KEY_R) {
361 redraw = 1;
362 mode++;
363 }
364 if (gKeysRepeat & KEY_A)
365 break;
366 if (gKeysRepeat & KEY_B)
367 break;
368 if (redraw != 0) {
369 redraw = 0;
370 page = (page + 8) % 8;
371 mode = (mode + 3) % 3;
372 UiWork_Finalize(window, 2);
373 window = UiWindow_Create(10, 0, 18, 12, 2);
374 if (mode == 0)
376 else if (mode == 1)
378 else
381 UiText_DrawNumberInWindow(page, 0, window, 40, 8);
382 base = page << 5;
383 UiText_DrawNumberInWindow(base, 3, window, 64, 8);
385 UiText_DrawNumberInWindow(base + 31, 3, window, 96, 8);
386 for (i = 0; i <= 31; i++) {
387 slot = -1;
388 row = i / 8;
389 x = (i - row * 8) * 16;
390 y = row * 16 + 16;
391 if (mode == 0) {
392 UiIcon_BuildItemIconTiles(base + i, 1, &slot, &tile, mode);
393 RenderOutput_Create(slot, OUTPUT_SIZE_16X16, window, x, y);
394 } else if (mode == 1) {
395 UiIcon_BuildAbilityIconTiles(base + i, 1, &slot, &tile, 0);
396 RenderOutput_Create(slot, OUTPUT_SIZE_16X16, window, x, y);
397 } else {
398 slot = Resource_FindFreeEntry();
399 Ui_BuildPatternToSlot(i, 0, slot);
400 RenderOutput_Create(slot, OUTPUT_SIZE_16X16, window, x, y);
401 }
402 }
403 }
404 WaitFrames(1);
405 }
406 UiWork_Finalize(window, 2);
408 return 0;
409}
410
411#if !TBS_PATCH_2
412#define DEBUG_GLYPH_NAME MsgDebugGlyphName
413#elif (LANGUAGE == LANGUAGE_GERMAN) || (LANGUAGE == LANGUAGE_FRENCH)
414#define DEBUG_GLYPH_NAME MsgEnd
415#else
416#define DEBUG_GLYPH_NAME MsgDebugSecondForm
417#endif
418
419/// Browses the character and sprite portrait maps as one circular list. Shows
420/// each entry's glyph and label, then releases both windows on A or B.
422 struct UiRenderWork *work;
423 struct UiWindow *portrait;
424 s32 redraw;
425 struct UiWindow *window;
426 s32 characterCount;
427 s32 entryCount;
428 s32 index;
429 s32 i;
430 s32 glyph;
431 s32 tile;
432 s32 slot;
433 s32 cancelKey;
434 u32 slotOffset;
435
436 work = UI_WORK;
437 redraw = 1;
438 portrait = UiWindow_CreateWithSideObject(0, 0, 10, 5);
439 window = UiWindow_Create(10, 10, 14, 3, 2);
440 index = 0;
441 for (i = 0; gPortrait_CharacterMap[i * 2] != -1; i++) {
442 }
443 characterCount = i;
444 for (i = 0; gPortrait_SpriteMap[i * 2] != -1; i++) {
445 }
446 entryCount = characterCount + i;
447
448 /* FAKEMATCH: the count-derived mask keeps the mask in r9 and work in fp; as
449 * cancel = KEY_B, 12 of 179 instructions differ in tbs-en. */
450 cancelKey = ((u32)(u16)characterCount >> 16) | KEY_B;
451 /* FAKEMATCH: defining the offset before the loop keeps its load in r1;
452 * defining it inside redraw uses r3 (4 instructions differ in all six
453 * editions). */
454 slotOffset = RENDER_SLOT_VALUE_OFFSET + 2;
455 while (1) {
456 if (gKeysRepeat & KEY_LEFT) {
457 redraw = 1;
458 index--;
459 }
460 if (gKeysRepeat & KEY_RIGHT) {
461 redraw = 1;
462 index++;
463 }
464 if (gKeysRepeat & KEY_L) {
465 redraw = 1;
466 index -= 10;
467 }
468 if (gKeysRepeat & KEY_R) {
469 redraw = 1;
470 index += 10;
471 }
472 if (gKeysRepeat & KEY_A)
473 break;
474 if (gKeysRepeat & cancelKey)
475 break;
476 if (redraw) {
477 redraw = 0;
478 index = (index + entryCount) % entryCount;
480 if (index < characterCount)
481 glyph = gPortrait_CharacterMap[index * 2 + 1];
482 else
483 glyph = gPortrait_SpriteMap[(index - characterCount) * 2 + 1] + 128;
484 {
485 /* FAKEMATCH(temporary): a word temporary for the slot keeps the
486 * palette in r2 through the slot store; as the slot assigned directly
487 * and 15 passed, 4 of 179 instructions differ in tbs-en. */
488 s32 palette;
489 s32 loadedSlot = *(u16 *)((u8 *)work + slotOffset);
490 palette = 15;
491 slot = loadedSlot;
492 UiGlyph_LoadEntryWithPalette(glyph, 0, &slot, &tile, palette, 1);
493 }
494 UiText_DrawNumberInWindow(index, 2, window, 0, 0);
495 UiText_DrawCharacterAtOffset(index + DEBUG_GLYPH_NAME, window, 24, 0);
496 }
497 WaitFrames(1);
498 }
499 UiWork_Finalize(window, 2);
500 UiWork_Finalize(portrait, 2);
501 WaitFrames(1);
502 return 0;
503}
What every part of the menu object shares: its includes, edition values, macros and the link round st...
#define OUTPUT_SIZE_16X16
OAM attribute bits a sprite output is created with: the size field of attribute 1 (bits 30-31 of the ...
void(*) SchedulerCallback(void)
s32 GameFlag_TestFar(s32 flag)
s32 GameFlag_SetBitFar(s32 flag)
s32 Djinn_AddToOwnerFar(s32 owner, s32 index, s32 bit)
void GameFlag_ClearBitFar(s32 flag)
s32 Scene_GetAreaNameIndexFar(s32 scene, s32 entrance)
void Event_SetDestinationFar(s32 first, s32 second)
#define FLAG_DJINNI_0
the flag of Djinni 0, set once it is caught
Definition flags.h:15
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
Definition frame.c:97
volatile u8 gSleepRequested
1: sleep this frame; more: count down to it.
void UiText_ShowPositionedMessageAndWait(s32 message, s32 flags)
Shows a message in a window centred on the screen, waits until it is typed out and closes it.
Definition frames.c:447
struct GameState gGameState
@ KEY_UP
Definition io_reg.h:249
@ KEY_B
Definition io_reg.h:244
@ KEY_SELECT
Definition io_reg.h:245
@ KEY_LEFT
Definition io_reg.h:248
@ KEY_START
Definition io_reg.h:246
@ KEY_RIGHT
Definition io_reg.h:247
@ KEY_R
Definition io_reg.h:251
@ KEY_A
Definition io_reg.h:243
@ KEY_DOWN
Definition io_reg.h:250
@ KEY_L
Definition io_reg.h:252
volatile u32 gKeysHeld
Keys down now.
volatile u32 gKeysPressed
Keys that went down this frame.
volatile u32 gKeysRepeat
Pressed keys, repeating while held: after 19 frames, then every 6.
u8 gWorkspace_RangeDash[]
u8 gWorkspace_PageLabel[]
const u8 gMenu_ColonString[]
u8 gWorkspace_EnergyTitle[]
const u8 gMenu_HexDigitsString[]
u8 gWorkspace_StatusTitle[]
struct ObjectSystemWork * gMenuCtrlWork
u8 gWorkspace_ItemTitle[]
s32 Menu_RunWorkspaceSelectionLoop(void)
Runs the system menu until the player picks an entry (its number, counting Save your quest as 0) or c...
Definition options.c:700
s32 Menu_RunWorkspaceOptions(void)
Runs the option screen (window colour and brightness, message speed, speech, auto-sleep) until A or S...
Definition options.c:422
struct RenderOutput * RenderOutput_Create(s32 slot, s32 oamFlags, struct UiWindow *window, s32 offsetX, s32 offsetY)
Creates a sprite output for the VRAM cache slot slot and attaches it to window, placed at (offsetX,...
Definition outputs.c:13
const s16 gPortrait_SpriteMap[100]
{sprite, portrait} pairs of the other speakers, ending in -1: portrait n of this list is portrait 128...
Definition scales.c:87
const s16 gPortrait_CharacterMap[20]
{character, portrait} pairs of the playable characters, ending in -1.
Definition scales.c:72
s32 Scheduler_AddOrUpdateCallback(SchedulerCallback callback, s32 order)
Schedules callback with order, or gives a task already running it the new order, and re-sorts the tab...
Definition scheduler.c:102
void UiTextResource_Initialize(struct MenuSprite *sprite, s32 *slot)
Sets up a sprite as the right-pointing arrow, in a free tile slot (returned in *slot).
Definition selection.c:1237
void UiTextResource_Release(s32 value)
Frees an arrow sprite's tile slot.
Definition selection.c:1261
void UiTextResource_SetPosition(struct MenuSprite *sprite, s32 x, s32 y)
Places an arrow sprite at (x, y) and queues it for drawing.
Definition selection.c:1254
#define NULL
Definition bilibin.h:6
s16 defaultEntrance
the entrance it was entered by
Definition game_state.h:41
s16 defaultScene
the scene being run, kept as it starts
Definition game_state.h:40
A menu sprite: a list link and its OAM attributes, as two words or as fields.
Definition menu_list.h:24
s16 suspended
nonzero while a menu has suspended sprite projection
Definition animspr.h:69
The window system's work: the windows' tilemap, the windows, the three text channels,...
Definition window.h:19
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
Definition uiwindow.h:11
u16 y
tiles
Definition uiwindow.h:16
u16 x
tiles
Definition uiwindow.h:15
#define MENU_TEXT_X
Definition tbs_edition.h:78
#define MENU_TEXT_Y
Definition tbs_edition.h:83
#define RENDER_SLOT_VALUE_OFFSET
Definition tbs_edition.h:75
#define MENU_LABEL_X
Definition tbs_edition.h:79
void UiText_DrawStringInWindow(const u8 *text, struct UiWindow *window, u32 x, u32 y)
Draws a byte string into a window's tilemap at pixel (x, y) of its interior, rounded down to tiles.
Definition text_tiles.c:646
void UiText_DrawResource(s32 message, struct UiWindow *window, s32 x, s32 y)
Decodes a message and draws it into a text canvas window at pixel (x, y).
Definition text_tiles.c:538
void UiText_DrawString(const u8 *text, struct UiWindow *window, s32 x, s32 y)
Draws a byte string into a text canvas window at pixel (x, y).
Definition text_tiles.c:599
void UiText_DrawNumberInWindow(s32 value, s32 width, struct UiWindow *window, s32 x, s32 y)
Draws a number (width as UiText_FormatNumber) into a window's tilemap at pixel (x,...
Definition text_tiles.c:678
void UiText_DrawCharacterAtOffset(s32 message, const struct UiWindow *window, u32 offsetX, u32 offsetY)
Decodes a message and draws it as tiles in a window at pixel (offsetX, offsetY) of its interior.
Definition text_tiles.c:552
void UiText_DrawNumber(s32 value, s32 width, struct UiWindow *window, s32 x, s32 y)
Draws a number (width as UiText_FormatNumber) into a text canvas window at pixel (x,...
Definition text_tiles.c:658
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
signed short s16
Definition types.h:12
unsigned short u16
Definition types.h:13
#define UNUSED
Definition types.h:22
unsigned char u8
Definition types.h:11
#define UI_WORK
Definition window.h:267
s32 Resource_FindFreeEntry(void)
Returns the number of the first free cache entry, or VRAM_CACHE_ENTRY_COUNT when all are taken.
Definition vram_cache.c:211
s32 Menu_HandleSelectionRowInput(struct UiWindow *window, s16 scene, s16 *entrance, s16 *selectedField)
Edits the debug scene or entrance, returning -1 to warp and -2 to cancel.
Definition debug.c:92
void Menu_DrawSelectionRow(struct UiWindow *work, s32 scene, const s16 *entrance)
Draws the debug scene and entrance numbers with their category/area labels.
Definition debug.c:19
s32 DebugMenu_BrowseIcons(void)
Browses pages of item, Psynergy and status-pattern icons, suspending the menu controller while the br...
Definition debug.c:327
UNUSED void DebugMenu_ScheduleSceneSelector(void)
Schedules the debug scene and entrance selector; 0xc80 is a scheduler order, not a number of frames t...
Definition debug.c:10
void Menu_DrawFlagBitTable(struct UiWindow *window, s32 page)
Draws one page of 256 flags as sixteen rows of hexadecimal labels and bits.
Definition debug.c:208
void Text_FormatHex(u32 value, u32 count, u8 *out)
Writes the lowest count digits of value, up to five, most significant first as uppercase hexadecimal ...
Definition debug.c:187
s32 Menu_RunSelectionWithCursorObject(void)
Shows a 16x16 flag grid per page and processes input until closed.
Definition debug.c:154
s32 Menu_RunWorkspaceResultLoop(void)
Handles Save, Sleep and Options from the field workspace.
Definition debug.c:303
s32 DebugMenu_BrowseEntryGlyphs(void)
Browses the character and sprite portrait maps as one circular list.
Definition debug.c:421
#define DEBUG_GLYPH_NAME
Definition debug.c:412
s32 Menu_HandleFlagGridInput(struct UiWindow *window, s32 *page, s32 *cursor)
Moves within the flag grid, changes pages, or toggles the selected flag.
Definition debug.c:243
void Menu_ReservedNoOp(void)
Reserved menu entry.
Definition debug.c:292
s16 Menu_RunSelection(void)
Definition debug.c:39
void Djinn_SetFoundFlagAndAdd(s32 owner, s32 element, s32 index)
Sets the Djinni's collected flag, then adds it to the specified owner.
Definition debug.c:295
s32 Save_WriteSelectedSlot(void)
The Save command: lets the player choose a file (the current one first), asks whether to save over it...
Definition save.c:1174
void UiIcon_BuildAbilityIconTiles(u32 glyph, s32 withBase, s32 *cacheSlot, s32 *tileOut, s32 reuse)
Builds the Psynergy icon glyph, over the icon frame when withBase is set, and loads it into *cacheSlo...
Definition icons.c:246
s32 Ui_BuildPatternToSlot(s32 icon, s32 unused, s32 cacheSlot)
Builds one of the other icons and loads it into sprite tile slot cacheSlot.
Definition icons.c:177
void UiIcon_BuildItemIconTiles(u32 glyph, s32 withBase, s32 *cacheSlot, s32 *tileOut, s32 reuse)
Builds the item icon glyph, over the icon frame when withBase is set, and loads it into *cacheSlot (a...
Definition icons.c:52
void UiGlyph_LoadEntryWithPalette(u32 icon, s32 unused, s32 *slot, s32 *tile, s32 palette, s32 reuse)
Loads a 32x32 icon from the icon resource into sprite tile slot *slot (a free slot unless reuse is se...
Definition icons.c:291
struct UiWindow * UiWindow_CreateWithSideObject(s32 speaker, s32 portraitOption, s32 x, s32 y)
Opens a portrait window at tile (x, y) showing the speaker's portrait.
Definition messages.c:525
void RenderOutput_PrepareForRedraw(struct UiWindow *window)
Clears a window's contents: redraws its empty frame and releases the render outputs it carries.
Definition windows.c:392
void UiWork_Finalize(struct UiWindow *window, s32 instant)
Closes a window: clears its contents and remembers its last rectangle.
Definition windows.c:349
struct UiWindow * UiWindow_Create(s32 x, s32 y, s32 width, s32 height, s32 attrs)
Opens a window at tile (x, y) of width by height tiles in the first free window slot,...
Definition windows.c:279