mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-22 09:09:18 +01:00
padscore: Invoke sampling callbacks every 5ms
This fixes high input latency in games like Pokemon Rumble U which update input via the sampling callbacks
This commit is contained in:
parent
b0bab273e2
commit
2843da4479
@ -746,7 +746,8 @@ namespace padscore
|
|||||||
// call sampling callback
|
// call sampling callback
|
||||||
for (auto i = 0; i < InputManager::kMaxWPADControllers; ++i)
|
for (auto i = 0; i < InputManager::kMaxWPADControllers; ++i)
|
||||||
{
|
{
|
||||||
if (g_padscore.controller_data[i].sampling_callback) {
|
if (g_padscore.controller_data[i].sampling_callback)
|
||||||
|
{
|
||||||
if (const auto controller = instance.get_wpad_controller(i))
|
if (const auto controller = instance.get_wpad_controller(i))
|
||||||
{
|
{
|
||||||
cemuLog_log(LogType::InputAPI, "Calling WPADsamplingCallback({})", i);
|
cemuLog_log(LogType::InputAPI, "Calling WPADsamplingCallback({})", i);
|
||||||
@ -761,7 +762,7 @@ namespace padscore
|
|||||||
{
|
{
|
||||||
OSCreateAlarm(&g_padscore.alarm);
|
OSCreateAlarm(&g_padscore.alarm);
|
||||||
const uint64 start_tick = coreinit::coreinit_getOSTime();
|
const uint64 start_tick = coreinit::coreinit_getOSTime();
|
||||||
const uint64 period_tick = coreinit::EspressoTime::GetTimerClock(); // once a second
|
const uint64 period_tick = coreinit::EspressoTime::GetTimerClock() / 200; // every 5ms
|
||||||
MPTR handler = PPCInterpreter_makeCallableExportDepr(TickFunction);
|
MPTR handler = PPCInterpreter_makeCallableExportDepr(TickFunction);
|
||||||
OSSetPeriodicAlarm(&g_padscore.alarm, start_tick, period_tick, handler);
|
OSSetPeriodicAlarm(&g_padscore.alarm, start_tick, period_tick, handler);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user