Merge pull request #14824 from JosJuice/save-controller-to-dtm

Core: Fix controllers resetting when starting input recording
This commit is contained in:
JosJuice
2026-08-29 11:20:54 +02:00
committed by GitHub
2 changed files with 23 additions and 12 deletions
@@ -116,6 +116,29 @@ void SaveToDTM(Movie::DTMHeader* dtm)
dtm->bFollowBranch = Config::Get(Config::MAIN_JIT_FOLLOW_BRANCH);
dtm->controllers = 0;
dtm->bongos = 0;
dtm->GBAControllers = 0;
for (int i = 0; i < SerialInterface::MAX_SI_CHANNELS; ++i)
{
const SerialInterface::SIDevices si_device = Config::Get(Config::GetInfoForSIDevice(i));
if (si_device != SerialInterface::SIDEVICE_NONE)
dtm->controllers |= 1 << i;
if (si_device == SerialInterface::SIDEVICE_GC_GBA_EMULATED)
dtm->GBAControllers |= 1 << i;
else if (si_device == SerialInterface::SIDEVICE_GC_TARUKONGA)
dtm->bongos |= 1 << i;
}
if (dtm->bWii)
{
for (int i = 0; i < MAX_WIIMOTES; ++i)
{
if (Config::Get(Config::GetInfoForWiimoteSource(i)) != WiimoteSource::None)
dtm->controllers |= 1 << (i + 4);
}
}
// Settings which only existed in old Dolphin versions
dtm->bSkipIdle = true;
dtm->bEFBCopyEnable = true;
-12
View File
@@ -1309,17 +1309,6 @@ void MovieManager::SaveRecording(const std::string& filename)
header.filetype[3] = 0x1A;
strncpy(header.gameID.data(), SConfig::GetInstance().GetGameID().c_str(), 6);
header.bWii = m_system.IsWii();
header.controllers = 0;
header.GBAControllers = 0;
for (int i = 0; i < 4; ++i)
{
if (IsUsingGBA(i))
header.GBAControllers |= 1 << i;
if (IsUsingPad(i))
header.controllers |= 1 << i;
if (IsUsingWiimote(i) && m_system.IsWii())
header.controllers |= 1 << (i + 4);
}
header.bFromSaveState = m_recording_from_save_state;
header.frameCount = m_total_frames;
@@ -1336,7 +1325,6 @@ void MovieManager::SaveRecording(const std::string& filename)
strncpy(header.discChange.data(), m_disc_change_filename.c_str(), header.discChange.size());
strncpy(header.author.data(), m_author.c_str(), header.author.size());
header.md5 = m_md5;
header.bongos = m_bongos;
header.revision = m_revision;
header.DSPiromHash = m_dsp_irom_hash;
header.DSPcoefHash = m_dsp_coef_hash;