mirror of https://github.com/mgba-emu/mgba.git
OpenEmu: Add rewinding support
This commit is contained in:
parent
7f4320e872
commit
656260c129
|
@ -26,6 +26,12 @@
|
||||||
<dict>
|
<dict>
|
||||||
<key>openemu.system.gba</key>
|
<key>openemu.system.gba</key>
|
||||||
<dict>
|
<dict>
|
||||||
|
<key>OEGameCoreRewindBufferSeconds</key>
|
||||||
|
<integer>1200</integer>
|
||||||
|
<key>OEGameCoreRewindInterval</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
<key>OEGameCoreSupportsRewinding</key>
|
||||||
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
<key>OEGameCorePlayerCount</key>
|
<key>OEGameCorePlayerCount</key>
|
||||||
|
|
|
@ -209,7 +209,7 @@
|
||||||
- (NSData *)serializeStateWithError:(NSError **)outError
|
- (NSData *)serializeStateWithError:(NSError **)outError
|
||||||
{
|
{
|
||||||
struct VFile* vf = VFileMemChunk(nil, 0);
|
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];
|
*outError = [NSError errorWithDomain:OEGameCoreErrorDomain code:OEGameCoreCouldNotLoadStateError userInfo:nil];
|
||||||
vf->close(vf);
|
vf->close(vf);
|
||||||
return nil;
|
return nil;
|
||||||
|
@ -225,7 +225,7 @@
|
||||||
- (BOOL)deserializeState:(NSData *)state withError:(NSError **)outError
|
- (BOOL)deserializeState:(NSData *)state withError:(NSError **)outError
|
||||||
{
|
{
|
||||||
struct VFile* vf = VFileFromConstMemory(state.bytes, state.length);
|
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];
|
*outError = [NSError errorWithDomain:OEGameCoreErrorDomain code:OEGameCoreCouldNotLoadStateError userInfo:nil];
|
||||||
vf->close(vf);
|
vf->close(vf);
|
||||||
return NO;
|
return NO;
|
||||||
|
|
Loading…
Reference in New Issue