mgba/src/gba/gba-savedata.h

34 lines
651 B
C
Raw Normal View History

2013-04-28 02:59:41 +00:00
#ifndef GBA_SAVEDATA_H
#define GBA_SAVEDATA_H
#include <stdint.h>
enum SavedataType {
SAVEDATA_NONE = 0,
SAVEDATA_SRAM,
SAVEDATA_FLASH512,
SAVEDATA_FLASH1M,
SAVEDATA_EEPROM
};
enum {
SAVEDATA_FLASH_BASE = 0x0E005555
};
struct GBASavedata {
enum SavedataType type;
uint8_t* data;
const char* filename;
int fd;
};
void GBASavedataInit(struct GBASavedata* savedata, const char* filename);
void GBASavedataDeinit(struct GBASavedata* savedata);
void GBASavedataInitFlash(struct GBASavedata* savedata);
void GBASavedataInitSRAM(struct GBASavedata* savedata);
void GBASavedataWriteFlash(struct GBASavedata* savedata, uint8_t value);
#endif