Skip to content

Commit

Permalink
Merge pull request #3810 from mathieui/fix-adapter-recording-savestate
Browse files Browse the repository at this point in the history
Fix loading save states with input recording with the adapter
  • Loading branch information
Parlane committed May 12, 2016
2 parents 48c0c2a + 2a0ba5a commit 356f709
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Source/Core/Core/Movie.cpp
Expand Up @@ -406,17 +406,28 @@ void ChangePads(bool instantly)
int controllers = 0;

for (int i = 0; i < MAX_SI_CHANNELS; ++i)
if (SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_CONTROLLER || SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_TARUKONGA)
if (SIDevice_IsGCController(SConfig::GetInstance().m_SIDevice[i]))
controllers |= (1 << i);

if (instantly && (s_numPads & 0x0F) == controllers)
return;

for (int i = 0; i < MAX_SI_CHANNELS; ++i)
{
SIDevices device = SIDEVICE_NONE;
if (IsUsingPad(i))
{
if (SIDevice_IsGCController(SConfig::GetInstance().m_SIDevice[i]))
device = SConfig::GetInstance().m_SIDevice[i];
else
device = IsUsingBongo(i) ? SIDEVICE_GC_TARUKONGA : SIDEVICE_GC_CONTROLLER;
}

if (instantly) // Changes from savestates need to be instantaneous
SerialInterface::AddDevice(IsUsingPad(i) ? (IsUsingBongo(i) ? SIDEVICE_GC_TARUKONGA : SIDEVICE_GC_CONTROLLER) : SIDEVICE_NONE, i);
SerialInterface::AddDevice(device, i);
else
SerialInterface::ChangeDevice(IsUsingPad(i) ? (IsUsingBongo(i) ? SIDEVICE_GC_TARUKONGA : SIDEVICE_GC_CONTROLLER) : SIDEVICE_NONE, i);
SerialInterface::ChangeDevice(device, i);
}
}

void ChangeWiiPads(bool instantly)
Expand Down

0 comments on commit 356f709

Please sign in to comment.