Expose GBAGetState
Jeffrey Pfau jeffrey@endrift.com
Tue, 14 Oct 2014 01:05:53 -0700
2 files changed,
4 insertions(+),
3 deletions(-)
M
src/gba/gba-serialize.c
→
src/gba/gba-serialize.c
@@ -102,7 +102,7 @@ GBARRSkipSegment(gba->rr);
} } -static struct VFile* _getStateVf(struct GBA* gba, struct VDir* dir, int slot, bool write) { +struct VFile* GBAGetState(struct GBA* gba, struct VDir* dir, int slot, bool write) { char suffix[5] = { '\0' }; snprintf(suffix, sizeof(suffix), ".ss%d", slot); return VDirOptionalOpenFile(dir, gba->activeFile, "savestate", suffix, write ? (O_CREAT | O_TRUNC | O_RDWR) : O_RDONLY);@@ -167,7 +167,7 @@ }
#endif bool GBASaveState(struct GBA* gba, struct VDir* dir, int slot, bool screenshot) { - struct VFile* vf = _getStateVf(gba, dir, slot, true); + struct VFile* vf = GBAGetState(gba, dir, slot, true); if (!vf) { return false; }@@ -177,7 +177,7 @@ return success;
} bool GBALoadState(struct GBA* gba, struct VDir* dir, int slot) { - struct VFile* vf = _getStateVf(gba, dir, slot, false); + struct VFile* vf = GBAGetState(gba, dir, slot, false); if (!vf) { return false; }
M
src/gba/gba-serialize.h
→
src/gba/gba-serialize.h
@@ -271,6 +271,7 @@ void GBADeserialize(struct GBA* gba, struct GBASerializedState* state);
bool GBASaveState(struct GBA* gba, struct VDir* dir, int slot, bool screenshot); bool GBALoadState(struct GBA* gba, struct VDir* dir, int slot); +struct VFile* GBAGetState(struct GBA* gba, struct VDir* dir, int slot, bool write); bool GBASaveStateNamed(struct GBA* gba, struct VFile* vf, bool screenshot); bool GBALoadStateNamed(struct GBA* gba, struct VFile* vf);