mirror of https://github.com/PCSX2/pcsx2.git
- Console TitleBar mentions how much patches were loaded (if no patches loaded then it doesn't say anything)
- Database key searching is no-longer case-sensitive (so for example: [patch = A1B2C3D4] is the same as [Patch = a1b2c3d4]) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3024 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
9b4239d81a
commit
ed9b0a3715
|
@ -541,7 +541,7 @@ void cdvdReset()
|
||||||
cdvd.RTC.month = (u8)curtime.GetMonth(wxDateTime::GMT9) + 1; // WX returns Jan as "0"
|
cdvd.RTC.month = (u8)curtime.GetMonth(wxDateTime::GMT9) + 1; // WX returns Jan as "0"
|
||||||
cdvd.RTC.year = (u8)(curtime.GetYear(wxDateTime::GMT9) - 2000);
|
cdvd.RTC.year = (u8)(curtime.GetYear(wxDateTime::GMT9) - 2000);
|
||||||
|
|
||||||
GameDB = new DataBase_Loader("DataBase.dbf", "Serial");
|
GameDB = new DataBase_Loader("DataBase.dbf");
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Freeze_v10Compat
|
struct Freeze_v10Compat
|
||||||
|
|
|
@ -77,6 +77,20 @@ private:
|
||||||
ss >> tString;
|
ss >> tString;
|
||||||
return tString;
|
return tString;
|
||||||
}
|
}
|
||||||
|
string toLower(string s) {
|
||||||
|
for (uint i = 0; i < s.length(); i++) {
|
||||||
|
char& c = s[i];
|
||||||
|
if (c >= 'A' && c <= 'Z') {
|
||||||
|
c += 'a' - 'A';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
bool strCompare(string& s1, string& s2) {
|
||||||
|
string t1 = toLower(s1);
|
||||||
|
string t2 = toLower(s2);
|
||||||
|
return !t1.compare(t2);
|
||||||
|
}
|
||||||
bool isComment(string& s) {
|
bool isComment(string& s) {
|
||||||
string sub = s.substr(0, 2);
|
string sub = s.substr(0, 2);
|
||||||
return (sub.compare("--") == 0) || (sub.compare("//") == 0);
|
return (sub.compare("--") == 0) || (sub.compare("//") == 0);
|
||||||
|
@ -141,7 +155,7 @@ public:
|
||||||
String_Stream header; // Header of the database
|
String_Stream header; // Header of the database
|
||||||
string baseKey; // Key to separate games by ("Serial")
|
string baseKey; // Key to separate games by ("Serial")
|
||||||
|
|
||||||
DataBase_Loader(string file, string key, string value = "") {
|
DataBase_Loader(string file, string key = "Serial", string value = "") {
|
||||||
curGame = NULL;
|
curGame = NULL;
|
||||||
baseKey = key;
|
baseKey = key;
|
||||||
if (!fileExists(file)) {
|
if (!fileExists(file)) {
|
||||||
|
@ -191,8 +205,8 @@ public:
|
||||||
bool setGame(string id) {
|
bool setGame(string id) {
|
||||||
deque<Game_Data*>::iterator it = gList.begin();
|
deque<Game_Data*>::iterator it = gList.begin();
|
||||||
for ( ; it != gList.end(); ++it) {
|
for ( ; it != gList.end(); ++it) {
|
||||||
if (!it[0]->id.compare(id)) {
|
if (strCompare(it[0]->id, id)) {
|
||||||
curGame = it[0];
|
curGame = it[0];
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -237,7 +251,7 @@ public:
|
||||||
if (curGame) {
|
if (curGame) {
|
||||||
deque<key_pair>::iterator it = curGame->kList.begin();
|
deque<key_pair>::iterator it = curGame->kList.begin();
|
||||||
for ( ; it != curGame->kList.end(); ++it) {
|
for ( ; it != curGame->kList.end(); ++it) {
|
||||||
if (!it[0].key.compare(key)) {
|
if (strCompare(it[0].key, key)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,7 +265,7 @@ public:
|
||||||
if (curGame) {
|
if (curGame) {
|
||||||
deque<key_pair>::iterator it = curGame->kList.begin();
|
deque<key_pair>::iterator it = curGame->kList.begin();
|
||||||
for ( ; it != curGame->kList.end(); ++it) {
|
for ( ; it != curGame->kList.end(); ++it) {
|
||||||
if (!it[0].key.compare(key)) {
|
if (strCompare(it[0].key, key)) {
|
||||||
return it[0].value;
|
return it[0].value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -301,7 +315,7 @@ public:
|
||||||
if (curGame) {
|
if (curGame) {
|
||||||
deque<key_pair>::iterator it = curGame->kList.begin();
|
deque<key_pair>::iterator it = curGame->kList.begin();
|
||||||
for ( ; it != curGame->kList.end(); ++it) {
|
for ( ; it != curGame->kList.end(); ++it) {
|
||||||
if (!it[0].key.compare(key)) {
|
if (strCompare(it[0].key, key)) {
|
||||||
it[0].value = value;
|
it[0].value = value;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -526,10 +526,11 @@ void ApplyPatch(int place)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitPatch(const wxString& crc)
|
int InitPatch(const wxString& crc)
|
||||||
{
|
{
|
||||||
inifile_read(crc);
|
inifile_read(crc);
|
||||||
Console.WriteLn("patchnumber: %d", patchnumber);
|
Console.WriteLn("patchnumber: %d", patchnumber);
|
||||||
|
return patchnumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetPatch( void )
|
void ResetPatch( void )
|
||||||
|
|
|
@ -59,7 +59,7 @@ void inifile_read( const wxString& name );
|
||||||
void inifile_command( const wxString& cmd );
|
void inifile_command( const wxString& cmd );
|
||||||
void inifile_trim( wxString& buffer );
|
void inifile_trim( wxString& buffer );
|
||||||
|
|
||||||
void InitPatch(const wxString& crc);
|
int InitPatch(const wxString& crc);
|
||||||
int AddPatch(int Mode, int Place, int Address, int Size, u64 data);
|
int AddPatch(int Mode, int Place, int Address, int Size, u64 data);
|
||||||
void ApplyPatch( int place = 1);
|
void ApplyPatch( int place = 1);
|
||||||
void ResetPatch( void );
|
void ResetPatch( void );
|
||||||
|
|
|
@ -581,6 +581,7 @@ void __fastcall eeGameStarting()
|
||||||
wxString gameName = L"Unknown Game (\?\?\?)";
|
wxString gameName = L"Unknown Game (\?\?\?)";
|
||||||
wxString gameSerial = L" [" + DiscID + L"]";
|
wxString gameSerial = L" [" + DiscID + L"]";
|
||||||
wxString gameCompat = L" [Status = Unknown]";
|
wxString gameCompat = L" [Status = Unknown]";
|
||||||
|
wxString gamePatch = L"";
|
||||||
|
|
||||||
if (GameDB && GameDB->gameLoaded()) {
|
if (GameDB && GameDB->gameLoaded()) {
|
||||||
int compat = GameDB->getInt("Compat");
|
int compat = GameDB->getInt("Compat");
|
||||||
|
@ -588,11 +589,17 @@ void __fastcall eeGameStarting()
|
||||||
gameName += L" (" + GameDB->getStringWX("Region") + L")";
|
gameName += L" (" + GameDB->getStringWX("Region") + L")";
|
||||||
gameCompat = L" [Status = "+compatToStringWX(compat)+L"]";
|
gameCompat = L" [Status = "+compatToStringWX(compat)+L"]";
|
||||||
}
|
}
|
||||||
|
|
||||||
// this title can be overwritten by patches if they set the gametitle key
|
if (EmuConfig.EnablePatches) {
|
||||||
Console.SetTitle(gameName + gameSerial + gameCompat);
|
int patches = InitPatch(gameCRC);
|
||||||
|
if (patches) {
|
||||||
if (EmuConfig.EnablePatches) InitPatch(gameCRC);
|
wxString pString( wxsFormat( L"%d", patches ) );
|
||||||
|
gamePatch = L" [Patches = " + pString + L"]";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.SetTitle(gameName + gameSerial + gameCompat + gamePatch);
|
||||||
|
|
||||||
GetMTGS().SendGameCRC(ElfCRC);
|
GetMTGS().SendGameCRC(ElfCRC);
|
||||||
|
|
||||||
g_GameStarted = true;
|
g_GameStarted = true;
|
||||||
|
|
|
@ -320,6 +320,18 @@
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Game DataBase"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\DataBase_Loader.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\File_Reader.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Docs"
|
Name="Docs"
|
||||||
|
@ -1281,18 +1293,6 @@
|
||||||
RelativePath="..\..\CDVD\IsoFileTools.h"
|
RelativePath="..\..\CDVD\IsoFileTools.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<Filter
|
|
||||||
Name="Game DataBase"
|
|
||||||
>
|
|
||||||
<File
|
|
||||||
RelativePath="..\..\DataBase_Loader.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\..\File_Reader.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
</Filter>
|
|
||||||
</Filter>
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
|
|
Loading…
Reference in New Issue