2013-04-17 22:43:11 -04:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Emulator state saving support.
|
|
|
|
|
2009-03-28 08:57:34 +00:00
|
|
|
#ifndef _STATE_H_
|
|
|
|
#define _STATE_H_
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2009-07-12 21:58:32 +00:00
|
|
|
#include <string>
|
2011-12-28 02:33:41 -06:00
|
|
|
#include <vector>
|
2009-07-12 21:58:32 +00:00
|
|
|
|
2011-03-17 10:17:45 +00:00
|
|
|
namespace State
|
2009-06-28 21:11:51 +00:00
|
|
|
{
|
|
|
|
|
2011-03-17 10:17:45 +00:00
|
|
|
void Init();
|
2011-10-15 22:19:42 +11:00
|
|
|
|
2011-03-17 10:17:45 +00:00
|
|
|
void Shutdown();
|
|
|
|
|
|
|
|
void EnableCompression(bool compression);
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
// These don't happen instantly - they get scheduled as events.
|
2010-04-17 21:02:03 +00:00
|
|
|
// ...But only if we're not in the main cpu thread.
|
|
|
|
// If we're in the main cpu thread then they run immediately instead
|
|
|
|
// because some things (like Lua) need them to run immediately.
|
2008-12-08 04:46:09 +00:00
|
|
|
// Slots from 0-99.
|
2011-03-17 10:17:45 +00:00
|
|
|
void Save(int slot);
|
|
|
|
void Load(int slot);
|
|
|
|
void Verify(int slot);
|
2009-06-28 01:11:35 +00:00
|
|
|
|
2011-03-17 10:17:45 +00:00
|
|
|
void SaveAs(const std::string &filename);
|
|
|
|
void LoadAs(const std::string &filename);
|
|
|
|
void VerifyAt(const std::string &filename);
|
2009-09-15 18:54:10 +00:00
|
|
|
|
2011-12-28 02:33:41 -06:00
|
|
|
void SaveToBuffer(std::vector<u8>& buffer);
|
|
|
|
void LoadFromBuffer(std::vector<u8>& buffer);
|
|
|
|
void VerifyBuffer(std::vector<u8>& buffer);
|
2009-06-28 01:11:35 +00:00
|
|
|
|
2011-03-17 10:17:45 +00:00
|
|
|
void LoadLastSaved();
|
|
|
|
void UndoSaveState();
|
|
|
|
void UndoLoadState();
|
2009-11-07 20:01:39 +00:00
|
|
|
|
2011-12-28 02:33:41 -06:00
|
|
|
// wait until previously scheduled savestate event (if any) is done
|
|
|
|
void Flush();
|
2009-06-28 01:11:35 +00:00
|
|
|
|
2011-12-18 01:15:59 -08:00
|
|
|
// for calling back into UI code without introducing a dependency on it in core
|
|
|
|
typedef void(*CallbackFunc)(void);
|
|
|
|
void SetOnAfterLoadCallback(CallbackFunc callback);
|
|
|
|
|
2011-03-17 10:17:45 +00:00
|
|
|
}
|
2009-06-28 01:11:35 +00:00
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
#endif
|