Eeprom is done

This commit is contained in:
Zach Bacon 2016-07-09 17:34:55 -04:00
parent 590dd281dd
commit 5f73631f84
No known key found for this signature in database
GPG Key ID: 7D110798AFE84B3A
2 changed files with 12 additions and 12 deletions

View File

@ -13,13 +13,13 @@ int eepromAddress = 0;
#ifdef __LIBRETRO__
// Workaround for broken-by-design GBA save semantics
extern u8 libretro_save_buf[0x20000 + 0x2000];
u8* eepromData = libretro_save_buf + 0x20000;
extern uint8_t libretro_save_buf[0x20000 + 0x2000];
uint8_t* eepromData = libretro_save_buf + 0x20000;
#else
u8 eepromData[0x2000];
uint8_t eepromData[0x2000];
#endif
u8 eepromBuffer[16];
uint8_t eepromBuffer[16];
bool eepromInUse = false;
int eepromSize = 512;
@ -103,7 +103,7 @@ void eepromReadGameSkip(gzFile gzFile, int version)
}
#endif
int eepromRead(u32 /* address */)
int eepromRead(uint32_t /* address */)
{
switch (eepromMode) {
case EEPROM_IDLE:
@ -137,7 +137,7 @@ int eepromRead(u32 /* address */)
return 1;
}
void eepromWrite(u32 /* address */, u8 value)
void eepromWrite(uint32_t /* address */, uint8_t value)
{
if (cpuDmaCount == 0)
return;

View File

@ -2,21 +2,21 @@
#define EEPROM_H
#ifdef __LIBRETRO__
extern void eepromSaveGame(u8*& data);
extern void eepromReadGame(const u8*& data, int version);
extern void eepromSaveGame(uint8_t*& data);
extern void eepromReadGame(const uint8_t*& data, int version);
#else
extern void eepromSaveGame(gzFile _gzFile);
extern void eepromReadGame(gzFile _gzFile, int version);
extern void eepromReadGameSkip(gzFile _gzFile, int version);
#endif
extern int eepromRead(u32 address);
extern void eepromWrite(u32 address, u8 value);
extern int eepromRead(uint32_t address);
extern void eepromWrite(uint32_t address, uint8_t value);
extern void eepromInit();
extern void eepromReset();
#ifdef __LIBRETRO__
extern u8* eepromData;
extern uint8_t* eepromData;
#else
extern u8 eepromData[0x2000];
extern uint8_t eepromData[0x2000];
#endif
extern bool eepromInUse;
extern int eepromSize;