- Added eeRoundMode and vuRoundMode options to the game database (these options are only applied if patches are enabled)

- Rename game database to "GameIndex.dbf"


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3029 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
cottonvibes 2010-05-16 09:50:15 +00:00
parent 8d6532a987
commit 16dfd5c9fc
5 changed files with 38 additions and 11 deletions

View File

@ -31,10 +31,18 @@
-- 6 = Perfect
---------------------------------------------
-- Patches
-- Round Modes (eeRoundMode = n and vuRoundMode = n)
---------------------------------------------
-- The rounding modes are numerically based.
-- 0 = Nearest
-- 1 = Negative Infinity
-- 2 = Positive Infinity
-- 3 = Chop (Zero)
---------------------------------------------
-- Patches ([patches] or [patches = crc])
---------------------------------------------
-- Patches must be specified in blocks.
-- [patches] or [patches = crc] is acceptable.
-- The blocks must end with a [/patch] tag.
-- The block tags must be on their own lines.
-- pcsx2 only loads the first [patches] block that matches the game.
@ -2797,11 +2805,12 @@ Serial = SLUS-20294
Name = Gitaroo Man
Region = NTSC-U
Compat = 5
eeRoundMode = 1
vuRoundMode = 3
[patches = 7130C553]
comment=Skip Videos
roundmode=DOWN,CHOP
//Skip Videos
patch=0,EE,0012aa28,word,24020001
@ -15477,11 +15486,12 @@ Serial = SLPM-65012
Name = Gitaroo Man
Region = NTSC-J
Compat = 5
eeRoundMode = 1
vuRoundMode = 3
[patches = C1767D64]
comment=patch by parotaku
roundmode=DOWN,CHOP
//Skip Videos (sceMpegIsEnd)
patch=0,EE,0012ea48,word,24020001

View File

@ -357,7 +357,7 @@ static __forceinline void _reloadElfInfo(wxString elfpath)
if (GameDB->setGame(gameSerial.ToUTF8().data())) { // Game Found
Console.WriteLn ("Game = %s (%s)", GameDB->getString("Name").c_str(), GameDB->getString("Region").c_str());
}
else Console.Warning("Game not found in database [%s]", gameSerial.ToAscii().data());
else Console.Warning(L"Game not found in database [%s]", gameSerial.c_str());
}
}
@ -546,7 +546,7 @@ void cdvdReset()
cdvd.RTC.month = (u8)curtime.GetMonth(wxDateTime::GMT9) + 1; // WX returns Jan as "0"
cdvd.RTC.year = (u8)(curtime.GetYear(wxDateTime::GMT9) - 2000);
GameDB = new DataBase_Loader("DataBase.dbf");
GameDB = new DataBase_Loader("GameIndex.dbf");
}
struct Freeze_v10Compat

View File

@ -15,6 +15,7 @@
#pragma once
#include "File_Reader.h"
#include "Patch.h"
struct key_pair {
string key;
@ -280,7 +281,7 @@ public:
// Gets a wxString representation of the 'value' for the given key
wxString getStringWX(string key) {
string s = getString(key);
return wxString(fromAscii(s.c_str()));
return wxString(fromUTF8(s.c_str()));
}
// Gets a double representation of the 'value' for the given key
@ -372,4 +373,20 @@ static wxString compatToStringWX(int compat) {
}
}
static void loadGameSettings(DataBase_Loader* gameDB) {
if (gameDB && gameDB->gameLoaded()) {
SSE_MXCSR eeMX = EmuConfig.Cpu.sseMXCSR;
SSE_MXCSR vuMX = EmuConfig.Cpu.sseVUMXCSR;
int eeRM = eeMX.GetRoundMode();
int vuRM = vuMX.GetRoundMode();
bool rm = 0;
if (gameDB->keyExists("eeRoundMode")) { eeRM = gameDB->getInt("eeRoundMode"); rm=1; }
if (gameDB->keyExists("vuRoundMode")) { vuRM = gameDB->getInt("vuRoundMode"); rm=1; }
if (rm && eeRM<4 && vuRM<4) {
Console.WriteLn("Game DataBase: Changing roundmodes!");
SetRoundMode((SSE_RoundMode)eeRM, (SSE_RoundMode)vuRM);
}
}
}
extern ScopedPtr<DataBase_Loader> GameDB;

View File

@ -128,7 +128,7 @@ public:
}
wxString getLineWX() {
ss->getline(buff, sizeof(buff));
return wxString(fromAscii(buff));
return wxString(fromUTF8(buff));
}
bool finished() {
return ss->eof() || ss->fail();

View File

@ -596,12 +596,12 @@ void __fastcall eeGameStarting()
wxString pString( wxsFormat( L"%d", patches ) );
gamePatch = L" [Patches = " + pString + L"]";
}
loadGameSettings(GameDB);
}
Console.SetTitle(gameName + gameSerial + gameCompat + gamePatch);
GetMTGS().SendGameCRC(ElfCRC);
g_GameStarted = true;
}