102 Dalmatians: Puppies to the Rescue
Decompilation Source Reference | GitLab repository
Loading...
Searching...
No Matches
save.c
Go to the documentation of this file.
1/* Recovered game implementation; original addresses identify provenance. */
18#include "pcdogs/menu/globals.h"
19#include "pcdogs/menu/types.h"
23#include "pcdogs/save/globals.h"
24#include "pcdogs/save/types.h"
27#include "pcdogs/text/globals.h"
28#include "pcdogs/ui/functions.h"
29#include <math.h>
30#include <stdarg.h>
31#include <string.h>
32
33static int32_t Menu_SaveTextOffset(int32_t dimension, int32_t pixels)
34{
35 // Retail multiplies in 32 bits before dividing by the current window dimension.
36 return (int32_t)((uint32_t)dimension * (uint32_t)pixels) / dimension;
37}
38
39static uint32_t Menu_SaveTextPosition(int32_t x, int32_t y)
40{
41 return (uint32_t)(uint16_t)x | ((uint32_t)y << UI_PACKED_Y_SHIFT);
42}
43
44static uint32_t Menu_SaveHighlight(uint32_t tint)
45{
46 uint32_t channel = (uint8_t)tint;
47 return SPRITE_RENDER_EXPLICIT_COLOR | (channel << 16) | (channel << 8) | (tint & GRAPHICS_COLOR_RGB_MASK);
48}
49
50static void Menu_DrawSaveSlotText(int32_t slot, int32_t x, const char *text, uint32_t flags)
51{
52 int32_t draw_x = Menu_SaveTextOffset(Graphics_WindowWidth, x);
53 int32_t draw_y = Menu_SaveTextOffset(Graphics_WindowHeight, 140) + slot * 32;
54 UI_RenderText(Menu_SaveTextPosition(draw_x, draw_y), text, flags, NULL);
55}
56
57// Original pcdogs.exe: 0x428d20
58// Draws five slots or the current operation's status message, with optional confirmation and button prompts.
59void Menu_RenderSaveGame(int32_t selected_slot, uint32_t highlight_tint, BOOL allow_save)
60{
61 static const int16_t status_string_ids[] = {
62 0x1a, 0x22, 0x23, 0x1a, 0x24, 0x25, 0x19, 0x26, 0x1a, 0x1d, 0x1c};
63
65 return;
67 {
69 return;
70 }
71
72 const char *title = String_GetByIndex(allow_save ? 22 : 16);
73 int32_t title_y = Menu_SaveTextOffset(Graphics_WindowHeight, 88);
75
76 int32_t buttons = UI_PROMPT_BACK | UI_PROMPT_CONFIRM;
78 {
79 Menu_RenderSaveYesNoPrompt(0x1f, (int8_t)g_saveDialogState, highlight_tint);
80 buttons = UI_PROMPT_CONFIRM;
81 }
82
83 uint8_t load_delay = g_saveGameMenuState.load_completion_frames;
84 if (load_delay || g_saveGameMenuState.save_completion_frames)
85 buttons = 0;
86
87 int32_t step = (int8_t)g_saveOperationStep;
88 bool show_slots = (step == SAVE_STATUS_READY && (g_saveLoadModeFlag ? !load_delay : allow_save)) || (step == SAVE_STATUS_READ_FAILED && !g_saveLoadModeFlag && allow_save);
89 if (!show_slots)
90 {
92 {
94 buttons &= ~UI_PROMPT_CONFIRM;
95 }
96 else if (step == MENU_SAVE_STATUS_OVERWRITE_CONFIRM && allow_save)
97 {
98 Menu_RenderSaveYesNoPrompt(0x20, (int8_t)g_saveOverwriteChoice, highlight_tint);
99 load_delay = g_saveGameMenuState.load_completion_frames;
100 buttons &= ~UI_PROMPT_BACK;
101 }
102 else if (step == SAVE_STATUS_ACCEPTED_1 || step == SAVE_STATUS_ACCEPTED_7 ||
104 buttons &= ~UI_PROMPT_CONFIRM;
105 else if (step == SAVE_OPERATION_VERIFY)
107
108 if (!load_delay && step != SAVE_OPERATION_WRITE && step != MENU_SAVE_STATUS_FOOTER_READY)
109 {
110 int32_t status_id = status_string_ids[step];
111 const char *status = String_GetByIndex(status_id);
113 status, UI_TEXT_ALIGN_CENTER, NULL);
114 if (buttons && status_id != 0x1a && step != MENU_SAVE_STATUS_CONFIRM_REQUEST)
115 UI_RenderButtonPrompts(buttons);
116 return;
117 }
118
119 int32_t status_id = status_string_ids[load_delay ? MENU_SAVE_STATUS_FOOTER_READY : step];
120 const char *footer = String_GetByIndex(status_id);
121 int32_t footer_y = Menu_SaveTextOffset(Graphics_WindowHeight, 400);
123 buttons = 0;
124 }
125
126 for (int32_t slot = 0; slot < (int32_t)(sizeof(g_saveRecord.slots) / sizeof(g_saveRecord.slots[0])); ++slot)
127 {
128 char line[80];
129 uint32_t flags = slot == selected_slot ? Menu_SaveHighlight(highlight_tint) : 0;
131 Menu_DrawSaveSlotText(slot, 38, line, flags);
132
134 continue;
135
136 struct Save_GameSlot *record = &g_saveRecord.slots[slot];
137 const char *description;
138 if (g_saveLoadModeFlag && g_saveFileBuffer.version_marker == SAVE_FILE_VERSION && record->is_valid)
139 {
140 int32_t percent = Level_CalculateCompletionPercent(record);
142 description = line;
143 }
144 else
145 description = String_GetByIndex(0x2b);
146 Menu_DrawSaveSlotText(slot, 370, description, flags);
147 }
148 if (buttons)
149 UI_RenderButtonPrompts(buttons);
150}
151
152// Original pcdogs.exe: 0x429160
153// Draws the lower-screen Yes/No prompt. The two choices use string IDs 3 and 4.
154void Menu_RenderSaveYesNoPrompt(int32_t title_string_id, int32_t selected_index, uint32_t highlight_tint)
155{
156 const char *title = String_GetByIndex(title_string_id);
157 int32_t y = Menu_SaveTextOffset(Graphics_WindowHeight, 140) + 176;
159
160 for (int32_t choice = 0; choice < 2; ++choice)
161 {
162 uint32_t flags = choice == selected_index ? Menu_SaveHighlight(highlight_tint) : 0;
163 const char *text = String_GetByIndex(3 + choice);
164 y = Menu_SaveTextOffset(Graphics_WindowHeight, 140) + 208 + 32 * choice;
166 }
167}
168
179
180static void Menu_FinishSaveInput(struct Menu_ActionResult *result, int32_t slot)
181{
182 result->selected_index = (uint8_t)slot;
183 if (result->action == MENU_ACTION_CONTINUE)
184 return;
185
187 if (result->action == MENU_ACTION_BACK)
189 else
191}
192
193static void Menu_HandleSaveConfirmation(struct Menu_ActionResult *result, int32_t slot)
194{
196 uint8_t *choice = overwrite ? &g_saveOverwriteChoice : &g_saveDialogState;
197
199 {
201 {
202 result->sound_effect = 0;
203 *choice = !*choice;
204 }
205 }
206 else if (*choice)
207 {
208 result->sound_effect = 1;
209 if (overwrite)
210 result->action = MENU_ACTION_BACK;
211 else
213 }
214 else
215 {
216 result->sound_effect = 2;
217 if (overwrite)
218 {
221 }
222 else
223 {
227 }
228 }
229 Menu_FinishSaveInput(result, slot);
230}
231
232// Original pcdogs.exe: 0x429500
233// Dispatches save/load results and input. Successful loads publish the copied world after a 15-frame delay.
234void Menu_HandleSaveGameLogic(struct Menu_ActionResult *result, int32_t slot, int32_t allow_save)
235{
236 result->sound_effect = UI_SOUND_NONE;
238
239 if (g_saveGameMenuState.save_completion_frames)
240 {
242 if (--g_saveGameMenuState.save_completion_frames == 0)
243 {
246 }
247 return;
248 }
249 if (g_saveGameMenuState.load_completion_frames)
250 {
251 if (--g_saveGameMenuState.load_completion_frames == 0)
252 {
254 result->selected_index = g_collectiblesData.max_world_reached;
256 }
257 else
259 return;
260 }
261
262 if (!g_saveMenuActive)
263 {
269 }
270 else
271 {
273 switch (g_saveOperationResult)
274 {
276 break;
279 {
282 }
283 else
284 {
285 result->sound_effect = 5;
286 g_saveGameMenuState.write_error = 1;
288 }
289 break;
292 {
293 result->sound_effect = 5;
294 g_saveGameMenuState.write_error = 0;
296 }
297 else
298 {
299 slot = 0;
301 }
302 break;
303 default:
306 else if (allow_save)
307 {
312 {
313 Menu_HandleSaveConfirmation(result, slot);
314 return;
315 }
316 }
317 }
318 }
319
320 int8_t step = (int8_t)g_saveOperationStep;
321 if (step <= SAVE_STATUS_ACCEPTED_7 && result->action != MENU_ACTION_COMPLETE)
322 {
324 {
325 result->sound_effect = 5;
326 if (allow_save)
327 {
328 if (step == SAVE_STATUS_READY || step == SAVE_STATUS_READ_FAILED)
329 {
330 result->sound_effect = 2;
331 Settings_SetSelectedSaveSlot((uint8_t)slot);
332 if (g_saveGameBuffer[slot].is_valid)
334 else
336 }
337 }
339 {
341 if (g_collectiblesData.max_world_reached >= 0)
342 {
343 g_saveHighestWorld = g_collectiblesData.max_world_reached;
346 Settings_SetSelectedSaveSlot((uint8_t)slot);
347 result->sound_effect = 2;
350 }
351 }
352 }
353 else if (g_menuInputCancel)
354 {
355 result->sound_effect = 1;
356 result->action = MENU_ACTION_BACK;
357 }
358 else if (g_saveLoadModeFlag || (allow_save && (step == SAVE_STATUS_READY || step == SAVE_STATUS_READ_FAILED)))
359 {
360 int32_t last_slot = (int32_t)(sizeof(g_saveRecord.slots) / sizeof(g_saveRecord.slots[0])) - 1;
361 if (g_menuInputUp)
362 {
363 result->sound_effect = 0;
364 if (--slot < 0)
365 slot = last_slot;
366 }
367 else if (g_menuInputDown)
368 {
369 result->sound_effect = 0;
370 if (++slot > last_slot)
371 slot = 0;
372 }
373 }
374 }
375 Menu_FinishSaveInput(result, slot);
376}
377
378// Original pcdogs.exe: 0x42bd40
379// Edits a three-character name through the glyph grid, delete action, and done action, or processes the inactive two-choice menu. Empty names are accepted, and cancel is not handled while the grid is active.
381{
382 if (g_nameEntryActive != 1)
383 {
385 {
386 int32_t confirmed_option = (int32_t)g_menuOptionIndex;
387
389
390 if (!confirmed_option)
391 {
392 g_menuContext = 0xa;
395
396 return;
397 }
398
399 if (confirmed_option == 1)
400 {
404 }
405 }
406 else if (g_menuInputUp)
407 {
408 char option_before_up = g_menuOptionIndex;
409
411 g_menuOptionIndex = option_before_up - 1;
412
413 if ((int8_t)(option_before_up - 1) < 0)
415 }
416 else if (g_menuInputDown)
417 {
418 char option_before_down = g_menuOptionIndex;
419
421 g_menuOptionIndex = option_before_down + 1;
422
423 if ((int8_t)(option_before_down + 1) >= 2)
425 }
426 }
427 else if (!g_menuInputConfirm)
428 {
429 char grid_row = g_nameEntryRow;
430 char grid_column = g_nameEntryColumn;
431 int32_t previous_grid_row = (int32_t)grid_row;
432 int32_t previous_grid_column = (int32_t)grid_column;
433
434 if (g_menuInputUp)
435 {
436 char row_before_up = grid_row;
437
438 grid_row -= 1;
440 g_nameEntryRow = grid_row;
441
442 if ((int8_t)(row_before_up - 1) < 0)
443 {
444 grid_row = 4;
445 g_nameEntryRow = 4;
446 }
447 }
448 else if (g_menuInputDown)
449 {
450 grid_row += 1;
452 g_nameEntryRow = grid_row;
453
454 if (grid_row >= 5)
455 {
456 grid_row = 0;
457 g_nameEntryRow = 0;
458 }
459 }
460 else if (g_menuInputRight)
461 {
462 grid_column += 1;
464 g_nameEntryColumn = grid_column;
465
466 if (grid_column >= 0xa)
467 {
468 grid_column = 0;
469 g_nameEntryColumn = grid_column;
470 }
471 }
472 else if (g_menuInputLeft)
473 {
474 char column_before_left = grid_column;
475
476 grid_column -= 1;
478 g_nameEntryColumn = grid_column;
479
480 if ((int8_t)(column_before_left - 1) < 0)
481 {
482 grid_column = 9;
483 g_nameEntryColumn = grid_column;
484 }
485 }
486
487 if (previous_grid_row != (int32_t)grid_row)
488 {
489 if (grid_row == 4)
490 {
491 g_nameEntryColumn = grid_column >= 5;
492
493 return;
494 }
495
496 if (previous_grid_row == 4)
497 g_nameEntryColumn = ((previous_grid_column) ? 7 : 2);
498 }
499 else if (previous_grid_column != (int32_t)grid_column && grid_row == 4)
500 g_nameEntryColumn = 1 - (uint8_t)previous_grid_column;
501 }
502 else
503 {
505 int32_t cursor = g_nameEntryCursor;
507
508 if (key == MENU_NAME_ENTRY_FINISH)
509 {
510 if (g_nameEntryText[cursor] == '?')
511 g_nameEntryText[cursor] = '\0';
512
514 char *destination = &g_collectiblesData.bonus_name_entry_buffer[slot * 4];
515 CRT_strcpy(destination, g_nameEntryText);
516
519 g_dynamicStringSlot0 = &g_collectiblesData.bonus_name_entry_buffer[slot * 4];
520 }
521 else if (key == MENU_NAME_ENTRY_BACKSPACE)
522 {
523 if (cursor > 0)
524 {
525 g_nameEntryText[cursor] = '\0';
527 }
528 }
529 else if (cursor < 3)
530 {
531 g_nameEntryText[cursor] = (char)key;
532 cursor = ++g_nameEntryCursor;
533 if (cursor < 3)
534 g_nameEntryText[cursor++] = '?';
535 g_nameEntryText[cursor] = '\0';
536 }
537 }
538}
539
540// Original pcdogs.exe: 0x42c010
541// Renders the active name-entry text and glyph/action grid, or the inactive two-choice menu. Each glyph is passed as a terminated two-byte string.
542void Menu_RenderNameEntry(uint32_t highlight_tint)
543{
544 int16_t inactive_name_entry_option_string_ids[0x2];
545
546 if (g_nameEntryActive != 1)
547 {
548 int32_t inactive_option_index = 0;
549
550 inactive_name_entry_option_string_ids[0] = 9;
551 inactive_name_entry_option_string_ids[1] = 0xa;
552
553 int32_t inactive_option_y_offset = 0;
554 int16_t *inactive_option_string_cursor = inactive_name_entry_option_string_ids;
555
556 do
557 {
558 int32_t inactive_option_tint;
559
560 if (inactive_option_index != (int32_t)g_menuOptionIndex)
561 inactive_option_tint = 0;
562 else
563 {
564 uint32_t inactive_highlight_channel = (uint32_t)(uint8_t)highlight_tint;
565
566 inactive_option_tint = ((inactive_highlight_channel | UI_TEXT_PACKED_COLOR_PREFIX) << 8 | inactive_highlight_channel) << 8 | (highlight_tint & GRAPHICS_COLOR_RGB_MASK);
567 }
568
569 char *inactive_option_text = String_GetByIndex((int32_t)(uint16_t)*inactive_option_string_cursor);
570 int32_t inactive_window_height = Graphics_WindowHeight;
571 int32_t inactive_window_width = Graphics_WindowWidth;
572
574 ((inactive_window_height / 2) + inactive_option_y_offset - 0x20) << UI_PACKED_Y_SHIFT | (uint32_t)(uint16_t)(inactive_window_width / 2),
575 inactive_option_text, inactive_option_tint | UI_TEXT_ALIGN_CENTER, NULL);
576 inactive_option_y_offset += 0x20;
577 inactive_option_index += 1;
578 inactive_option_string_cursor = &inactive_option_string_cursor[1];
579 } while (inactive_option_y_offset < 0x40);
580
581 return;
582 }
583
584 int32_t window_width_or_highlight_channel = Graphics_WindowWidth;
585 char glyph_text[0x2];
586
587 glyph_text[1] = 0;
588
589 int32_t name_window_width = window_width_or_highlight_channel;
590 int32_t initial_name_cursor_index = (int32_t)g_nameEntryCursor;
591 int32_t name_draw_x =
592 (name_window_width / 2) - (int64_t)(window_width_or_highlight_channel * 0x1e) / window_width_or_highlight_channel;
593 int32_t name_character_index = 0;
594
595 if (initial_name_cursor_index >= 0)
596 {
597 bool name_character_unselected = 0 != initial_name_cursor_index;
598 int32_t current_name_cursor_index;
599
600 do
601 {
602 uint32_t text_flags;
603
604 if (name_character_unselected)
605 text_flags = 0;
606 else
607 {
608 window_width_or_highlight_channel = (uint32_t)(uint8_t)highlight_tint;
609 text_flags =
610 ((window_width_or_highlight_channel | UI_TEXT_PACKED_COLOR_PREFIX) << 8 | window_width_or_highlight_channel) << 8 | (highlight_tint & GRAPHICS_COLOR_RGB_MASK);
611 }
612
613 int32_t name_window_height = Graphics_WindowHeight;
614
615 glyph_text[0] = g_nameEntryText[name_character_index];
616
617 int32_t name_height_low = name_window_height;
618
619 UI_RenderText(((name_height_low / 2) - 0x40) << UI_PACKED_Y_SHIFT | (uint32_t)(uint16_t)name_draw_x,
620 (const char *)(&glyph_text), text_flags, NULL);
621 window_width_or_highlight_channel = Graphics_WindowWidth;
622 name_draw_x += (int64_t)(window_width_or_highlight_channel * 0x14) / window_width_or_highlight_channel;
623 name_character_index += 1;
624 current_name_cursor_index = (int32_t)g_nameEntryCursor;
625 name_character_unselected = name_character_index != current_name_cursor_index;
626 } while (name_character_index <= current_name_cursor_index);
627 }
628
629 int32_t grid_window_height = Graphics_WindowHeight;
630 int32_t grid_draw_y = grid_window_height / 2;
631 int32_t charset_row = 0;
632 int32_t name_entry_row_y = grid_draw_y;
633 int32_t grid_row_index = 0;
634
635 while (true)
636 {
637 if (charset_row != 4)
638 {
639 int32_t grid_column_index = 0;
640 int32_t grid_draw_x = (int64_t)(window_width_or_highlight_channel * 0x64) / window_width_or_highlight_channel;
641
642 do
643 {
644 int32_t grid_glyph_tint;
645
646 if (grid_row_index != (int32_t)g_nameEntryRow || grid_column_index != (int32_t)g_nameEntryColumn)
647 grid_glyph_tint = 0;
648 else
649 {
650 uint32_t grid_highlight_channel = (uint32_t)(uint8_t)highlight_tint;
651
652 grid_glyph_tint =
653 ((grid_highlight_channel | UI_TEXT_PACKED_COLOR_PREFIX) << 8 | grid_highlight_channel) << 8 | (highlight_tint & GRAPHICS_COLOR_RGB_MASK);
654 }
655
656 glyph_text[0] = g_nameEntryCharset[grid_column_index + charset_row * 0xa];
658 (uint32_t)(uint16_t)grid_draw_x | grid_draw_y << UI_PACKED_Y_SHIFT,
659 (const char *)(&glyph_text), grid_glyph_tint | UI_TEXT_ALIGN_CENTER, NULL);
660 window_width_or_highlight_channel = Graphics_WindowWidth;
661 grid_draw_x += (int64_t)(window_width_or_highlight_channel * 0x32) / window_width_or_highlight_channel;
662 grid_column_index += 1;
663 } while (grid_column_index < 0xa);
664 }
665 else
666 {
667 uint32_t action_highlight_tint;
668 int32_t delete_action_tint;
669
670 if (g_nameEntryRow != (uint8_t)charset_row || g_nameEntryColumn)
671 {
672 action_highlight_tint = highlight_tint;
673 delete_action_tint = 0;
674 }
675 else
676 {
677 action_highlight_tint = highlight_tint;
678
679 uint32_t delete_highlight_channel = (uint32_t)(uint8_t)action_highlight_tint;
680
681 delete_action_tint = ((delete_highlight_channel | UI_TEXT_PACKED_COLOR_PREFIX) << 8 | delete_highlight_channel) << 8 | (action_highlight_tint & GRAPHICS_COLOR_RGB_MASK);
682 }
683
684 int32_t packed_action_y = grid_draw_y << UI_PACKED_Y_SHIFT;
685
687 (uint32_t)((int16_t)((int64_t)(window_width_or_highlight_channel * 0x64) / window_width_or_highlight_channel) + (int16_t)(((int64_t)(window_width_or_highlight_channel * 0x32) / window_width_or_highlight_channel) << 1)) | packed_action_y,
688 String_GetByIndex(0x54), delete_action_tint | UI_TEXT_ALIGN_CENTER, NULL);
689
690 int32_t finish_action_tint;
691
692 if (g_nameEntryRow != 4 || g_nameEntryColumn != 1)
693 finish_action_tint = 0;
694 else
695 {
696 uint32_t finish_highlight_channel = (uint32_t)(uint8_t)action_highlight_tint;
697
698 finish_action_tint = ((finish_highlight_channel | UI_TEXT_PACKED_COLOR_PREFIX) << 8 | finish_highlight_channel) << 8 | (action_highlight_tint & GRAPHICS_COLOR_RGB_MASK);
699 }
700
701 int32_t action_window_width = Graphics_WindowWidth;
702 int32_t action_column_spacing = (int64_t)(action_window_width * 0x32) / action_window_width;
703
705 (uint32_t)((int16_t)(action_column_spacing << 3) - (uint16_t)action_column_spacing + (int16_t)((int64_t)(action_window_width * 0x64) / action_window_width)) | packed_action_y,
706 String_GetByIndex(8), finish_action_tint | UI_TEXT_ALIGN_CENTER, NULL);
707 window_width_or_highlight_channel = Graphics_WindowWidth;
708 }
709
710 bool has_more_grid_rows = grid_row_index + 1 < 5;
711
712 grid_row_index += 1;
713 name_entry_row_y += 0x20;
714
715 if (!has_more_grid_rows)
716 break;
717
718 charset_row = grid_row_index;
719 grid_draw_y = name_entry_row_y;
720 }
721
722 char *text = String_GetByIndex(0x58);
723 int32_t title_window_height = Graphics_WindowHeight;
724 int32_t title_window_width = Graphics_WindowWidth;
725
727 ((title_window_height / 2) - 0x80) << UI_PACKED_Y_SHIFT | (uint32_t)(uint16_t)(title_window_width / 2),
728 text, UI_TEXT_ALIGN_CENTER, NULL);
729}
#define SPRITE_RENDER_EXPLICIT_COLOR
Definition constants.h:33
#define GRAPHICS_COLOR_RGB_MASK
Definition constants.h:38
#define Graphics_WindowWidth
Definition globals.h:140
#define Graphics_WindowHeight
Definition globals.h:143
#define INPUT_BUTTON_CONFIRM
Definition constants.h:11
#define g_inputStateCurrentP1
Definition globals.h:72
#define g_inputToggleMaskP1
Definition globals.h:69
int32_t Level_GetSaveArrayIndex(int32_t level_id)
Definition progress.c:30
int32_t Level_CalculateCompletionPercent(struct Save_GameSlot *save)
Definition progress.c:291
bool Level_BuildCompletionTable(void)
Definition progress.c:205
#define g_currentLevelID
Definition globals.h:43
@ MENU_SAVE_DIALOG_HIDDEN
Definition constants.h:83
@ MENU_SAVE_DIALOG_NO
Definition constants.h:82
@ MENU_SAVE_DIALOG_YES
Definition constants.h:81
#define MENU_SAVE_COMPLETION_DELAY_FRAMES
Definition constants.h:137
#define MENU_LOAD_COMPLETION_DELAY_FRAMES
Definition constants.h:138
@ MENU_SAVE_STATUS_RESET
Definition constants.h:88
@ MENU_SAVE_STATUS_CONFIRM_REQUEST
Definition constants.h:91
@ MENU_SAVE_STATUS_FOOTER_READY
Definition constants.h:90
@ MENU_SAVE_STATUS_OVERWRITE_CONFIRM
Definition constants.h:89
@ MENU_STATE_SAVE_SLOTS
Definition constants.h:15
@ MENU_ACTION_COMPLETE
Definition constants.h:35
@ MENU_ACTION_CONTINUE
Definition constants.h:33
@ MENU_ACTION_BACK
Definition constants.h:34
@ MENU_TRANSITION_RESTORE_MUSIC
Definition constants.h:54
@ MENU_NAME_ENTRY_BACKSPACE
Definition constants.h:96
@ MENU_NAME_ENTRY_FINISH
Definition constants.h:97
#define MENU_SAVE_ERROR_NOTICE_FRAMES
Definition constants.h:136
#define g_nameEntryCursor
Definition globals.h:17
#define g_menuInputConfirm
Definition globals.h:96
#define g_fmt_Menu_SavePercent
Definition globals.h:24
#define g_nameEntryText
Definition globals.h:18
#define g_menuInputDown
Definition globals.h:87
#define g_menuPostTransitionAction
Definition globals.h:57
#define g_menuOptionIndex
Definition globals.h:72
#define g_menuState
Definition globals.h:39
#define g_menuContext
Definition globals.h:60
#define g_menuSoundEffect
Definition globals.h:54
#define g_menuInputUp
Definition globals.h:84
#define g_menuInputRight
Definition globals.h:93
#define g_menuTransitionDelay
Definition globals.h:51
#define g_menuInputLeft
Definition globals.h:90
#define g_menuInputCancel
Definition globals.h:99
HRESULT D3D_ClearViewport()
int32_t String_FormatCRTString(char *buffer, char const *format,...)
Definition formatting.c:18
char * CRT_strcpy(char *dest, char const *src)
Definition strings.c:158
#define SAVE_FILE_VERSION
Definition constants.h:25
@ SAVE_OPERATION_READ
Definition constants.h:9
@ SAVE_OPERATION_VERIFY
Definition constants.h:12
@ SAVE_OPERATION_WRITE
Definition constants.h:10
@ SAVE_OPERATION_CLEANUP
Definition constants.h:11
@ SAVE_STATUS_ACCEPTED_7
Definition constants.h:22
@ SAVE_STATUS_ACCEPTED_1
Definition constants.h:18
@ SAVE_STATUS_READ_FAILED
Definition constants.h:21
@ SAVE_STATUS_READY
Definition constants.h:17
void Save_SaveGameToSlot(int32_t slot_index)
Definition files.c:29
void Save_SnapshotWorldCompletionBits(void)
Definition progress.c:74
void Save_InitGameOperation(int32_t operation, void *buffer, uint32_t size)
Definition files.c:154
void Save_ProcessGameOperation(struct Save_OperationStatus *status_out)
Definition files.c:45
#define g_saveMenuOperation
Definition globals.h:23
#define g_saveRecord
Definition globals.h:12
#define g_saveOverwriteChoice
Definition globals.h:35
#define g_collectiblesData
Definition globals.h:21
#define g_saveGameBuffer
Definition globals.h:18
#define g_saveHighestWorld
Definition globals.h:9
#define g_saveFileBuffer
Definition globals.h:15
#define g_saveGameMenuState
Definition globals.h:44
#define g_saveOperationResult
Definition globals.h:29
#define g_saveLoadModeFlag
Definition globals.h:27
#define g_saveGameDirtyFlag
Definition globals.h:41
#define g_saveOperationStep
Definition globals.h:25
#define g_saveMenuActive
Definition globals.h:32
#define g_saveDialogState
Definition globals.h:38
void Menu_RenderSaveYesNoPrompt(int32_t title_string_id, int32_t selected_index, uint32_t highlight_tint)
Definition save.c:154
void Menu_ProcessNameEntryInput()
Definition save.c:380
static void Menu_BeginSaveRead(void)
Definition save.c:169
static void Menu_FinishSaveInput(struct Menu_ActionResult *result, int32_t slot)
Definition save.c:180
static int32_t Menu_SaveTextOffset(int32_t dimension, int32_t pixels)
Definition save.c:33
static void Menu_HandleSaveConfirmation(struct Menu_ActionResult *result, int32_t slot)
Definition save.c:193
void Menu_HandleSaveGameLogic(struct Menu_ActionResult *result, int32_t slot, int32_t allow_save)
Definition save.c:234
static uint32_t Menu_SaveHighlight(uint32_t tint)
Definition save.c:44
static uint32_t Menu_SaveTextPosition(int32_t x, int32_t y)
Definition save.c:39
void Menu_RenderNameEntry(uint32_t highlight_tint)
Definition save.c:542
void Menu_RenderSaveGame(int32_t selected_slot, uint32_t highlight_tint, BOOL allow_save)
Definition save.c:59
static void Menu_DrawSaveSlotText(int32_t slot, int32_t x, const char *text, uint32_t flags)
Definition save.c:50
int32_t Settings_GetSelectedSaveSlot(void)
Definition preferences.c:56
void Settings_SetSelectedSaveSlot(uint8_t slot_index)
Definition preferences.c:63
#define g_nameEntryCharset
Definition strings.h:394
uint8_t action
Definition types.h:10
uint8_t sound_effect
Definition types.h:12
uint8_t selected_index
Definition types.h:11
uint8_t is_valid
Definition types.h:13
char * String_GetByIndex(int32_t string_id)
Definition strings.c:66
#define g_dynamicStringSlot0
Definition globals.h:33
#define g_formatStringAndInt
Definition globals.h:12
#define UI_TEXT_PACKED_COLOR_PREFIX
Definition constants.h:14
#define UI_SOUND_NONE
Definition constants.h:84
#define UI_TEXT_ALIGN_CENTER
Definition constants.h:6
#define UI_PROMPT_CONFIRM
Definition constants.h:67
#define UI_PACKED_Y_SHIFT
Definition constants.h:93
#define UI_PROMPT_BACK
Definition constants.h:66
void UI_RenderButtonPrompts(int32_t button_set)
Definition hud.c:771
void UI_RenderText(uint32_t packed_xy, char const *text, uint32_t text_flags, void *font_context)
Definition text.c:226
#define g_unloadDelayCounter
Definition values.h:534
#define g_nameEntryRow
Definition values.h:399
#define g_nameEntryColumn
Definition values.h:402
#define g_nameEntryActive
Definition values.h:396