diff --git a/bin/DataBase.dbf b/bin/DataBase.dbf index 031a0ab7ab..089c7f35e0 100644 --- a/bin/DataBase.dbf +++ b/bin/DataBase.dbf @@ -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 --------------------------------------------- diff --git a/pcsx2/DataBase_Loader.h b/pcsx2/DataBase_Loader.h index d96415b193..1d3e7f5683 100644 --- a/pcsx2/DataBase_Loader.h +++ b/pcsx2/DataBase_Loader.h @@ -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); diff --git a/pcsx2/R5900.cpp b/pcsx2/R5900.cpp index 9b2cc75e7c..db945bfa5c 100644 --- a/pcsx2/R5900.cpp +++ b/pcsx2/R5900.cpp @@ -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);