My first commit :D

Dual Core sync fix.
When the FIFO is processing data we must not advance the cpu cycles in CoreTiming because in this way the VI will be desynchronized. So, We are waiting until the FIFO finish and while we process only the events required by the FIFO.
This should fix Issue 2072 .
This affect to all games in dual core mode.
Please, You can test all games with VPS limiter auto, 60, 50 depending of the game and compare with prev revision.
For example now NSMB in the video Intro has 60 fps (prev 30 fps) :D or SMG does't need anymore FPS Limitter Hack to get 55-60 fps
Beside the slowdowns now are more softly and the fps more stables because the VI sync is almost perfect.
The Core Timing and Fifo modifications are delicated. Please report if this hang any game. Don't forget check with prev revision.
Enjoy it! Thanks to Rodolfo for teach me all about dolphin.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5777 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Marcos Vitali
2010-06-24 13:28:54 +00:00
parent 2faae384b3
commit 10b5d2371c
15 changed files with 112 additions and 22 deletions

View File

@ -147,9 +147,13 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
VideoFifo_CheckEFBAccess();
VideoFifo_CheckSwapRequest();
// check if we are able to run this buffer
// check if we are able to run this buffer
while (_fifo.bFF_GPReadEnable && _fifo.CPReadWriteDistance)
{
// while the FIFO is processing data we activate this for sync with emulator thread.
CommandProcessor::isFifoBusy = true;
if (!fifoStateRun)
break;
@ -170,6 +174,7 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
if (_fifo.bFF_BPInt)
CommandProcessor::UpdateInterruptsFromVideoPlugin();
CommandProcessor::FifoCriticalLeave();
CommandProcessor::isFifoBusy = false;
break;
}
@ -205,15 +210,19 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
// Those two are pretty important and must be called in the FIFO Loop.
// If we don't, s_swapRequested (OGL only) or s_efbAccessRequested won't be set to false
// leading the CPU thread to wait in Video_BeginField or Video_AccessEFB thus slowing things down.
VideoFifo_CheckEFBAccess();
VideoFifo_CheckSwapRequest();
CommandProcessor::isFifoBusy = false;
}
if (!_fifo.CPReadIdle && _fifo.CPReadWriteDistance < _fifo.CPLoWatermark)
{
Common::AtomicStore(_fifo.CPReadIdle, true);
CommandProcessor::UpdateInterruptsFromVideoPlugin();
}
_fifo.CPCmdIdle = true;
CommandProcessor::SetFifoIdleFromVideoPlugin();
if (EmuRunning)