Alchemy
Loading...
Searching...
No Matches

save_state.h File Reference

The save workspace: slot headers and summaries. More...

Go to the source code of this file.

Data Structures

struct  SaveSlotHeader
 The header of a save sector in flash: its signature, the record it holds, its checksum and its sequence number. More...
struct  SaveSummary
 A save file's summary for the file screen: the leader's name, level and class, the area, play time, coins, Djinn and party. More...
struct  SaveWorkspace
 The save work: which of the 16 flash sectors hold a record, their record ids and sequence numbers, one sector's buffer and the three files' summaries. More...

Macros

#define DMA3_BUSY   0x80000000
#define START_DMA(source_, destination_, control_)
#define WAIT_DMA()

Functions

 STATIC_ASSERT (sizeof(struct SaveSummary)==64)
 STATIC_ASSERT (offsetof(struct SaveSummary, level)==0x1c)
 STATIC_ASSERT (offsetof(struct SaveSummary, sendFlag)==0x31)
 STATIC_ASSERT (offsetof(struct SaveSummary, checksum)==0x3c)
 STATIC_ASSERT (offsetof(struct SaveWorkspace, slot)==0x40)
 STATIC_ASSERT (offsetof(struct SaveWorkspace, summary)==0x1040)
 STATIC_ASSERT (sizeof(struct SaveSlotHeader)==0x10)
 STATIC_ASSERT (sizeof(struct SaveWorkspace)==0x1100)
 STATIC_ASSERT (offsetof(struct SaveWorkspace, recordId)==0x10)
 STATIC_ASSERT (offsetof(struct SaveWorkspace, sequence)==0x20)
 STATIC_ASSERT (offsetof(struct SaveSummary, flagCount)==0x32)
 STATIC_ASSERT (offsetof(struct SaveSummary, unk38)==0x38)
static __inline__ void WaitDma (struct DmaRegisters volatile *channel)

Variables

struct SaveWorkspace * gSaveWorkspace
s16 gTitleSendOptionEnabled

Detailed Description

The save workspace: slot headers and summaries.

Definition in file save_state.h.

Macro Definition Documentation

◆ DMA3_BUSY

#define DMA3_BUSY   0x80000000

Definition at line 91 of file save_state.h.

Referenced by WaitDma().

◆ START_DMA

#define START_DMA ( source_,
destination_,
control_ )
Value:
Dma_Set((const void *)(source_), (void *)(destination_), (control_), REG_DMA3)
#define REG_DMA3
Definition io_reg.h:153

Definition at line 93 of file save_state.h.

Referenced by GameState_InitDefaults(), SaveState_InitializeWorkspace(), SaveState_InvalidateSlot(), SaveState_ReadRecordPayload(), and SaveState_WriteRecord().

◆ WAIT_DMA

#define WAIT_DMA ( )
Value:
#define DMA3
DMA3, the channel the game copies with, as its three registers.
Definition dma.h:18
static __inline__ void WaitDma(struct DmaRegisters volatile *channel)
Definition save_state.h:96

Definition at line 101 of file save_state.h.

Referenced by GameState_InitDefaults(), SaveState_InitializeWorkspace(), SaveState_InvalidateSlot(), SaveState_ReadRecordPayload(), SaveState_ReadSlotAndCheckChecksum(), and SaveState_WriteRecord().

Function Documentation

◆ STATIC_ASSERT() [1/12]

STATIC_ASSERT ( sizeof(struct SaveSummary) = =64)

◆ STATIC_ASSERT() [2/12]

STATIC_ASSERT ( offsetof(struct SaveSummary, level) = =0x1c)

◆ STATIC_ASSERT() [3/12]

STATIC_ASSERT ( offsetof(struct SaveSummary, sendFlag) = =0x31)

◆ STATIC_ASSERT() [4/12]

STATIC_ASSERT ( offsetof(struct SaveSummary, checksum) = =0x3c)

◆ STATIC_ASSERT() [5/12]

STATIC_ASSERT ( offsetof(struct SaveWorkspace, slot) = =0x40)

◆ STATIC_ASSERT() [6/12]

STATIC_ASSERT ( offsetof(struct SaveWorkspace, summary) = =0x1040)

◆ STATIC_ASSERT() [7/12]

STATIC_ASSERT ( sizeof(struct SaveSlotHeader) = =0x10)

◆ STATIC_ASSERT() [8/12]

STATIC_ASSERT ( sizeof(struct SaveWorkspace) = =0x1100)

◆ STATIC_ASSERT() [9/12]

STATIC_ASSERT ( offsetof(struct SaveWorkspace, recordId) = =0x10)

◆ STATIC_ASSERT() [10/12]

STATIC_ASSERT ( offsetof(struct SaveWorkspace, sequence) = =0x20)

◆ STATIC_ASSERT() [11/12]

STATIC_ASSERT ( offsetof(struct SaveSummary, flagCount) = =0x32)

◆ STATIC_ASSERT() [12/12]

STATIC_ASSERT ( offsetof(struct SaveSummary, unk38) = =0x38)

◆ WaitDma()

__inline__ void WaitDma ( struct DmaRegisters volatile * channel)
static

Definition at line 96 of file save_state.h.

Referenced by DisplayScroll_InitializeHBlankDma(), WaitDma(), and WaitDma().

Variable Documentation

◆ gSaveWorkspace

◆ gTitleSendOptionEnabled

s16 gTitleSendOptionEnabled
extern