Remove pre-generated SYSCONF

Dolphin is able to generate one with all correct default settings, so
we don't need to ship with a pre-generated SYSCONF and worry about
syncing default settings.

Additionally, this commit changes SysConf to work with session SYSCONFs
so that Dolphin is able to generate a default one even for Movie/TAS.
Which SYSCONF needs to be touched is explicitly specified to avoid
confusion about which file SysConf is managing.

(Another notable change is that the Wii root functions are moved into
Core to prevent Common from depending on Core.)
This commit is contained in:
Léo Lam
2017-01-06 21:59:02 +01:00
parent d346d4ced1
commit 64101137cd
14 changed files with 111 additions and 82 deletions

View File

@ -17,9 +17,9 @@
#include "Core/Movie.h"
SysConf::SysConf()
SysConf::SysConf(const Common::FromWhichRoot root_type)
{
UpdateLocation();
UpdateLocation(root_type);
}
SysConf::~SysConf()
@ -50,6 +50,7 @@ bool SysConf::LoadFromFile(const std::string& filename)
{
File::CreateFullPath(filename);
GenerateSysConf();
ApplySettingsFromMovie();
return true;
}
@ -61,12 +62,10 @@ bool SysConf::LoadFromFile(const std::string& filename)
SYSCONF_SIZE, size))
{
GenerateSysConf();
ApplySettingsFromMovie();
return true;
}
else
{
return false;
}
return false;
}
File::IOFile f(filename, "rb");
@ -76,13 +75,7 @@ bool SysConf::LoadFromFile(const std::string& filename)
{
m_Filename = filename;
m_IsValid = true;
// Apply Wii settings from normal SYSCONF on Movie recording/playback
if (Movie::IsRecordingInput() || Movie::IsPlayingInput())
{
SetData("IPL.LNG", Movie::GetLanguage());
SetData("IPL.E60", Movie::IsPAL60());
SetData("IPL.PGS", Movie::IsProgressive());
}
ApplySettingsFromMovie();
return true;
}
}
@ -90,6 +83,17 @@ bool SysConf::LoadFromFile(const std::string& filename)
return false;
}
// Apply Wii settings from normal SYSCONF on Movie recording/playback
void SysConf::ApplySettingsFromMovie()
{
if (!Movie::IsMovieActive())
return;
SetData("IPL.LNG", Movie::GetLanguage());
SetData("IPL.E60", Movie::IsPAL60());
SetData("IPL.PGS", Movie::IsProgressive());
}
bool SysConf::LoadFromFileInternal(File::IOFile&& file)
{
// Fill in infos
@ -420,7 +424,7 @@ bool SysConf::Save()
return SaveToFile(m_Filename);
}
void SysConf::UpdateLocation()
void SysConf::UpdateLocation(const Common::FromWhichRoot root_type)
{
// if the old Wii User dir had a sysconf file save any settings that have been changed to it
if (m_IsValid)
@ -429,11 +433,8 @@ void SysConf::UpdateLocation()
// Clear the old filename and set the default filename to the new user path
// So that it can be generated if the file does not exist in the new location
m_Filename.clear();
// Note: We don't use the dummy Wii root here (if in use) because this is
// all tied up with the configuration code. In the future this should
// probably just be synced with the other settings.
m_FilenameDefault =
File::GetUserPath(D_WIIROOT_IDX) + DIR_SEP WII_SYSCONF_DIR DIR_SEP WII_SYSCONF;
// In the future the SYSCONF should probably just be synced with the other settings.
m_FilenameDefault = Common::RootUserPath(root_type) + DIR_SEP WII_SYSCONF_DIR DIR_SEP WII_SYSCONF;
Reload();
}