mirror of https://github.com/RPCS3/rpcs3.git
Improved LogFrame.
This commit is contained in:
parent
af219bb415
commit
b6ac09aa1a
|
@ -297,7 +297,7 @@ void CPUThread::ExecOnce()
|
||||||
|
|
||||||
void CPUThread::Task()
|
void CPUThread::Task()
|
||||||
{
|
{
|
||||||
if (Ini.HLELogging.GetValue()) ConLog.Write("%s enter", CPUThread::GetFName().c_str());
|
if (Ini.LogAllSysCalls.GetValue()) ConLog.Write("%s enter", CPUThread::GetFName().c_str());
|
||||||
|
|
||||||
const std::vector<u64>& bp = Emu.GetBreakPoints();
|
const std::vector<u64>& bp = Emu.GetBreakPoints();
|
||||||
|
|
||||||
|
@ -359,7 +359,7 @@ void CPUThread::Task()
|
||||||
ConLog.Success("Exit Code: %d", exitcode);
|
ConLog.Success("Exit Code: %d", exitcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Ini.HLELogging.GetValue()) ConLog.Write("%s leave", CPUThread::GetFName().c_str());
|
if (Ini.LogAllSysCalls.GetValue()) ConLog.Write("%s leave", CPUThread::GetFName().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
s64 CPUThread::ExecAsCallback(u64 pc, bool wait, u64 a1, u64 a2, u64 a3, u64 a4) // not multithread-safe
|
s64 CPUThread::ExecAsCallback(u64 pc, bool wait, u64 a1, u64 a2, u64 a3, u64 a4) // not multithread-safe
|
||||||
|
|
|
@ -69,7 +69,7 @@ private:
|
||||||
{
|
{
|
||||||
SysCalls::DoSyscall(CPU.GPR[11]);
|
SysCalls::DoSyscall(CPU.GPR[11]);
|
||||||
|
|
||||||
if(Ini.HLELogging.GetValue())
|
if (Ini.LogAllSysCalls.GetValue())
|
||||||
{
|
{
|
||||||
ConLog.Warning("SysCall[0x%llx] done with code [0x%llx]! #pc: 0x%llx", CPU.GPR[11], CPU.GPR[3], CPU.PC);
|
ConLog.Warning("SysCall[0x%llx] done with code [0x%llx]! #pc: 0x%llx", CPU.GPR[11], CPU.GPR[3], CPU.PC);
|
||||||
if(CPU.GPR[11] > 1024)
|
if(CPU.GPR[11] > 1024)
|
||||||
|
@ -2097,7 +2097,7 @@ private:
|
||||||
case 0x2: SysCall(); break;
|
case 0x2: SysCall(); break;
|
||||||
case 0x3:
|
case 0x3:
|
||||||
StaticExecute(CPU.GPR[11]);
|
StaticExecute(CPU.GPR[11]);
|
||||||
if (Ini.HLELogging.GetValue())
|
if (Ini.LogAllSysCalls.GetValue())
|
||||||
{
|
{
|
||||||
ConLog.Write("'%s' done with code[0x%llx]! #pc: 0x%llx",
|
ConLog.Write("'%s' done with code[0x%llx]! #pc: 0x%llx",
|
||||||
g_static_funcs_list[CPU.GPR[11]]->name, CPU.GPR[3], CPU.PC);
|
g_static_funcs_list[CPU.GPR[11]]->name, CPU.GPR[3], CPU.PC);
|
||||||
|
|
|
@ -251,7 +251,7 @@ u32 RawSPUThread::GetIndex() const
|
||||||
|
|
||||||
void RawSPUThread::Task()
|
void RawSPUThread::Task()
|
||||||
{
|
{
|
||||||
if (Ini.HLELogging.GetValue()) ConLog.Write("%s enter", PPCThread::GetFName().c_str());
|
if (Ini.LogAllSysCalls.GetValue()) ConLog.Write("%s enter", PPCThread::GetFName().c_str());
|
||||||
|
|
||||||
const std::vector<u64>& bp = Emu.GetBreakPoints();
|
const std::vector<u64>& bp = Emu.GetBreakPoints();
|
||||||
|
|
||||||
|
@ -334,5 +334,5 @@ void RawSPUThread::Task()
|
||||||
ConLog.Error("Exception: %s", e);
|
ConLog.Error("Exception: %s", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Ini.HLELogging.GetValue()) ConLog.Write("%s leave", PPCThread::GetFName().c_str());
|
if (Ini.LogAllSysCalls.GetValue()) ConLog.Write("%s leave", PPCThread::GetFName().c_str());
|
||||||
}
|
}
|
||||||
|
|
|
@ -649,7 +649,7 @@ public:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Ini.HLELogging.GetValue() || rec->s)
|
if (Ini.LogAllSysCalls.GetValue() || rec->s)
|
||||||
ConLog.Write("*** list element(%d/%d): s = 0x%x, ts = 0x%x, low ea = 0x%x (lsa = 0x%x)",
|
ConLog.Write("*** list element(%d/%d): s = 0x%x, ts = 0x%x, low ea = 0x%x (lsa = 0x%x)",
|
||||||
i, list_size, (u16)rec->s, (u16)rec->ts, (u32)rec->ea, lsa | (addr & 0xf));
|
i, list_size, (u16)rec->s, (u16)rec->ts, (u32)rec->ea, lsa | (addr & 0xf));
|
||||||
|
|
||||||
|
@ -693,7 +693,7 @@ public:
|
||||||
case MFC_PUTR_CMD: // ???
|
case MFC_PUTR_CMD: // ???
|
||||||
case MFC_GET_CMD:
|
case MFC_GET_CMD:
|
||||||
{
|
{
|
||||||
if (Ini.HLELogging.GetValue()) ConLog.Write("DMA %s%s%s%s: lsa = 0x%x, ea = 0x%llx, tag = 0x%x, size = 0x%x, cmd = 0x%x",
|
if (Ini.LogAllSysCalls.GetValue()) ConLog.Write("DMA %s%s%s%s: lsa = 0x%x, ea = 0x%llx, tag = 0x%x, size = 0x%x, cmd = 0x%x",
|
||||||
(op & MFC_PUT_CMD ? "PUT" : "GET"),
|
(op & MFC_PUT_CMD ? "PUT" : "GET"),
|
||||||
(op & MFC_RESULT_MASK ? "R" : ""),
|
(op & MFC_RESULT_MASK ? "R" : ""),
|
||||||
(op & MFC_BARRIER_MASK ? "B" : ""),
|
(op & MFC_BARRIER_MASK ? "B" : ""),
|
||||||
|
@ -708,7 +708,7 @@ public:
|
||||||
case MFC_PUTRL_CMD: // ???
|
case MFC_PUTRL_CMD: // ???
|
||||||
case MFC_GETL_CMD:
|
case MFC_GETL_CMD:
|
||||||
{
|
{
|
||||||
if (Ini.HLELogging.GetValue()) ConLog.Write("DMA %s%s%s%s: lsa = 0x%x, list = 0x%llx, tag = 0x%x, size = 0x%x, cmd = 0x%x",
|
if (Ini.LogAllSysCalls.GetValue()) ConLog.Write("DMA %s%s%s%s: lsa = 0x%x, list = 0x%llx, tag = 0x%x, size = 0x%x, cmd = 0x%x",
|
||||||
(op & MFC_PUT_CMD ? "PUT" : "GET"),
|
(op & MFC_PUT_CMD ? "PUT" : "GET"),
|
||||||
(op & MFC_RESULT_MASK ? "RL" : "L"),
|
(op & MFC_RESULT_MASK ? "RL" : "L"),
|
||||||
(op & MFC_BARRIER_MASK ? "B" : ""),
|
(op & MFC_BARRIER_MASK ? "B" : ""),
|
||||||
|
@ -724,7 +724,7 @@ public:
|
||||||
case MFC_PUTLLUC_CMD:
|
case MFC_PUTLLUC_CMD:
|
||||||
case MFC_PUTQLLUC_CMD:
|
case MFC_PUTQLLUC_CMD:
|
||||||
{
|
{
|
||||||
if (Ini.HLELogging.GetValue() || size != 128) ConLog.Write("DMA %s: lsa=0x%x, ea = 0x%llx, (tag) = 0x%x, (size) = 0x%x, cmd = 0x%x",
|
if (Ini.LogAllSysCalls.GetValue() || size != 128) ConLog.Write("DMA %s: lsa=0x%x, ea = 0x%llx, (tag) = 0x%x, (size) = 0x%x, cmd = 0x%x",
|
||||||
(op == MFC_GETLLAR_CMD ? "GETLLAR" :
|
(op == MFC_GETLLAR_CMD ? "GETLLAR" :
|
||||||
op == MFC_PUTLLC_CMD ? "PUTLLC" :
|
op == MFC_PUTLLC_CMD ? "PUTLLC" :
|
||||||
op == MFC_PUTLLUC_CMD ? "PUTLLUC" : "PUTQLLUC"),
|
op == MFC_PUTLLUC_CMD ? "PUTLLUC" : "PUTQLLUC"),
|
||||||
|
@ -921,7 +921,7 @@ public:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Ini.HLELogging.GetValue())
|
if (Ini.LogAllSysCalls.GetValue())
|
||||||
{
|
{
|
||||||
ConLog.Write("sys_spu_thread_send_event(spup=%d, data0=0x%x, data1=0x%x)", spup, v & 0x00ffffff, data);
|
ConLog.Write("sys_spu_thread_send_event(spup=%d, data0=0x%x, data1=0x%x)", spup, v & 0x00ffffff, data);
|
||||||
}
|
}
|
||||||
|
@ -1143,7 +1143,7 @@ public:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Ini.HLELogging.GetValue())
|
if (Ini.LogAllSysCalls.GetValue())
|
||||||
{
|
{
|
||||||
ConLog.Write("sys_spu_thread_receive_event(spuq=0x%x)", spuq);
|
ConLog.Write("sys_spu_thread_receive_event(spuq=0x%x)", spuq);
|
||||||
}
|
}
|
||||||
|
@ -1208,7 +1208,7 @@ public:
|
||||||
{
|
{
|
||||||
ConLog.Error("sys_spu_thread_exit (no status, code 0x102)");
|
ConLog.Error("sys_spu_thread_exit (no status, code 0x102)");
|
||||||
}
|
}
|
||||||
else if (Ini.HLELogging.GetValue())
|
else if (Ini.LogAllSysCalls.GetValue())
|
||||||
{
|
{
|
||||||
// the real exit status
|
// the real exit status
|
||||||
ConLog.Write("sys_spu_thread_exit (status=0x%x)", SPU.Out_MBox.GetValue());
|
ConLog.Write("sys_spu_thread_exit (status=0x%x)", SPU.Out_MBox.GetValue());
|
||||||
|
|
|
@ -445,7 +445,7 @@ void Module::SetName(const std::string& name)
|
||||||
|
|
||||||
void Module::Log(const u32 id, std::string fmt, ...)
|
void Module::Log(const u32 id, std::string fmt, ...)
|
||||||
{
|
{
|
||||||
if(Ini.HLELogging.GetValue())
|
if(Ini.LogAllSysCalls.GetValue())
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
va_start(list, fmt);
|
va_start(list, fmt);
|
||||||
|
@ -456,7 +456,7 @@ void Module::Log(const u32 id, std::string fmt, ...)
|
||||||
|
|
||||||
void Module::Log(std::string fmt, ...)
|
void Module::Log(std::string fmt, ...)
|
||||||
{
|
{
|
||||||
if(Ini.HLELogging.GetValue())
|
if (Ini.LogAllSysCalls.GetValue())
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
va_start(list, fmt);
|
va_start(list, fmt);
|
||||||
|
|
|
@ -555,8 +555,8 @@ void default_syscall()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case 1000:
|
case 1000:
|
||||||
Ini.HLELogging.SetValue(!Ini.HLELogging.GetValue());
|
Ini.LogAllSysCalls.SetValue(!Ini.LogAllSysCalls.GetValue());
|
||||||
ConLog.Warning("Log %s", (Ini.HLELogging.GetValue() ? "enabled" : "disabled"));
|
ConLog.Warning("Log %s", (Ini.LogAllSysCalls.GetValue() ? "enabled" : "disabled"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ public:
|
||||||
|
|
||||||
void Log(const u32 id, std::string fmt, ...)
|
void Log(const u32 id, std::string fmt, ...)
|
||||||
{
|
{
|
||||||
if(Ini.HLELogging.GetValue())
|
if (Ini.LogAllSysCalls.GetValue())
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
va_start(list, fmt);
|
va_start(list, fmt);
|
||||||
|
@ -57,7 +57,7 @@ public:
|
||||||
|
|
||||||
void Log(std::string fmt, ...)
|
void Log(std::string fmt, ...)
|
||||||
{
|
{
|
||||||
if(Ini.HLELogging.GetValue())
|
if(Ini.LogAllSysCalls.GetValue())
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
va_start(list, fmt);
|
va_start(list, fmt);
|
||||||
|
|
|
@ -9,6 +9,11 @@
|
||||||
LogWriter ConLog;
|
LogWriter ConLog;
|
||||||
LogFrame* ConLogFrame;
|
LogFrame* ConLogFrame;
|
||||||
|
|
||||||
|
enum LogIDs
|
||||||
|
{
|
||||||
|
id_log_level = 0x888,
|
||||||
|
};
|
||||||
|
|
||||||
std::mutex g_cs_conlog;
|
std::mutex g_cs_conlog;
|
||||||
|
|
||||||
static const uint max_item_count = 500;
|
static const uint max_item_count = 500;
|
||||||
|
@ -122,7 +127,8 @@ void LogWriter::WriteToLog(const std::string& prefix, const std::string& value,
|
||||||
if(m_logfile.IsOpened() && !new_prefix.empty())
|
if(m_logfile.IsOpened() && !new_prefix.empty())
|
||||||
m_logfile.Write(fmt::FromUTF8("[" + new_prefix + "]: " + value + "\n"));
|
m_logfile.Write(fmt::FromUTF8("[" + new_prefix + "]: " + value + "\n"));
|
||||||
|
|
||||||
if(!ConLogFrame || Ini.HLELogLvl.GetValue() == 4 || (lvl != 0 && lvl <= Ini.HLELogLvl.GetValue()))
|
|
||||||
|
if(!ConLogFrame)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock(g_cs_conlog);
|
std::lock_guard<std::mutex> lock(g_cs_conlog);
|
||||||
|
@ -163,15 +169,26 @@ void LogWriter::SkipLn()
|
||||||
WriteToLog("", "", 0);
|
WriteToLog("", "", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(LogFrame, wxPanel)
|
BEGIN_EVENT_TABLE(LogFrame, FrameBase)
|
||||||
EVT_CLOSE(LogFrame::OnQuit)
|
EVT_CLOSE(LogFrame::OnQuit)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
LogFrame::LogFrame(wxWindow* parent)
|
LogFrame::LogFrame()
|
||||||
: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(600, 500))
|
: FrameBase(nullptr, wxID_ANY, "Log Frame", "LogFrame", wxSize(600, 500))
|
||||||
, ThreadBase("LogThread")
|
, ThreadBase("LogThread")
|
||||||
, m_log(*new wxListView(this))
|
, m_log(*new wxListView(this))
|
||||||
{
|
{
|
||||||
|
wxMenuBar* menubar = new wxMenuBar();
|
||||||
|
|
||||||
|
wxMenu* menu_log_settings = new wxMenu();
|
||||||
|
menubar->Append(menu_log_settings, "Settings");
|
||||||
|
menu_log_settings->Append(id_log_level, "Log Level");
|
||||||
|
SetMenuBar(menubar);
|
||||||
|
|
||||||
|
//events
|
||||||
|
Bind(wxEVT_MENU, &LogFrame::Settings, this, id_log_level);
|
||||||
|
Bind(wxEVT_SIZE, &LogFrame::UpdateListSize, this);
|
||||||
|
|
||||||
m_log.InsertColumn(0, wxEmptyString);
|
m_log.InsertColumn(0, wxEmptyString);
|
||||||
m_log.InsertColumn(1, "Log");
|
m_log.InsertColumn(1, "Log");
|
||||||
m_log.SetBackgroundColour(wxColour("Black"));
|
m_log.SetBackgroundColour(wxColour("Black"));
|
||||||
|
@ -245,3 +262,72 @@ void LogFrame::OnQuit(wxCloseEvent& event)
|
||||||
ConLogFrame = nullptr;
|
ConLogFrame = nullptr;
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LogFrame::Settings(wxCommandEvent& WXUNUSED(event))
|
||||||
|
{
|
||||||
|
bool paused = false;
|
||||||
|
|
||||||
|
if (Emu.IsRunning())
|
||||||
|
{
|
||||||
|
Emu.Pause();
|
||||||
|
paused = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxDialog diag(this, wxID_ANY, "Settings", wxDefaultPosition);
|
||||||
|
static const u32 height = 400;
|
||||||
|
static const u32 width = 385;
|
||||||
|
|
||||||
|
wxStaticBoxSizer* s_round_log_level = new wxStaticBoxSizer(wxVERTICAL, &diag, _("Log Level"));
|
||||||
|
wxBoxSizer* s_panel = new wxBoxSizer(wxVERTICAL);
|
||||||
|
wxBoxSizer* s_subpanel_loglvl = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
|
wxCheckBox* chbox_log_write = new wxCheckBox(&diag, wxID_ANY, "Write");
|
||||||
|
wxCheckBox* chbox_log_error = new wxCheckBox(&diag, wxID_ANY, "Error");
|
||||||
|
wxCheckBox* chbox_log_warning = new wxCheckBox(&diag, wxID_ANY, "Warning");
|
||||||
|
wxCheckBox* chbox_log_success = new wxCheckBox(&diag, wxID_ANY, "Success");
|
||||||
|
wxCheckBox* chbox_hle_logging = new wxCheckBox(&diag, wxID_ANY, "Log all SysCalls");
|
||||||
|
|
||||||
|
s_round_log_level->Add(chbox_log_write, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
|
s_round_log_level->Add(chbox_log_error, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
|
s_round_log_level->Add(chbox_log_warning, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
|
s_round_log_level->Add(chbox_log_success, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
|
s_round_log_level->AddSpacer(20);
|
||||||
|
s_round_log_level->Add(chbox_hle_logging, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
|
|
||||||
|
// get values from .ini
|
||||||
|
chbox_log_write->SetValue(Ini.LogWrite.GetValue());
|
||||||
|
chbox_log_warning->SetValue(Ini.LogWarning.GetValue());
|
||||||
|
chbox_log_error->SetValue(Ini.LogError.GetValue());
|
||||||
|
chbox_log_success->SetValue(Ini.LogSuccess.GetValue());
|
||||||
|
chbox_hle_logging->SetValue(Ini.LogAllSysCalls.GetValue());
|
||||||
|
|
||||||
|
s_subpanel_loglvl->Add(s_round_log_level, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
|
|
||||||
|
wxBoxSizer* s_b_panel(new wxBoxSizer(wxHORIZONTAL));
|
||||||
|
s_b_panel->Add(new wxButton(&diag, wxID_OK), wxSizerFlags().Border(wxALL, 5).Bottom());
|
||||||
|
s_b_panel->Add(new wxButton(&diag, wxID_CANCEL), wxSizerFlags().Border(wxALL, 5).Bottom());
|
||||||
|
|
||||||
|
s_panel->Add(s_subpanel_loglvl);
|
||||||
|
s_panel->Add(s_b_panel);
|
||||||
|
|
||||||
|
diag.SetSizerAndFit(s_panel);
|
||||||
|
|
||||||
|
if (diag.ShowModal() == wxID_OK)
|
||||||
|
{
|
||||||
|
Ini.LogWrite.SetValue(chbox_log_write->GetValue());
|
||||||
|
Ini.LogWarning.SetValue(chbox_log_warning->GetValue());
|
||||||
|
Ini.LogError.SetValue(chbox_log_error->GetValue());
|
||||||
|
Ini.LogSuccess.SetValue(chbox_log_success->GetValue());
|
||||||
|
Ini.LogAllSysCalls.SetValue(chbox_hle_logging->GetValue());
|
||||||
|
|
||||||
|
Ini.Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (paused) Emu.Resume();
|
||||||
|
}
|
||||||
|
|
||||||
|
void LogFrame::UpdateListSize(wxSizeEvent& event)
|
||||||
|
{
|
||||||
|
m_log.SetSize(this->GetSize());
|
||||||
|
event.Skip();
|
||||||
|
}
|
|
@ -19,13 +19,20 @@ public:
|
||||||
template <typename ...Arg>
|
template <typename ...Arg>
|
||||||
void Write(const std::string &fmt, Arg&&... args)
|
void Write(const std::string &fmt, Arg&&... args)
|
||||||
{
|
{
|
||||||
|
if (!Ini.LogWrite.GetValue())
|
||||||
|
return;
|
||||||
|
|
||||||
std::string frmt = fmt::Format(fmt, std::forward<Arg>(args)...);
|
std::string frmt = fmt::Format(fmt, std::forward<Arg>(args)...);
|
||||||
|
|
||||||
WriteToLog("!", frmt, 2);
|
WriteToLog("!", frmt, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename ...Arg>
|
template <typename ...Arg>
|
||||||
void Error(const std::string &fmt, Arg&&... args)
|
void Error(const std::string &fmt, Arg&&... args)
|
||||||
{
|
{
|
||||||
|
if (!Ini.LogError.GetValue())
|
||||||
|
return;
|
||||||
|
|
||||||
std::string frmt = fmt::Format(fmt, std::forward<Arg>(args)...);
|
std::string frmt = fmt::Format(fmt, std::forward<Arg>(args)...);
|
||||||
WriteToLog("E", frmt, 4);
|
WriteToLog("E", frmt, 4);
|
||||||
}
|
}
|
||||||
|
@ -33,6 +40,9 @@ public:
|
||||||
template <typename ...Arg>
|
template <typename ...Arg>
|
||||||
void Warning(const std::string &fmt, Arg&&... args)
|
void Warning(const std::string &fmt, Arg&&... args)
|
||||||
{
|
{
|
||||||
|
if (!Ini.LogWarning.GetValue())
|
||||||
|
return;
|
||||||
|
|
||||||
std::string frmt = fmt::Format(fmt, std::forward<Arg>(args)...);
|
std::string frmt = fmt::Format(fmt, std::forward<Arg>(args)...);
|
||||||
WriteToLog("W", frmt, 3);
|
WriteToLog("W", frmt, 3);
|
||||||
}
|
}
|
||||||
|
@ -40,6 +50,9 @@ public:
|
||||||
template <typename ...Arg>
|
template <typename ...Arg>
|
||||||
void Success(const std::string &fmt, Arg&&... args)
|
void Success(const std::string &fmt, Arg&&... args)
|
||||||
{
|
{
|
||||||
|
if (!Ini.LogSuccess.GetValue())
|
||||||
|
return;
|
||||||
|
|
||||||
std::string frmt = fmt::Format(fmt, std::forward<Arg>(args)...);
|
std::string frmt = fmt::Format(fmt, std::forward<Arg>(args)...);
|
||||||
WriteToLog("S", frmt, 1);
|
WriteToLog("S", frmt, 1);
|
||||||
}
|
}
|
||||||
|
@ -48,13 +61,13 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
class LogFrame
|
class LogFrame
|
||||||
: public wxPanel
|
: public FrameBase
|
||||||
, public ThreadBase
|
, public ThreadBase
|
||||||
{
|
{
|
||||||
wxListView& m_log;
|
wxListView& m_log;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LogFrame(wxWindow* parent);
|
LogFrame();
|
||||||
~LogFrame();
|
~LogFrame();
|
||||||
|
|
||||||
bool Close(bool force = false);
|
bool Close(bool force = false);
|
||||||
|
@ -62,6 +75,8 @@ public:
|
||||||
private:
|
private:
|
||||||
virtual void Task();
|
virtual void Task();
|
||||||
|
|
||||||
|
void Settings(wxCommandEvent& event);
|
||||||
|
void UpdateListSize(wxSizeEvent& event);
|
||||||
void OnQuit(wxCloseEvent& event);
|
void OnQuit(wxCloseEvent& event);
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE();
|
DECLARE_EVENT_TABLE();
|
||||||
|
|
|
@ -103,10 +103,9 @@ MainFrame::MainFrame()
|
||||||
// Panels
|
// Panels
|
||||||
m_game_viewer = new GameViewer(this);
|
m_game_viewer = new GameViewer(this);
|
||||||
m_debugger_frame = new DebuggerPanel(this);
|
m_debugger_frame = new DebuggerPanel(this);
|
||||||
ConLogFrame = new LogFrame(this);
|
ConLogFrame = new LogFrame;
|
||||||
|
|
||||||
AddPane(m_game_viewer, "Game List", wxAUI_DOCK_BOTTOM);
|
AddPane(m_game_viewer, "Game List", wxAUI_DOCK_BOTTOM);
|
||||||
AddPane(ConLogFrame, "Log", wxAUI_DOCK_BOTTOM);
|
|
||||||
AddPane(m_debugger_frame, "Debugger", wxAUI_DOCK_RIGHT);
|
AddPane(m_debugger_frame, "Debugger", wxAUI_DOCK_RIGHT);
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
|
@ -392,9 +391,6 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
||||||
// Audio
|
// Audio
|
||||||
wxStaticBoxSizer* s_round_audio_out = new wxStaticBoxSizer(wxVERTICAL, p_audio, _("Audio Out"));
|
wxStaticBoxSizer* s_round_audio_out = new wxStaticBoxSizer(wxVERTICAL, p_audio, _("Audio Out"));
|
||||||
|
|
||||||
// HLE / Misc.
|
|
||||||
wxStaticBoxSizer* s_round_hle_log_lvl = new wxStaticBoxSizer(wxVERTICAL, p_hle, _("Log Level"));
|
|
||||||
|
|
||||||
// System
|
// System
|
||||||
wxStaticBoxSizer* s_round_sys_lang = new wxStaticBoxSizer(wxVERTICAL, p_system, _("Language"));
|
wxStaticBoxSizer* s_round_sys_lang = new wxStaticBoxSizer(wxVERTICAL, p_system, _("Language"));
|
||||||
|
|
||||||
|
@ -407,7 +403,6 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
||||||
wxComboBox* cbox_keyboard_handler = new wxComboBox(p_io, wxID_ANY);
|
wxComboBox* cbox_keyboard_handler = new wxComboBox(p_io, wxID_ANY);
|
||||||
wxComboBox* cbox_mouse_handler = new wxComboBox(p_io, wxID_ANY);
|
wxComboBox* cbox_mouse_handler = new wxComboBox(p_io, wxID_ANY);
|
||||||
wxComboBox* cbox_audio_out = new wxComboBox(p_audio, wxID_ANY);
|
wxComboBox* cbox_audio_out = new wxComboBox(p_audio, wxID_ANY);
|
||||||
wxComboBox* cbox_hle_loglvl = new wxComboBox(p_hle, wxID_ANY);
|
|
||||||
wxComboBox* cbox_sys_lang = new wxComboBox(p_system, wxID_ANY);
|
wxComboBox* cbox_sys_lang = new wxComboBox(p_system, wxID_ANY);
|
||||||
|
|
||||||
wxCheckBox* chbox_cpu_ignore_rwerrors = new wxCheckBox(p_cpu, wxID_ANY, "Ignore Read/Write errors");
|
wxCheckBox* chbox_cpu_ignore_rwerrors = new wxCheckBox(p_cpu, wxID_ANY, "Ignore Read/Write errors");
|
||||||
|
@ -418,7 +413,6 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
||||||
wxCheckBox* chbox_gs_vsync = new wxCheckBox(p_graphics, wxID_ANY, "VSync");
|
wxCheckBox* chbox_gs_vsync = new wxCheckBox(p_graphics, wxID_ANY, "VSync");
|
||||||
wxCheckBox* chbox_audio_dump = new wxCheckBox(p_audio, wxID_ANY, "Dump to file");
|
wxCheckBox* chbox_audio_dump = new wxCheckBox(p_audio, wxID_ANY, "Dump to file");
|
||||||
wxCheckBox* chbox_audio_conv = new wxCheckBox(p_audio, wxID_ANY, "Convert to 16 bit");
|
wxCheckBox* chbox_audio_conv = new wxCheckBox(p_audio, wxID_ANY, "Convert to 16 bit");
|
||||||
wxCheckBox* chbox_hle_logging = new wxCheckBox(p_hle, wxID_ANY, "Log all SysCalls");
|
|
||||||
wxCheckBox* chbox_hle_hook_stfunc = new wxCheckBox(p_hle, wxID_ANY, "Hook static functions");
|
wxCheckBox* chbox_hle_hook_stfunc = new wxCheckBox(p_hle, wxID_ANY, "Hook static functions");
|
||||||
wxCheckBox* chbox_hle_savetty = new wxCheckBox(p_hle, wxID_ANY, "Save TTY output to file");
|
wxCheckBox* chbox_hle_savetty = new wxCheckBox(p_hle, wxID_ANY, "Save TTY output to file");
|
||||||
wxCheckBox* chbox_hle_exitonstop = new wxCheckBox(p_hle, wxID_ANY, "Exit RPCS3 when process finishes");
|
wxCheckBox* chbox_hle_exitonstop = new wxCheckBox(p_hle, wxID_ANY, "Exit RPCS3 when process finishes");
|
||||||
|
@ -462,12 +456,6 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
||||||
cbox_audio_out->Append("Null");
|
cbox_audio_out->Append("Null");
|
||||||
cbox_audio_out->Append("OpenAL");
|
cbox_audio_out->Append("OpenAL");
|
||||||
|
|
||||||
cbox_hle_loglvl->Append("All");
|
|
||||||
cbox_hle_loglvl->Append("Success");
|
|
||||||
cbox_hle_loglvl->Append("Warnings");
|
|
||||||
cbox_hle_loglvl->Append("Errors");
|
|
||||||
cbox_hle_loglvl->Append("Nothing");
|
|
||||||
|
|
||||||
cbox_sys_lang->Append("Japanese");
|
cbox_sys_lang->Append("Japanese");
|
||||||
cbox_sys_lang->Append("English (US)");
|
cbox_sys_lang->Append("English (US)");
|
||||||
cbox_sys_lang->Append("French");
|
cbox_sys_lang->Append("French");
|
||||||
|
@ -497,7 +485,6 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
||||||
chbox_gs_vsync ->SetValue(Ini.GSVSyncEnable.GetValue());
|
chbox_gs_vsync ->SetValue(Ini.GSVSyncEnable.GetValue());
|
||||||
chbox_audio_dump ->SetValue(Ini.AudioDumpToFile.GetValue());
|
chbox_audio_dump ->SetValue(Ini.AudioDumpToFile.GetValue());
|
||||||
chbox_audio_conv ->SetValue(Ini.AudioConvertToU16.GetValue());
|
chbox_audio_conv ->SetValue(Ini.AudioConvertToU16.GetValue());
|
||||||
chbox_hle_logging ->SetValue(Ini.HLELogging.GetValue());
|
|
||||||
chbox_hle_hook_stfunc ->SetValue(Ini.HLEHookStFunc.GetValue());
|
chbox_hle_hook_stfunc ->SetValue(Ini.HLEHookStFunc.GetValue());
|
||||||
chbox_hle_savetty ->SetValue(Ini.HLESaveTTY.GetValue());
|
chbox_hle_savetty ->SetValue(Ini.HLESaveTTY.GetValue());
|
||||||
chbox_hle_exitonstop ->SetValue(Ini.HLEExitOnStop.GetValue());
|
chbox_hle_exitonstop ->SetValue(Ini.HLEExitOnStop.GetValue());
|
||||||
|
@ -513,14 +500,12 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
||||||
cbox_keyboard_handler->SetSelection(Ini.KeyboardHandlerMode.GetValue());
|
cbox_keyboard_handler->SetSelection(Ini.KeyboardHandlerMode.GetValue());
|
||||||
cbox_mouse_handler ->SetSelection(Ini.MouseHandlerMode.GetValue());
|
cbox_mouse_handler ->SetSelection(Ini.MouseHandlerMode.GetValue());
|
||||||
cbox_audio_out ->SetSelection(Ini.AudioOutMode.GetValue());
|
cbox_audio_out ->SetSelection(Ini.AudioOutMode.GetValue());
|
||||||
cbox_hle_loglvl ->SetSelection(Ini.HLELogLvl.GetValue());
|
|
||||||
cbox_sys_lang ->SetSelection(Ini.SysLanguage.GetValue());
|
cbox_sys_lang ->SetSelection(Ini.SysLanguage.GetValue());
|
||||||
|
|
||||||
|
|
||||||
// Enable / Disable parameters
|
// Enable / Disable parameters
|
||||||
chbox_audio_dump->Enable(Emu.IsStopped());
|
chbox_audio_dump->Enable(Emu.IsStopped());
|
||||||
chbox_audio_conv->Enable(Emu.IsStopped());
|
chbox_audio_conv->Enable(Emu.IsStopped());
|
||||||
chbox_hle_logging->Enable(Emu.IsStopped());
|
|
||||||
chbox_hle_hook_stfunc->Enable(Emu.IsStopped());
|
chbox_hle_hook_stfunc->Enable(Emu.IsStopped());
|
||||||
|
|
||||||
|
|
||||||
|
@ -537,8 +522,6 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
||||||
|
|
||||||
s_round_audio_out->Add(cbox_audio_out, wxSizerFlags().Border(wxALL, 5).Expand());
|
s_round_audio_out->Add(cbox_audio_out, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
|
|
||||||
s_round_hle_log_lvl->Add(cbox_hle_loglvl, wxSizerFlags().Border(wxALL, 5).Expand());
|
|
||||||
|
|
||||||
s_round_sys_lang->Add(cbox_sys_lang, wxSizerFlags().Border(wxALL, 5).Expand());
|
s_round_sys_lang->Add(cbox_sys_lang, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
|
|
||||||
// Core
|
// Core
|
||||||
|
@ -567,8 +550,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
||||||
s_subpanel_audio->Add(chbox_audio_conv, wxSizerFlags().Border(wxALL, 5).Expand());
|
s_subpanel_audio->Add(chbox_audio_conv, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
|
|
||||||
// HLE / Misc.
|
// HLE / Misc.
|
||||||
s_subpanel_hle->Add(s_round_hle_log_lvl, wxSizerFlags().Border(wxALL, 5).Expand());
|
s_subpanel_hle->AddSpacer(15);
|
||||||
s_subpanel_hle->Add(chbox_hle_logging, wxSizerFlags().Border(wxALL, 5).Expand());
|
|
||||||
s_subpanel_hle->Add(chbox_hle_hook_stfunc, wxSizerFlags().Border(wxALL, 5).Expand());
|
s_subpanel_hle->Add(chbox_hle_hook_stfunc, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
s_subpanel_hle->Add(chbox_hle_savetty, wxSizerFlags().Border(wxALL, 5).Expand());
|
s_subpanel_hle->Add(chbox_hle_savetty, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
s_subpanel_hle->Add(chbox_hle_exitonstop, wxSizerFlags().Border(wxALL, 5).Expand());
|
s_subpanel_hle->Add(chbox_hle_exitonstop, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
|
@ -613,11 +595,9 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
||||||
Ini.AudioOutMode.SetValue(cbox_audio_out->GetSelection());
|
Ini.AudioOutMode.SetValue(cbox_audio_out->GetSelection());
|
||||||
Ini.AudioDumpToFile.SetValue(chbox_audio_dump->GetValue());
|
Ini.AudioDumpToFile.SetValue(chbox_audio_dump->GetValue());
|
||||||
Ini.AudioConvertToU16.SetValue(chbox_audio_conv->GetValue());
|
Ini.AudioConvertToU16.SetValue(chbox_audio_conv->GetValue());
|
||||||
Ini.HLELogging.SetValue(chbox_hle_logging->GetValue());
|
|
||||||
Ini.HLEHookStFunc.SetValue(chbox_hle_hook_stfunc->GetValue());
|
Ini.HLEHookStFunc.SetValue(chbox_hle_hook_stfunc->GetValue());
|
||||||
Ini.HLESaveTTY.SetValue(chbox_hle_savetty->GetValue());
|
Ini.HLESaveTTY.SetValue(chbox_hle_savetty->GetValue());
|
||||||
Ini.HLEExitOnStop.SetValue(chbox_hle_exitonstop->GetValue());
|
Ini.HLEExitOnStop.SetValue(chbox_hle_exitonstop->GetValue());
|
||||||
Ini.HLELogLvl.SetValue(cbox_hle_loglvl->GetSelection());
|
|
||||||
Ini.SysLanguage.SetValue(cbox_sys_lang->GetSelection());
|
Ini.SysLanguage.SetValue(cbox_sys_lang->GetSelection());
|
||||||
Ini.HLEHideDebugConsole.SetValue(chbox_hle_hide_debug_console->GetValue());
|
Ini.HLEHideDebugConsole.SetValue(chbox_hle_hide_debug_console->GetValue());
|
||||||
Ini.HLEAlwaysStart.SetValue(chbox_hle_always_start->GetValue());
|
Ini.HLEAlwaysStart.SetValue(chbox_hle_always_start->GetValue());
|
||||||
|
|
38
rpcs3/Ini.h
38
rpcs3/Ini.h
|
@ -152,13 +152,18 @@ public:
|
||||||
IniEntry<int> PadHandlerRStickUp;
|
IniEntry<int> PadHandlerRStickUp;
|
||||||
|
|
||||||
// HLE/Miscs
|
// HLE/Miscs
|
||||||
IniEntry<bool> HLELogging;
|
|
||||||
IniEntry<bool> HLEHookStFunc;
|
IniEntry<bool> HLEHookStFunc;
|
||||||
IniEntry<bool> HLESaveTTY;
|
IniEntry<bool> HLESaveTTY;
|
||||||
IniEntry<bool> HLEExitOnStop;
|
IniEntry<bool> HLEExitOnStop;
|
||||||
IniEntry<u8> HLELogLvl;
|
|
||||||
IniEntry<bool> HLEHideDebugConsole;
|
|
||||||
IniEntry<bool> HLEAlwaysStart;
|
IniEntry<bool> HLEAlwaysStart;
|
||||||
|
IniEntry<bool> HLEHideDebugConsole;
|
||||||
|
|
||||||
|
// ConLog
|
||||||
|
IniEntry<bool> LogAllSysCalls;
|
||||||
|
IniEntry<bool> LogWrite;
|
||||||
|
IniEntry<bool> LogWarning;
|
||||||
|
IniEntry<bool> LogError;
|
||||||
|
IniEntry<bool> LogSuccess;
|
||||||
|
|
||||||
// Language
|
// Language
|
||||||
IniEntry<u8> SysLanguage;
|
IniEntry<u8> SysLanguage;
|
||||||
|
@ -220,14 +225,19 @@ public:
|
||||||
PadHandlerRStickUp.Init("ControlSetings_PadHandlerRStickUp", path);
|
PadHandlerRStickUp.Init("ControlSetings_PadHandlerRStickUp", path);
|
||||||
|
|
||||||
// HLE/Misc
|
// HLE/Misc
|
||||||
HLELogging.Init("HLE_HLELogging", path);
|
|
||||||
HLEHookStFunc.Init("HLE_HLEHookStFunc", path);
|
HLEHookStFunc.Init("HLE_HLEHookStFunc", path);
|
||||||
HLESaveTTY.Init("HLE_HLESaveTTY", path);
|
HLESaveTTY.Init("HLE_HLESaveTTY", path);
|
||||||
HLEExitOnStop.Init("HLE_HLEExitOnStop", path);
|
HLEExitOnStop.Init("HLE_HLEExitOnStop", path);
|
||||||
HLELogLvl.Init("HLE_HLELogLvl", path);
|
|
||||||
HLEHideDebugConsole.Init("HLE_HLEHideDebugConsole", path);
|
HLEHideDebugConsole.Init("HLE_HLEHideDebugConsole", path);
|
||||||
HLEAlwaysStart.Init("HLE_HLEAlwaysStart", path);
|
HLEAlwaysStart.Init("HLE_HLEAlwaysStart", path);
|
||||||
|
|
||||||
|
// ConLog
|
||||||
|
LogAllSysCalls.Init("Log_LogAllSysCalls", path);
|
||||||
|
LogWrite.Init("Log_LogWrite", path);
|
||||||
|
LogWarning.Init("Log_LogWarning", path);
|
||||||
|
LogError.Init("Log_LogError", path);
|
||||||
|
LogSuccess.Init("Log_LogSuccess", path);
|
||||||
|
|
||||||
// Language
|
// Language
|
||||||
SysLanguage.Init("Sytem_SysLanguage", path);
|
SysLanguage.Init("Sytem_SysLanguage", path);
|
||||||
}
|
}
|
||||||
|
@ -284,14 +294,19 @@ public:
|
||||||
PadHandlerRStickUp.Load(366); //WXK_PAGEUP
|
PadHandlerRStickUp.Load(366); //WXK_PAGEUP
|
||||||
|
|
||||||
// HLE/Miscs
|
// HLE/Miscs
|
||||||
HLELogging.Load(false);
|
|
||||||
HLEHookStFunc.Load(false);
|
HLEHookStFunc.Load(false);
|
||||||
HLESaveTTY.Load(false);
|
HLESaveTTY.Load(false);
|
||||||
HLEExitOnStop.Load(false);
|
HLEExitOnStop.Load(false);
|
||||||
HLELogLvl.Load(3);
|
|
||||||
HLEHideDebugConsole.Load(false);
|
HLEHideDebugConsole.Load(false);
|
||||||
HLEAlwaysStart.Load(false);
|
HLEAlwaysStart.Load(false);
|
||||||
|
|
||||||
|
// ConLog
|
||||||
|
LogAllSysCalls.Load(false);
|
||||||
|
LogWrite.Load(true);
|
||||||
|
LogWarning.Load(false);
|
||||||
|
LogError.Load(true);
|
||||||
|
LogSuccess.Load(true);
|
||||||
|
|
||||||
// Language
|
// Language
|
||||||
SysLanguage.Load(1);
|
SysLanguage.Load(1);
|
||||||
|
|
||||||
|
@ -349,14 +364,19 @@ public:
|
||||||
PadHandlerRStickUp.Save();
|
PadHandlerRStickUp.Save();
|
||||||
|
|
||||||
// HLE/Miscs
|
// HLE/Miscs
|
||||||
HLELogging.Save();
|
|
||||||
HLEHookStFunc.Save();
|
HLEHookStFunc.Save();
|
||||||
HLESaveTTY.Save();
|
HLESaveTTY.Save();
|
||||||
HLEExitOnStop.Save();
|
HLEExitOnStop.Save();
|
||||||
HLELogLvl.Save();
|
|
||||||
HLEHideDebugConsole.Save();
|
HLEHideDebugConsole.Save();
|
||||||
HLEAlwaysStart.Save();
|
HLEAlwaysStart.Save();
|
||||||
|
|
||||||
|
// ConLog
|
||||||
|
LogAllSysCalls.Save();
|
||||||
|
LogWrite.Save();
|
||||||
|
LogWarning.Save();
|
||||||
|
LogError.Save();
|
||||||
|
LogSuccess.Save();
|
||||||
|
|
||||||
// Language
|
// Language
|
||||||
SysLanguage.Save();
|
SysLanguage.Save();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue