From bd891cfff6c9711d1e0b57d9fd92b5cf322e67c5 Mon Sep 17 00:00:00 2001 From: John Peterson Date: Thu, 26 Feb 2009 08:12:40 +0000 Subject: [PATCH] Paths: Made a WII_SYSCONF_FILE path for the Wii configuration, and removed an unused variable git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2444 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/Paths.h | 3 +++ Source/Core/DolphinWX/Src/BootManager.cpp | 13 ++----------- Source/Core/DolphinWX/Src/ConfigMain.cpp | 9 ++++----- Source/Core/DolphinWX/Src/ConfigMain.h | 1 - 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/Source/Core/Common/Src/Paths.h b/Source/Core/Common/Src/Paths.h index 40acab6dee..0813f394f7 100644 --- a/Source/Core/Common/Src/Paths.h +++ b/Source/Core/Common/Src/Paths.h @@ -30,6 +30,7 @@ // Dirs in User #define GC_USER_DIR "GC" #define WII_USER_DIR "Wii" + #define WII_SYSCONF_DIR "shared2/sys" #define CONFIG_DIR "Config" #define GAMECONFIG_DIR "GameConfig" #define MAPS_DIR "Maps" @@ -72,6 +73,7 @@ #define WII_EUR_SETTING "setting-eur.txt" #define WII_USA_SETTING "setting-usa.txt" #define WII_JAP_SETTING "setting-jpn.txt" +#define WII_SYSCONF "SYSCONF" #define MEMORY_DUMP_FILE "mainram.dump" @@ -130,5 +132,6 @@ #define WII_EUR_SETTING_FILE FULL_WII_SYS_DIR WII_EUR_SETTING #define WII_USA_SETTING_FILE FULL_WII_SYS_DIR WII_USA_SETTING #define WII_JAP_SETTING_FILE FULL_WII_SYS_DIR WII_JAP_SETTING +#define WII_SYSCONF_FILE FULL_WII_USER_DIR WII_SYSCONF_DIR DIR_SEP WII_SYSCONF #endif // PATHS_H diff --git a/Source/Core/DolphinWX/Src/BootManager.cpp b/Source/Core/DolphinWX/Src/BootManager.cpp index 01df13fe80..5b8c2bc9c3 100644 --- a/Source/Core/DolphinWX/Src/BootManager.cpp +++ b/Source/Core/DolphinWX/Src/BootManager.cpp @@ -141,24 +141,15 @@ bool BootCore(const std::string& _rFilename) { //bRefreshList = false; FILE* pStream; // file handle - u8 m_SYSCONF[0x4000]; // SYSCONF file u16 IPL_PGS = 0x17CC; // progressive scan u16 IPL_AR = 0x04D9; // widescreen - std::string FullSYSCONFPath = FULL_WII_USER_DIR "shared2/sys/SYSCONF"; - - //wxMessageBox(wxString::Format(": %02x", m_SYSCONF[IPL_AR])); ini.Get("Wii", "ProgressiveScan", &StartUp.bProgressiveScan, StartUp.bProgressiveScan); ini.Get("Wii", "Widescreen", &StartUp.bWidescreen, StartUp.bWidescreen); - m_SYSCONF[IPL_PGS] = StartUp.bProgressiveScan; - m_SYSCONF[IPL_AR] = StartUp.bWidescreen; - - //wxMessageBox(wxString::Format(": %02x", m_SYSCONF[IPL_AR])); - // Save the update Wii SYSCONF settings pStream = NULL; - pStream = fopen(FullSYSCONFPath.c_str(), "r+b"); + pStream = fopen(WII_SYSCONF_FILE, "r+b"); if (pStream != NULL) { fseek(pStream, IPL_PGS, 0); @@ -169,7 +160,7 @@ bool BootCore(const std::string& _rFilename) } else { - PanicAlert("Could not write to %s", FullSYSCONFPath.c_str()); + PanicAlert("Could not write to %s", WII_SYSCONF_FILE); } } // --------------- diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp index abe27f1c51..cee7bceefa 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.cpp +++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp @@ -94,9 +94,8 @@ CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title, bRefreshList = false; // Load Wii SYSCONF - FullSYSCONFPath = FULL_WII_USER_DIR "shared2/sys/SYSCONF"; pStream = NULL; - pStream = fopen(FullSYSCONFPath.c_str(), "rb"); + pStream = fopen(WII_SYSCONF_FILE, "rb"); if (pStream != NULL) { fread(m_SYSCONF, 1, 0x4000, pStream); @@ -105,7 +104,7 @@ CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title, } else { - PanicAlert("Could not read %s. Please recover the SYSCONF file to that location.", FullSYSCONFPath.c_str()); + PanicAlert("Could not read %s. Please recover the SYSCONF file to that location.", WII_SYSCONF_FILE); m_bSysconfOK = false; } @@ -544,7 +543,7 @@ void CConfigMain::OnClose(wxCloseEvent& WXUNUSED (event)) if(m_bSysconfOK) { // Save SYSCONF with the new settings - pStream = fopen(FullSYSCONFPath.c_str(), "wb"); + pStream = fopen(WII_SYSCONF_FILE, "wb"); if (pStream != NULL) { fwrite(m_SYSCONF, 1, 0x4000, pStream); @@ -552,7 +551,7 @@ void CConfigMain::OnClose(wxCloseEvent& WXUNUSED (event)) } else { - PanicAlert("Could not write to %s", FullSYSCONFPath.c_str()); + PanicAlert("Could not write to %s", WII_SYSCONF_FILE); } } diff --git a/Source/Core/DolphinWX/Src/ConfigMain.h b/Source/Core/DolphinWX/Src/ConfigMain.h index 046dabef1c..edd8bbe4f8 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.h +++ b/Source/Core/DolphinWX/Src/ConfigMain.h @@ -105,7 +105,6 @@ class CConfigMain FILE* pStream; u8 m_SYSCONF[0x4000]; bool m_bSysconfOK; - std::string FullSYSCONFPath; enum {