From 8fef9fc0c38681dfbe3666eb1417bcc508b4acbc Mon Sep 17 00:00:00 2001 From: arcum42 Date: Fri, 26 Feb 2010 09:07:26 +0000 Subject: [PATCH] spu2-x: Start working on the debug settings a bit. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2645 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/spu2-x/src/Linux/Config.cpp | 4 +-- plugins/spu2-x/src/Linux/ConfigDebug.cpp | 39 +++++++++++++++++++----- plugins/spu2-x/src/Linux/Dialogs.cpp | 2 +- plugins/spu2-x/src/Linux/Dialogs.h | 7 +++++ 4 files changed, 41 insertions(+), 11 deletions(-) diff --git a/plugins/spu2-x/src/Linux/Config.cpp b/plugins/spu2-x/src/Linux/Config.cpp index f914006d54..ba7a64ffbf 100644 --- a/plugins/spu2-x/src/Linux/Config.cpp +++ b/plugins/spu2-x/src/Linux/Config.cpp @@ -63,7 +63,7 @@ void ReadSettings() PortaudioOut->ReadSettings(); SoundtouchCfg::ReadSettings(); - //DebugConfig::ReadSettings(); + DebugConfig::ReadSettings(); // Sanity Checks // ------------- @@ -87,7 +87,7 @@ void WriteSettings() PortaudioOut->WriteSettings(); SoundtouchCfg::WriteSettings(); - //DebugConfig::WriteSettings(); + DebugConfig::WriteSettings(); } void advanced_dialog() diff --git a/plugins/spu2-x/src/Linux/ConfigDebug.cpp b/plugins/spu2-x/src/Linux/ConfigDebug.cpp index f32f927c1e..da82fbb17d 100644 --- a/plugins/spu2-x/src/Linux/ConfigDebug.cpp +++ b/plugins/spu2-x/src/Linux/ConfigDebug.cpp @@ -45,10 +45,22 @@ wchar_t CoresDumpFileName[255]; wchar_t MemDumpFileName[255]; wchar_t RegDumpFileName[255]; -/*namespace DebugConfig { +namespace DebugConfig { static const wchar_t* Section = L"DEBUG"; +static void set_default_filenames() +{ + swprintf(AccessLogFileName, 255, L"logs/SPU2Log.txt"); + swprintf(WaveLogFileName, 255, L"logs/SPU2log.wav"); + swprintf(DMA4LogFileName, 255, L"logs/logs/SPU2dma4.dat"); + swprintf(DMA7LogFileName, 255, L"logs/SPU2dma7.dat"); + + swprintf(CoresDumpFileName, 255, L"logs/SPU2Cores.txt"); + swprintf(MemDumpFileName, 255, L"logs/SPU2mem.dat"); + swprintf(RegDumpFileName, 255, L"logs/SPU2regs.dat"); +} + void ReadSettings() { DebugEnabled = CfgReadBool(Section, L"Global_Enable",0); @@ -67,15 +79,16 @@ void ReadSettings() _CoresDump = CfgReadBool(Section, L"Dump_Info",0); _MemDump = CfgReadBool(Section, L"Dump_Memory",0); _RegDump = CfgReadBool(Section, L"Dump_Regs",0); - - CfgReadStr(Section,L"Access_Log_Filename",AccessLogFileName,255,L"logs/SPU2Log.txt"); + + set_default_filenames(); + /*CfgReadStr(Section,L"Access_Log_Filename",AccessLogFileName,255,L"logs/SPU2Log.txt"); CfgReadStr(Section,L"WaveLog_Filename", WaveLogFileName, 255,L"logs/SPU2log.wav"); CfgReadStr(Section,L"DMA4Log_Filename", DMA4LogFileName, 255,L"logs/SPU2dma4.dat"); CfgReadStr(Section,L"DMA7Log_Filename", DMA7LogFileName, 255,L"logs/SPU2dma7.dat"); CfgReadStr(Section,L"Info_Dump_Filename",CoresDumpFileName,255,L"logs/SPU2Cores.txt"); CfgReadStr(Section,L"Mem_Dump_Filename", MemDumpFileName, 255,L"logs/SPU2mem.dat"); - CfgReadStr(Section,L"Reg_Dump_Filename", RegDumpFileName, 255,L"logs/SPU2regs.dat"); + CfgReadStr(Section,L"Reg_Dump_Filename", RegDumpFileName, 255,L"logs/SPU2regs.dat");*/ } @@ -98,13 +111,23 @@ void WriteSettings() CfgWriteBool(Section,L"Dump_Info", _CoresDump); CfgWriteBool(Section,L"Dump_Memory",_MemDump); CfgWriteBool(Section,L"Dump_Regs", _RegDump); - - CfgWriteStr(Section,L"Access_Log_Filename",AccessLogFileName); + + set_default_filenames(); + /*CfgWriteStr(Section,L"Access_Log_Filename",AccessLogFileName); CfgWriteStr(Section,L"WaveLog_Filename", WaveLogFileName); CfgWriteStr(Section,L"DMA4Log_Filename", DMA4LogFileName); CfgWriteStr(Section,L"DMA7Log_Filename", DMA7LogFileName); CfgWriteStr(Section,L"Info_Dump_Filename",CoresDumpFileName); CfgWriteStr(Section,L"Mem_Dump_Filename", MemDumpFileName); - CfgWriteStr(Section,L"Reg_Dump_Filename", RegDumpFileName); -}*/ + CfgWriteStr(Section,L"Reg_Dump_Filename", RegDumpFileName);*/ + +} + +void DisplayDialog() +{ + ReadSettings(); + WriteSettings(); +} + +} diff --git a/plugins/spu2-x/src/Linux/Dialogs.cpp b/plugins/spu2-x/src/Linux/Dialogs.cpp index 58c6dbce2d..61189e3019 100644 --- a/plugins/spu2-x/src/Linux/Dialogs.cpp +++ b/plugins/spu2-x/src/Linux/Dialogs.cpp @@ -55,7 +55,7 @@ void SysMessage(const wchar_t *fmt, ...) GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, - "%s", msg); + "%s", msg.ToUTF8().data()); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); } diff --git a/plugins/spu2-x/src/Linux/Dialogs.h b/plugins/spu2-x/src/Linux/Dialogs.h index 20e62c5662..1084a6de6b 100644 --- a/plugins/spu2-x/src/Linux/Dialogs.h +++ b/plugins/spu2-x/src/Linux/Dialogs.h @@ -21,6 +21,13 @@ #include "../Global.h" #include "../Config.h" +namespace DebugConfig +{ + extern void ReadSettings(); + extern void WriteSettings(); + extern void DisplayDialog(); +} + extern void CfgSetSettingsDir(const char* dir); extern void CfgWriteBool(const wchar_t* Section, const wchar_t* Name, bool Value);