mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-15 16:59:18 +01:00
Merge pull request #3393 from rabbott99/desync-fix
Movie: Reset wiimotes at at start of recording/playback to fix desync issues
This commit is contained in:
commit
c16c2d9356
@ -51,6 +51,12 @@ void Initialize(void* const hwnd, bool wait)
|
|||||||
Movie::ChangeWiiPads();
|
Movie::ChangeWiiPads();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ResetAllWiimotes()
|
||||||
|
{
|
||||||
|
for (int i = WIIMOTE_CHAN_0; i < MAX_BBMOTES; ++i)
|
||||||
|
static_cast<WiimoteEmu::Wiimote*>(s_config.GetController(i))->Reset();
|
||||||
|
}
|
||||||
|
|
||||||
void LoadConfig()
|
void LoadConfig()
|
||||||
{
|
{
|
||||||
s_config.LoadConfig(false);
|
s_config.LoadConfig(false);
|
||||||
|
@ -37,6 +37,7 @@ namespace Wiimote
|
|||||||
|
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
void Initialize(void* const hwnd, bool wait = false);
|
void Initialize(void* const hwnd, bool wait = false);
|
||||||
|
void ResetAllWiimotes();
|
||||||
void LoadConfig();
|
void LoadConfig();
|
||||||
void Resume();
|
void Resume();
|
||||||
void Pause();
|
void Pause();
|
||||||
|
@ -115,6 +115,7 @@ public:
|
|||||||
void InterruptChannel(const u16 _channelID, const void* _pData, u32 _Size);
|
void InterruptChannel(const u16 _channelID, const void* _pData, u32 _Size);
|
||||||
void ControlChannel(const u16 _channelID, const void* _pData, u32 _Size);
|
void ControlChannel(const u16 _channelID, const void* _pData, u32 _Size);
|
||||||
void ConnectOnInput();
|
void ConnectOnInput();
|
||||||
|
void Reset();
|
||||||
|
|
||||||
void DoState(PointerWrap& p);
|
void DoState(PointerWrap& p);
|
||||||
void RealState();
|
void RealState();
|
||||||
@ -145,8 +146,6 @@ private:
|
|||||||
u8* data;
|
u8* data;
|
||||||
};
|
};
|
||||||
|
|
||||||
void Reset();
|
|
||||||
|
|
||||||
void ReportMode(const wm_report_mode* const dr);
|
void ReportMode(const wm_report_mode* const dr);
|
||||||
void SendAck(const u8 _reportID);
|
void SendAck(const u8 _reportID);
|
||||||
void RequestStatus(const wm_request_status* const rs = nullptr);
|
void RequestStatus(const wm_request_status* const rs = nullptr);
|
||||||
|
@ -500,6 +500,14 @@ bool BeginRecordingInput(int controllers)
|
|||||||
md5thread.detach();
|
md5thread.detach();
|
||||||
GetSettings();
|
GetSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wiimotes cause desync issues if they're not reset before launching the game
|
||||||
|
if (!Core::IsRunningAndStarted())
|
||||||
|
{
|
||||||
|
// This will also reset the wiimotes for gamecube games, but that shouldn't do anything
|
||||||
|
Wiimote::ResetAllWiimotes();
|
||||||
|
}
|
||||||
|
|
||||||
s_playMode = MODE_RECORDING;
|
s_playMode = MODE_RECORDING;
|
||||||
s_author = SConfig::GetInstance().m_strMovieAuthor;
|
s_author = SConfig::GetInstance().m_strMovieAuthor;
|
||||||
EnsureTmpInputSize(1);
|
EnsureTmpInputSize(1);
|
||||||
@ -854,6 +862,9 @@ bool PlayInput(const std::string& filename)
|
|||||||
|
|
||||||
s_playMode = MODE_PLAYING;
|
s_playMode = MODE_PLAYING;
|
||||||
|
|
||||||
|
// Wiimotes cause desync issues if they're not reset before launching the game
|
||||||
|
Wiimote::ResetAllWiimotes();
|
||||||
|
|
||||||
Core::UpdateWantDeterminism();
|
Core::UpdateWantDeterminism();
|
||||||
|
|
||||||
s_totalBytes = g_recordfd.GetSize() - 256;
|
s_totalBytes = g_recordfd.GetSize() - 256;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user