Back up Wii setting.txt and SYSCONF while emulating

When booting a Wii game, Dolphin can overwrite certain settings
in the SYSCONF file, such as turning off PAL60 for NTSC games.
Normally, these settings get reverted at the end of emulation, but
this does not happen if Dolphin crashes or force quits in some other
way. (Personally, I have a tendency to use Visual Studio's Stop
Debugging button, which kills the process...)

Dolphin also overwrites certain values in setting.txt when booting
a Wii game. Unlike with SYSCONF, we currently make no effort to
preserve the original values in this file.

This change fixes both of these problems by copying SYSCONF and
setting.txt to the Backup folder when booting a Wii game, and then
copying them back either when launching Dolphin (in case the
previous run of Dolphin crashed) or when ending emulation.
This commit is contained in:
JosJuice
2020-03-16 13:02:35 +01:00
parent 5f6598f9e9
commit 1b844067aa
4 changed files with 74 additions and 0 deletions

View File

@ -31,6 +31,7 @@
#include "Core/HW/Wiimote.h"
#include "Core/IOS/IOS.h"
#include "Core/IOS/STM/STM.h"
#include "Core/WiiRoot.h"
#include "InputCommon/GCAdapter.h"
@ -88,6 +89,8 @@ static void InitCustomPaths()
void Init()
{
Core::RestoreWiiSettings(Core::RestoreReason::CrashRecovery);
Config::Init();
Config::AddConfigChangedCallback(InitCustomPaths);
Config::AddLayer(ConfigLoaders::GenerateBaseConfigLoader());