GBA: Kill GBAGetState

This commit is contained in:
Jeffrey Pfau 2016-02-14 22:50:27 -08:00
parent de065be15c
commit ddc2932c95
5 changed files with 1 additions and 26 deletions

View File

@ -438,7 +438,6 @@ bool GBALoadMB(struct GBA* gba, struct VFile* vf, const char* fname) {
return false;
}
gba->yankedRomSize = 0;
gba->activeFile = fname;
gba->memory.romSize = 0;
gba->memory.romMask = 0;
gba->romCrc32 = doCrc32(gba->pristineRom, gba->pristineRomSize);

View File

@ -111,8 +111,6 @@ struct GBA {
struct VFile* romVf;
struct VFile* biosVf;
const char* activeFile;
struct mAVStream* stream;
struct mKeyCallback* keyCallback;
struct mStopCallback* stopCallback;

View File

@ -63,10 +63,7 @@ static void _drawState(struct GUIBackground* background, void* id) {
gbaBackground->p->drawScreenshot(gbaBackground->p, gbaBackground->screenshot, true);
return;
}
struct VFile* vf = NULL;
if (gbaBackground->p->core->platform(gbaBackground->p->core) == PLATFORM_GBA) {
vf = GBAGetState(gbaBackground->p->core->board, gbaBackground->p->core->dirs.state, stateId, false);
}
struct VFile* vf = mCoreGetState(gbaBackground->p->core, stateId, false);
uint32_t* pixels = gbaBackground->screenshot;
if (!pixels) {
pixels = anonymousMemoryMap(VIDEO_HORIZONTAL_PIXELS * VIDEO_VERTICAL_PIXELS * 4);

View File

@ -206,22 +206,6 @@ bool GBADeserialize(struct GBA* gba, const struct GBASerializedState* state) {
return true;
}
struct VFile* GBAGetState(struct GBA* gba, struct VDir* dir, int slot, bool write) {
char basename[PATH_MAX];
separatePath(gba->activeFile, 0, basename, 0);
char path[PATH_MAX];
snprintf(path, sizeof(path), "%s.ss%i", basename, slot);
return dir->openFile(dir, path, write ? (O_CREAT | O_TRUNC | O_RDWR) : O_RDONLY);
}
void GBADeleteState(struct GBA* gba, struct VDir* dir, int slot) {
char basename[PATH_MAX];
separatePath(gba->activeFile, 0, basename, 0);
char path[PATH_MAX];
snprintf(path, sizeof(path), "%s.ss%i", basename, slot);
dir->deleteFile(dir, path);
}
#ifdef USE_PNG
static bool _savePNGState(struct GBA* gba, struct VFile* vf, struct GBAExtdata* extdata) {
unsigned stride;

View File

@ -385,9 +385,6 @@ struct VDir;
void GBASerialize(struct GBA* gba, struct GBASerializedState* state);
bool GBADeserialize(struct GBA* gba, const struct GBASerializedState* state);
struct VFile* GBAGetState(struct GBA* gba, struct VDir* dir, int slot, bool write);
void GBADeleteState(struct GBA* thread, struct VDir* dir, int slot);
bool GBASaveStateNamed(struct GBA* gba, struct VFile* vf, int flags);
bool GBALoadStateNamed(struct GBA* gba, struct VFile* vf, int flags);