Fixed the load-state memory leak, also fixed various other savestate issues. Found (probably) the cause of load-state crashing Dolphin: BPWrites. Tried to put a CriticalSection around BPWritten but it only causes Dolphin to hang when loading a state. Can someone find why it hangs?

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3873 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY
2009-07-22 22:50:52 +00:00
parent eec7cba0af
commit 3c9b5bbf7b
3 changed files with 62 additions and 43 deletions

View File

@ -27,15 +27,20 @@
#include "OpcodeDecoding.h"
#include "VertexLoader.h"
#include "VertexShaderManager.h"
#include "Thread.h"
using namespace BPFunctions;
// FIXME: Hangs load-state, but should fix graphic-heavy games state loading
//Common::CriticalSection s_bpCritical;
void BPInit()
{
memset(&bpmem, 0, sizeof(bpmem));
bpmem.bpMask = 0xFFFFFF;
}
// ----------------------------------------------------------------------------------------------------------
// Write to the Bypass Memory (Bypass Raster State Registers)
/* ------------------
@ -73,6 +78,9 @@ void BPWritten(const Bypass& bp)
//default: break;
//}
// FIXME: Hangs load-state, but should fix graphic-heavy games state loading
//s_bpCritical.Enter();
FlushPipeline();
((u32*)&bpmem)[bp.address] = bp.newvalue;
@ -605,10 +613,11 @@ void BPWritten(const Bypass& bp)
default:
WARN_LOG(VIDEO, "Unknown BP opcode: address = 0x%08x value = 0x%08x", bp.address, bp.newvalue);
break;
}
}
}
}
// FIXME: Hangs load-state, but should fix graphic-heavy games state loading
//s_bpCritical.Leave();
}
}