summaryrefslogtreecommitdiff
path: root/libpcsxcore/misc.c
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-06-26 01:01:05 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-06-26 01:01:05 +0000
commit306902a14b95908dfb49ce1e5c41edf90f61eaa3 (patch)
tree30be174f00d3f32843d093a51c069ec23c144262 /libpcsxcore/misc.c
parent72524b9a4e45a26cd598474aa1302d95080f7fcf (diff)
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@53626 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore/misc.c')
-rw-r--r--libpcsxcore/misc.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c
index 8d99ef91..b7b56cbc 100644
--- a/libpcsxcore/misc.c
+++ b/libpcsxcore/misc.c
@@ -456,7 +456,7 @@ static const char PcsxHeader[32] = "STv4 PCSX v" PACKAGE_VERSION;
// Savestate Versioning!
// If you make changes to the savestate version, please increment the value below.
-static const u32 SaveVersion = SWAPu32(0x8b410003);
+static const u32 SaveVersion = 0x8b410004;
int SaveState(const char *file) {
gzFile f;
@@ -469,7 +469,8 @@ int SaveState(const char *file) {
if (f == NULL) return -1;
gzwrite(f, (void *)PcsxHeader, 32);
- gzwrite(f, (void *)&SaveVersion, sizeof(SaveVersion));
+ gzwrite(f, (void *)&SaveVersion, sizeof(u32));
+ gzwrite(f, (void *)&Config.HLE, sizeof(boolean));
pMem = (unsigned char *)malloc(128 * 96 * 3);
if (pMem == NULL) return -1;
@@ -520,14 +521,16 @@ int LoadState(const char *file) {
int Size;
char header[32];
u32 version;
+ boolean hle;
f = gzopen(file, "rb");
if (f == NULL) return -1;
gzread(f, header, sizeof(header));
gzread(f, &version, sizeof(u32));
+ gzread(f, &hle, sizeof(boolean));
- if (strncmp("STv4 PCSX", header, 9) != 0 || version != SaveVersion) {
+ if (strncmp("STv4 PCSX", header, 9) != 0 || version != SaveVersion || hle != Config.HLE) {
gzclose(f);
return -1;
}
@@ -571,16 +574,18 @@ int CheckState(const char *file) {
gzFile f;
char header[32];
u32 version;
+ boolean hle;
f = gzopen(file, "rb");
if (f == NULL) return -1;
gzread(f, header, sizeof(header));
gzread(f, &version, sizeof(u32));
+ gzread(f, &hle, sizeof(boolean));
gzclose(f);
- if (strncmp("STv4 PCSX", header, 9) != 0 || version != SaveVersion)
+ if (strncmp("STv4 PCSX", header, 9) != 0 || version != SaveVersion || hle != Config.HLE)
return -1;
return 0;
@@ -592,8 +597,6 @@ int SendPcsxInfo() {
if (NET_recvData == NULL || NET_sendData == NULL)
return 0;
-// SysPrintf("SendPcsxInfo\n");
-
NET_sendData(&Config.Xa, sizeof(Config.Xa), PSE_NET_BLOCKING);
NET_sendData(&Config.Sio, sizeof(Config.Sio), PSE_NET_BLOCKING);
NET_sendData(&Config.SpuIrq, sizeof(Config.SpuIrq), PSE_NET_BLOCKING);
@@ -601,8 +604,6 @@ int SendPcsxInfo() {
NET_sendData(&Config.PsxType, sizeof(Config.PsxType), PSE_NET_BLOCKING);
NET_sendData(&Config.Cpu, sizeof(Config.Cpu), PSE_NET_BLOCKING);
-// SysPrintf("Send OK\n");
-
return 0;
}
@@ -612,8 +613,6 @@ int RecvPcsxInfo() {
if (NET_recvData == NULL || NET_sendData == NULL)
return 0;
-// SysPrintf("RecvPcsxInfo\n");
-
NET_recvData(&Config.Xa, sizeof(Config.Xa), PSE_NET_BLOCKING);
NET_recvData(&Config.Sio, sizeof(Config.Sio), PSE_NET_BLOCKING);
NET_recvData(&Config.SpuIrq, sizeof(Config.SpuIrq), PSE_NET_BLOCKING);
@@ -638,8 +637,6 @@ int RecvPcsxInfo() {
psxCpu->Reset();
}
-// SysPrintf("Recv OK\n");
-
return 0;
}