VideoCommon/Fifo: Refactor to class, move to Core::System.

This commit is contained in:
Admiral H. Curtiss
2022-12-09 20:01:25 +01:00
parent d250e69ddf
commit 5624dd6d39
18 changed files with 377 additions and 300 deletions

View File

@ -277,7 +277,9 @@ void Stop() // - Hammertime!
// Dump left over jobs
HostDispatchJobs();
Fifo::EmulatorState(false);
auto& system = Core::System::GetInstance();
system.GetFifo().EmulatorState(false);
INFO_LOG_FMT(CONSOLE, "Stop [Main Thread]\t\t---- Shutting down ----");
@ -285,7 +287,7 @@ void Stop() // - Hammertime!
INFO_LOG_FMT(CONSOLE, "{}", StopMessage(true, "Stop CPU"));
CPU::Stop();
if (Core::System::GetInstance().IsDualCoreMode())
if (system.IsDualCoreMode())
{
// Video_EnterLoop() should now exit so that EmuThread()
// will continue concurrently with the rest of the commands
@ -597,7 +599,7 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
wiifs_guard.Dismiss();
// This adds the SyncGPU handler to CoreTiming, so now CoreTiming::Advance might block.
Fifo::Prepare();
system.GetFifo().Prepare();
// Setup our core
if (Config::Get(Config::MAIN_CPU_CORE) != PowerPC::CPUCore::Interpreter)
@ -622,7 +624,7 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
s_cpu_thread = std::thread(cpuThreadFunc, savestate_path, delete_savestate);
// become the GPU thread
Fifo::RunGpuLoop();
system.GetFifo().RunGpuLoop();
// We have now exited the Video Loop
INFO_LOG_FMT(CONSOLE, "{}", StopMessage(false, "Video Loop Ended"));
@ -766,7 +768,8 @@ static bool PauseAndLock(bool do_lock, bool unpause_on_unlock)
// video has to come after CPU, because CPU thread can wait for video thread
// (s_efbAccessRequested).
Fifo::PauseAndLock(do_lock, false);
auto& system = Core::System::GetInstance();
system.GetFifo().PauseAndLock(do_lock, false);
ResetRumble();
@ -1029,7 +1032,10 @@ void UpdateWantDeterminism(bool initial)
const auto ios = IOS::HLE::GetIOS();
if (ios)
ios->UpdateWantDeterminism(new_want_determinism);
Fifo::UpdateWantDeterminism(new_want_determinism);
auto& system = Core::System::GetInstance();
system.GetFifo().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();