revamp handling of wii sysconf. it's in Common lib so that plugins can (possibly) utilize it if they like

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4268 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman
2009-09-14 06:26:49 +00:00
parent a08c801256
commit aff34e6789
10 changed files with 508 additions and 337 deletions

View File

@ -52,6 +52,7 @@
#include "Volume.h"
#include "VolumeCreator.h"
#include "ConfigManager.h"
#include "SysConf.h"
#include "Core.h"
#if defined(HAVE_WX) && HAVE_WX
#include "ConfigMain.h"
@ -127,24 +128,8 @@ bool BootCore(const std::string& _rFilename)
// Wii settings
if (StartUp.bWii)
{
game_ini.Get("Wii", "ProgressiveScan", &StartUp.bProgressiveScan, StartUp.bProgressiveScan);
game_ini.Get("Wii", "Widescreen", &StartUp.bWidescreen, StartUp.bWidescreen);
// Save the update Wii SYSCONF settings
FILE* pStream = fopen(WII_SYSCONF_FILE, "r+b");
if (pStream)
{
const int IPL_PGS = 0x17CC; // progressive scan
const int IPL_AR = 0x04D9; // widescreen
fseek(pStream, IPL_PGS, 0);
fputc(StartUp.bProgressiveScan ? 1 : 0, pStream);
fseek(pStream, IPL_AR, 0);
fputc(StartUp.bWidescreen ? 1 : 0, pStream);
fclose(pStream);
}
else
{
PanicAlert("Could not write to %s", WII_SYSCONF_FILE);
}
// Flush possible changes to SYSCONF to file
SConfig::GetInstance().m_SYSCONF->Save();
}
}