From e168f95257d617dfc5135831de0f4d117f0fbabf Mon Sep 17 00:00:00 2001 From: John Peterson Date: Sat, 29 Nov 2008 00:06:38 +0000 Subject: [PATCH] Moved back SYSCONF to shared2/sys, it was probably unnecessary to have it in two places git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1325 8ced0084-cf51-0410-be5f-012b33b47a6e --- Data/User/{Config => Wii/shared2/sys}/SYSCONF | Bin .../{Config => Wii/shared2/sys}/readme.txt | 0 Source/Core/DolphinWX/Src/BootManager.cpp | 18 ++++++++------ Source/Core/DolphinWX/Src/ConfigMain.cpp | 23 +++++------------- Source/Core/DolphinWX/Src/ConfigMain.h | 1 + 5 files changed, 18 insertions(+), 24 deletions(-) rename Data/User/{Config => Wii/shared2/sys}/SYSCONF (100%) rename Data/User/{Config => Wii/shared2/sys}/readme.txt (100%) diff --git a/Data/User/Config/SYSCONF b/Data/User/Wii/shared2/sys/SYSCONF similarity index 100% rename from Data/User/Config/SYSCONF rename to Data/User/Wii/shared2/sys/SYSCONF diff --git a/Data/User/Config/readme.txt b/Data/User/Wii/shared2/sys/readme.txt similarity index 100% rename from Data/User/Config/readme.txt rename to Data/User/Wii/shared2/sys/readme.txt diff --git a/Source/Core/DolphinWX/Src/BootManager.cpp b/Source/Core/DolphinWX/Src/BootManager.cpp index 0242c763d4..145dbe5dee 100644 --- a/Source/Core/DolphinWX/Src/BootManager.cpp +++ b/Source/Core/DolphinWX/Src/BootManager.cpp @@ -85,7 +85,9 @@ bool BootCore(const std::string& _rFilename) return false; } - // Load overrides + // ------------------------------------------------ + // Load game specific settings + // ---------------- IniFile ini; std::string unique_id = StartUp.GetUniqueID(); if (unique_id.size() == 6 && ini.Load((FULL_GAMECONFIG_DIR + unique_id + ".ini").c_str())) @@ -99,7 +101,7 @@ bool BootCore(const std::string& _rFilename) // ------------------------------------------------ - // Read SYSCONF settings + // Update SYSCONF with game specific settings // ---------------- bool bEnableProgressiveScan, bEnableWideScreen; //bRefreshList = false; @@ -107,10 +109,11 @@ bool BootCore(const std::string& _rFilename) u8 m_SYSCONF[0x4000]; // SYSCONF file u16 IPL_PGS = 0x17CC; // pregressive scan u16 IPL_AR = 0x04D9; // widescreen + std::string FullSYSCONFPath = FULL_WII_USER_DIR "shared2/sys/SYSCONF"; // Load Wii SYSCONF pStream = NULL; - pStream = fopen(FULL_CONFIG_DIR "SYSCONF", "rb"); + pStream = fopen(FullSYSCONFPath.c_str(), "rb"); if (pStream != NULL) { fread(m_SYSCONF, 1, 0x4000, pStream); @@ -128,7 +131,7 @@ bool BootCore(const std::string& _rFilename) // Enable custom Wii SYSCONF settings by saving the file to shared2 pStream = NULL; - pStream = fopen(FULL_WII_USER_DIR "shared2/sys/SYSCONF", "wb"); + pStream = fopen(FullSYSCONFPath.c_str(), "wb"); if (pStream != NULL) { fwrite(m_SYSCONF, 1, 0x4000, pStream); @@ -136,16 +139,17 @@ bool BootCore(const std::string& _rFilename) } else { - PanicAlert("Could not write to shared2/sys/SYSCONF"); + PanicAlert("Could not write to %s", FullSYSCONFPath.c_str()); } } else { - PanicAlert("Could not read %sSYSCONF", FULL_CONFIG_DIR); + PanicAlert("Could not read %s", FullSYSCONFPath.c_str()); } - // ---------------- + // --------- } + // --------- #if !defined(OSX64) if(main_frame) StartUp.hMainWindow = main_frame->GetRenderHandle(); diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp index 5d67d1500b..e58d025ddd 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.cpp +++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp @@ -63,8 +63,9 @@ 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(FULL_CONFIG_DIR "SYSCONF", "rb"); + pStream = fopen(FullSYSCONFPath.c_str(), "rb"); if (pStream != NULL) { fread(m_SYSCONF, 1, 0x4000, pStream); @@ -73,7 +74,7 @@ CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title, } else { - PanicAlert("Could not read " FULL_CONFIG_DIR "SYSCONF. Please recover the SYSCONF file to that location."); + PanicAlert("Could not read %s. Please recover the SYSCONF file to that location.", FullSYSCONFPath.c_str()); m_bSysconfOK = false; } @@ -307,9 +308,8 @@ void CConfigMain::OnClose(wxCloseEvent& WXUNUSED (event)) save anything, it will be a corrupted file */ if(m_bSysconfOK) { - // Save Wii SYSCONF twice so that we can keep game specific settings for it - pStream = NULL; - pStream = fopen(FULL_CONFIG_DIR "SYSCONF", "wb"); + // Save SYSCONF with the new settings + pStream = fopen(FullSYSCONFPath.c_str(), "wb"); if (pStream != NULL) { fwrite(m_SYSCONF, 1, 0x4000, pStream); @@ -317,18 +317,7 @@ void CConfigMain::OnClose(wxCloseEvent& WXUNUSED (event)) } else { - PanicAlert("Could not write to SYSCONF"); - } - - pStream = fopen(FULL_WII_USER_DIR "shared2/sys/SYSCONF", "wb"); - if (pStream != NULL) - { - fwrite(m_SYSCONF, 1, 0x4000, pStream); - fclose(pStream); - } - else - { - PanicAlert("Could not write to shared2/sys/SYSCONF"); + PanicAlert("Could not write to %s", FullSYSCONFPath.c_str()); } } diff --git a/Source/Core/DolphinWX/Src/ConfigMain.h b/Source/Core/DolphinWX/Src/ConfigMain.h index 11c803cc0b..13790fb4f5 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.h +++ b/Source/Core/DolphinWX/Src/ConfigMain.h @@ -89,6 +89,7 @@ class CConfigMain FILE* pStream; u8 m_SYSCONF[0x4000]; bool m_bSysconfOK; + std::string FullSYSCONFPath; enum {