GBA: Kill GBAGetState
Jeffrey Pfau jeffrey@endrift.com
Sun, 14 Feb 2016 22:50:27 -0800
5 files changed,
1 insertions(+),
26 deletions(-)
M
src/gba/gba.c
→
src/gba/gba.c
@@ -438,7 +438,6 @@ mLOG(GBA, WARN, "Couldn't map ROM");
return false; } gba->yankedRomSize = 0; - gba->activeFile = fname; gba->memory.romSize = 0; gba->memory.romMask = 0; gba->romCrc32 = doCrc32(gba->pristineRom, gba->pristineRomSize);
M
src/gba/gba.h
→
src/gba/gba.h
@@ -111,8 +111,6 @@ uint32_t romCrc32;
struct VFile* romVf; struct VFile* biosVf; - const char* activeFile; - struct mAVStream* stream; struct mKeyCallback* keyCallback; struct mStopCallback* stopCallback;
M
src/gba/gui/gui-runner.c
→
src/gba/gui/gui-runner.c
@@ -63,10 +63,7 @@ if (gbaBackground->screenshot && gbaBackground->screenshotId == (int) 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);
M
src/gba/serialize.c
→
src/gba/serialize.c
@@ -206,22 +206,6 @@ }
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;
M
src/gba/serialize.h
→
src/gba/serialize.h
@@ -385,9 +385,6 @@
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);