2#include "PR/os_flash.h"
12#define GLOBALS_PAGE_1 6
13#define GLOBALS_PAGE_2 7
57 for (i = 0; i <
sizeof(
gSaveGlobals) /
sizeof(*it); i++) {
107 s32* it = (s32*)saveData;
111 for (i = 0; i <
sizeof(*saveData) /
sizeof(*it); i++) {
127 s32 i, j, minSaveCount;
147 minSaveCount = 0x7FFFFFFF;
238 OSMesgQueue mesgQueue;
240 s8* buf = (s8*)readBuffer;
244 osInvalDCache(buf, numBytes);
245 osCreateMesgQueue(&mesgQueue, &mesg, 1);
248 while (numBytes != 0) {
255 osFlashReadArray(&mb, 0, pageNum *
sizeof(
SaveGlobals) + i, buf, 1, &mesgQueue);
256 osRecvMesg(&mesgQueue, NULL, 1);
266 OSMesgQueue mesgQueue;
271 osWritebackDCache(readBuffer, numBytes);
272 osCreateMesgQueue(&mesgQueue, &mesg, 1);
275 while (numBytes != 0) {
282 osFlashWriteBuffer(&mb, 0, readBuffer, &mesgQueue);
283 osFlashWriteArray((pageNum *
sizeof(
SaveGlobals)) + i);
284 osRecvMesg(&mesgQueue, NULL, 1);
#define DX_MOD_NAME
Creates the version string that appears on the file select menu.
#define ASSERT(condition)
@ STORY_CH6_STAR_SPIRIT_RESCUED
@ STORY_CH4_STAR_SPIRIT_RESCUED
@ STORY_CH5_OPENED_ESCAPE_ROUTE
@ STORY_CH3_STAR_SPIRIT_RESCUED
@ STORY_CH1_STAR_SPIRIT_RESCUED
@ STORY_CH2_STAR_SPIRIT_RESCUED
@ STORY_CH7_STAR_SPIRIT_RESCUED
BSS SaveData FetchSaveBuffer
BSS SaveInfo LogicalSaveInfo[4]
b32 fio_load_globals(void)
b32 fio_load_game(s32 saveSlot)
b32 fio_save_globals(void)
s32 get_spirits_rescued(void)
void fio_erase_flash(s32 pageNum)
b32 fio_read_flash(s32 pageNum, void *readBuffer, u32 numBytes)
void fio_erase_game(s32 saveSlot)
b32 fio_fetch_saved_file_info(void)
SaveData gCurrentSaveFile
s32 fio_calc_globals_checksum(void)
b32 fio_write_flash(s32 pageNum, s8 *readBuffer, u32 numBytes)
BSS s32 NextAvailablePhysicalSave
s32 fio_calc_file_checksum(SaveData *saveData)
b32 fio_validate_file_checksum(SaveData *saveData)
b32 fio_validate_globals_checksums(void)
BSS SaveInfo PhysicalSaveInfo[6]
void fio_save_game(s32 saveSlot)
void fio_init_flash(void)
SaveFileSummary gSaveSlotSummary[4]
s32 evt_get_variable(Evt *script, Bytecode var)
GameStatus * gGameStatusPtr
void fio_deserialize_state()
Load game data from gCurrentSaveFile Performs version checking and supports potential migration betwe...
void fio_serialize_state()
Store current game data to gCurrentSaveFile.
SaveData struct from unmodified Paper Mario.