Support a gcm revision-specific game ini for cheats + partially fix gecko codes in default ini.
The local ini is not revision-specific because it would require renaming everything. Meh.
This commit is contained in:
parent
1ed06f1dc4
commit
f57ff0a569
|
@ -28,8 +28,8 @@ struct ARCode
|
||||||
|
|
||||||
void RunAllActive();
|
void RunAllActive();
|
||||||
bool RunCode(const ARCode &arcode);
|
bool RunCode(const ARCode &arcode);
|
||||||
void LoadCodes(IniFile &globalIni, IniFile &localIni, bool forceLoad);
|
void LoadCodes(IniFile &globalini, IniFile &localIni, bool forceLoad);
|
||||||
void LoadCodes(std::vector<ARCode> &_arCodes, IniFile &globalIni, IniFile &localIni);
|
void LoadCodes(std::vector<ARCode> &_arCodes, IniFile &globalini, IniFile &localIni);
|
||||||
size_t GetCodeListSize();
|
size_t GetCodeListSize();
|
||||||
ARCode GetARCode(size_t index);
|
ARCode GetARCode(size_t index);
|
||||||
void SetARCode_IsActive(bool active, size_t index);
|
void SetARCode_IsActive(bool active, size_t index);
|
||||||
|
|
|
@ -149,8 +149,7 @@ bool CBoot::EmulatedBS2_GC()
|
||||||
PC = PowerPC::ppcState.gpr[3];
|
PC = PowerPC::ppcState.gpr[3];
|
||||||
|
|
||||||
// Load patches
|
// Load patches
|
||||||
std::string gameID = VolumeHandler::GetVolume()->GetUniqueID();
|
PatchEngine::LoadPatches();
|
||||||
PatchEngine::LoadPatches(gameID.c_str());
|
|
||||||
|
|
||||||
PowerPC::ppcState.DebugCount = 0;
|
PowerPC::ppcState.DebugCount = 0;
|
||||||
|
|
||||||
|
@ -422,7 +421,7 @@ bool CBoot::EmulatedBS2_Wii()
|
||||||
|
|
||||||
// Load patches and run startup patches
|
// Load patches and run startup patches
|
||||||
std::string gameID = VolumeHandler::GetVolume()->GetUniqueID();
|
std::string gameID = VolumeHandler::GetVolume()->GetUniqueID();
|
||||||
PatchEngine::LoadPatches(gameID.c_str());
|
PatchEngine::LoadPatches();
|
||||||
|
|
||||||
// return
|
// return
|
||||||
PC = PowerPC::ppcState.gpr[3];
|
PC = PowerPC::ppcState.gpr[3];
|
||||||
|
|
|
@ -118,7 +118,7 @@ bool CBoot::Boot_WiiWAD(const char* _pFilename)
|
||||||
// Load patches and run startup patches
|
// Load patches and run startup patches
|
||||||
const DiscIO::IVolume* pVolume = DiscIO::CreateVolumeFromFilename(_pFilename);
|
const DiscIO::IVolume* pVolume = DiscIO::CreateVolumeFromFilename(_pFilename);
|
||||||
if (pVolume != NULL)
|
if (pVolume != NULL)
|
||||||
PatchEngine::LoadPatches(pVolume->GetUniqueID().c_str());
|
PatchEngine::LoadPatches();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,14 +75,17 @@ bool BootCore(const std::string& _rFilename)
|
||||||
|
|
||||||
// Load game specific settings
|
// Load game specific settings
|
||||||
std::string unique_id = StartUp.GetUniqueID();
|
std::string unique_id = StartUp.GetUniqueID();
|
||||||
|
std::string revision_specific = StartUp.m_strRevisionSpecificUniqueID;
|
||||||
StartUp.m_strGameIniDefault = File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP + unique_id + ".ini";
|
StartUp.m_strGameIniDefault = File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP + unique_id + ".ini";
|
||||||
|
if (revision_specific != "")
|
||||||
|
StartUp.m_strGameIniDefaultRevisionSpecific = File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP + revision_specific + ".ini";
|
||||||
|
else
|
||||||
|
StartUp.m_strGameIniDefaultRevisionSpecific = "";
|
||||||
StartUp.m_strGameIniLocal = File::GetUserPath(D_GAMESETTINGS_IDX) + unique_id + ".ini";
|
StartUp.m_strGameIniLocal = File::GetUserPath(D_GAMESETTINGS_IDX) + unique_id + ".ini";
|
||||||
|
|
||||||
if (unique_id.size() == 6)
|
if (unique_id.size() == 6)
|
||||||
{
|
{
|
||||||
IniFile game_ini;
|
IniFile game_ini = StartUp.LoadGameIni();
|
||||||
game_ini.Load(StartUp.m_strGameIniDefault);
|
|
||||||
game_ini.Load(StartUp.m_strGameIniLocal, true);
|
|
||||||
|
|
||||||
config_cache.valid = true;
|
config_cache.valid = true;
|
||||||
config_cache.bCPUThread = StartUp.bCPUThread;
|
config_cache.bCPUThread = StartUp.bCPUThread;
|
||||||
|
|
|
@ -204,9 +204,7 @@ bool Init()
|
||||||
g_aspect_wide = _CoreParameter.bWii;
|
g_aspect_wide = _CoreParameter.bWii;
|
||||||
if (g_aspect_wide)
|
if (g_aspect_wide)
|
||||||
{
|
{
|
||||||
IniFile gameIni;
|
IniFile gameIni = _CoreParameter.LoadGameIni();
|
||||||
gameIni.Load(_CoreParameter.m_strGameIniDefault.c_str());
|
|
||||||
gameIni.Load(_CoreParameter.m_strGameIniLocal.c_str(), true);
|
|
||||||
gameIni.Get("Wii", "Widescreen", &g_aspect_wide,
|
gameIni.Get("Wii", "Widescreen", &g_aspect_wide,
|
||||||
!!SConfig::GetInstance().m_SYSCONF->
|
!!SConfig::GetInstance().m_SYSCONF->
|
||||||
GetData<u8>("IPL.AR"));
|
GetData<u8>("IPL.AR"));
|
||||||
|
|
|
@ -147,6 +147,7 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2)
|
||||||
}
|
}
|
||||||
m_strName = pVolume->GetName();
|
m_strName = pVolume->GetName();
|
||||||
m_strUniqueID = pVolume->GetUniqueID();
|
m_strUniqueID = pVolume->GetUniqueID();
|
||||||
|
m_strRevisionSpecificUniqueID = pVolume->GetRevisionSpecificUniqueID();
|
||||||
|
|
||||||
// Check if we have a Wii disc
|
// Check if we have a Wii disc
|
||||||
bWii = DiscIO::IsVolumeWiiDisc(pVolume);
|
bWii = DiscIO::IsVolumeWiiDisc(pVolume);
|
||||||
|
@ -390,3 +391,29 @@ void SCoreStartupParameter::CheckMemcardPath(std::string& memcardPath, std::stri
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IniFile SCoreStartupParameter::LoadGameIni() const
|
||||||
|
{
|
||||||
|
IniFile game_ini;
|
||||||
|
game_ini.Load(m_strGameIniDefault);
|
||||||
|
if (m_strGameIniDefaultRevisionSpecific != "")
|
||||||
|
game_ini.Load(m_strGameIniDefaultRevisionSpecific, true);
|
||||||
|
game_ini.Load(m_strGameIniLocal, true);
|
||||||
|
return game_ini;
|
||||||
|
}
|
||||||
|
|
||||||
|
IniFile SCoreStartupParameter::LoadDefaultGameIni() const
|
||||||
|
{
|
||||||
|
IniFile game_ini;
|
||||||
|
game_ini.Load(m_strGameIniDefault);
|
||||||
|
if (m_strGameIniDefaultRevisionSpecific != "")
|
||||||
|
game_ini.Load(m_strGameIniDefaultRevisionSpecific, true);
|
||||||
|
return game_ini;
|
||||||
|
}
|
||||||
|
|
||||||
|
IniFile SCoreStartupParameter::LoadLocalGameIni() const
|
||||||
|
{
|
||||||
|
IniFile game_ini;
|
||||||
|
game_ini.Load(m_strGameIniLocal);
|
||||||
|
return game_ini;
|
||||||
|
}
|
||||||
|
|
|
@ -197,8 +197,10 @@ struct SCoreStartupParameter
|
||||||
std::string m_strDVDRoot;
|
std::string m_strDVDRoot;
|
||||||
std::string m_strApploader;
|
std::string m_strApploader;
|
||||||
std::string m_strUniqueID;
|
std::string m_strUniqueID;
|
||||||
|
std::string m_strRevisionSpecificUniqueID;
|
||||||
std::string m_strName;
|
std::string m_strName;
|
||||||
std::string m_strGameIniDefault;
|
std::string m_strGameIniDefault;
|
||||||
|
std::string m_strGameIniDefaultRevisionSpecific;
|
||||||
std::string m_strGameIniLocal;
|
std::string m_strGameIniLocal;
|
||||||
|
|
||||||
// Constructor just calls LoadDefaults
|
// Constructor just calls LoadDefaults
|
||||||
|
@ -208,6 +210,9 @@ struct SCoreStartupParameter
|
||||||
bool AutoSetup(EBootBS2 _BootBS2);
|
bool AutoSetup(EBootBS2 _BootBS2);
|
||||||
const std::string &GetUniqueID() const { return m_strUniqueID; }
|
const std::string &GetUniqueID() const { return m_strUniqueID; }
|
||||||
void CheckMemcardPath(std::string& memcardPath, std::string Region, bool isSlotA);
|
void CheckMemcardPath(std::string& memcardPath, std::string Region, bool isSlotA);
|
||||||
|
IniFile LoadDefaultGameIni() const;
|
||||||
|
IniFile LoadLocalGameIni() const;
|
||||||
|
IniFile LoadGameIni() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -65,7 +65,8 @@ namespace Gecko
|
||||||
std::string name, creator;
|
std::string name, creator;
|
||||||
std::vector<std::string> notes;
|
std::vector<std::string> notes;
|
||||||
|
|
||||||
bool enabled;
|
bool enabled;
|
||||||
|
bool user_defined;
|
||||||
|
|
||||||
bool Compare(GeckoCode compare) const;
|
bool Compare(GeckoCode compare) const;
|
||||||
bool Exist(u32 address, u32 data);
|
bool Exist(u32 address, u32 data);
|
||||||
|
|
|
@ -15,70 +15,74 @@
|
||||||
namespace Gecko
|
namespace Gecko
|
||||||
{
|
{
|
||||||
|
|
||||||
// TODO: Support loading codes from default game inis.
|
void LoadCodes(const IniFile& globalIni, const IniFile& localIni, std::vector<GeckoCode>& gcodes)
|
||||||
void LoadCodes(const IniFile& inifile, std::vector<GeckoCode>& gcodes)
|
|
||||||
{
|
{
|
||||||
std::vector<std::string> lines;
|
const IniFile* inis[] = {&globalIni, &localIni};
|
||||||
inifile.GetLines(GECKO_CODE_INI_SECTION, lines, false);
|
for (size_t i = 0; i < ArraySize(inis); ++i)
|
||||||
|
|
||||||
GeckoCode gcode;
|
|
||||||
|
|
||||||
std::vector<std::string>::const_iterator
|
|
||||||
lines_iter = lines.begin(),
|
|
||||||
lines_end = lines.end();
|
|
||||||
for (; lines_iter!=lines_end; ++lines_iter)
|
|
||||||
{
|
{
|
||||||
if (lines_iter->empty())
|
std::vector<std::string> lines;
|
||||||
continue;
|
inis[i]->GetLines(GECKO_CODE_INI_SECTION, lines, false);
|
||||||
|
|
||||||
std::istringstream ss(*lines_iter);
|
GeckoCode gcode;
|
||||||
|
|
||||||
switch ((*lines_iter)[0])
|
for (auto lines_iter = lines.begin(); lines_iter!=lines.end(); ++lines_iter)
|
||||||
{
|
{
|
||||||
|
if (lines_iter->empty())
|
||||||
|
continue;
|
||||||
|
|
||||||
// enabled or disabled code
|
std::istringstream ss(*lines_iter);
|
||||||
case '+' :
|
|
||||||
ss.seekg(1);
|
|
||||||
case '$' :
|
|
||||||
if (gcode.name.size())
|
|
||||||
gcodes.push_back(gcode);
|
|
||||||
gcode = GeckoCode();
|
|
||||||
gcode.enabled = (1 == ss.tellg()); // silly
|
|
||||||
ss.seekg(1, std::ios_base::cur);
|
|
||||||
// read the code name
|
|
||||||
std::getline(ss, gcode.name, '['); // stop at [ character (beginning of contributor name)
|
|
||||||
gcode.name = StripSpaces(gcode.name);
|
|
||||||
// read the code creator name
|
|
||||||
std::getline(ss, gcode.creator, ']');
|
|
||||||
break;
|
|
||||||
|
|
||||||
// notes
|
switch ((*lines_iter)[0])
|
||||||
case '*':
|
{
|
||||||
gcode.notes.push_back(std::string(++lines_iter->begin(), lines_iter->end()));
|
|
||||||
break;
|
// enabled or disabled code
|
||||||
|
case '+' :
|
||||||
|
ss.seekg(1);
|
||||||
|
case '$' :
|
||||||
|
if (gcode.name.size())
|
||||||
|
gcodes.push_back(gcode);
|
||||||
|
gcode = GeckoCode();
|
||||||
|
gcode.enabled = (1 == ss.tellg()); // silly
|
||||||
|
gcode.user_defined = i == 1;
|
||||||
|
ss.seekg(1, std::ios_base::cur);
|
||||||
|
// read the code name
|
||||||
|
std::getline(ss, gcode.name, '['); // stop at [ character (beginning of contributor name)
|
||||||
|
gcode.name = StripSpaces(gcode.name);
|
||||||
|
// read the code creator name
|
||||||
|
std::getline(ss, gcode.creator, ']');
|
||||||
|
break;
|
||||||
|
|
||||||
|
// notes
|
||||||
|
case '*':
|
||||||
|
gcode.notes.push_back(std::string(++lines_iter->begin(), lines_iter->end()));
|
||||||
|
break;
|
||||||
|
|
||||||
|
// either part of the code, or an option choice
|
||||||
|
default :
|
||||||
|
{
|
||||||
|
GeckoCode::Code new_code;
|
||||||
|
// TODO: support options
|
||||||
|
new_code.original_line = *lines_iter;
|
||||||
|
ss >> std::hex >> new_code.address >> new_code.data;
|
||||||
|
gcode.codes.push_back(new_code);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// either part of the code, or an option choice
|
|
||||||
default :
|
|
||||||
{
|
|
||||||
GeckoCode::Code new_code;
|
|
||||||
// TODO: support options
|
|
||||||
new_code.original_line = *lines_iter;
|
|
||||||
ss >> std::hex >> new_code.address >> new_code.data;
|
|
||||||
gcode.codes.push_back(new_code);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add the last code
|
||||||
|
if (gcode.name.size())
|
||||||
|
gcodes.push_back(gcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the last code
|
|
||||||
if (gcode.name.size())
|
|
||||||
gcodes.push_back(gcode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// used by the SaveGeckoCodes function
|
// used by the SaveGeckoCodes function
|
||||||
void SaveGeckoCode(std::vector<std::string>& lines, const GeckoCode& gcode)
|
void SaveGeckoCode(std::vector<std::string>& lines, const GeckoCode& gcode)
|
||||||
{
|
{
|
||||||
|
if (!gcode.user_defined)
|
||||||
|
return;
|
||||||
|
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|
||||||
if (gcode.enabled)
|
if (gcode.enabled)
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
namespace Gecko
|
namespace Gecko
|
||||||
{
|
{
|
||||||
|
|
||||||
void LoadCodes(const IniFile& inifile, std::vector<GeckoCode>& gcodes);
|
void LoadCodes(const IniFile& globalIni, const IniFile& localIni, std::vector<GeckoCode>& gcodes);
|
||||||
void SaveCodes(IniFile& inifile, const std::vector<GeckoCode>& gcodes);
|
void SaveCodes(IniFile& inifile, const std::vector<GeckoCode>& gcodes);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "GeckoCode.h"
|
#include "GeckoCode.h"
|
||||||
#include "GeckoCodeConfig.h"
|
#include "GeckoCodeConfig.h"
|
||||||
#include "FileUtil.h"
|
#include "FileUtil.h"
|
||||||
|
#include "ConfigManager.h"
|
||||||
|
|
||||||
using namespace Common;
|
using namespace Common;
|
||||||
|
|
||||||
|
@ -166,22 +167,18 @@ int GetSpeedhackCycles(const u32 addr)
|
||||||
return iter->second;
|
return iter->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadPatches(const char *gameID)
|
void LoadPatches()
|
||||||
{
|
{
|
||||||
IniFile globalIni, localIni;
|
IniFile merged = SConfig::GetInstance().m_LocalCoreStartupParameter.LoadGameIni();
|
||||||
globalIni.Load(File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP + gameID + ".ini");
|
IniFile globalIni = SConfig::GetInstance().m_LocalCoreStartupParameter.LoadDefaultGameIni();
|
||||||
localIni.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + gameID + ".ini", true);
|
IniFile localIni = SConfig::GetInstance().m_LocalCoreStartupParameter.LoadLocalGameIni();
|
||||||
|
|
||||||
IniFile merged;
|
|
||||||
merged.Load(File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP + gameID + ".ini");
|
|
||||||
merged.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + gameID + ".ini", true);
|
|
||||||
|
|
||||||
LoadPatchSection("OnFrame", onFrame, globalIni, localIni);
|
LoadPatchSection("OnFrame", onFrame, globalIni, localIni);
|
||||||
ActionReplay::LoadCodes(globalIni, localIni, false);
|
ActionReplay::LoadCodes(globalIni, localIni, false);
|
||||||
|
|
||||||
// lil silly
|
// lil silly
|
||||||
std::vector<Gecko::GeckoCode> gcodes;
|
std::vector<Gecko::GeckoCode> gcodes;
|
||||||
Gecko::LoadCodes(localIni, gcodes);
|
Gecko::LoadCodes(globalIni, localIni, gcodes);
|
||||||
Gecko::SetActiveCodes(gcodes);
|
Gecko::SetActiveCodes(gcodes);
|
||||||
|
|
||||||
LoadSpeedhacks("Speedhacks", speedHacks, merged);
|
LoadSpeedhacks("Speedhacks", speedHacks, merged);
|
||||||
|
|
|
@ -39,7 +39,7 @@ struct Patch
|
||||||
int GetSpeedhackCycles(const u32 addr);
|
int GetSpeedhackCycles(const u32 addr);
|
||||||
void LoadPatchSection(const char *section, std::vector<Patch> &patches,
|
void LoadPatchSection(const char *section, std::vector<Patch> &patches,
|
||||||
IniFile &globalIni, IniFile &localIni);
|
IniFile &globalIni, IniFile &localIni);
|
||||||
void LoadPatches(const char *gameID);
|
void LoadPatches();
|
||||||
void ApplyFramePatches();
|
void ApplyFramePatches();
|
||||||
void ApplyARPatches();
|
void ApplyARPatches();
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
|
|
|
@ -25,6 +25,7 @@ public:
|
||||||
virtual bool GetTitleID(u8*) const { return false; }
|
virtual bool GetTitleID(u8*) const { return false; }
|
||||||
virtual void GetTMD(u8*, u32 *_sz) const { *_sz=0; }
|
virtual void GetTMD(u8*, u32 *_sz) const { *_sz=0; }
|
||||||
virtual std::string GetUniqueID() const = 0;
|
virtual std::string GetUniqueID() const = 0;
|
||||||
|
virtual std::string GetRevisionSpecificUniqueID() const { return ""; }
|
||||||
virtual std::string GetMakerID() const = 0;
|
virtual std::string GetMakerID() const = 0;
|
||||||
virtual int GetRevision() const { return 0; }
|
virtual int GetRevision() const { return 0; }
|
||||||
// TODO: eliminate?
|
// TODO: eliminate?
|
||||||
|
|
|
@ -54,6 +54,13 @@ std::string CVolumeGC::GetUniqueID() const
|
||||||
return ID;
|
return ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string CVolumeGC::GetRevisionSpecificUniqueID() const
|
||||||
|
{
|
||||||
|
char rev[16];
|
||||||
|
sprintf(rev, "r%d", GetRevision());
|
||||||
|
return GetUniqueID() + rev;
|
||||||
|
}
|
||||||
|
|
||||||
IVolume::ECountry CVolumeGC::GetCountry() const
|
IVolume::ECountry CVolumeGC::GetCountry() const
|
||||||
{
|
{
|
||||||
if (!m_pReader)
|
if (!m_pReader)
|
||||||
|
|
|
@ -20,6 +20,7 @@ public:
|
||||||
bool Read(u64 _Offset, u64 _Length, u8* _pBuffer) const;
|
bool Read(u64 _Offset, u64 _Length, u8* _pBuffer) const;
|
||||||
bool RAWRead(u64 _Offset, u64 _Length, u8* _pBuffer) const;
|
bool RAWRead(u64 _Offset, u64 _Length, u8* _pBuffer) const;
|
||||||
std::string GetUniqueID() const;
|
std::string GetUniqueID() const;
|
||||||
|
std::string GetRevisionSpecificUniqueID() const;
|
||||||
std::string GetMakerID() const;
|
std::string GetMakerID() const;
|
||||||
int GetRevision() const;
|
int GetRevision() const;
|
||||||
std::vector<std::string> GetNames() const;
|
std::vector<std::string> GetNames() const;
|
||||||
|
|
|
@ -242,10 +242,9 @@ void wxCheatsWindow::OnEvent_Close(wxCloseEvent& ev)
|
||||||
void wxCheatsWindow::UpdateGUI()
|
void wxCheatsWindow::UpdateGUI()
|
||||||
{
|
{
|
||||||
// load code
|
// load code
|
||||||
m_gameini_default_path = File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP + Core::g_CoreStartupParameter.GetUniqueID() + ".ini";
|
m_gameini_default = Core::g_CoreStartupParameter.LoadDefaultGameIni();
|
||||||
m_gameini_default.Load(m_gameini_default_path);
|
m_gameini_local = Core::g_CoreStartupParameter.LoadLocalGameIni();
|
||||||
m_gameini_local_path = File::GetUserPath(D_GAMESETTINGS_IDX) + Core::g_CoreStartupParameter.GetUniqueID() + ".ini";
|
m_gameini_local_path = Core::g_CoreStartupParameter.m_strGameIniLocal;
|
||||||
m_gameini_local.Load(m_gameini_local_path, true);
|
|
||||||
Load_ARCodes();
|
Load_ARCodes();
|
||||||
Load_GeckoCodes();
|
Load_GeckoCodes();
|
||||||
|
|
||||||
|
@ -286,7 +285,7 @@ void wxCheatsWindow::Load_ARCodes()
|
||||||
|
|
||||||
void wxCheatsWindow::Load_GeckoCodes()
|
void wxCheatsWindow::Load_GeckoCodes()
|
||||||
{
|
{
|
||||||
m_geckocode_panel->LoadCodes(m_gameini_local, Core::g_CoreStartupParameter.GetUniqueID(), true);
|
m_geckocode_panel->LoadCodes(m_gameini_default, m_gameini_local, Core::g_CoreStartupParameter.GetUniqueID(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxCheatsWindow::OnEvent_CheatsList_ItemSelected(wxCommandEvent& WXUNUSED (event))
|
void wxCheatsWindow::OnEvent_CheatsList_ItemSelected(wxCommandEvent& WXUNUSED (event))
|
||||||
|
|
|
@ -132,7 +132,6 @@ class wxCheatsWindow : public wxDialog
|
||||||
Gecko::CodeConfigPanel *m_geckocode_panel;
|
Gecko::CodeConfigPanel *m_geckocode_panel;
|
||||||
IniFile m_gameini_default;
|
IniFile m_gameini_default;
|
||||||
IniFile m_gameini_local;
|
IniFile m_gameini_local;
|
||||||
std::string m_gameini_default_path;
|
|
||||||
std::string m_gameini_local_path;
|
std::string m_gameini_local_path;
|
||||||
|
|
||||||
void Init_ChildControls();
|
void Init_ChildControls();
|
||||||
|
|
|
@ -81,13 +81,13 @@ void CodeConfigPanel::UpdateCodeList(bool checkRunning)
|
||||||
UpdateInfoBox(evt);
|
UpdateInfoBox(evt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeConfigPanel::LoadCodes(const IniFile& inifile, const std::string& gameid, bool checkRunning)
|
void CodeConfigPanel::LoadCodes(const IniFile& globalIni, const IniFile& localIni, const std::string& gameid, bool checkRunning)
|
||||||
{
|
{
|
||||||
m_gameid = gameid;
|
m_gameid = gameid;
|
||||||
|
|
||||||
m_gcodes.clear();
|
m_gcodes.clear();
|
||||||
if (!checkRunning || Core::IsRunning())
|
if (!checkRunning || Core::IsRunning())
|
||||||
Gecko::LoadCodes(inifile, m_gcodes);
|
Gecko::LoadCodes(globalIni, localIni, m_gcodes);
|
||||||
|
|
||||||
UpdateCodeList(checkRunning);
|
UpdateCodeList(checkRunning);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ public:
|
||||||
CodeConfigPanel(wxWindow* const parent);
|
CodeConfigPanel(wxWindow* const parent);
|
||||||
|
|
||||||
|
|
||||||
void LoadCodes(const IniFile& inifile, const std::string& gameid = "", bool checkRunning = false);
|
void LoadCodes(const IniFile& globalIni, const IniFile& localIni, const std::string& gameid = "", bool checkRunning = false);
|
||||||
const std::vector<GeckoCode>& GetCodes() const { return m_gcodes; }
|
const std::vector<GeckoCode>& GetCodes() const { return m_gcodes; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -110,6 +110,7 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
|
||||||
|
|
||||||
// Load game ini
|
// Load game ini
|
||||||
std::string _iniFilename = OpenISO->GetUniqueID();
|
std::string _iniFilename = OpenISO->GetUniqueID();
|
||||||
|
std::string _iniFilenameRevisionSpecific = OpenISO->GetRevisionSpecificUniqueID();
|
||||||
|
|
||||||
if (!_iniFilename.length())
|
if (!_iniFilename.length())
|
||||||
{
|
{
|
||||||
|
@ -123,9 +124,12 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
|
||||||
}
|
}
|
||||||
|
|
||||||
GameIniFileDefault = File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP + _iniFilename + ".ini";
|
GameIniFileDefault = File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP + _iniFilename + ".ini";
|
||||||
|
std::string GameIniFileDefaultRevisionSpecific = File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP + _iniFilenameRevisionSpecific + ".ini";
|
||||||
GameIniFileLocal = File::GetUserPath(D_GAMESETTINGS_IDX) + _iniFilename + ".ini";
|
GameIniFileLocal = File::GetUserPath(D_GAMESETTINGS_IDX) + _iniFilename + ".ini";
|
||||||
|
|
||||||
GameIniDefault.Load(GameIniFileDefault);
|
GameIniDefault.Load(GameIniFileDefault);
|
||||||
|
if (_iniFilenameRevisionSpecific != "")
|
||||||
|
GameIniDefault.Load(GameIniFileDefaultRevisionSpecific);
|
||||||
GameIniLocal.Load(GameIniFileLocal);
|
GameIniLocal.Load(GameIniFileLocal);
|
||||||
|
|
||||||
// Setup GUI
|
// Setup GUI
|
||||||
|
@ -1047,7 +1051,7 @@ void CISOProperties::LoadGameConfig()
|
||||||
|
|
||||||
PatchList_Load();
|
PatchList_Load();
|
||||||
ActionReplayList_Load();
|
ActionReplayList_Load();
|
||||||
m_geckocode_panel->LoadCodes(GameIniLocal, OpenISO->GetUniqueID());
|
m_geckocode_panel->LoadCodes(GameIniDefault, GameIniLocal, OpenISO->GetUniqueID());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CISOProperties::SaveGameIniValueFrom3StateCheckbox(const char* section, const char* key, wxCheckBox* checkbox)
|
void CISOProperties::SaveGameIniValueFrom3StateCheckbox(const char* section, const char* key, wxCheckBox* checkbox)
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "Core.h"
|
#include "Core.h"
|
||||||
#include "Movie.h"
|
#include "Movie.h"
|
||||||
#include "OnScreenDisplay.h"
|
#include "OnScreenDisplay.h"
|
||||||
|
#include "ConfigManager.h"
|
||||||
|
|
||||||
VideoConfig g_Config;
|
VideoConfig g_Config;
|
||||||
VideoConfig g_ActiveConfig;
|
VideoConfig g_ActiveConfig;
|
||||||
|
@ -120,7 +121,7 @@ void VideoConfig::Load(const char *ini_file)
|
||||||
OSD::AddMessage("Warning: Shader Debugging is enabled, performance will suffer heavily", 15000);
|
OSD::AddMessage("Warning: Shader Debugging is enabled, performance will suffer heavily", 15000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoConfig::GameIniLoad(const char* default_ini_file, const char* local_ini_file)
|
void VideoConfig::GameIniLoad()
|
||||||
{
|
{
|
||||||
bool gfx_override_exists = false;
|
bool gfx_override_exists = false;
|
||||||
|
|
||||||
|
@ -136,9 +137,7 @@ void VideoConfig::GameIniLoad(const char* default_ini_file, const char* local_in
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
IniFile iniFile;
|
IniFile iniFile = SConfig::GetInstance().m_LocalCoreStartupParameter.LoadGameIni();
|
||||||
iniFile.Load(default_ini_file);
|
|
||||||
iniFile.Load(local_ini_file, true);
|
|
||||||
|
|
||||||
CHECK_SETTING("Video_Hardware", "VSync", bVSync);
|
CHECK_SETTING("Video_Hardware", "VSync", bVSync);
|
||||||
|
|
||||||
|
|
|
@ -50,10 +50,9 @@ struct VideoConfig
|
||||||
{
|
{
|
||||||
VideoConfig();
|
VideoConfig();
|
||||||
void Load(const char *ini_file);
|
void Load(const char *ini_file);
|
||||||
void GameIniLoad(const char* default_ini, const char* game_ini);
|
void GameIniLoad();
|
||||||
void VerifyValidity();
|
void VerifyValidity();
|
||||||
void Save(const char *ini_file);
|
void Save(const char *ini_file);
|
||||||
void GameIniSave(const char* default_ini, const char* game_ini);
|
|
||||||
void UpdateProjectionHack();
|
void UpdateProjectionHack();
|
||||||
bool IsVSync();
|
bool IsVSync();
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,7 @@ bool VideoBackend::Initialize(void *&window_handle)
|
||||||
const SCoreStartupParameter& core_params = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
const SCoreStartupParameter& core_params = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||||
|
|
||||||
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_dx11.ini").c_str());
|
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_dx11.ini").c_str());
|
||||||
g_Config.GameIniLoad(core_params.m_strGameIniDefault.c_str(), core_params.m_strGameIniLocal.c_str());
|
g_Config.GameIniLoad();
|
||||||
g_Config.UpdateProjectionHack();
|
g_Config.UpdateProjectionHack();
|
||||||
g_Config.VerifyValidity();
|
g_Config.VerifyValidity();
|
||||||
UpdateActiveConfig();
|
UpdateActiveConfig();
|
||||||
|
|
|
@ -150,8 +150,7 @@ bool VideoBackend::Initialize(void *&window_handle)
|
||||||
frameCount = 0;
|
frameCount = 0;
|
||||||
|
|
||||||
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_dx9.ini").c_str());
|
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_dx9.ini").c_str());
|
||||||
g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIniDefault.c_str(),
|
g_Config.GameIniLoad();
|
||||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIniLocal.c_str());
|
|
||||||
g_Config.UpdateProjectionHack();
|
g_Config.UpdateProjectionHack();
|
||||||
g_Config.VerifyValidity();
|
g_Config.VerifyValidity();
|
||||||
// as only some driver/hardware configurations support dual source blending only enable it if is
|
// as only some driver/hardware configurations support dual source blending only enable it if is
|
||||||
|
|
|
@ -172,8 +172,7 @@ bool VideoBackend::Initialize(void *&window_handle)
|
||||||
frameCount = 0;
|
frameCount = 0;
|
||||||
|
|
||||||
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_opengl.ini").c_str());
|
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_opengl.ini").c_str());
|
||||||
g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIniDefault.c_str(),
|
g_Config.GameIniLoad();
|
||||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIniLocal.c_str());
|
|
||||||
g_Config.UpdateProjectionHack();
|
g_Config.UpdateProjectionHack();
|
||||||
g_Config.VerifyValidity();
|
g_Config.VerifyValidity();
|
||||||
UpdateActiveConfig();
|
UpdateActiveConfig();
|
||||||
|
|
Loading…
Reference in New Issue