CoreTiming: Pass Core::System to Events.

This commit is contained in:
Admiral H. Curtiss 2022-11-06 17:54:58 +01:00
parent 1a5110791c
commit a36a5c1308
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
23 changed files with 102 additions and 82 deletions

View File

@ -19,6 +19,7 @@
#include "Core/Config/MainSettings.h"
#include "Core/Core.h"
#include "Core/PowerPC/PowerPC.h"
#include "Core/System.h"
#include "VideoCommon/Fifo.h"
#include "VideoCommon/VideoBackendBase.h"
@ -82,7 +83,7 @@ static float s_config_OC_factor;
static float s_config_OC_inv_factor;
static bool s_config_sync_on_skip_idle;
static void EmptyTimedCallback(u64 userdata, s64 cyclesLate)
static void EmptyTimedCallback(Core::System& system, u64 userdata, s64 cyclesLate)
{
}
@ -345,7 +346,7 @@ void Advance()
Event evt = std::move(s_event_queue.front());
std::pop_heap(s_event_queue.begin(), s_event_queue.end(), std::greater<Event>());
s_event_queue.pop_back();
evt.type->callback(evt.userdata, g.global_timer - evt.time);
evt.type->callback(Core::System::GetInstance(), evt.userdata, g.global_timer - evt.time);
}
s_is_global_timer_sane = false;

View File

@ -21,6 +21,11 @@
class PointerWrap;
namespace Core
{
class System;
}
namespace CoreTiming
{
// These really shouldn't be global, but jit64 accesses them directly
@ -39,7 +44,7 @@ extern Globals g;
void Init();
void Shutdown();
typedef void (*TimedCallback)(u64 userdata, s64 cyclesLate);
typedef void (*TimedCallback)(Core::System& system, u64 userdata, s64 cyclesLate);
// This should only be called from the CPU thread, if you are calling it any other thread, you are
// doing something evil

View File

@ -198,12 +198,12 @@ int GetAIPeriod()
return static_cast<int>(std::min(period, s_period));
}
void Update(u64 userdata, s64 cycles_late)
static void Update(Core::System& system, u64 userdata, s64 cycles_late)
{
if (!IsPlaying())
return;
auto& state = Core::System::GetInstance().GetAudioInterfaceState().GetData();
auto& state = system.GetAudioInterfaceState().GetData();
const u64 diff = CoreTiming::GetTicks() - state.last_cpu_time;
if (diff > state.cpu_cycles_per_sample)

View File

@ -177,13 +177,13 @@ void DoState(PointerWrap& p)
static void UpdateInterrupts();
static void Do_ARAM_DMA();
static void GenerateDSPInterrupt(u64 DSPIntType, s64 cyclesLate = 0);
static void GenerateDSPInterrupt(Core::System& system, u64 DSPIntType, s64 cyclesLate = 0);
static void CompleteARAM(u64 userdata, s64 cyclesLate)
static void CompleteARAM(Core::System& system, u64 userdata, s64 cyclesLate)
{
auto& state = Core::System::GetInstance().GetDSPState().GetData();
auto& state = system.GetDSPState().GetData();
state.dsp_control.DMAState = 0;
GenerateDSPInterrupt(INT_ARAM);
GenerateDSPInterrupt(system, INT_ARAM);
}
DSPEmulator* GetDSPEmulator()
@ -471,9 +471,9 @@ static void UpdateInterrupts()
ProcessorInterface::SetInterrupt(ProcessorInterface::INT_CAUSE_DSP, ints_set);
}
static void GenerateDSPInterrupt(u64 DSPIntType, s64 cyclesLate)
static void GenerateDSPInterrupt(Core::System& system, u64 DSPIntType, s64 cyclesLate)
{
auto& state = Core::System::GetInstance().GetDSPState().GetData();
auto& state = system.GetDSPState().GetData();
// The INT_* enumeration members have values that reflect their bit positions in
// DSP_CONTROL - we mask by (INT_DSP | INT_ARAM | INT_AID) just to ensure people
@ -512,7 +512,8 @@ void UpdateDSPSlice(int cycles)
// This happens at 4 khz, since 32 bytes at 4khz = 4 bytes at 32 khz (16bit stereo pcm)
void UpdateAudioDMA()
{
auto& state = Core::System::GetInstance().GetDSPState().GetData();
auto& system = Core::System::GetInstance();
auto& state = system.GetDSPState().GetData();
static short zero_samples[8 * 2] = {0};
if (state.audio_dma.AudioDMAControl.Enable)
@ -534,7 +535,7 @@ void UpdateAudioDMA()
state.audio_dma.current_source_address = state.audio_dma.SourceAddress;
state.audio_dma.remaining_blocks_count = state.audio_dma.AudioDMAControl.NumBlocks;
GenerateDSPInterrupt(DSP::INT_AID);
GenerateDSPInterrupt(system, DSP::INT_AID);
}
}
else

