BTEmu: Throttle prior to wii remote input update.

This commit is contained in:
Jordan Woyak 2025-03-02 03:25:23 -06:00
parent 9675c90890
commit aa624d8ba8

View File

@ -347,10 +347,13 @@ void BluetoothEmuDevice::Update()
wiimote->Update();
const u64 interval = GetSystem().GetSystemTimers().GetTicksPerSecond() / Wiimote::UPDATE_FREQ;
const u64 now = GetSystem().GetCoreTiming().GetTicks();
auto& core_timing = GetSystem().GetCoreTiming();
const u64 now = core_timing.GetTicks();
if (now - m_last_ticks > interval)
{
// Throttle before Wii Remote update so input is taken just before needed. (lower input latency)
core_timing.Throttle(now);
g_controller_interface.SetCurrentInputChannel(ciface::InputChannel::Bluetooth);
g_controller_interface.UpdateInput();