HW: Poll system input from system timers

Rather than playing terrible hacks to determine the start of input
frames, just update system input periodically. Specifically, every
60th of a second.
This commit is contained in:
Jasper St. Pierre
2014-11-15 01:47:29 -08:00
parent f3b739341e
commit 854f6b8688
4 changed files with 15 additions and 18 deletions

View File

@ -17,7 +17,6 @@ namespace Wiimote
{
static InputConfig s_config(WIIMOTE_INI_NAME, _trans("Wiimote"), "Wiimote");
static int s_last_number = 4;
InputConfig* GetConfig()
{
@ -115,12 +114,6 @@ void Update(int _number)
// TODO: change this to a try_to_lock, and make it give empty input on failure
std::lock_guard<std::recursive_mutex> lk(s_config.controls_lock);
if (_number <= s_last_number)
{
g_controller_interface.UpdateInput();
}
s_last_number = _number;
if (WIIMOTE_SRC_EMU & g_wiimote_sources[_number])
((WiimoteEmu::Wiimote*)s_config.controllers[_number])->Update();
else
@ -153,7 +146,6 @@ void DoState(u8 **ptr, PointerWrap::Mode mode)
// TODO:
PointerWrap p(ptr, mode);
p.Do(s_last_number);
for (unsigned int i=0; i<MAX_BBMOTES; ++i)
((WiimoteEmu::Wiimote*)s_config.controllers[i])->DoState(p);
}