Fix determinism issues with Wiimote netplay.

- Change the Wiimote emulation SYSCONF R/W to use the temporary NAND if in use.
- Fix up SysConf API so this actually works.

Kind of a hack.  Like I said, this can be cleaned up when configuration
is synced...
This commit is contained in:
comex
2015-04-20 22:24:21 -04:00
parent 0d257b9e88
commit 45b07cbdcd
2 changed files with 25 additions and 6 deletions

View File

@ -38,6 +38,10 @@ void SysConf::Clear()
bool SysConf::LoadFromFile(const std::string& filename)
{
if (m_IsValid)
Clear();
m_IsValid = false;
// Basic check
if (!File::Exists(filename))
{
@ -67,6 +71,7 @@ bool SysConf::LoadFromFile(const std::string& filename)
if (LoadFromFileInternal(f.ReleaseHandle()))
{
m_Filename = filename;
m_IsValid = true;
return true;
}
}
@ -107,6 +112,7 @@ bool SysConf::LoadFromFileInternal(FILE *fh)
f.ReadArray(curEntry.name, curEntry.nameLength);
curEntry.name[curEntry.nameLength] = '\0';
// Get length of data
curEntry.data = nullptr;
curEntry.dataLength = 0;
switch (curEntry.type)
{
@ -362,6 +368,7 @@ void SysConf::GenerateSysConf()
g.WriteBytes("SCed", 4);
m_Filename = m_FilenameDefault;
m_IsValid = true;
}
bool SysConf::SaveToFile(const std::string& filename)
@ -418,11 +425,8 @@ void SysConf::UpdateLocation()
bool SysConf::Reload()
{
if (m_IsValid)
Clear();
std::string& filename = m_Filename.empty() ? m_FilenameDefault : m_Filename;
m_IsValid = LoadFromFile(filename);
LoadFromFile(filename);
return m_IsValid;
}