master
Kelebek1 2022-07-10 08:29:37 +07:00
parent 240650f6a6
commit b23c6b456c
5 changed files with 9 additions and 11 deletions

@ -245,8 +245,7 @@ struct KernelCore::Impl {
}); });
const auto time_interval = std::chrono::nanoseconds{std::chrono::milliseconds(10)}; const auto time_interval = std::chrono::nanoseconds{std::chrono::milliseconds(10)};
system.CoreTiming().ScheduleLoopingEvent(std::chrono::nanoseconds(0), time_interval, system.CoreTiming().ScheduleLoopingEvent(time_interval, time_interval, preemption_event);
preemption_event);
} }
void InitializeShutdownThreads() { void InitializeShutdownThreads() {

@ -97,11 +97,10 @@ IAppletResource::IAppletResource(Core::System& system_,
return std::nullopt; return std::nullopt;
}); });
system.CoreTiming().ScheduleLoopingEvent(std::chrono::nanoseconds(0), pad_update_ns, system.CoreTiming().ScheduleLoopingEvent(pad_update_ns, pad_update_ns, pad_update_event);
pad_update_event); system.CoreTiming().ScheduleLoopingEvent(mouse_keyboard_update_ns, mouse_keyboard_update_ns,
system.CoreTiming().ScheduleLoopingEvent(std::chrono::nanoseconds(0), mouse_keyboard_update_ns,
mouse_keyboard_update_event); mouse_keyboard_update_event);
system.CoreTiming().ScheduleLoopingEvent(std::chrono::nanoseconds(0), motion_update_ns, system.CoreTiming().ScheduleLoopingEvent(motion_update_ns, motion_update_ns,
motion_update_event); motion_update_event);
system.HIDCore().ReloadInputDevices(); system.HIDCore().ReloadInputDevices();

@ -57,7 +57,7 @@ HidBus::HidBus(Core::System& system_)
return std::nullopt; return std::nullopt;
}); });
system_.CoreTiming().ScheduleLoopingEvent(std::chrono::nanoseconds(0), hidbus_update_ns, system_.CoreTiming().ScheduleLoopingEvent(hidbus_update_ns, hidbus_update_ns,
hidbus_update_event); hidbus_update_event);
} }

@ -73,14 +73,14 @@ NVFlinger::NVFlinger(Core::System& system_, HosBinderDriverServer& hos_binder_dr
const auto lock_guard = Lock(); const auto lock_guard = Lock();
Compose(); Compose();
return std::chrono::nanoseconds(GetNextTicks()) - ns_late; return std::max(std::chrono::nanoseconds::zero(),
std::chrono::nanoseconds(GetNextTicks()) - ns_late);
}); });
if (system.IsMulticore()) { if (system.IsMulticore()) {
vsync_thread = std::jthread([this](std::stop_token token) { SplitVSync(token); }); vsync_thread = std::jthread([this](std::stop_token token) { SplitVSync(token); });
} else { } else {
system.CoreTiming().ScheduleLoopingEvent(std::chrono::nanoseconds(0), frame_ns, system.CoreTiming().ScheduleLoopingEvent(frame_ns, frame_ns, composition_event);
composition_event);
} }
} }

@ -189,7 +189,7 @@ void CheatEngine::Initialize() {
FrameCallback(user_data, ns_late); FrameCallback(user_data, ns_late);
return std::nullopt; return std::nullopt;
}); });
core_timing.ScheduleLoopingEvent(std::chrono::nanoseconds(0), CHEAT_ENGINE_NS, event); core_timing.ScheduleLoopingEvent(CHEAT_ENGINE_NS, CHEAT_ENGINE_NS, event);
metadata.process_id = system.CurrentProcess()->GetProcessID(); metadata.process_id = system.CurrentProcess()->GetProcessID();
metadata.title_id = system.GetCurrentProcessProgramID(); metadata.title_id = system.GetCurrentProcessProgramID();