diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2017-01-06 21:59:02 +0100 |
|---|---|---|
| committer | Léo Lam <leo@innovatetechnologi.es> | 2017-01-12 21:30:11 +0100 |
| commit | 64101137cd6e507942364fb7e446692d69277341 (patch) | |
| tree | 0cdcc2d10c1e080dc99d982434e38b5df1903442 /Source/Core/Common/SysConf.cpp | |
| parent | d346d4ced163502be4d308a6ce8573814454c11c (diff) | |
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.)
Diffstat (limited to 'Source/Core/Common/SysConf.cpp')
| -rw-r--r-- | Source/Core/Common/SysConf.cpp | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/Source/Core/Common/SysConf.cpp b/Source/Core/Common/SysConf.cpp index 3b2ab36694..e8f8fb3cef 100644 --- a/Source/Core/Common/SysConf.cpp +++ b/Source/Core/Common/SysConf.cpp @@ -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(); } |
