diff options
| author | Lioncash <mathew1800@gmail.com> | 2015-05-27 03:08:48 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2015-05-27 03:53:29 -0400 |
| commit | 1ba3b4e7ac9d53710454c46ac5384ee44a096b70 (patch) | |
| tree | 272b191ed1fbddfd113af6e6b19b9c5173a4c954 /Source/Core/VideoCommon/Fifo.cpp | |
| parent | 1c2d4e5d42f173c60499f1c173b7ba4a70033128 (diff) | |
CommandProcessor: Replace volatile usages with atomics
Also remove said variables from being globals.
Diffstat (limited to 'Source/Core/VideoCommon/Fifo.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Fifo.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/Fifo.cpp b/Source/Core/VideoCommon/Fifo.cpp index 1b556cca58..289a62d8e7 100644 --- a/Source/Core/VideoCommon/Fifo.cpp +++ b/Source/Core/VideoCommon/Fifo.cpp @@ -103,7 +103,7 @@ void Fifo_Init() s_video_buffer = (u8*)AllocateMemoryPages(FIFO_SIZE + 4); ResetVideoBuffer(); s_gpu_running_state.store(false); - Common::AtomicStore(CommandProcessor::VITicks, CommandProcessor::m_cpClockOrigin); + CommandProcessor::SetVITicks(CommandProcessor::m_cpClockOrigin); } void Fifo_Shutdown() @@ -321,17 +321,17 @@ void RunGpuLoop() if (!fifo.isGpuReadingData) { - Common::AtomicStore(CommandProcessor::VITicks, CommandProcessor::m_cpClockOrigin); + CommandProcessor::SetVITicks(CommandProcessor::m_cpClockOrigin); } bool run_loop = true; // check if we are able to run this buffer - while (run_loop && !CommandProcessor::interruptWaiting && fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance && !AtBreakpoint()) + while (run_loop && !CommandProcessor::IsInterruptWaiting() && fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance && !AtBreakpoint()) { fifo.isGpuReadingData = true; - if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bSyncGPU || Common::AtomicLoad(CommandProcessor::VITicks) > CommandProcessor::m_cpClockOrigin) + if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bSyncGPU || CommandProcessor::GetVITicks() > CommandProcessor::m_cpClockOrigin) { u32 readPtr = fifo.CPReadPointer; ReadDataFromFifo(readPtr); @@ -349,8 +349,8 @@ void RunGpuLoop() s_video_buffer_read_ptr = OpcodeDecoder_Run(DataReader(s_video_buffer_read_ptr, write_ptr), &cyclesExecuted, false); - if (SConfig::GetInstance().m_LocalCoreStartupParameter.bSyncGPU && Common::AtomicLoad(CommandProcessor::VITicks) >= cyclesExecuted) - Common::AtomicAdd(CommandProcessor::VITicks, -(s32)cyclesExecuted); + if (SConfig::GetInstance().m_LocalCoreStartupParameter.bSyncGPU && CommandProcessor::GetVITicks() >= cyclesExecuted) + CommandProcessor::DecrementVITicks(cyclesExecuted); Common::AtomicStore(fifo.CPReadPointer, readPtr); Common::AtomicAdd(fifo.CPReadWriteDistance, -32); |
