This could alleviate the suffering of dual core synchronization a bit.

But I doubt you would notice it in most cases.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4830 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
ayuanx committed 2010-01-14 10:52:14 +00:00
1 parent b186f0821e
commit 571a47ef9a
11 files changed
+108 -49

No files matched your search

+7 -6
View File
@@ -548,13 +548,14 @@ void ScreenShot()
// This should only be called from VI
void VideoThrottle()
{
u32 TargetVPS = (SConfig::GetInstance().m_Framelimit > 1) ? SConfig::GetInstance().m_Framelimit * 10
: VideoInterface::TargetRefreshRate;
u32 TargetVPS = (SConfig::GetInstance().m_Framelimit > 1) ?
SConfig::GetInstance().m_Framelimit * 10 : VideoInterface::TargetRefreshRate;
// When frame limit is NOT off
if (SConfig::GetInstance().m_Framelimit)
{
u32 frametime = DrawnVideo * 1000 / TargetVPS;
// Make the limiter a bit loose
u32 frametime = DrawnVideo * 1000 / ++TargetVPS;
while ((u32)Timer.GetTimeDifference() < frametime)
Common::YieldCPU();
//Common::SleepCurrentThread(1);
@@ -567,7 +568,7 @@ void VideoThrottle()
SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
u32 FPS = Common::AtomicLoad(DrawnFrame) * 1000 / ElapseTime;
u32 VPS = DrawnVideo * 1000 / ElapseTime;
u32 VPS = --DrawnVideo * 1000 / ElapseTime;
u32 Speed = VPS * 100 / VideoInterface::TargetRefreshRate;
// Settings are shown the same for both extended and summary info
@@ -611,7 +612,7 @@ void VideoThrottle()
SystemTimers::GetTicksPerSecond() / 1000000,
_CoreParameter.bSkipIdle ? "~" : "",
TicksPercentage);
#else // Summary information
std::string SFPS = StringFromFormat("FPS: %u - VPS: %u - SPEED: %u%%", FPS, VPS, Speed);
#endif
@@ -630,7 +631,7 @@ void VideoThrottle()
Common::AtomicStore(DrawnFrame, 0);
DrawnVideo = 0;
}
DrawnVideo++;
}
+6 -16
View File
@@ -132,13 +132,7 @@ int
// This is completely arbitrary. If we find that we need lower latency, we can just
// increase this number.
IPC_HLE_PERIOD,
// For DC watchdog hack
// Once every 4 frame-period seems to be enough (arbitrary taking 60fps as the ref).
// TODO: make it VI output frame rate compliant (30/60 and 25/50)
// Assuming game's frame-finish-watchdog wait more than 4 emulated frame-period before starting its mess.
FAKE_GP_WATCHDOG_PERIOD;
IPC_HLE_PERIOD;
@@ -227,7 +221,7 @@ void AdvanceCallback(int cyclesExecuted)
void FakeGPWatchdogCallback(u64 userdata, int cyclesLate)
{
CPluginManager::GetInstance().GetVideo()->Video_WaitForFrameFinish(); // lock CPUThread until frame finish
CoreTiming::ScheduleEvent(FAKE_GP_WATCHDOG_PERIOD-cyclesLate, et_FakeGPWD);
CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerFrame() - cyclesLate, et_FakeGPWD);
}
void PatchEngineCallback(u64 userdata, int cyclesLate)
@@ -235,7 +229,7 @@ void PatchEngineCallback(u64 userdata, int cyclesLate)
// Patch mem and run the Action Replay
PatchEngine::ApplyFramePatches();
PatchEngine::ApplyARPatches();
CoreTiming::ScheduleEvent((GetTicksPerSecond() / 5000) - cyclesLate, et_PatchEngine);
CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerFrame() - cyclesLate, et_PatchEngine);
}
void Init()
@@ -271,8 +265,6 @@ void Init()
if (UsingDSPLLE)
DSP_PERIOD = 12000; // TO BE TWEAKED
FAKE_GP_WATCHDOG_PERIOD = GetTicksPerSecond() / 60;
// This is the biggest question mark.
AI_PERIOD = GetTicksPerSecond() / 80;
@@ -297,16 +289,14 @@ void Init()
CoreTiming::ScheduleEvent(AI_PERIOD, et_AI);
CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerFrame(), et_VI);
CoreTiming::ScheduleEvent(DSP_PERIOD, et_DSP);
CoreTiming::ScheduleEvent(GetTicksPerSecond() / 60, et_SI);
CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerFrame(), et_SI);
CoreTiming::ScheduleEvent(AUDIO_DMA_PERIOD, et_AudioDMA);
// For DC watchdog hack
if (Core::GetStartupParameter().bCPUThread)
{
CoreTiming::ScheduleEvent(FAKE_GP_WATCHDOG_PERIOD, et_FakeGPWD);
}
CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerFrame(), et_FakeGPWD);
CoreTiming::ScheduleEvent(GetTicksPerSecond() / 60, et_PatchEngine);
CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerFrame(), et_PatchEngine);
if (Core::GetStartupParameter().bWii)
CoreTiming::ScheduleEvent(IPC_HLE_PERIOD, et_IPC_HLE);