- Improve Fifo_Init() and Fifo_ExitLoop() for avoid Crashes when the emulation Start and Stop.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7159 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Marcos Vitali 2011-02-13 04:10:40 +00:00
parent 05feabdb49
commit cd9ec1805a
1 changed files with 4 additions and 2 deletions

View File

@ -54,6 +54,7 @@ void Fifo_DoState(PointerWrap &p)
void Fifo_Init() void Fifo_Init()
{ {
videoBuffer = (u8*)AllocateMemoryPages(FIFO_SIZE); videoBuffer = (u8*)AllocateMemoryPages(FIFO_SIZE);
size = 0;
fifoStateRun = false; fifoStateRun = false;
} }
@ -84,7 +85,8 @@ void Fifo_ExitLoop()
{ {
// This should break the wait loop in CPU thread // This should break the wait loop in CPU thread
CommandProcessor::fifo.bFF_GPReadEnable = false; CommandProcessor::fifo.bFF_GPReadEnable = false;
CommandProcessor::SetFifoIdleFromVideoPlugin(); SCPFifoStruct &_fifo = CommandProcessor::fifo;
while(_fifo.isFifoProcesingData) Common::YieldCPU();
// Terminate GPU thread loop // Terminate GPU thread loop
fifoStateRun = false; fifoStateRun = false;
EmuRunning = true; EmuRunning = true;