summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2015-05-25 23:49:56 -0400
committerRyan Houdek <Sonicadvance1@gmail.com>2015-05-25 23:49:56 -0400
commitf4625e638387beeddde2d149461607614d950d14 (patch)
tree5ad0a0ef426ffcb601a926e3f6a2dafbedeeede2 /Source/Core
parent061848457a66d4efb9a3dc52159a59d1b1c5fd69 (diff)
parentb645547930a43e72c9186126f6cf28361cfee6ce (diff)
Merge pull request #2398 from JosJuice/revert-854f6b8
Attempt at fixing issue 8544 (input recording desyncs)
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/HW/GCPad.cpp8
-rw-r--r--Source/Core/Core/HW/SystemTimers.cpp14
-rw-r--r--Source/Core/Core/HW/Wiimote.cpp8
3 files changed, 16 insertions, 14 deletions
diff --git a/Source/Core/Core/HW/GCPad.cpp b/Source/Core/Core/HW/GCPad.cpp
index 891ac7ef99..d2dc106c24 100644
--- a/Source/Core/Core/HW/GCPad.cpp
+++ b/Source/Core/Core/HW/GCPad.cpp
@@ -57,6 +57,14 @@ void GetStatus(u8 _numPAD, GCPadStatus* _pPADStatus)
memset(_pPADStatus, 0, sizeof(*_pPADStatus));
_pPADStatus->err = PAD_ERR_NONE;
+ // if we are on the next input cycle, update output and input
+ static int _last_numPAD = 4;
+ if (_numPAD <= _last_numPAD)
+ {
+ g_controller_interface.UpdateInput();
+ }
+ _last_numPAD = _numPAD;
+
// get input
((GCPad*)s_config.controllers[_numPAD])->GetInput(_pPADStatus);
}
diff --git a/Source/Core/Core/HW/SystemTimers.cpp b/Source/Core/Core/HW/SystemTimers.cpp
index a4b22dd366..5c84966489 100644
--- a/Source/Core/Core/HW/SystemTimers.cpp
+++ b/Source/Core/Core/HW/SystemTimers.cpp
@@ -61,8 +61,6 @@ IPC_HLE_PERIOD: For the Wiimote this is the call schedule:
#include "Core/IPC_HLE/WII_IPC_HLE.h"
#include "Core/PowerPC/PowerPC.h"
-#include "InputCommon/ControllerInterface/ControllerInterface.h"
-
#include "VideoCommon/CommandProcessor.h"
#include "VideoCommon/VideoBackendBase.h"
@@ -81,7 +79,6 @@ static int et_DSP;
static int et_IPC_HLE;
static int et_PatchEngine; // PatchEngine updates every 1/60th of a second by default
static int et_Throttle;
-static int et_UpdateInput;
// These are badly educated guesses
// Feel free to experiment. Set these in Init below.
@@ -134,14 +131,6 @@ static void VICallback(u64 userdata, int cyclesLate)
CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerLine() - cyclesLate, et_VI);
}
-static void UpdateInputCallback(u64 userdata, int cyclesLate)
-{
- g_controller_interface.UpdateInput();
-
- // Poll system input every 1/60th of a second.
- CoreTiming::ScheduleEvent(SystemTimers::GetTicksPerSecond() / 60 - cyclesLate, et_UpdateInput);
-}
-
static void SICallback(u64 userdata, int cyclesLate)
{
SerialInterface::UpdateDevices();
@@ -270,7 +259,6 @@ void Init()
et_IPC_HLE = CoreTiming::RegisterEvent("IPC_HLE_UpdateCallback", IPC_HLE_UpdateCallback);
et_PatchEngine = CoreTiming::RegisterEvent("PatchEngine", PatchEngineCallback);
et_Throttle = CoreTiming::RegisterEvent("Throttle", ThrottleCallback);
- et_UpdateInput = CoreTiming::RegisterEvent("UpdateInput", UpdateInputCallback);
CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerLine(), et_VI);
CoreTiming::ScheduleEvent(0, et_DSP);
@@ -284,8 +272,6 @@ void Init()
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
CoreTiming::ScheduleEvent(IPC_HLE_PERIOD, et_IPC_HLE);
-
- CoreTiming::ScheduleEvent(0, et_UpdateInput);
}
void Shutdown()
diff --git a/Source/Core/Core/HW/Wiimote.cpp b/Source/Core/Core/HW/Wiimote.cpp
index 0aa8dfbc15..378cc6f52f 100644
--- a/Source/Core/Core/HW/Wiimote.cpp
+++ b/Source/Core/Core/HW/Wiimote.cpp
@@ -118,6 +118,14 @@ void Update(int _number)
{
//PanicAlert( "Wiimote_Update" );
+ // if we are on the next input cycle, update output and input
+ static int _last_number = 4;
+ if (_number <= _last_number)
+ {
+ g_controller_interface.UpdateInput();
+ }
+ _last_number = _number;
+
if (WIIMOTE_SRC_EMU & g_wiimote_sources[_number])
((WiimoteEmu::Wiimote*)s_config.controllers[_number])->Update();
else