From 32ef02c959fc2887bb81c3912c55a612d2acdd81 Mon Sep 17 00:00:00 2001 From: "memberTwo.mb2" Date: Wed, 14 Jan 2009 09:26:13 +0000 Subject: [PATCH] 1)For the planet. It's not like I made peace with OS scheduler for speed critical code, but in that case this really helps showing the load balancing between CPU and GPU. When CPU core load drops, GPU devs knows what to do :p. Thanks tinctorius for indirectly pointing this. 2) Tweak FAKE_GP_WATCHDOG_PERIOD for a bit more GPU asynchronicity. ZTP still ok here but tell me if it breaks games in DC. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1866 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/HW/CommandProcessor.cpp | 2 +- Source/Core/Core/Src/HW/SystemTimers.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/Src/HW/CommandProcessor.cpp b/Source/Core/Core/Src/HW/CommandProcessor.cpp index f9a04fe875..d3957f24a0 100644 --- a/Source/Core/Core/Src/HW/CommandProcessor.cpp +++ b/Source/Core/Core/Src/HW/CommandProcessor.cpp @@ -190,7 +190,7 @@ void IncrementGPWDToken() void WaitForFrameFinish() { while ((fake_GPWatchdogLastToken == fifo.Fake_GPWDToken) && fifo.bFF_GPReadEnable && (fifo.CPReadWriteDistance > 0) && !(fifo.bFF_BPEnable && fifo.bFF_Breakpoint)) - ; + Common::SleepCurrentThread(1); fake_GPWatchdogLastToken = fifo.Fake_GPWDToken; } diff --git a/Source/Core/Core/Src/HW/SystemTimers.cpp b/Source/Core/Core/Src/HW/SystemTimers.cpp index cef7c557cc..6106eb8f85 100644 --- a/Source/Core/Core/Src/HW/SystemTimers.cpp +++ b/Source/Core/Core/Src/HW/SystemTimers.cpp @@ -132,9 +132,11 @@ int IPC_HLE_PERIOD = GetTicksPerSecond() / 250, // For DC watchdog hack - // Once every 2 frame-period should be enough. - // Assuming game's frame-finish-watchdog wait more than 2 emulated frame-period before starting its mess. - FAKE_GP_WATCHDOG_PERIOD = GetTicksPerSecond() / 30; + // Once every 10 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 10 emulated frame-period before starting its mess. + // Note: 1/4 sec is the very maximum for ZTP to work in DC... 1/6 for safety. + FAKE_GP_WATCHDOG_PERIOD = GetTicksPerSecond() / 6; ///////////////////////////////////