View File

@ -188,10 +188,10 @@ DVDInterfaceState::DVDInterfaceState() : m_data(std::make_unique<Data>())
DVDInterfaceState::~DVDInterfaceState() = default;
static void AutoChangeDiscCallback(u64 userdata, s64 cyclesLate);
static void EjectDiscCallback(u64 userdata, s64 cyclesLate);
static void InsertDiscCallback(u64 userdata, s64 cyclesLate);
static void FinishExecutingCommandCallback(u64 userdata, s64 cycles_late);
static void AutoChangeDiscCallback(Core::System& system, u64 userdata, s64 cyclesLate);
static void EjectDiscCallback(Core::System& system, u64 userdata, s64 cyclesLate);
static void InsertDiscCallback(Core::System& system, u64 userdata, s64 cyclesLate);
static void FinishExecutingCommandCallback(Core::System& system, u64 userdata, s64 cycles_late);
static void SetLidOpen();
@ -531,19 +531,19 @@ bool IsDiscInside()
return DVDThread::HasDisc();
}
static void AutoChangeDiscCallback(u64 userdata, s64 cyclesLate)
static void AutoChangeDiscCallback(Core::System& system, u64 userdata, s64 cyclesLate)
{
AutoChangeDisc();
}
static void EjectDiscCallback(u64 userdata, s64 cyclesLate)
static void EjectDiscCallback(Core::System& system, u64 userdata, s64 cyclesLate)
{
SetDisc(nullptr, {});
}
static void InsertDiscCallback(u64 userdata, s64 cyclesLate)
static void InsertDiscCallback(Core::System& system, u64 userdata, s64 cyclesLate)
{
auto& state = Core::System::GetInstance().GetDVDInterfaceState().GetData();
auto& state = system.GetDVDInterfaceState().GetData();
std::unique_ptr<DiscIO::VolumeDisc> new_disc = DiscIO::CreateDisc(state.disc_path_to_insert);
if (new_disc)
@ -1370,7 +1370,7 @@ static u64 PackFinishExecutingCommandUserdata(ReplyType reply_type, DIInterruptT
return (static_cast<u64>(reply_type) << 32) + static_cast<u32>(interrupt_type);
}
void FinishExecutingCommandCallback(u64 userdata, s64 cycles_late)
void FinishExecutingCommandCallback(Core::System& system, u64 userdata, s64 cycles_late)
{
ReplyType reply_type = static_cast<ReplyType>(userdata >> 32);
DIInterruptType interrupt_type = static_cast<DIInterruptType>(userdata & 0xFFFFFFFF);

View File

@ -72,7 +72,7 @@ static void StartReadInternal(bool copy_to_ram, u32 output_address, u64 dvd_offs
const DiscIO::Partition& partition,
DVDInterface::ReplyType reply_type, s64 ticks_until_completion);
static void FinishRead(u64 id, s64 cycles_late);
static void FinishRead(Core::System& system, u64 id, s64 cycles_late);
struct DVDThreadState::Data
{
@ -328,9 +328,9 @@ static void StartReadInternal(bool copy_to_ram, u32 output_address, u64 dvd_offs
CoreTiming::ScheduleEvent(ticks_until_completion, state.finish_read, id);
}
static void FinishRead(u64 id, s64 cycles_late)
static void FinishRead(Core::System& system, u64 id, s64 cycles_late)
{
auto& state = Core::System::GetInstance().GetDVDThreadState().GetData();
auto& state = system.GetDVDThreadState().GetData();
// We can't simply pop result_queue and always get the ReadResult
// we want, because the DVD thread may add ReadResults to the queue

View File

@ -43,8 +43,8 @@ ExpansionInterfaceState::ExpansionInterfaceState() : m_data(std::make_unique<Dat
ExpansionInterfaceState::~ExpansionInterfaceState() = default;
static void ChangeDeviceCallback(u64 userdata, s64 cyclesLate);
static void UpdateInterruptsCallback(u64 userdata, s64 cycles_late);
static void ChangeDeviceCallback(Core::System& system, u64 userdata, s64 cyclesLate);
static void UpdateInterruptsCallback(Core::System& system, u64 userdata, s64 cycles_late);
namespace
{
@ -214,13 +214,13 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
}
}
static void ChangeDeviceCallback(u64 userdata, s64 cyclesLate)
static void ChangeDeviceCallback(Core::System& system, u64 userdata, s64 cyclesLate)
{
u8 channel = (u8)(userdata >> 32);
u8 type = (u8)(userdata >> 16);
u8 num = (u8)userdata;
auto& state = Core::System::GetInstance().GetExpansionInterfaceState().GetData();
auto& state = system.GetExpansionInterfaceState().GetData();
state.channels.at(channel)->AddDevice(static_cast<EXIDeviceType>(type), num);
}
@ -270,7 +270,7 @@ void UpdateInterrupts()
ProcessorInterface::SetInterrupt(ProcessorInterface::INT_CAUSE_EXI, causeInt);
}
static void UpdateInterruptsCallback(u64 userdata, s64 cycles_late)
static void UpdateInterruptsCallback(Core::System& system, u64 userdata, s64 cycles_late)
{
UpdateInterrupts();
}

View File

@ -71,12 +71,12 @@ void CEXIMemoryCard::EventCompleteFindInstance(u64 userdata,
}
}
void CEXIMemoryCard::CmdDoneCallback(u64 userdata, s64)
void CEXIMemoryCard::CmdDoneCallback(Core::System& system, u64 userdata, s64)
{
EventCompleteFindInstance(userdata, [](CEXIMemoryCard* instance) { instance->CmdDone(); });
}
void CEXIMemoryCard::TransferCompleteCallback(u64 userdata, s64)
void CEXIMemoryCard::TransferCompleteCallback(Core::System& system, u64 userdata, s64)
{
EventCompleteFindInstance(userdata,
[](CEXIMemoryCard* instance) { instance->TransferComplete(); });

View File

@ -14,6 +14,10 @@
class MemoryCardBase;
class PointerWrap;
namespace Core
{
class System;
}
namespace Memcard
{
struct HeaderData;
@ -58,10 +62,10 @@ private:
std::function<void(CEXIMemoryCard*)> callback);
// Scheduled when a command that required delayed end signaling is done.
static void CmdDoneCallback(u64 userdata, s64 cyclesLate);
static void CmdDoneCallback(Core::System& system, u64 userdata, s64 cyclesLate);
// Scheduled when memory card is done transferring data
static void TransferCompleteCallback(u64 userdata, s64 cyclesLate);
static void TransferCompleteCallback(Core::System& system, u64 userdata, s64 cyclesLate);
// Signals that the command that was previously executed is now done.
void CmdDone();

View File

@ -39,13 +39,13 @@ static u32 m_ResetCode;
// ID and callback for scheduling reset button presses/releases
static CoreTiming::EventType* toggleResetButton;
static void ToggleResetButtonCallback(u64 userdata, s64 cyclesLate);
static void ToggleResetButtonCallback(Core::System& system, u64 userdata, s64 cyclesLate);
static CoreTiming::EventType* iosNotifyResetButton;
static void IOSNotifyResetButtonCallback(u64 userdata, s64 cyclesLate);
static void IOSNotifyResetButtonCallback(Core::System& system, u64 userdata, s64 cyclesLate);
static CoreTiming::EventType* iosNotifyPowerButton;
static void IOSNotifyPowerButtonCallback(u64 userdata, s64 cyclesLate);
static void IOSNotifyPowerButtonCallback(Core::System& system, u64 userdata, s64 cyclesLate);
// Let the PPC know that an external exception is set/cleared
void UpdateException();
@ -230,12 +230,12 @@ static void SetResetButton(bool set)
SetInterrupt(INT_CAUSE_RST_BUTTON, !set);
}
static void ToggleResetButtonCallback(u64 userdata, s64 cyclesLate)
static void ToggleResetButtonCallback(Core::System& system, u64 userdata, s64 cyclesLate)
{
SetResetButton(!!userdata);
}
static void IOSNotifyResetButtonCallback(u64 userdata, s64 cyclesLate)
static void IOSNotifyResetButtonCallback(Core::System& system, u64 userdata, s64 cyclesLate)
{
const auto ios = IOS::HLE::GetIOS();
if (!ios)
@ -246,7 +246,7 @@ static void IOSNotifyResetButtonCallback(u64 userdata, s64 cyclesLate)
std::static_pointer_cast<IOS::HLE::STMEventHookDevice>(stm)->ResetButton();
}
static void IOSNotifyPowerButtonCallback(u64 userdata, s64 cyclesLate)
static void IOSNotifyPowerButtonCallback(Core::System& system, u64 userdata, s64 cyclesLate)
{
const auto ios = IOS::HLE::GetIOS();
if (!ios)

View File

@ -243,10 +243,10 @@ static void SetNoResponse(u32 channel)
}
}
static void ChangeDeviceCallback(u64 user_data, s64 cycles_late)
static void ChangeDeviceCallback(Core::System& system, u64 user_data, s64 cycles_late)
{
// The purpose of this callback is to simply re-enable device changes.
auto& state = Core::System::GetInstance().GetSerialInterfaceState().GetData();
auto& state = system.GetSerialInterfaceState().GetData();
state.channel[user_data].has_recent_device_change = false;
}
@ -295,9 +295,9 @@ constexpr s32 ConvertSILengthField(u32 field)
return ((field - 1) & SI_XFER_LENGTH_MASK) + 1;
}
static void RunSIBuffer(u64 user_data, s64 cycles_late)
static void RunSIBuffer(Core::System& system, u64 user_data, s64 cycles_late)
{
auto& state = Core::System::GetInstance().GetSerialInterfaceState().GetData();
auto& state = system.GetSerialInterfaceState().GetData();
if (state.com_csr.TSTART)
{
const s32 request_length = ConvertSILengthField(state.com_csr.OUTLNGTH);
@ -380,9 +380,9 @@ void DoState(PointerWrap& p)
}
template <int device_number>
static void DeviceEventCallback(u64 userdata, s64 cyclesLate)
static void DeviceEventCallback(Core::System& system, u64 userdata, s64 cyclesLate)
{
auto& state = Core::System::GetInstance().GetSerialInterfaceState().GetData();
auto& state = system.GetSerialInterfaceState().GetData();
state.channel[device_number].device->OnEvent(userdata, cyclesLate);
}
@ -555,7 +555,8 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
mmio->Register(base | SI_COM_CSR, MMIO::DirectRead<u32>(&state.com_csr.hex),
MMIO::ComplexWrite<u32>([](u32, u32 val) {
auto& state = Core::System::GetInstance().GetSerialInterfaceState().GetData();
auto& system = Core::System::GetInstance();
auto& state = system.GetSerialInterfaceState().GetData();
const USIComCSR tmp_com_csr(val);
state.com_csr.CHANNEL = tmp_com_csr.CHANNEL.Value();
@ -575,7 +576,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
if (state.com_csr.TSTART)
CoreTiming::RemoveEvent(state.event_type_tranfer_pending);
state.com_csr.TSTART = 1;
RunSIBuffer(0, 0);
RunSIBuffer(system, 0, 0);
}
if (!state.com_csr.TSTART)

View File

@ -100,7 +100,7 @@ std::mutex s_emu_to_real_time_mutex;
u64 s_time_spent_sleeping;
// DSP/CPU timeslicing.
void DSPCallback(u64 userdata, s64 cyclesLate)
void DSPCallback(Core::System& system, u64 userdata, s64 cyclesLate)
{
// splits up the cycle budget in case lle is used
// for hle, just gives all of the slice to hle
@ -115,13 +115,13 @@ int GetAudioDMACallbackPeriod()
(Mixer::FIXED_SAMPLE_RATE_DIVIDEND * 4 / 32);
}
void AudioDMACallback(u64 userdata, s64 cyclesLate)
void AudioDMACallback(Core::System& system, u64 userdata, s64 cyclesLate)
{
DSP::UpdateAudioDMA(); // Push audio to speakers.
CoreTiming::ScheduleEvent(GetAudioDMACallbackPeriod() - cyclesLate, et_AudioDMA);
}
void IPC_HLE_UpdateCallback(u64 userdata, s64 cyclesLate)
void IPC_HLE_UpdateCallback(Core::System& system, u64 userdata, s64 cyclesLate)
{
if (SConfig::GetInstance().bWii)
{
@ -130,19 +130,19 @@ void IPC_HLE_UpdateCallback(u64 userdata, s64 cyclesLate)
}
}
void VICallback(u64 userdata, s64 cyclesLate)
void VICallback(Core::System& system, u64 userdata, s64 cyclesLate)
{
VideoInterface::Update(CoreTiming::GetTicks() - cyclesLate);
CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerHalfLine() - cyclesLate, et_VI);
}
void DecrementerCallback(u64 userdata, s64 cyclesLate)
void DecrementerCallback(Core::System& system, u64 userdata, s64 cyclesLate)
{
PowerPC::ppcState.spr[SPR_DEC] = 0xFFFFFFFF;
PowerPC::ppcState.Exceptions |= EXCEPTION_DECREMENTER;
}
void PatchEngineCallback(u64 userdata, s64 cycles_late)
void PatchEngineCallback(Core::System& system, u64 userdata, s64 cycles_late)
{
// We have 2 periods, a 1000 cycle error period and the VI period.
// We have to carefully combine these together so that we stay on the VI period without drifting.
@ -167,7 +167,7 @@ void PatchEngineCallback(u64 userdata, s64 cycles_late)
CoreTiming::ScheduleEvent(next_schedule, et_PatchEngine, cycles_pruned);
}
void ThrottleCallback(u64 deadline, s64 cyclesLate)
void ThrottleCallback(Core::System& system, u64 deadline, s64 cyclesLate)
{
// Allow the GPU thread to sleep. Setting this flag here limits the wakeups to 1 kHz.
Fifo::GpuMaySleep();

View File

@ -112,7 +112,7 @@ Common::Flags<GPIO> g_gpio_out;
static u32 resets;
static CoreTiming::EventType* updateInterrupts;
static void UpdateInterrupts(u64 = 0, s64 cyclesLate = 0);
static void UpdateInterrupts(Core::System& system, u64 userdata, s64 cyclesLate);
void DoState(PointerWrap& p)
{
@ -283,7 +283,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
mmio->Register(base | UNK_1D0, MMIO::Constant<u32>(0), MMIO::Nop<u32>());
}
static void UpdateInterrupts(u64 userdata, s64 cyclesLate)
static void UpdateInterrupts(Core::System& system, u64 userdata, s64 cyclesLate)
{
if ((ctrl.Y1 & ctrl.IY1) || (ctrl.Y2 & ctrl.IY2))
{

View File

@ -624,7 +624,7 @@ void DIDevice::InterruptFromDVDInterface(DVDInterface::DIInterruptType interrupt
}
}
void DIDevice::FinishDICommandCallback(u64 userdata, s64 ticksbehind)
void DIDevice::FinishDICommandCallback(Core::System& system, u64 userdata, s64 ticksbehind)
{
const DIResult result = static_cast<DIResult>(userdata);

View File

@ -19,6 +19,10 @@ namespace DVDInterface
{
enum class DIInterruptType : int;
}
namespace Core
{
class System;
}
namespace CoreTiming
{
struct EventType;
@ -128,7 +132,7 @@ private:
void ChangePartition(const DiscIO::Partition partition);
void InitializeIfFirstTime();
void ResetDIRegisters();
static void FinishDICommandCallback(u64 userdata, s64 ticksbehind);
static void FinishDICommandCallback(Core::System& system, u64 userdata, s64 ticksbehind);
void FinishDICommand(DIResult result);
static CoreTiming::EventType* s_finish_executing_di_command;

View File

@ -115,13 +115,15 @@ ESDevice::ESDevice(Kernel& ios, const std::string& device_name) : Device(ios, de
void ESDevice::InitializeEmulationState()
{
s_finish_init_event = CoreTiming::RegisterEvent(
"IOS-ESFinishInit", [](u64, s64) { GetIOS()->GetES()->FinishInit(); });
s_reload_ios_for_ppc_launch_event =
CoreTiming::RegisterEvent("IOS-ESReloadIOSForPPCLaunch", [](u64 ios_id, s64) {
"IOS-ESFinishInit", [](Core::System& system, u64, s64) { GetIOS()->GetES()->FinishInit(); });
s_reload_ios_for_ppc_launch_event = CoreTiming::RegisterEvent(
"IOS-ESReloadIOSForPPCLaunch", [](Core::System& system, u64 ios_id, s64) {
GetIOS()->GetES()->LaunchTitle(ios_id, HangPPC::Yes);
});
s_bootstrap_ppc_for_launch_event = CoreTiming::RegisterEvent(
"IOS-ESBootstrapPPCForLaunch", [](u64, s64) { GetIOS()->GetES()->BootstrapPPC(); });
s_bootstrap_ppc_for_launch_event =
CoreTiming::RegisterEvent("IOS-ESBootstrapPPCForLaunch", [](Core::System& system, u64, s64) {
GetIOS()->GetES()->BootstrapPPC();
});
}
void ESDevice::FinalizeEmulationState()

View File

@ -876,7 +876,7 @@ IOSC& Kernel::GetIOSC()
return m_iosc;
}
static void FinishPPCBootstrap(u64 userdata, s64 cycles_late)
static void FinishPPCBootstrap(Core::System& system, u64 userdata, s64 cycles_late)
{
// See Kernel::BootstrapPPC
const bool is_ancast = userdata == 1;
@ -891,18 +891,20 @@ static void FinishPPCBootstrap(u64 userdata, s64 cycles_late)
void Init()
{
s_event_enqueue = CoreTiming::RegisterEvent("IPCEvent", [](u64 userdata, s64) {
if (s_ios)
s_ios->HandleIPCEvent(userdata);
});
s_event_enqueue =
CoreTiming::RegisterEvent("IPCEvent", [](Core::System& system, u64 userdata, s64) {
if (s_ios)
s_ios->HandleIPCEvent(userdata);
});
ESDevice::InitializeEmulationState();
s_event_finish_ppc_bootstrap =
CoreTiming::RegisterEvent("IOSFinishPPCBootstrap", FinishPPCBootstrap);
s_event_finish_ios_boot = CoreTiming::RegisterEvent(
"IOSFinishIOSBoot", [](u64 ios_title_id, s64) { FinishIOSBoot(ios_title_id); });
s_event_finish_ios_boot =
CoreTiming::RegisterEvent("IOSFinishIOSBoot", [](Core::System& system, u64 ios_title_id,
s64) { FinishIOSBoot(ios_title_id); });
DIDevice::s_finish_executing_di_command =
CoreTiming::RegisterEvent("FinishDICommand", DIDevice::FinishDICommandCallback);

View File

@ -124,7 +124,7 @@ static void Hex2mem(u8* dst, u8* src, u32 len)
}
}
static void UpdateCallback(u64 userdata, s64 cycles_late)
static void UpdateCallback(Core::System& system, u64 userdata, s64 cycles_late)
{
ProcessCommands(false);
if (IsActive())

View File

@ -68,7 +68,7 @@ void PairedSingle::SetPS1(double value)
ps1 = Common::BitCast<u64>(value);
}
static void InvalidateCacheThreadSafe(u64 userdata, s64 cyclesLate)
static void InvalidateCacheThreadSafe(Core::System& system, u64 userdata, s64 cyclesLate)
{
ppcState.iCache.Invalidate(static_cast<u32>(userdata));
}

View File

@ -49,7 +49,7 @@ static bool IsOnThread()
return Core::System::GetInstance().IsDualCoreMode();
}
static void UpdateInterrupts_Wrapper(u64 userdata, s64 cyclesLate)
static void UpdateInterrupts_Wrapper(Core::System& system, u64 userdata, s64 cyclesLate)
{
UpdateInterrupts(userdata);
}

View File

@ -595,12 +595,12 @@ static int WaitForGpuThread(int ticks)
return GPU_TIME_SLOT_SIZE;
}
static void SyncGPUCallback(u64 ticks, s64 cyclesLate)
static void SyncGPUCallback(Core::System& system, u64 ticks, s64 cyclesLate)
{
ticks += cyclesLate;
int next = -1;
if (!Core::System::GetInstance().IsDualCoreMode() || s_use_deterministic_gpu_thread)
if (!system.IsDualCoreMode() || s_use_deterministic_gpu_thread)
{
next = RunGpuOnCpu((int)ticks);
}

View File

@ -182,7 +182,7 @@ void DoState(PointerWrap& p)
}
static void UpdateInterrupts();
static void SetTokenFinish_OnMainThread(u64 userdata, s64 cyclesLate);
static void SetTokenFinish_OnMainThread(Core::System& system, u64 userdata, s64 cyclesLate);
void Init()
{
@ -297,7 +297,7 @@ static void UpdateInterrupts()
s_signal_finish_interrupt && m_Control.pe_finish_enable);
}
static void SetTokenFinish_OnMainThread(u64 userdata, s64 cyclesLate)
static void SetTokenFinish_OnMainThread(Core::System& system, u64 userdata, s64 cyclesLate)
{
std::unique_lock<std::mutex> lk(s_token_finish_mutex);
s_event_raised = false;

View File

@ -25,7 +25,7 @@ static u64 s_expected_callback = 0;
static s64 s_lateness = 0;
template <unsigned int IDX>
void CallbackTemplate(u64 userdata, s64 lateness)
void CallbackTemplate(Core::System& system, u64 userdata, s64 lateness)
{
static_assert(IDX < CB_IDS.size(), "IDX out of range");
s_callbacks_ran_flags.set(IDX);
@ -121,7 +121,7 @@ namespace SharedSlotTest
static unsigned int s_counter = 0;
template <unsigned int ID>
void FifoCallback(u64 userdata, s64 lateness)
void FifoCallback(Core::System& system, u64 userdata, s64 lateness)
{
static_assert(ID < CB_IDS.size(), "ID out of range");
s_callbacks_ran_flags.set(ID);
@ -186,7 +186,7 @@ namespace ChainSchedulingTest
{
static int s_reschedules = 0;
static void RescheduleCallback(u64 userdata, s64 lateness)
static void RescheduleCallback(Core::System& system, u64 userdata, s64 lateness)
{
--s_reschedules;
EXPECT_TRUE(s_reschedules >= 0);
@ -241,7 +241,7 @@ namespace ScheduleIntoPastTest
{
static CoreTiming::EventType* s_cb_next = nullptr;
static void ChainCallback(u64 userdata, s64 lateness)
static void ChainCallback(Core::System& system, u64 userdata, s64 lateness)
{
EXPECT_EQ(CB_IDS[0] + 1, userdata);
EXPECT_EQ(0, lateness);