mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-16 05:42:55 +00:00
Save states now work (to some extent). Please report special cases which cause crashes or anything of the sort. Also removed debug messages from state management
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@385 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
06f0b02ecd
commit
95eb8f9ef3
@ -264,7 +264,7 @@
|
|||||||
OmitFramePointers="true"
|
OmitFramePointers="true"
|
||||||
EnableFiberSafeOptimizations="false"
|
EnableFiberSafeOptimizations="false"
|
||||||
WholeProgramOptimization="false"
|
WholeProgramOptimization="false"
|
||||||
AdditionalIncludeDirectories="..\Common\Src;..\DiscIO\Src;..\..\PluginSpecs;..\Debugger\Src;..\..\..\Externals\Bochs_disasm"
|
AdditionalIncludeDirectories="..\Common\Src;..\DiscIO\Src;..\..\PluginSpecs;..\Debugger\Src;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
|
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
|
||||||
#include "State.h"
|
#include "State.h"
|
||||||
|
#include "Core.h"
|
||||||
#include "CoreTiming.h"
|
#include "CoreTiming.h"
|
||||||
#include "HW/HW.h"
|
#include "HW/HW.h"
|
||||||
#include "PowerPC/PowerPC.h"
|
#include "PowerPC/PowerPC.h"
|
||||||
@ -28,6 +29,8 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "zlib.h"
|
||||||
|
|
||||||
static int ev_Save;
|
static int ev_Save;
|
||||||
static int ev_Load;
|
static int ev_Load;
|
||||||
|
|
||||||
@ -57,6 +60,8 @@ void SaveStateCallback(u64 userdata, int cyclesLate)
|
|||||||
fwrite(buffer, sz, 1, f);
|
fwrite(buffer, sz, 1, f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
delete [] buffer;
|
delete [] buffer;
|
||||||
|
|
||||||
|
Core::DisplayMessage("Saved State", 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadStateCallback(u64 userdata, int cyclesLate)
|
void LoadStateCallback(u64 userdata, int cyclesLate)
|
||||||
@ -71,9 +76,11 @@ void LoadStateCallback(u64 userdata, int cyclesLate)
|
|||||||
fread(buffer, sz, 1, f);
|
fread(buffer, sz, 1, f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
u8 *ptr;
|
u8 *ptr = buffer;
|
||||||
PointerWrap p(&ptr, PointerWrap::MODE_READ);
|
PointerWrap p(&ptr, PointerWrap::MODE_READ);
|
||||||
DoState(p);
|
DoState(p);
|
||||||
|
|
||||||
|
Core::DisplayMessage("Loaded State", 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void State_Init()
|
void State_Init()
|
||||||
|
@ -23,33 +23,22 @@
|
|||||||
#include "TextureDecoder.h"
|
#include "TextureDecoder.h"
|
||||||
#include "Fifo.h"
|
#include "Fifo.h"
|
||||||
|
|
||||||
static void DoState(PointerWrap &p) {
|
|
||||||
// BP Memory
|
|
||||||
p.Do(bpmem);
|
|
||||||
// CP Memory
|
|
||||||
p.Do(arraybases);
|
|
||||||
p.Do(arraystrides);
|
|
||||||
p.Do(MatrixIndexA);
|
|
||||||
p.Do(MatrixIndexB);
|
|
||||||
// XF Memory
|
|
||||||
p.Do(xfregs);
|
|
||||||
PanicAlert("video: XFMem");
|
|
||||||
p.Do(xfmem);
|
|
||||||
PanicAlert("video: Texture decoder");
|
|
||||||
// Texture decoder
|
|
||||||
p.Do(texMem);
|
|
||||||
|
|
||||||
// FIFO
|
|
||||||
PanicAlert("video: FIFO");
|
|
||||||
Fifo_DoState(p);
|
|
||||||
|
|
||||||
//TODO: Check for more pointers in the data structures and make them
|
|
||||||
// serializable
|
|
||||||
}
|
|
||||||
|
|
||||||
void VideoCommon_DoState(PointerWrap &p) {
|
void VideoCommon_DoState(PointerWrap &p) {
|
||||||
PanicAlert("Saving state from Video Common Library");
|
// BP Memory
|
||||||
//TODO: Save the video state
|
p.Do(bpmem);
|
||||||
DoState(p);
|
// CP Memory
|
||||||
PanicAlert("END save video");
|
p.Do(arraybases);
|
||||||
|
p.Do(arraystrides);
|
||||||
|
p.Do(MatrixIndexA);
|
||||||
|
p.Do(MatrixIndexB);
|
||||||
|
// XF Memory
|
||||||
|
p.Do(xfregs);
|
||||||
|
p.Do(xfmem);
|
||||||
|
// Texture decoder
|
||||||
|
p.Do(texMem);
|
||||||
|
|
||||||
|
// FIFO
|
||||||
|
Fifo_DoState(p);
|
||||||
|
|
||||||
|
//TODO: search for more data that should be saved and add it here
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user