patches: move verbose from ELF-log to Dev-verbose

improvements from the previous commit stay (less noisy, better reboot verbose)
This commit is contained in:
Avi Halachmi (:avih) 2015-01-19 10:12:12 +02:00
parent 6305d8d61e
commit 2da3e15aaa
2 changed files with 9 additions and 21 deletions

View File

@ -27,10 +27,6 @@
#include <wx/txtstrm.h> #include <wx/txtstrm.h>
#include <wx/zipstrm.h> #include <wx/zipstrm.h>
bool ElfConActive() {
return SysConsole.ELF.IsActive();
}
IniPatch Patch[ MAX_PATCH ]; IniPatch Patch[ MAX_PATCH ];
IniPatch Cheat[ MAX_CHEAT ]; IniPatch Cheat[ MAX_CHEAT ];
@ -201,17 +197,14 @@ static int LoadCheatsFiles(const wxDirName& folderName, wxString& fileSpec, cons
bool found = dir.GetFirst(&buffer, L"*", wxDIR_FILES); bool found = dir.GetFirst(&buffer, L"*", wxDIR_FILES);
while (found) { while (found) {
if (buffer.Upper().Matches(fileSpec.Upper())) { if (buffer.Upper().Matches(fileSpec.Upper())) {
if (ElfConActive()) DevCon.WriteLn(Color_Green, L"Found %s file: '%s'", WX_STR(friendlyName), WX_STR(buffer));
Console.WriteLn(Color_Green, L"Found %s file: '%s'", WX_STR(friendlyName), WX_STR(buffer));
int before = cheatnumber; int before = cheatnumber;
f.Open(Path::Combine(dir.GetName(), buffer)); f.Open(Path::Combine(dir.GetName(), buffer));
inifile_process(f); inifile_process(f);
f.Close(); f.Close();
int loaded = cheatnumber - before; int loaded = cheatnumber - before;
if (ElfConActive()) { DevCon.WriteLn((loaded ? Color_Green : Color_Gray), L"Loaded %d %s from '%s' at '%s'",
Console.WriteLn((loaded ? Color_Green : Color_Gray), L"Loaded %d %s from '%s' at '%s'", loaded, WX_STR(friendlyName), WX_STR(buffer), WX_STR(folderName.ToString()));
loaded, WX_STR(friendlyName), WX_STR(buffer), WX_STR(folderName.ToString()));
}
numberFoundCheatsFiles ++; numberFoundCheatsFiles ++;
} }
found = dir.GetNext(&buffer); found = dir.GetNext(&buffer);
@ -237,10 +230,8 @@ int LoadCheatsFromZip(wxString gameCRC, const wxString& cheatsArchiveFilename) {
wxString name = entry->GetName(); wxString name = entry->GetName();
name.MakeUpper(); name.MakeUpper();
if (name.Find(gameCRC) == 0 && name.Find(L".PNACH")+6u == name.Length()) { if (name.Find(gameCRC) == 0 && name.Find(L".PNACH")+6u == name.Length()) {
if (ElfConActive()) { DevCon.WriteLn(Color_Green, L"Loading patch '%s' from archive '%s'",
Console.WriteLn(Color_Green, L"Loading patch '%s' from archive '%s'", WX_STR(entry->GetName()), WX_STR(cheatsArchiveFilename));
WX_STR(entry->GetName()), WX_STR(cheatsArchiveFilename));
}
wxTextInputStream pnach(zip); wxTextInputStream pnach(zip);
while (!zip.Eof()) { while (!zip.Eof()) {
inifile_processString(pnach.ReadLine()); inifile_processString(pnach.ReadLine());
@ -271,8 +262,7 @@ int LoadCheats(wxString name, const wxDirName& folderName, const wxString& frien
Console.WriteLn(Color_Gray, L"Not found %s file: %s", WX_STR(friendlyName), WX_STR(pathName)); Console.WriteLn(Color_Gray, L"Not found %s file: %s", WX_STR(friendlyName), WX_STR(pathName));
} }
if (ElfConActive()) DevCon.WriteLn((loaded ? Color_Green : Color_Gray), L"Overall %d %s loaded", loaded, WX_STR(friendlyName));
Console.WriteLn((loaded ? Color_Green : Color_Gray), L"Overall %d %s loaded", loaded, WX_STR(friendlyName));
return loaded; return loaded;
} }
@ -295,8 +285,7 @@ namespace PatchFunc
{ {
void comment( const wxString& text1, const wxString& text2 ) void comment( const wxString& text1, const wxString& text2 )
{ {
if (ElfConActive()) DevCon.WriteLn(L"comment: " + text2);
Console.WriteLn(L"comment: " + text2);
} }
struct PatchPieces struct PatchPieces
@ -324,8 +313,7 @@ namespace PatchFunc
// (translated) messages for display in a popup window then we'll have to upgrade the // (translated) messages for display in a popup window then we'll have to upgrade the
// exception a little bit. // exception a little bit.
if (ElfConActive()) DevCon.WriteLn(cmd + L" " + param);
Console.WriteLn(cmd + L" " + param);
try try
{ {

View File

@ -398,7 +398,7 @@ void AppCoreThread::ApplySettings( const Pcsx2Config& src )
wxString cheats_ws_archive = Path::Combine(PathDefs::GetProgramDataDir(), wxFileName(L"cheats_ws.zip")); wxString cheats_ws_archive = Path::Combine(PathDefs::GetProgramDataDir(), wxFileName(L"cheats_ws.zip"));
if (numberDbfCheatsLoaded = LoadCheatsFromZip(gameCRC, cheats_ws_archive)) { if (numberDbfCheatsLoaded = LoadCheatsFromZip(gameCRC, cheats_ws_archive)) {
if (verbose || SysConsole.ELF.IsActive()) if (verbose || DevConWriterEnabled)
Console.WriteLn(Color_Green, "(Wide Screen Cheats DB) Patches Loaded: %d", numberDbfCheatsLoaded); Console.WriteLn(Color_Green, "(Wide Screen Cheats DB) Patches Loaded: %d", numberDbfCheatsLoaded);
gameWsHacks.Printf(L" [%d widescreen hacks]", numberDbfCheatsLoaded); gameWsHacks.Printf(L" [%d widescreen hacks]", numberDbfCheatsLoaded);
} }