From 4aa6f6c81239c45ce302a10e12ea3574c9b39d01 Mon Sep 17 00:00:00 2001 From: Chris Burgener Date: Wed, 24 Feb 2016 13:56:59 -0500 Subject: [PATCH] Apply Wii Settings on Movie Recording/Playback --- Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb.cpp | 7 +++++++ Source/Core/Core/Movie.cpp | 9 +++++++++ Source/Core/Core/Movie.h | 4 +++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb.cpp index a30c34d8a0..781ff67858 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb.cpp @@ -45,6 +45,13 @@ CWII_IPC_HLE_Device_usb_oh1_57e_305::CWII_IPC_HLE_Device_usb_oh1_57e_305(u32 _De owned_sysconf.reset(new SysConf()); sysconf = owned_sysconf.get(); sysconf->LoadFromFile(File::GetUserPath(D_SESSION_WIIROOT_IDX) + DIR_SEP WII_SYSCONF_DIR DIR_SEP WII_SYSCONF); + // Apply Wii settings from normal SYSCONF on Movie recording/playback + if (Movie::IsRecordingInput() || Movie::IsPlayingInput()) + { + sysconf->SetData("IPL.LNG", Movie::GetLanguage()); + sysconf->SetData("IPL.E60", Movie::IsPAL60()); + sysconf->SetData("IPL.PGS", Movie::IsProgressive()); + } } else { diff --git a/Source/Core/Core/Movie.cpp b/Source/Core/Core/Movie.cpp index 91ace55535..825d15e4ce 100644 --- a/Source/Core/Core/Movie.cpp +++ b/Source/Core/Core/Movie.cpp @@ -80,6 +80,7 @@ static u8 s_bongos, s_memcards; static u8 s_revision[20]; static u32 s_DSPiromHash = 0; static u32 s_DSPcoefHash = 0; +static u8 s_language = 10; //Set to unknown until language is known static bool s_bRecordingFromSaveState = false; static bool s_bPolled = false; @@ -385,6 +386,11 @@ int GetCPUMode() return s_iCPUCore; } +u8 GetLanguage() +{ + return s_language; +} + bool IsStartingFromClearSave() { return g_bClearSave; @@ -810,6 +816,7 @@ void ReadHeader() s_bongos = tmpHeader.bongos; s_bSyncGPU = tmpHeader.bSyncGPU; s_bNetPlay = tmpHeader.bNetPlay; + s_language = tmpHeader.language; memcpy(s_revision, tmpHeader.revision, ArraySize(s_revision)); } else @@ -1254,6 +1261,7 @@ void SaveRecording(const std::string& filename) header.DSPiromHash = s_DSPiromHash; header.DSPcoefHash = s_DSPcoefHash; header.tickCount = s_totalTickCount; + header.language = s_language; // TODO header.uniqueID = 0; @@ -1317,6 +1325,7 @@ void GetSettings() s_bSyncGPU = SConfig::GetInstance().bSyncGPU; s_iCPUCore = SConfig::GetInstance().iCPUCore; s_bNetPlay = NetPlay::IsNetPlayRunning(); + s_language = SConfig::GetInstance().m_SYSCONF->GetData("IPL.LNG"); if (!SConfig::GetInstance().bWii) g_bClearSave = !File::Exists(SConfig::GetInstance().m_strMemoryCardA); s_memcards |= (SConfig::GetInstance().m_EXIDevice[0] == EXIDEVICE_MEMORYCARD) << 0; diff --git a/Source/Core/Core/Movie.h b/Source/Core/Core/Movie.h index c7fe7e630c..7fa19d22f5 100644 --- a/Source/Core/Core/Movie.h +++ b/Source/Core/Core/Movie.h @@ -102,7 +102,8 @@ struct DTMHeader bool bSyncGPU; bool bNetPlay; bool bPAL60; - u8 reserved[12]; // Padding for any new config options + u8 language; + u8 reserved[11]; // Padding for any new config options u8 discChange[40]; // Name of iso file to switch to, for two disc games. u8 revision[20]; // Git hash u32 DSPiromHash; @@ -137,6 +138,7 @@ bool IsSkipIdle(); bool IsDSPHLE(); bool IsFastDiscSpeed(); int GetCPUMode(); +u8 GetLanguage(); bool IsStartingFromClearSave(); bool IsUsingMemcard(int memcard); bool IsSyncGPU();