mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 23:29:44 -06:00
CoreTiming: Refactor to class.
This commit is contained in:
@ -21,6 +21,7 @@
|
||||
#include "Core/FifoPlayer/FifoRecorder.h"
|
||||
#include "Core/HW/Memmap.h"
|
||||
#include "Core/HW/VideoInterface.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
#include "VideoCommon/BPFunctions.h"
|
||||
#include "VideoCommon/BPMemory.h"
|
||||
@ -324,7 +325,8 @@ static void BPWritten(const BPCmd& bp, int cycles_into_future)
|
||||
if (g_ActiveConfig.bImmediateXFB)
|
||||
{
|
||||
// below div two to convert from bytes to pixels - it expects width, not stride
|
||||
g_renderer->Swap(destAddr, destStride / 2, destStride, height, CoreTiming::GetTicks());
|
||||
g_renderer->Swap(destAddr, destStride / 2, destStride, height,
|
||||
Core::System::GetInstance().GetCoreTiming().GetTicks());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -149,7 +149,8 @@ void Init()
|
||||
s_interrupt_set.Clear();
|
||||
s_interrupt_waiting.Clear();
|
||||
|
||||
et_UpdateInterrupts = CoreTiming::RegisterEvent("CPInterrupt", UpdateInterrupts_Wrapper);
|
||||
et_UpdateInterrupts = Core::System::GetInstance().GetCoreTiming().RegisterEvent(
|
||||
"CPInterrupt", UpdateInterrupts_Wrapper);
|
||||
}
|
||||
|
||||
u32 GetPhysicalAddressMask()
|
||||
@ -406,7 +407,7 @@ void GatherPipeBursted()
|
||||
|
||||
// If the game is running close to overflowing, make the exception checking more frequent.
|
||||
if (fifo.bFF_HiWatermark.load(std::memory_order_relaxed) != 0)
|
||||
CoreTiming::ForceExceptionCheck(0);
|
||||
Core::System::GetInstance().GetCoreTiming().ForceExceptionCheck(0);
|
||||
|
||||
fifo.CPReadWriteDistance.fetch_add(GPFifo::GATHER_PIPE_SIZE, std::memory_order_seq_cst);
|
||||
|
||||
@ -445,7 +446,7 @@ void UpdateInterrupts(u64 userdata)
|
||||
DEBUG_LOG_FMT(COMMANDPROCESSOR, "Interrupt cleared");
|
||||
ProcessorInterface::SetInterrupt(INT_CAUSE_CP, false);
|
||||
}
|
||||
CoreTiming::ForceExceptionCheck(0);
|
||||
Core::System::GetInstance().GetCoreTiming().ForceExceptionCheck(0);
|
||||
s_interrupt_waiting.Clear();
|
||||
Fifo::RunGpu();
|
||||
}
|
||||
@ -453,7 +454,10 @@ void UpdateInterrupts(u64 userdata)
|
||||
void UpdateInterruptsFromVideoBackend(u64 userdata)
|
||||
{
|
||||
if (!Fifo::UseDeterministicGPUThread())
|
||||
CoreTiming::ScheduleEvent(0, et_UpdateInterrupts, userdata, CoreTiming::FromThread::NON_CPU);
|
||||
{
|
||||
Core::System::GetInstance().GetCoreTiming().ScheduleEvent(0, et_UpdateInterrupts, userdata,
|
||||
CoreTiming::FromThread::NON_CPU);
|
||||
}
|
||||
}
|
||||
|
||||
bool IsInterruptWaiting()
|
||||
|
@ -448,7 +448,8 @@ bool AtBreakpoint()
|
||||
|
||||
void RunGpu()
|
||||
{
|
||||
const bool is_dual_core = Core::System::GetInstance().IsDualCoreMode();
|
||||
auto& system = Core::System::GetInstance();
|
||||
const bool is_dual_core = system.IsDualCoreMode();
|
||||
|
||||
// wake up GPU thread
|
||||
if (is_dual_core && !s_use_deterministic_gpu_thread)
|
||||
@ -462,7 +463,8 @@ void RunGpu()
|
||||
if (s_syncing_suspended)
|
||||
{
|
||||
s_syncing_suspended = false;
|
||||
CoreTiming::ScheduleEvent(GPU_TIME_SLOT_SIZE, s_event_sync_gpu, GPU_TIME_SLOT_SIZE);
|
||||
system.GetCoreTiming().ScheduleEvent(GPU_TIME_SLOT_SIZE, s_event_sync_gpu,
|
||||
GPU_TIME_SLOT_SIZE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -611,7 +613,7 @@ static void SyncGPUCallback(Core::System& system, u64 ticks, s64 cyclesLate)
|
||||
|
||||
s_syncing_suspended = next < 0;
|
||||
if (!s_syncing_suspended)
|
||||
CoreTiming::ScheduleEvent(next, s_event_sync_gpu, next);
|
||||
system.GetCoreTiming().ScheduleEvent(next, s_event_sync_gpu, next);
|
||||
}
|
||||
|
||||
void SyncGPUForRegisterAccess()
|
||||
@ -627,7 +629,8 @@ void SyncGPUForRegisterAccess()
|
||||
// Initialize GPU - CPU thread syncing, this gives us a deterministic way to start the GPU thread.
|
||||
void Prepare()
|
||||
{
|
||||
s_event_sync_gpu = CoreTiming::RegisterEvent("SyncGPUCallback", SyncGPUCallback);
|
||||
s_event_sync_gpu =
|
||||
Core::System::GetInstance().GetCoreTiming().RegisterEvent("SyncGPUCallback", SyncGPUCallback);
|
||||
s_syncing_suspended = true;
|
||||
}
|
||||
} // namespace Fifo
|
||||
|
@ -202,8 +202,8 @@ void Init()
|
||||
s_signal_token_interrupt = false;
|
||||
s_signal_finish_interrupt = false;
|
||||
|
||||
et_SetTokenFinishOnMainThread =
|
||||
CoreTiming::RegisterEvent("SetTokenFinish", SetTokenFinish_OnMainThread);
|
||||
et_SetTokenFinishOnMainThread = Core::System::GetInstance().GetCoreTiming().RegisterEvent(
|
||||
"SetTokenFinish", SetTokenFinish_OnMainThread);
|
||||
}
|
||||
|
||||
void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
|
||||
@ -341,7 +341,8 @@ static void RaiseEvent(int cycles_into_future)
|
||||
// games time to setup any interrupt state
|
||||
cycles = std::max(500, cycles_into_future);
|
||||
}
|
||||
CoreTiming::ScheduleEvent(cycles, et_SetTokenFinishOnMainThread, 0, from);
|
||||
Core::System::GetInstance().GetCoreTiming().ScheduleEvent(cycles, et_SetTokenFinishOnMainThread,
|
||||
0, from);
|
||||
}
|
||||
|
||||
// SetToken
|
||||
|
Reference in New Issue
Block a user