Functions
DiskSave_Initialize
u8 DiskSave_Initialize()

Detect if a disk drive is present and valid disk is inserted

Return

SAVEDATA_NODRIVE if no disk drive is present SAVEDATA_NODISK if no disk is present SAVEDATA_VALID if a valid disk is present

DiskSave_SetName
inline void DiskSave_SetName(
const c8* name
)

Set the base name of the save data file

Parameters
name
const c8*

Pointer to the ASCIIZ string with the name (must be 6 characters max) The name will be used as the base for the save data file, e.g. "GAME" will create files like "GAME00.SAV", "GAME01.SAV", etc.

DiskSave_SetExtension
inline void DiskSave_SetExtension(
const c8* ext
)

Set the extension of the save data file

Parameters
ext
const c8*

Pointer to the ASCIIZ string with the extension (must be 3 characters max) The extension will be used for the save data file, e.g. "SAV" will create files like "GAME00.SAV", "GAME01.SAV", etc.

DiskSave_BuildFilename
void DiskSave_BuildFilename(
u8 entry,
c8* buffer,
bool pad
)

Build the filename for a given save data entry

Parameters
entry
u8

Save data entry

buffer
c8*

Pointer to the buffer where the filename will be stored (must be at least 13 bytes long)

pad
bool

If TRUE, the filename will be padded with spaces to fill 8 characters

DiskSave_Check
u8 DiskSave_Check(
u8 entry
)

Check if a save data entry is valid

Parameters
entry
u8

Save data entry

Return
DiskSave_Save
bool DiskSave_Save(
u8 entry,
const u8* data,
u16 size
)

Save data to a file

Parameters
entry
u8

Save data entry

data
const u8*

Pointer to the data to save

size
u16

Size of the data to save in bytes

Return

FALSE if the save data could not be saved

DiskSave_Load
bool DiskSave_Load(
u8 entry,
u8* data,
u16 size
)

Load saved data from a file

Parameters
entry
u8

Save data entry

data
u8*

Pointer to the buffer where the data will be loaded

size
u16

Size of the data to load in bytes

Return

FALSE if the save data could not be loaded

DiskSave_Delete
bool DiskSave_Delete(
u8 entry
)

Delete saved data from a file

Parameters
entry
u8

Save data entry

Return

FALSE if the save data could not be deleted

DiskSave_GetFreeEntries
u8 DiskSave_GetFreeEntries()

Get the number of free save data entries available on the disk (for 1024 bytes max per entry)

Return

Number of free save data entries available on the current disk

DiskSave_AvailableDrives
inline u8 DiskSave_AvailableDrives()

Get a bit field of all available disk drives

Return

Bit field of available drives (bit 0 for A, bit 1 for B, ..., bit 7 for H)

DiskSave_SelectDrive
inline u8 DiskSave_SelectDrive(
u8 drive
)

Select disk drive number

Parameters
drive
u8

Disk drive number (0 for A, 1 for B, ..., 7 for H)

Return

Number of available drives

DiskSave_GetCurrentDrive
inline u8 DiskSave_GetCurrentDrive()

Get current disk drive number

Return

Current drive number (0 for A, 1 for B, ..., 7 for H)