diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index 0226d67f69..3eb5743d73 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -264,7 +264,7 @@ void Stop() // - Hammertime! s_is_stopping = true; - EmulatorState(false); + Fifo::EmulatorState(false); INFO_LOG(CONSOLE, "Stop [Main Thread]\t\t---- Shutting down ----"); @@ -536,7 +536,7 @@ void EmuThread() s_cpu_thread = std::thread(cpuThreadFunc); // become the GPU thread - RunGpuLoop(); + Fifo::RunGpuLoop(); // We have now exited the Video Loop INFO_LOG(CONSOLE, "%s", StopMessage(false, "Video Loop Ended").c_str()); @@ -738,7 +738,7 @@ bool PauseAndLock(bool doLock, bool unpauseOnUnlock) DSP::GetDSPEmulator()->PauseAndLock(doLock, unpauseOnUnlock); // video has to come after CPU, because CPU thread can wait for video thread (s_efbAccessRequested). - Fifo_PauseAndLock(doLock, unpauseOnUnlock); + Fifo::PauseAndLock(doLock, unpauseOnUnlock); #if defined(__LIBUSB__) || defined(_WIN32) GCAdapter::ResetRumble(); @@ -890,7 +890,7 @@ void UpdateWantDeterminism(bool initial) g_want_determinism = new_want_determinism; WiiSockMan::GetInstance().UpdateWantDeterminism(new_want_determinism); - Fifo_UpdateWantDeterminism(new_want_determinism); + Fifo::UpdateWantDeterminism(new_want_determinism); // We need to clear the cache because some parts of the JIT depend on want_determinism, e.g. use of FMA. JitInterface::ClearCache(); Common::InitializeWiiRoot(g_want_determinism); diff --git a/Source/Core/Core/CoreTiming.cpp b/Source/Core/Core/CoreTiming.cpp index 99ad530de5..6a1c76b186 100644 --- a/Source/Core/Core/CoreTiming.cpp +++ b/Source/Core/Core/CoreTiming.cpp @@ -446,7 +446,7 @@ void Idle() //the VI will be desynchronized. So, We are waiting until the FIFO finish and //while we process only the events required by the FIFO. ProcessFifoWaitEvents(); - Fifo_Update(0); + Fifo::Update(0); } idledCycles += DowncountToCycles(PowerPC::ppcState.downcount); diff --git a/Source/Core/Core/HW/CPU.cpp b/Source/Core/Core/HW/CPU.cpp index de09581db3..2ed01bfde4 100644 --- a/Source/Core/Core/HW/CPU.cpp +++ b/Source/Core/Core/HW/CPU.cpp @@ -115,7 +115,7 @@ void EnableStepping(const bool stepping) { PowerPC::Pause(); m_StepEvent.Reset(); - EmulatorState(false); + Fifo::EmulatorState(false); AudioCommon::ClearAudioBuffer(true); } else @@ -138,7 +138,7 @@ void EnableStepping(const bool stepping) } PowerPC::Start(); m_StepEvent.Set(); - EmulatorState(true); + Fifo::EmulatorState(true); AudioCommon::ClearAudioBuffer(false); } } diff --git a/Source/Core/Core/HW/SystemTimers.cpp b/Source/Core/Core/HW/SystemTimers.cpp index 0add01bb74..129c15c8c5 100644 --- a/Source/Core/Core/HW/SystemTimers.cpp +++ b/Source/Core/Core/HW/SystemTimers.cpp @@ -128,7 +128,7 @@ static void VICallback(u64 userdata, int cyclesLate) static void CPCallback(u64 userdata, int cyclesLate) { u64 now = CoreTiming::GetTicks(); - int next = Fifo_Update((int)(now - s_last_sync_gpu_tick)); + int next = Fifo::Update((int)(now - s_last_sync_gpu_tick)); s_last_sync_gpu_tick = now; if (next > 0) @@ -181,7 +181,7 @@ static void PatchEngineCallback(u64 userdata, int cyclesLate) static void ThrottleCallback(u64 last_time, int cyclesLate) { // Allow the GPU thread to sleep. Setting this flag here limits the wakeups to 1 kHz. - GpuMaySleep(); + Fifo::GpuMaySleep(); u32 time = Common::Timer::GetTimeMs(); diff --git a/Source/Core/Core/Movie.cpp b/Source/Core/Core/Movie.cpp index 36f71d0068..2351a84896 100644 --- a/Source/Core/Core/Movie.cpp +++ b/Source/Core/Core/Movie.cpp @@ -241,7 +241,7 @@ void SetFrameSkipping(unsigned int framesToSkip) // Don't forget to re-enable rendering in case it wasn't... // as this won't be changed anymore when frameskip is turned off if (framesToSkip == 0) - Fifo_SetRendering(true); + Fifo::SetRendering(true); } void SetPolledDevice() @@ -289,7 +289,7 @@ void FrameSkipping() if (s_frameSkipCounter > s_framesToSkip || Core::ShouldSkipFrame(s_frameSkipCounter) == false) s_frameSkipCounter = 0; - Fifo_SetRendering(!s_frameSkipCounter); + Fifo::SetRendering(!s_frameSkipCounter); } } diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index dfe1408ada..9ecd0a7667 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -718,7 +718,7 @@ void formatBufferDump(const u8* in, u8* out, int w, int h, int p) // This function has the final picture. We adjust the aspect ratio here. void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, const EFBRectangle& rc, float Gamma) { - if (g_bSkipCurrentFrame || (!XFBWrited && !g_ActiveConfig.RealXFBEnabled()) || !fbWidth || !fbHeight) + if (Fifo::g_bSkipCurrentFrame || (!XFBWrited && !g_ActiveConfig.RealXFBEnabled()) || !fbWidth || !fbHeight) { if (SConfig::GetInstance().m_DumpFrames && !frame_data.empty()) AVIDump::AddFrame(&frame_data[0], fbWidth, fbHeight); diff --git a/Source/Core/VideoBackends/D3D/main.cpp b/Source/Core/VideoBackends/D3D/main.cpp index d74cbbbfdf..9bd7b685f1 100644 --- a/Source/Core/VideoBackends/D3D/main.cpp +++ b/Source/Core/VideoBackends/D3D/main.cpp @@ -183,7 +183,7 @@ void VideoBackend::Video_Prepare() // VideoCommon BPInit(); - Fifo_Init(); + Fifo::Init(); IndexGenerator::Init(); VertexLoaderManager::Init(); OpcodeDecoder_Init(); @@ -206,7 +206,7 @@ void VideoBackend::Shutdown() if (g_renderer) { // VideoCommon - Fifo_Shutdown(); + Fifo::Shutdown(); CommandProcessor::Shutdown(); GeometryShaderManager::Shutdown(); PixelShaderManager::Shutdown(); diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index ce332c0b98..5e043ee5da 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -1235,7 +1235,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co } static int w = 0, h = 0; - if (g_bSkipCurrentFrame || (!XFBWrited && !g_ActiveConfig.RealXFBEnabled()) || !fbWidth || !fbHeight) + if (Fifo::g_bSkipCurrentFrame || (!XFBWrited && !g_ActiveConfig.RealXFBEnabled()) || !fbWidth || !fbHeight) { DumpFrame(frame_data, w, h); Core::Callback_VideoCopiedToXFB(false); diff --git a/Source/Core/VideoBackends/OGL/main.cpp b/Source/Core/VideoBackends/OGL/main.cpp index 1134b26302..07648b6acd 100644 --- a/Source/Core/VideoBackends/OGL/main.cpp +++ b/Source/Core/VideoBackends/OGL/main.cpp @@ -181,7 +181,7 @@ void VideoBackend::Video_Prepare() BPInit(); g_vertex_manager = std::make_unique(); g_perf_query = GetPerfQuery(); - Fifo_Init(); // must be done before OpcodeDecoder_Init() + Fifo::Init(); // must be done before OpcodeDecoder_Init() OpcodeDecoder_Init(); IndexGenerator::Init(); VertexShaderManager::Init(); @@ -215,7 +215,7 @@ void VideoBackend::Video_Cleanup() if (!g_renderer) return; - Fifo_Shutdown(); + Fifo::Shutdown(); // The following calls are NOT Thread Safe // And need to be called from the video thread diff --git a/Source/Core/VideoBackends/Software/DebugUtil.cpp b/Source/Core/VideoBackends/Software/DebugUtil.cpp index 493fe51352..e7f3089027 100644 --- a/Source/Core/VideoBackends/Software/DebugUtil.cpp +++ b/Source/Core/VideoBackends/Software/DebugUtil.cpp @@ -191,7 +191,7 @@ void CopyTempBuffer(s16 x, s16 y, int bufferBase, int subBuffer, const char *nam void OnObjectBegin() { - if (!g_bSkipCurrentFrame) + if (!Fifo::g_bSkipCurrentFrame) { if (g_ActiveConfig.bDumpTextures && stats.thisFrame.numDrawnObjects >= g_ActiveConfig.drawStart && stats.thisFrame.numDrawnObjects < g_ActiveConfig.drawEnd) DumpActiveTextures(); @@ -200,7 +200,7 @@ void OnObjectBegin() void OnObjectEnd() { - if (!g_bSkipCurrentFrame) + if (!Fifo::g_bSkipCurrentFrame) { if (g_ActiveConfig.bDumpObjects && stats.thisFrame.numDrawnObjects >= g_ActiveConfig.drawStart && stats.thisFrame.numDrawnObjects < g_ActiveConfig.drawEnd) DumpEfb(StringFromFormat("%sobject%i.png", diff --git a/Source/Core/VideoBackends/Software/EfbCopy.cpp b/Source/Core/VideoBackends/Software/EfbCopy.cpp index 9637ef7af0..1111960c6f 100644 --- a/Source/Core/VideoBackends/Software/EfbCopy.cpp +++ b/Source/Core/VideoBackends/Software/EfbCopy.cpp @@ -73,7 +73,7 @@ namespace EfbCopy rc.right = rc.left + (int)bpmem.copyTexSrcWH.x + 1; rc.bottom = rc.top + (int)bpmem.copyTexSrcWH.y + 1; - if (!g_bSkipCurrentFrame) + if (!Fifo::g_bSkipCurrentFrame) { if (bpmem.triggerEFBCopy.copy_to_xfb) { diff --git a/Source/Core/VideoBackends/Software/SWRenderer.cpp b/Source/Core/VideoBackends/Software/SWRenderer.cpp index ba3f2a9fcc..0aa5bdb50a 100644 --- a/Source/Core/VideoBackends/Software/SWRenderer.cpp +++ b/Source/Core/VideoBackends/Software/SWRenderer.cpp @@ -108,7 +108,7 @@ void SWRenderer::UpdateColorTexture(EfbInterface::yuv422_packed *xfb, u32 fbWidt // Called on the GPU thread void SWRenderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, const EFBRectangle& rc, float Gamma) { - if (!g_bSkipCurrentFrame) + if (!Fifo::g_bSkipCurrentFrame) { if (g_ActiveConfig.bUseXFB) diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp index a2ed4ff3a0..8600297e9c 100644 --- a/Source/Core/VideoBackends/Software/SWmain.cpp +++ b/Source/Core/VideoBackends/Software/SWmain.cpp @@ -198,8 +198,7 @@ void VideoSoftware::Video_Cleanup() { if (g_renderer) { - Fifo_Shutdown(); - + Fifo::Shutdown(); SWRenderer::Shutdown(); DebugUtil::Shutdown(); // The following calls are NOT Thread Safe @@ -228,7 +227,7 @@ void VideoSoftware::Video_Prepare() BPInit(); g_vertex_manager = std::make_unique(); g_perf_query = std::make_unique(); - Fifo_Init(); // must be done before OpcodeDecoder_Init() + Fifo::Init(); // must be done before OpcodeDecoder_Init() OpcodeDecoder_Init(); IndexGenerator::Init(); VertexShaderManager::Init(); diff --git a/Source/Core/VideoCommon/AsyncRequests.cpp b/Source/Core/VideoCommon/AsyncRequests.cpp index 1ce7c8fdb7..bddf8e7445 100644 --- a/Source/Core/VideoCommon/AsyncRequests.cpp +++ b/Source/Core/VideoCommon/AsyncRequests.cpp @@ -81,7 +81,7 @@ void AsyncRequests::PushEvent(const AsyncRequests::Event& event, bool blocking) m_queue.push(event); - RunGpu(); + Fifo::RunGpu(); if (blocking) { m_cond.wait(lock, [this]{return m_queue.empty();}); diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp index 6dc505c28e..35f017f5c5 100644 --- a/Source/Core/VideoCommon/BPStructs.cpp +++ b/Source/Core/VideoCommon/BPStructs.cpp @@ -177,7 +177,7 @@ static void BPWritten(const BPCmd& bp) switch (bp.newvalue & 0xFF) { case 0x02: - if (!g_use_deterministic_gpu_thread) + if (!Fifo::g_use_deterministic_gpu_thread) PixelEngine::SetFinish(); // may generate interrupt DEBUG_LOG(VIDEO, "GXSetDrawDone SetPEFinish (value: 0x%02X)", (bp.newvalue & 0xFFFF)); return; @@ -188,12 +188,12 @@ static void BPWritten(const BPCmd& bp) } return; case BPMEM_PE_TOKEN_ID: // Pixel Engine Token ID - if (!g_use_deterministic_gpu_thread) + if (!Fifo::g_use_deterministic_gpu_thread) PixelEngine::SetToken(static_cast(bp.newvalue & 0xFFFF), false); DEBUG_LOG(VIDEO, "SetPEToken 0x%04x", (bp.newvalue & 0xFFFF)); return; case BPMEM_PE_TOKEN_INT_ID: // Pixel Engine Interrupt Token ID - if (!g_use_deterministic_gpu_thread) + if (!Fifo::g_use_deterministic_gpu_thread) PixelEngine::SetToken(static_cast(bp.newvalue & 0xFFFF), true); DEBUG_LOG(VIDEO, "SetPEToken + INT 0x%04x", (bp.newvalue & 0xFFFF)); return; @@ -378,7 +378,7 @@ static void BPWritten(const BPCmd& bp) case BPMEM_CLEARBBOX2: // Don't compute bounding box if this frame is being skipped! // Wrong but valid values are better than bogus values... - if (!g_bSkipCurrentFrame) + if (!Fifo::g_bSkipCurrentFrame) { u8 offset = bp.address & 2; BoundingBox::active = true; diff --git a/Source/Core/VideoCommon/CommandProcessor.cpp b/Source/Core/VideoCommon/CommandProcessor.cpp index 8bca029cae..1d5e1ab172 100644 --- a/Source/Core/VideoCommon/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/CommandProcessor.cpp @@ -223,7 +223,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base) UCPCtrlReg tmp(val); m_CPCtrlReg.Hex = tmp.Hex; SetCpControlRegister(); - RunGpu(); + Fifo::RunGpu(); }) ); @@ -233,7 +233,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base) UCPClearReg tmp(val); m_CPClearReg.Hex = tmp.Hex; SetCpClearRegister(); - RunGpu(); + Fifo::RunGpu(); }) ); @@ -265,17 +265,17 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base) : MMIO::DirectRead(MMIO::Utils::HighPart(&fifo.CPReadWriteDistance)), MMIO::ComplexWrite([](u32, u16 val) { WriteHigh(fifo.CPReadWriteDistance, val); - SyncGPU(SYNC_GPU_OTHER); + Fifo::SyncGPU(Fifo::SYNC_GPU_OTHER); if (fifo.CPReadWriteDistance == 0) { GPFifo::ResetGatherPipe(); - ResetVideoBuffer(); + Fifo::ResetVideoBuffer(); } else { - ResetVideoBuffer(); + Fifo::ResetVideoBuffer(); } - RunGpu(); + Fifo::RunGpu(); }) ); mmio->Register(base | FIFO_READ_POINTER_LO, @@ -306,7 +306,7 @@ void GatherPipeBursted() // if we aren't linked, we don't care about gather pipe data if (!m_CPCtrlReg.GPLinkEnable) { - if (IsOnThread() && !g_use_deterministic_gpu_thread) + if (IsOnThread() && !Fifo::g_use_deterministic_gpu_thread) { // In multibuffer mode is not allowed write in the same FIFO attached to the GPU. // Fix Pokemon XD in DC mode. @@ -314,10 +314,10 @@ void GatherPipeBursted() (ProcessorInterface::Fifo_CPUBase == fifo.CPBase) && fifo.CPReadWriteDistance > 0) { - FlushGpu(); + Fifo::FlushGpu(); } } - RunGpu(); + Fifo::RunGpu(); return; } @@ -340,7 +340,7 @@ void GatherPipeBursted() Common::AtomicAdd(fifo.CPReadWriteDistance, GATHER_PIPE_SIZE); - RunGpu(); + Fifo::RunGpu(); _assert_msg_(COMMANDPROCESSOR, fifo.CPReadWriteDistance <= fifo.CPEnd - fifo.CPBase, "FIFO is overflowed by GatherPipe !\nCPU thread is too fast!"); @@ -367,12 +367,12 @@ void UpdateInterrupts(u64 userdata) } CoreTiming::ForceExceptionCheck(0); s_interrupt_waiting.store(false); - RunGpu(); + Fifo::RunGpu(); } void UpdateInterruptsFromVideoBackend(u64 userdata) { - if (!g_use_deterministic_gpu_thread) + if (!Fifo::g_use_deterministic_gpu_thread) CoreTiming::ScheduleEvent_Threadsafe(0, et_UpdateInterrupts, userdata); } @@ -494,7 +494,7 @@ void SetCpStatusRegister() // Here always there is one fifo attached to the GPU m_CPStatusReg.Breakpoint = fifo.bFF_Breakpoint; m_CPStatusReg.ReadIdle = !fifo.CPReadWriteDistance || (fifo.CPReadPointer == fifo.CPWritePointer); - m_CPStatusReg.CommandIdle = !fifo.CPReadWriteDistance || AtBreakpoint() || !fifo.bFF_GPReadEnable; + m_CPStatusReg.CommandIdle = !fifo.CPReadWriteDistance || Fifo::AtBreakpoint() || !fifo.bFF_GPReadEnable; m_CPStatusReg.UnderflowLoWatermark = fifo.bFF_LoWatermark; m_CPStatusReg.OverflowHiWatermark = fifo.bFF_HiWatermark; @@ -519,7 +519,7 @@ void SetCpControlRegister() if (fifo.bFF_GPReadEnable && !m_CPCtrlReg.GPReadEnable) { fifo.bFF_GPReadEnable = m_CPCtrlReg.GPReadEnable; - FlushGpu(); + Fifo::FlushGpu(); } else { diff --git a/Source/Core/VideoCommon/Fifo.cpp b/Source/Core/VideoCommon/Fifo.cpp index 6ad184cc3e..97c8902bd8 100644 --- a/Source/Core/VideoCommon/Fifo.cpp +++ b/Source/Core/VideoCommon/Fifo.cpp @@ -30,6 +30,9 @@ #include "VideoCommon/VertexManagerBase.h" #include "VideoCommon/VideoConfig.h" +namespace Fifo +{ + static constexpr u32 FIFO_SIZE = 2 * 1024 * 1024; bool g_bSkipCurrentFrame = false; @@ -66,7 +69,7 @@ static u8* s_video_buffer_pp_read_ptr; static std::atomic s_sync_ticks; static Common::Event s_sync_wakeup_event; -void Fifo_DoState(PointerWrap &p) +void DoState(PointerWrap &p) { p.DoArray(s_video_buffer, FIFO_SIZE); u8* write_ptr = s_video_buffer_write_ptr; @@ -81,7 +84,7 @@ void Fifo_DoState(PointerWrap &p) p.Do(g_bSkipCurrentFrame); } -void Fifo_PauseAndLock(bool doLock, bool unpauseOnUnlock) +void PauseAndLock(bool doLock, bool unpauseOnUnlock) { if (doLock) { @@ -97,7 +100,7 @@ void Fifo_PauseAndLock(bool doLock, bool unpauseOnUnlock) } -void Fifo_Init() +void Init() { // Padded so that SIMD overreads in the vertex loader are safe s_video_buffer = (u8*)AllocateMemoryPages(FIFO_SIZE + 4); @@ -107,7 +110,7 @@ void Fifo_Init() s_sync_ticks.store(0); } -void Fifo_Shutdown() +void Shutdown() { if (s_gpu_mainloop.IsRunning()) PanicAlert("Fifo shutting down while active"); @@ -122,7 +125,7 @@ void Fifo_Shutdown() s_fifo_aux_read_ptr = nullptr; } -void Fifo_SetRendering(bool enabled) +void SetRendering(bool enabled) { g_bSkipCurrentFrame = !enabled; } @@ -450,7 +453,7 @@ void RunGpu() } } -void Fifo_UpdateWantDeterminism(bool want) +void UpdateWantDeterminism(bool want) { // We are paused (or not running at all yet), so // it should be safe to change this. @@ -492,7 +495,7 @@ void Fifo_UpdateWantDeterminism(bool want) } } -int Fifo_Update(int ticks) +int Update(int ticks) { const SConfig& param = SConfig::GetInstance(); @@ -528,3 +531,5 @@ int Fifo_Update(int ticks) return param.iSyncGpuMaxDistance - s_sync_ticks.load(); } + +} diff --git a/Source/Core/VideoCommon/Fifo.h b/Source/Core/VideoCommon/Fifo.h index a66cec7fc2..c137869414 100644 --- a/Source/Core/VideoCommon/Fifo.h +++ b/Source/Core/VideoCommon/Fifo.h @@ -9,6 +9,9 @@ class PointerWrap; +namespace Fifo +{ + extern bool g_bSkipCurrentFrame; // This could be in SConfig, but it depends on multiple settings @@ -16,11 +19,11 @@ extern bool g_bSkipCurrentFrame; extern bool g_use_deterministic_gpu_thread; extern std::atomic g_video_buffer_write_ptr_xthread; -void Fifo_Init(); -void Fifo_Shutdown(); -void Fifo_DoState(PointerWrap &f); -void Fifo_PauseAndLock(bool doLock, bool unpauseOnUnlock); -void Fifo_UpdateWantDeterminism(bool want); +void Init(); +void Shutdown(); +void DoState(PointerWrap &f); +void PauseAndLock(bool doLock, bool unpauseOnUnlock); +void UpdateWantDeterminism(bool want); // Used for diagnostics. enum SyncGPUReason @@ -47,5 +50,7 @@ void ExitGpuLoop(); void EmulatorState(bool running); bool AtBreakpoint(); void ResetVideoBuffer(); -void Fifo_SetRendering(bool bEnabled); -int Fifo_Update(int ticks); +void SetRendering(bool bEnabled); +int Update(int ticks); + +}; diff --git a/Source/Core/VideoCommon/MainBase.cpp b/Source/Core/VideoCommon/MainBase.cpp index 2e14fb27d5..173c8f7077 100644 --- a/Source/Core/VideoCommon/MainBase.cpp +++ b/Source/Core/VideoCommon/MainBase.cpp @@ -31,7 +31,7 @@ static volatile struct void VideoBackendBase::Video_ExitLoop() { - ExitGpuLoop(); + Fifo::ExitGpuLoop(); s_FifoShuttingDown.Set(); } @@ -52,7 +52,7 @@ void VideoBackendBase::Video_EndField() { if (m_initialized && g_ActiveConfig.bUseXFB && g_renderer) { - SyncGPU(SYNC_GPU_SWAP); + Fifo::SyncGPU(Fifo::SYNC_GPU_SWAP); AsyncRequests::Event e; e.time = 0; @@ -105,7 +105,7 @@ u32 VideoBackendBase::Video_GetQueryResult(PerfQueryType type) return 0; } - SyncGPU(SYNC_GPU_PERFQUERY); + Fifo::SyncGPU(Fifo::SYNC_GPU_PERFQUERY); AsyncRequests::Event e; e.time = 0; @@ -131,7 +131,7 @@ u16 VideoBackendBase::Video_GetBoundingBox(int index) return 0; } - SyncGPU(SYNC_GPU_BBOX); + Fifo::SyncGPU(Fifo::SYNC_GPU_BBOX); AsyncRequests::Event e; u16 result; diff --git a/Source/Core/VideoCommon/OpcodeDecoding.cpp b/Source/Core/VideoCommon/OpcodeDecoding.cpp index 000711b19e..5e7b57a54a 100644 --- a/Source/Core/VideoCommon/OpcodeDecoding.cpp +++ b/Source/Core/VideoCommon/OpcodeDecoding.cpp @@ -39,8 +39,8 @@ static u32 InterpretDisplayList(u32 address, u32 size) { u8* startAddress; - if (g_use_deterministic_gpu_thread) - startAddress = (u8*)PopFifoAuxBuffer(size); + if (Fifo::g_use_deterministic_gpu_thread) + startAddress = (u8*)Fifo::PopFifoAuxBuffer(size); else startAddress = Memory::GetPointer(address); @@ -66,7 +66,7 @@ static void InterpretDisplayListPreprocess(u32 address, u32 size) { u8* startAddress = Memory::GetPointer(address); - PushFifoAuxBuffer(startAddress, size); + Fifo::PushFifoAuxBuffer(startAddress, size); if (startAddress != nullptr) { @@ -278,7 +278,7 @@ u8* OpcodeDecoder_Run(DataReader src, u32* cycles, bool in_display_list) (cmd_byte & GX_PRIMITIVE_MASK) >> GX_PRIMITIVE_SHIFT, num_vertices, src, - g_bSkipCurrentFrame, + Fifo::g_bSkipCurrentFrame, is_preprocess); if (bytes < 0) diff --git a/Source/Core/VideoCommon/PixelEngine.cpp b/Source/Core/VideoCommon/PixelEngine.cpp index 162815ac40..af261eb90f 100644 --- a/Source/Core/VideoCommon/PixelEngine.cpp +++ b/Source/Core/VideoCommon/PixelEngine.cpp @@ -298,7 +298,7 @@ void SetToken(const u16 _token, const int _bSetTokenAcknowledge) CommandProcessor::SetInterruptTokenWaiting(true); - if (!SConfig::GetInstance().bCPUThread || g_use_deterministic_gpu_thread) + if (!SConfig::GetInstance().bCPUThread || Fifo::g_use_deterministic_gpu_thread) CoreTiming::ScheduleEvent(0, et_SetTokenOnMainThread, _token | (_bSetTokenAcknowledge << 16)); else CoreTiming::ScheduleEvent_Threadsafe(0, et_SetTokenOnMainThread, _token | (_bSetTokenAcknowledge << 16)); @@ -310,7 +310,7 @@ void SetFinish() { CommandProcessor::SetInterruptFinishWaiting(true); - if (!SConfig::GetInstance().bCPUThread || g_use_deterministic_gpu_thread) + if (!SConfig::GetInstance().bCPUThread || Fifo::g_use_deterministic_gpu_thread) CoreTiming::ScheduleEvent(0, et_SetFinishOnMainThread, 0); else CoreTiming::ScheduleEvent_Threadsafe(0, et_SetFinishOnMainThread, 0); diff --git a/Source/Core/VideoCommon/VideoState.cpp b/Source/Core/VideoCommon/VideoState.cpp index 9f2b11f31c..53fa4f0c89 100644 --- a/Source/Core/VideoCommon/VideoState.cpp +++ b/Source/Core/VideoCommon/VideoState.cpp @@ -35,7 +35,7 @@ static void DoState(PointerWrap &p) p.DoMarker("texMem"); // FIFO - Fifo_DoState(p); + Fifo::DoState(p); p.DoMarker("Fifo"); CommandProcessor::DoState(p); @@ -71,7 +71,7 @@ void VideoCommon_DoState(PointerWrap &p) void VideoCommon_RunLoop(bool enable) { - EmulatorState(enable); + Fifo::EmulatorState(enable); } void VideoCommon_Init() diff --git a/Source/Core/VideoCommon/XFStructs.cpp b/Source/Core/VideoCommon/XFStructs.cpp index ecf1eda08e..4fb7333964 100644 --- a/Source/Core/VideoCommon/XFStructs.cpp +++ b/Source/Core/VideoCommon/XFStructs.cpp @@ -258,9 +258,9 @@ void LoadIndexedXF(u32 val, int refarray) u32* currData = (u32*)(&xfmem) + address; u32* newData; - if (g_use_deterministic_gpu_thread) + if (Fifo::g_use_deterministic_gpu_thread) { - newData = (u32*)PopFifoAuxBuffer(size * sizeof(u32)); + newData = (u32*)Fifo::PopFifoAuxBuffer(size * sizeof(u32)); } else { @@ -291,5 +291,5 @@ void PreprocessIndexedXF(u32 val, int refarray) u32* new_data = (u32*)Memory::GetPointer(g_preprocess_cp_state.array_bases[refarray] + g_preprocess_cp_state.array_strides[refarray] * index); size_t buf_size = size * sizeof(u32); - PushFifoAuxBuffer(new_data, buf_size); + Fifo::PushFifoAuxBuffer(new_data, buf_size); }