From d31bed8b79a1266d7ac9c7c6f0e45c20d36aaf4c Mon Sep 17 00:00:00 2001 From: degasus Date: Wed, 3 Jun 2015 23:21:46 +0200 Subject: Fifo: Rewrite SyncGpu The new implementation has 3 options: SyncGpuMaxDistance SyncGpuMinDistance SyncGpuOverclock The MaxDistance controlls how many CPU cycles the CPU is allowed to be in front of the GPU. Too low values will slow down extremly, too high values are as unsynchronized and half of the games will crash. The -MinDistance (negative) set how many cycles the GPU is allowed to be in front of the CPU. As we are used to emulate an infinitiv fast GPU, this may be set to any high (negative) number. The last parameter is to hack a faster (>1.0) or slower(<1.0) GPU. As we don't emulate GPU timing very well (eg skip the timings of the pixel stage completely), an overclock factor of ~0.5 is often much more accurate than 1.0 --- Source/Core/VideoCommon/CommandProcessor.cpp | 29 ---------------------------- 1 file changed, 29 deletions(-) (limited to 'Source/Core/VideoCommon/CommandProcessor.cpp') diff --git a/Source/Core/VideoCommon/CommandProcessor.cpp b/Source/Core/VideoCommon/CommandProcessor.cpp index 88b16afe7e..e16484de4d 100644 --- a/Source/Core/VideoCommon/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/CommandProcessor.cpp @@ -16,7 +16,6 @@ #include "Core/HW/Memmap.h" #include "Core/HW/MMIO.h" #include "Core/HW/ProcessorInterface.h" -#include "Core/HW/SystemTimers.h" #include "VideoCommon/CommandProcessor.h" #include "VideoCommon/Fifo.h" #include "VideoCommon/PixelEngine.h" @@ -47,8 +46,6 @@ static std::atomic s_interrupt_waiting; static std::atomic s_interrupt_token_waiting; static std::atomic s_interrupt_finish_waiting; -static std::atomic s_vi_ticks(CommandProcessor::m_cpClockOrigin); - static bool IsOnThread() { return SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread; @@ -546,30 +543,4 @@ void SetCpClearRegister() { } -void Update() -{ - while (s_vi_ticks.load() > m_cpClockOrigin && fifo.isGpuReadingData && IsOnThread()) - Common::YieldCPU(); - - if (fifo.isGpuReadingData) - s_vi_ticks.fetch_add(SystemTimers::GetTicksPerSecond() / 10000); - - RunGpu(); -} - -u32 GetVITicks() -{ - return s_vi_ticks.load(); -} - -void SetVITicks(u32 ticks) -{ - s_vi_ticks.store(ticks); -} - -void DecrementVITicks(u32 ticks) -{ - s_vi_ticks.fetch_sub(ticks); -} - } // end of namespace CommandProcessor -- cgit v1.2.3