Get the console title-bar to say "Unknown Game" if the game wasn't found in the database...

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3001 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
cottonvibes 2010-05-13 22:04:52 +00:00
parent cbb865632d
commit 70a247674d
3 changed files with 27 additions and 11 deletions

View File

@ -18,6 +18,18 @@
-- All comments must be written in this header or they will not be
-- saved properly by pcsx2's database writer.
---------------------------------------------
-- Compatibility Status (Compat = n)
---------------------------------------------
-- The compatibility info is numerically based.
-- 0 = Unknown Compatibility Status
-- 1 = Nothing
-- 2 = Intro
-- 3 = Menu
-- 4 = In-game
-- 5 = Playable
-- 6 = Perfect
---------------------------------------------
-- Game List
---------------------------------------------

View File

@ -163,6 +163,13 @@ public:
return false;
}
// Returns true if a game is currently loaded into the database
// Returns false if otherwise (this means you need to call setGame()
// or it could mean the game was not found in the database at all...)
bool gameLoaded() {
return !!curGame;
}
// Saves changes to the database
void saveToFile(string file = "DataBase.dbf") {
File_Writer writer(file);

View File

@ -578,22 +578,19 @@ void __fastcall eeGameStarting()
{
if (!g_GameStarted && ElfCRC) {
wxString gameCRC( wxsFormat( L"%8.8x", ElfCRC ) );
wxString gameName;
if (GameDB) {
wxString gameName = L"Unknown Game (\?\?\?)";
wxString gameSerial = L" [" + DiscID + L"]";
wxString gameCompat = L" [Status = Unknown]";
if (GameDB && GameDB->gameLoaded()) {
int compat = GameDB->getInt("Compat");
gameName = GameDB->getStringWX("Name");
gameName += L" (" + GameDB->getStringWX("Region") + L")";
gameName += L" [" + DiscID + L"]";
gameName += L" [Status = "+compatToStringWX(compat)+L"]";
}
else {
gameName += L" [" + DiscID + L"]";
gameName += L" [" + gameCRC + L"]";
gameName += L" [Status = Unknown]";
gameName += L" (" + GameDB->getStringWX("Region") + L")";
gameCompat = L" [Status = "+compatToStringWX(compat)+L"]";
}
// if patches found the following title will be overwritten
Console.SetTitle(gameName);
Console.SetTitle(gameName + gameSerial + gameCompat);
if (EmuConfig.EnablePatches) InitPatch(gameCRC);
GetMTGS().SendGameCRC(ElfCRC);