diff --git a/common/include/PS2Eext.h b/common/include/PS2Eext.h index 4f4fd5c4a8..1435f0fd57 100644 --- a/common/include/PS2Eext.h +++ b/common/include/PS2Eext.h @@ -135,9 +135,9 @@ struct PluginConf fclose(ConfFile); } - int ReadInt(std::string item) + int ReadInt(const std::string& item, int defval) { - int value = -1; + int value = defval; std::string buf = item + " = %d\n"; if (ConfFile) fscanf(ConfFile, buf.c_str(), &value); diff --git a/plugins/FWnull/Config.cpp b/plugins/FWnull/Config.cpp index 41232040a5..e2ebeb5586 100644 --- a/plugins/FWnull/Config.cpp +++ b/plugins/FWnull/Config.cpp @@ -62,7 +62,7 @@ void LoadConfig() return; } - conf.Log = Ini.ReadInt("logging"); + conf.Log = Ini.ReadInt("logging", 0); setLoggingState(); Ini.Close(); } diff --git a/plugins/USBnull/Config.cpp b/plugins/USBnull/Config.cpp index 941540e832..fef2ec9e51 100644 --- a/plugins/USBnull/Config.cpp +++ b/plugins/USBnull/Config.cpp @@ -62,7 +62,7 @@ void LoadConfig() return; } - conf.Log = Ini.ReadInt("logging"); + conf.Log = Ini.ReadInt("logging", 0); setLoggingState(); Ini.Close(); } diff --git a/plugins/USBnull/USB.cpp b/plugins/USBnull/USB.cpp index 3d6675b71a..7a80920fb8 100644 --- a/plugins/USBnull/USB.cpp +++ b/plugins/USBnull/USB.cpp @@ -100,10 +100,13 @@ EXPORT_C_(u8) USBread8(u32 addr) switch(addr) { // Handle any appropriate addresses here. - case 0x1f801600: USBLog.WriteLn("*Unknown 8 bit read at address %lx", addr); break; + case 0x1f801600: + USBLog.WriteLn("(USBnull) 8 bit read at address %lx", addr); + break; + default: //value = usbRu8(addr); - USBLog.WriteLn("*Unknown 8 bit read at address %lx", addr); + USBLog.WriteLn("*(USBnull) 8 bit read at address %lx", addr); break; } return value; @@ -116,10 +119,13 @@ EXPORT_C_(u16) USBread16(u32 addr) switch(addr) { // Handle any appropriate addresses here. - case 0x1f801600: USBLog.WriteLn("*Unknown 16 bit read at address %lx", addr); break; + case 0x1f801600: + USBLog.WriteLn("(USBnull) 16 bit read at address %lx", addr); + break; + default: //value = usbRu16(addr); - USBLog.WriteLn("*Unknown 16 bit read at address %lx", addr); + USBLog.WriteLn("(USBnull) 16 bit read at address %lx", addr); } return value; } @@ -131,10 +137,13 @@ EXPORT_C_(u32) USBread32(u32 addr) switch(addr) { // Handle any appropriate addresses here. - case 0x1f801600: USBLog.WriteLn("*Unknown 32 bit read at address %lx", addr); break; + case 0x1f801600: + USBLog.WriteLn("(USBnull) 32 bit read at address %lx", addr); + break; + default: //value = usbRu32(addr); - USBLog.WriteLn("*Unknown 32 bit read at address %lx", addr); + USBLog.WriteLn("(USBnull) 32 bit read at address %lx", addr); } return value; } @@ -144,10 +153,13 @@ EXPORT_C_(void) USBwrite8(u32 addr, u8 value) switch(addr) { // Handle any appropriate addresses here. - case 0x1f801600: USBLog.WriteLn("*Unknown 8 bit write at address %lx value %x", addr, value); break; + case 0x1f801600: + USBLog.WriteLn("(USBnull) 8 bit write at address %lx value %x", addr, value); + break; + default: //usbRu8(addr) = value; - USBLog.WriteLn("*Unknown 8 bit write at address %lx value %x", addr, value); + USBLog.WriteLn("(USBnull) 8 bit write at address %lx value %x", addr, value); } } @@ -156,10 +168,13 @@ EXPORT_C_(void) USBwrite16(u32 addr, u16 value) switch(addr) { // Handle any appropriate addresses here. - case 0x1f801600: USBLog.WriteLn("*Unknown 8 bit write at address %lx value %x", addr, value); break; + case 0x1f801600: + USBLog.WriteLn("(USBnull) 16 bit write at address %lx value %x", addr, value); + break; + default: //usbRu16(addr) = value; - USBLog.WriteLn("*Unknown 16 bit write at address %lx value %x", addr, value); + USBLog.WriteLn("(USBnull) 16 bit write at address %lx value %x", addr, value); } } @@ -168,10 +183,13 @@ EXPORT_C_(void) USBwrite32(u32 addr, u32 value) switch(addr) { // Handle any appropriate addresses here. - case 0x1f801600: USBLog.WriteLn("*Unknown 8 bit write at address %lx value %x", addr, value); break; + case 0x1f801600: + USBLog.WriteLn("(USBnull) 16 bit write at address %lx value %x", addr, value); + break; + default: //usbRu32(addr) = value; - USBLog.WriteLn("*Unknown 32 bit write at address %lx value %x", addr, value); + USBLog.WriteLn("(USBnull) 32 bit write at address %lx value %x", addr, value); } } diff --git a/plugins/dev9null/Config.cpp b/plugins/dev9null/Config.cpp index 4cc20a6ad4..f86b41ecd9 100644 --- a/plugins/dev9null/Config.cpp +++ b/plugins/dev9null/Config.cpp @@ -62,7 +62,7 @@ void LoadConfig() return; } - conf.Log = Ini.ReadInt("logging"); + conf.Log = Ini.ReadInt("logging",0); Ini.Close(); }