added EmuState so you can place the function games.ini had in your game's ini. also renamed the Patches folder to GameIni (thx nakee, toroise was beeing an a**)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@708 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
daco65 2008-09-26 13:51:00 +00:00
parent 4e2eaf599a
commit 9e9c3700b2
2 changed files with 53 additions and 2 deletions

View File

@ -78,7 +78,7 @@ bool BootCore(const std::string& _rFilename)
// Load overrides
IniFile ini;
std::string unique_id = StartUp.GetUniqueID();
if (unique_id.size() == 6 && ini.Load(("Patches/" + unique_id + ".ini").c_str()))
if (unique_id.size() == 6 && ini.Load(("GameIni/" + unique_id + ".ini").c_str()))
{
ini.Get("Core", "UseDualCore", &StartUp.bUseDualCore, StartUp.bUseDualCore);
ini.Get("Core", "SkipIdle", &StartUp.bSkipIdle, StartUp.bSkipIdle);

View File

@ -28,6 +28,7 @@
#include "GameListCtrl.h"
#include "Blob.h"
#include "FilesystemViewer.h"
#include "IniFile.h"
#if USE_XPM_BITMAPS
#include "../resources/Flag_Europe.xpm"
@ -251,6 +252,54 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
item.SetTextColour(wxColour(0xFF0000));
SetItem(item);
}
//emulation status = COLUMN_EMULATION_STATE
{
wxListItem item;
item.SetId(ItemIndex);
IniFile ini;
std::string EmuState;
std::string GameIni;
item.SetColumn(COLUMN_EMULATION_STATE);
//NOTE (Daco): i dont like the fact of having so much ini's just to have
//the game emulation state of every game you have.
GameIni = "GameIni/" + (rISOFile.GetUniqueID()) + ".ini";
ini.Load(GameIni.c_str());
ini.Get("EmuState","EmulationStateId",&EmuState);
if (EmuState.empty())
{
//srry, its empty
//item.SetText("unknown");
//without unknown it looks more pretty :P
}
else
{
if(EmuState == "5")
item.SetText("Perfect");
else if(EmuState == "4")
item.SetText("In Game");
else if(EmuState == "3")
item.SetText("Intro");
else if(EmuState == "2")
{
item.SetText("Problems: Other");
//NOTE (Daco): IMO under 2 i see problems like music and games that only work
//with GL or only with DX9
//TODO (Daco): maybe 2 should get a function to present more info... o.o
}
else if(EmuState == "1")
item.SetText("Broken");
else if(EmuState == "0")
item.SetText("Not Set");
else
{
//if the EmuState isn't a number between 0 & 5 we dont know the state
//hence why it should say unknown
item.SetText("unknown emu ID");
}
}
SetItem(item);
}
#ifndef __WXMSW__
// country
@ -636,11 +685,13 @@ void CGameListCtrl::OnEditPatchFile(wxCommandEvent& WXUNUSED (event))
const GameListItem *iso = GetSelectedISO();
if (!iso)
return;
std::string filename = "Patches/" + iso->GetUniqueID() + ".ini";
std::string filename = "GameIni/" + iso->GetUniqueID() + ".ini";
if (!File::Exists(filename.c_str())) {
if (AskYesNo("%s.ini does not exist. Do you want to create it?", iso->GetUniqueID().c_str())) {
FILE *f = fopen(filename.c_str(), "w");
fprintf(f, "# %s - %s\r\n\r\n", iso->GetUniqueID().c_str(), iso->GetName().c_str());
fprintf(f, "[EmuState]\n#The Emulation State.\n");
fprintf(f, "EmulationStateId = 0\n");
fprintf(f, "[OnFrame]\r\n#Add memory patches here.\r\n\r\n");
fprintf(f, "[ActionReplay]\r\n#Add decrypted action replay cheats here.\r\n");
fclose(f);