OpenEmu: Add rewinding support

This commit is contained in:
Jeffrey Pfau 2016-01-02 17:17:08 -08:00
parent 7f4320e872
commit 656260c129
2 changed files with 8 additions and 2 deletions

View File

@ -26,6 +26,12 @@
<dict>
<key>openemu.system.gba</key>
<dict>
<key>OEGameCoreRewindBufferSeconds</key>
<integer>1200</integer>
<key>OEGameCoreRewindInterval</key>
<integer>0</integer>
<key>OEGameCoreSupportsRewinding</key>
<true/>
</dict>
</dict>
<key>OEGameCorePlayerCount</key>

View File

@ -209,7 +209,7 @@
- (NSData *)serializeStateWithError:(NSError **)outError
{
struct VFile* vf = VFileMemChunk(nil, 0);
if (!GBASaveStateNamed(context.gba, vf, 0)) {
if (!GBASaveStateNamed(context.gba, vf, SAVESTATE_SAVEDATA)) {
*outError = [NSError errorWithDomain:OEGameCoreErrorDomain code:OEGameCoreCouldNotLoadStateError userInfo:nil];
vf->close(vf);
return nil;
@ -225,7 +225,7 @@
- (BOOL)deserializeState:(NSData *)state withError:(NSError **)outError
{
struct VFile* vf = VFileFromConstMemory(state.bytes, state.length);
if (!GBALoadStateNamed(context.gba, vf, 0)) {
if (!GBALoadStateNamed(context.gba, vf, SAVESTATE_SAVEDATA)) {
*outError = [NSError errorWithDomain:OEGameCoreErrorDomain code:OEGameCoreCouldNotLoadStateError userInfo:nil];
vf->close(vf);
return NO;