mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
1. This should fix Issue 1625 (Bizarre Auto Frame Limit)
Now the frame limiter yields on CPU thread, not as before on GPU thread mistakenly 2. Fixed clear of VI interrupts I guess VI interrupts are not used at all, because they were never cleared before 3. Made GPU thread 0% processor usage when paused whatever your active config is. I tried the event approach but somehow the thread resume latency is excessively long (Who can tell me why?) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4790 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -383,7 +383,6 @@ void Write16(const u16 _Value, const u32 _Address)
|
||||
// Touching that game is a no-go so I don't want to take the risk :p
|
||||
while (fifo.bFF_GPReadEnable && ((!fifo.bFF_BPEnable && fifo.CPReadWriteDistance) || (fifo.bFF_BPEnable && !fifo.bFF_Breakpoint)))
|
||||
{
|
||||
Fifo_RunLoop();
|
||||
s_fifoIdleEvent.MsgWait();
|
||||
}
|
||||
}
|
||||
@ -414,8 +413,6 @@ void Write16(const u16 _Value, const u32 _Address)
|
||||
Common::AtomicStore(fifo.bFF_Breakpoint, 0);
|
||||
}
|
||||
|
||||
Fifo_RunLoop();
|
||||
|
||||
DEBUG_LOG(COMMANDPROCESSOR,"\t write to CTRL_REGISTER : %04x", _Value);
|
||||
DEBUG_LOG(COMMANDPROCESSOR, "\t GPREAD %s | LINK %s | BP %s || Init %s | OvF %s | UndF %s"
|
||||
, fifo.bFF_GPReadEnable ? "ON" : "OFF"
|
||||
@ -572,10 +569,9 @@ void WaitForFrameFinish()
|
||||
{
|
||||
while ((fake_GPWatchdogLastToken == fifo.Fake_GPWDToken) && fifo.bFF_GPReadEnable && ((!fifo.bFF_BPEnable && fifo.CPReadWriteDistance) || (fifo.bFF_BPEnable && !fifo.bFF_Breakpoint)));
|
||||
{
|
||||
Fifo_RunLoop();
|
||||
s_fifoIdleEvent.MsgWait();
|
||||
}
|
||||
|
||||
|
||||
fake_GPWatchdogLastToken = fifo.Fake_GPWDToken;
|
||||
}
|
||||
|
||||
@ -594,7 +590,6 @@ void STACKALIGN GatherPipeBursted()
|
||||
fifo.CPWritePointer += GATHER_PIPE_SIZE;
|
||||
|
||||
Common::AtomicAdd(fifo.CPReadWriteDistance, GATHER_PIPE_SIZE);
|
||||
Fifo_RunLoop();
|
||||
|
||||
// High watermark overflow handling (hacked way)
|
||||
if (fifo.CPReadWriteDistance > fifo.CPHiWatermark)
|
||||
@ -619,7 +614,6 @@ void STACKALIGN GatherPipeBursted()
|
||||
// Wait for GPU to catch up
|
||||
while (fifo.CPReadWriteDistance > fifo.CPLoWatermark && fifo.bFF_GPReadEnable && (!fifo.bFF_BPEnable || (fifo.bFF_BPEnable && !fifo.bFF_Breakpoint)))
|
||||
{
|
||||
Fifo_RunLoop();
|
||||
s_fifoIdleEvent.MsgWait();
|
||||
}
|
||||
}
|
||||
@ -725,7 +719,6 @@ void UpdateFifoRegister()
|
||||
dist = (wp - fifo.CPBase) + ((fifo.CPEnd + GATHER_PIPE_SIZE) - rp);
|
||||
|
||||
Common::AtomicStore(fifo.CPReadWriteDistance, dist);
|
||||
Fifo_RunLoop();
|
||||
|
||||
if (!g_VideoInitialize.bOnThread)
|
||||
CatchUpGPU();
|
||||
|
@ -34,6 +34,7 @@ extern u8* g_pVideoData;
|
||||
namespace
|
||||
{
|
||||
static volatile bool fifoStateRun = false;
|
||||
static volatile bool EmuRunning = false;
|
||||
static u8 *videoBuffer;
|
||||
static Common::Event fifo_run_event;
|
||||
// STATE_TO_SAVE
|
||||
@ -100,9 +101,11 @@ void Fifo_ExitLoopNonBlocking()
|
||||
fifo_run_event.Set();
|
||||
}
|
||||
|
||||
void Fifo_RunLoop()
|
||||
void Fifo_RunLoop(bool run)
|
||||
{
|
||||
fifo_run_event.Set();
|
||||
EmuRunning = run;
|
||||
if (run)
|
||||
fifo_run_event.Set();
|
||||
}
|
||||
|
||||
// Description: Fifo_EnterLoop() sends data through this function.
|
||||
@ -210,9 +213,7 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
|
||||
}
|
||||
|
||||
CommandProcessor::SetFifoIdleFromVideoPlugin();
|
||||
// "VideoFifo_CheckEFBAccess()" & "VideoFifo_CheckSwapRequest()" should be
|
||||
// moved to a more suitable place than inside function "Fifo_EnterLoop()"
|
||||
if (g_ActiveConfig.bEFBAccessEnable || g_ActiveConfig.bUseXFB)
|
||||
if (EmuRunning)
|
||||
Common::YieldCPU();
|
||||
else
|
||||
fifo_run_event.MsgWait();
|
||||
|
@ -36,7 +36,7 @@ void Fifo_SendFifoData(u8* _uData, u32 len);
|
||||
void Fifo_EnterLoop(const SVideoInitialize &video_initialize);
|
||||
void Fifo_ExitLoop();
|
||||
void Fifo_ExitLoopNonBlocking();
|
||||
void Fifo_RunLoop();
|
||||
void Fifo_RunLoop(bool run);
|
||||
|
||||
void Fifo_DoState(PointerWrap &f);
|
||||
|
||||
|
Reference in New Issue
Block a user