Fixed the database reader in Linux again (by moving the check into a better location). Got rid of some unused Patch code.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3013 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2010-05-15 06:51:10 +00:00
parent 00f7cde4e0
commit 427206a97c
4 changed files with 18 additions and 26 deletions

View File

@ -22,10 +22,12 @@ struct key_pair {
key_pair(string _key, string _value)
: key(_key) , value(_value) {}
string toString() {
string t;
string t;
if (key[0] == '[') {
t = key + "\n";
t += value;
t += value;
stringstream ss(key);
string t2;
ss >> t2;
@ -92,15 +94,15 @@ private:
keyPair.key = line;
}
for(;;) {
t = reader.getLine();
t = reader.getLine();
int eol = t.rfind("\r");
if (eol != string::npos) t = t.substr(0, eol);
if (!t.compare(endString)) break;
keyPair.value += t + "\n";
}
}
void extract(string& line, key_pair& keyPair, File_Reader& reader) {
int eol = line.rfind("\r");
if (eol != string::npos) line = line.substr(0, eol);
void extract(string& line, key_pair& keyPair, File_Reader& reader) {
stringstream ss(line);
string t;
keyPair.key = "";

View File

@ -61,8 +61,13 @@ public:
string getLine() {
if (fs->eof()) throw 1;
fs->getline(buff, sizeof(buff));
if (fs->fail()) throw 1;
return string(buff);
if (fs->fail()) throw 1;
string ret(buff);
int eol = ret.rfind("\r");
if (eol != string::npos) ret = ret.substr(0, eol);
return ret;
}
template<class T> void readLine(T& str) {
if (fs->eof()) throw 1;

View File

@ -27,7 +27,7 @@ u32 SkipCount = 0, IterationCount = 0;
u32 IterationIncrement = 0, ValueIncrement = 0;
u32 PrevCheatType = 0, PrevCheatAddr = 0,LastType = 0;
int g_ZeroGSOptions = 0, patchnumber;
int patchnumber;
wxString strgametitle;
@ -43,17 +43,11 @@ static const PatchTextTable commands[] =
{ 1, L"comment", PatchFunc::comment },
{ 2, L"gametitle", PatchFunc::gametitle },
{ 3, L"patch", PatchFunc::patch },
{ 4, L"fastmemory", NULL }, // enable for faster but bugger mem (mvc2 is faster)
{ 5, L"roundmode", PatchFunc::roundmode }, // changes rounding mode for floating point
{ 4, L"roundmode", PatchFunc::roundmode }, // changes rounding mode for floating point
// syntax: roundmode=X,Y
// possible values for X,Y: NEAR, DOWN, UP, CHOP
// X - EE rounding mode (default is NEAR)
// Y - VU rounding mode (default is CHOP)
{ 6, L"zerogs", PatchFunc::zerogs }, // zerogs=hex
{ 7, L"vunanmode", NULL },
{ 8, L"ffxhack", NULL}, // *obsolete*
{ 9, L"xkickdelay", NULL},
{ 0, wxEmptyString, NULL } // Array Terminator
};
@ -724,12 +718,6 @@ namespace PatchFunc
SetRoundMode(eetype,vutype);
}
void zerogs(const wxString& cmd, const wxString& param)
{
DevCon.WriteLn( cmd + L" " + param);
g_ZeroGSOptions = StrToU32(param, 16);
}
}
void PrintRoundMode(SSE_RoundMode ee, SSE_RoundMode vu)

View File

@ -53,7 +53,6 @@ namespace PatchFunc
PATCHTABLEFUNC gametitle;
PATCHTABLEFUNC patch;
PATCHTABLEFUNC roundmode;
PATCHTABLEFUNC zerogs;
}
void inifile_read( const wxString& name );
@ -65,8 +64,6 @@ int AddPatch(int Mode, int Place, int Address, int Size, u64 data);
void ApplyPatch( int place = 1);
void ResetPatch( void );
extern int g_ZeroGSOptions;
void SetRoundMode(SSE_RoundMode ee, SSE_RoundMode vu);
#endif /* __PATCH_H__ */