mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
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:
@ -45,6 +45,7 @@
|
||||
#include "Core/Movie.h"
|
||||
#include "Core/NetPlayProto.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "Core/WiiRoot.h"
|
||||
|
||||
#include "DiscIO/Enums.h"
|
||||
|
||||
@ -439,7 +440,10 @@ bool BootCore(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
|
||||
|
||||
// Ensure any new settings are written to the SYSCONF
|
||||
if (StartUp.bWii)
|
||||
{
|
||||
Core::BackupWiiSettings();
|
||||
ConfigLoaders::SaveToSYSCONF(Config::LayerType::Meta);
|
||||
}
|
||||
|
||||
const bool load_ipl = !StartUp.bWii && !StartUp.bHLE_BS2 &&
|
||||
std::holds_alternative<BootParameters::Disc>(boot->parameters);
|
||||
@ -487,6 +491,7 @@ static void RestoreSYSCONF()
|
||||
|
||||
void RestoreConfig()
|
||||
{
|
||||
Core::RestoreWiiSettings(Core::RestoreReason::EmulationEnd);
|
||||
RestoreSYSCONF();
|
||||
Config::ClearCurrentRunLayer();
|
||||
Config::RemoveLayer(Config::LayerType::Movie);
|
||||
|
Reference in New Issue
Block a user