From b6ac09aa1a967e19a6a8b4de1aa12df75dd7e733 Mon Sep 17 00:00:00 2001 From: Oil Date: Thu, 5 Jun 2014 18:08:44 +0400 Subject: [PATCH 01/12] Improved LogFrame. --- rpcs3/Emu/CPU/CPUThread.cpp | 4 +- rpcs3/Emu/Cell/PPUInterpreter.h | 4 +- rpcs3/Emu/Cell/RawSPUThread.cpp | 4 +- rpcs3/Emu/Cell/SPUThread.h | 14 ++--- rpcs3/Emu/SysCalls/Modules.cpp | 4 +- rpcs3/Emu/SysCalls/SysCalls.cpp | 4 +- rpcs3/Emu/SysCalls/SysCalls.h | 4 +- rpcs3/Gui/ConLog.cpp | 94 +++++++++++++++++++++++++++++++-- rpcs3/Gui/ConLog.h | 19 ++++++- rpcs3/Gui/MainFrame.cpp | 26 ++------- rpcs3/Ini.h | 38 +++++++++---- 11 files changed, 158 insertions(+), 57 deletions(-) diff --git a/rpcs3/Emu/CPU/CPUThread.cpp b/rpcs3/Emu/CPU/CPUThread.cpp index 9ae338ce2d..a1caaa1bf0 100644 --- a/rpcs3/Emu/CPU/CPUThread.cpp +++ b/rpcs3/Emu/CPU/CPUThread.cpp @@ -297,7 +297,7 @@ void CPUThread::ExecOnce() 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& bp = Emu.GetBreakPoints(); @@ -359,7 +359,7 @@ void CPUThread::Task() 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 diff --git a/rpcs3/Emu/Cell/PPUInterpreter.h b/rpcs3/Emu/Cell/PPUInterpreter.h index 03c2900927..bb23f6a147 100644 --- a/rpcs3/Emu/Cell/PPUInterpreter.h +++ b/rpcs3/Emu/Cell/PPUInterpreter.h @@ -69,7 +69,7 @@ private: { 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); if(CPU.GPR[11] > 1024) @@ -2097,7 +2097,7 @@ private: case 0x2: SysCall(); break; case 0x3: StaticExecute(CPU.GPR[11]); - if (Ini.HLELogging.GetValue()) + if (Ini.LogAllSysCalls.GetValue()) { ConLog.Write("'%s' done with code[0x%llx]! #pc: 0x%llx", g_static_funcs_list[CPU.GPR[11]]->name, CPU.GPR[3], CPU.PC); diff --git a/rpcs3/Emu/Cell/RawSPUThread.cpp b/rpcs3/Emu/Cell/RawSPUThread.cpp index 4cb01dcd9e..d0cc2bb941 100644 --- a/rpcs3/Emu/Cell/RawSPUThread.cpp +++ b/rpcs3/Emu/Cell/RawSPUThread.cpp @@ -251,7 +251,7 @@ u32 RawSPUThread::GetIndex() const 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& bp = Emu.GetBreakPoints(); @@ -334,5 +334,5 @@ void RawSPUThread::Task() 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()); } diff --git a/rpcs3/Emu/Cell/SPUThread.h b/rpcs3/Emu/Cell/SPUThread.h index 7845a48f12..0684ee93ff 100644 --- a/rpcs3/Emu/Cell/SPUThread.h +++ b/rpcs3/Emu/Cell/SPUThread.h @@ -649,7 +649,7 @@ public: 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)", 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_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_RESULT_MASK ? "R" : ""), (op & MFC_BARRIER_MASK ? "B" : ""), @@ -708,7 +708,7 @@ public: case MFC_PUTRL_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_RESULT_MASK ? "RL" : "L"), (op & MFC_BARRIER_MASK ? "B" : ""), @@ -724,7 +724,7 @@ public: case MFC_PUTLLUC_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_PUTLLC_CMD ? "PUTLLC" : op == MFC_PUTLLUC_CMD ? "PUTLLUC" : "PUTQLLUC"), @@ -921,7 +921,7 @@ public: 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); } @@ -1143,7 +1143,7 @@ public: return; } - if (Ini.HLELogging.GetValue()) + if (Ini.LogAllSysCalls.GetValue()) { 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)"); } - else if (Ini.HLELogging.GetValue()) + else if (Ini.LogAllSysCalls.GetValue()) { // the real exit status ConLog.Write("sys_spu_thread_exit (status=0x%x)", SPU.Out_MBox.GetValue()); diff --git a/rpcs3/Emu/SysCalls/Modules.cpp b/rpcs3/Emu/SysCalls/Modules.cpp index b240f0d635..22f90eedbe 100644 --- a/rpcs3/Emu/SysCalls/Modules.cpp +++ b/rpcs3/Emu/SysCalls/Modules.cpp @@ -445,7 +445,7 @@ void Module::SetName(const std::string& name) void Module::Log(const u32 id, std::string fmt, ...) { - if(Ini.HLELogging.GetValue()) + if(Ini.LogAllSysCalls.GetValue()) { va_list list; va_start(list, fmt); @@ -456,7 +456,7 @@ void Module::Log(const u32 id, std::string fmt, ...) void Module::Log(std::string fmt, ...) { - if(Ini.HLELogging.GetValue()) + if (Ini.LogAllSysCalls.GetValue()) { va_list list; va_start(list, fmt); diff --git a/rpcs3/Emu/SysCalls/SysCalls.cpp b/rpcs3/Emu/SysCalls/SysCalls.cpp index a068fbab8b..bd72b3a247 100644 --- a/rpcs3/Emu/SysCalls/SysCalls.cpp +++ b/rpcs3/Emu/SysCalls/SysCalls.cpp @@ -555,8 +555,8 @@ void default_syscall() return; case 1000: - Ini.HLELogging.SetValue(!Ini.HLELogging.GetValue()); - ConLog.Warning("Log %s", (Ini.HLELogging.GetValue() ? "enabled" : "disabled")); + Ini.LogAllSysCalls.SetValue(!Ini.LogAllSysCalls.GetValue()); + ConLog.Warning("Log %s", (Ini.LogAllSysCalls.GetValue() ? "enabled" : "disabled")); return; } diff --git a/rpcs3/Emu/SysCalls/SysCalls.h b/rpcs3/Emu/SysCalls/SysCalls.h index 5793703a28..b069564898 100644 --- a/rpcs3/Emu/SysCalls/SysCalls.h +++ b/rpcs3/Emu/SysCalls/SysCalls.h @@ -46,7 +46,7 @@ public: void Log(const u32 id, std::string fmt, ...) { - if(Ini.HLELogging.GetValue()) + if (Ini.LogAllSysCalls.GetValue()) { va_list list; va_start(list, fmt); @@ -57,7 +57,7 @@ public: void Log(std::string fmt, ...) { - if(Ini.HLELogging.GetValue()) + if(Ini.LogAllSysCalls.GetValue()) { va_list list; va_start(list, fmt); diff --git a/rpcs3/Gui/ConLog.cpp b/rpcs3/Gui/ConLog.cpp index 6b4dbb6c33..54177b0aea 100644 --- a/rpcs3/Gui/ConLog.cpp +++ b/rpcs3/Gui/ConLog.cpp @@ -9,6 +9,11 @@ LogWriter ConLog; LogFrame* ConLogFrame; +enum LogIDs +{ + id_log_level = 0x888, +}; + std::mutex g_cs_conlog; 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()) m_logfile.Write(fmt::FromUTF8("[" + new_prefix + "]: " + value + "\n")); - if(!ConLogFrame || Ini.HLELogLvl.GetValue() == 4 || (lvl != 0 && lvl <= Ini.HLELogLvl.GetValue())) + + if(!ConLogFrame) return; std::lock_guard lock(g_cs_conlog); @@ -163,15 +169,26 @@ void LogWriter::SkipLn() WriteToLog("", "", 0); } -BEGIN_EVENT_TABLE(LogFrame, wxPanel) +BEGIN_EVENT_TABLE(LogFrame, FrameBase) EVT_CLOSE(LogFrame::OnQuit) END_EVENT_TABLE() -LogFrame::LogFrame(wxWindow* parent) - : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(600, 500)) +LogFrame::LogFrame() + : FrameBase(nullptr, wxID_ANY, "Log Frame", "LogFrame", wxSize(600, 500)) , ThreadBase("LogThread") , 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(1, "Log"); m_log.SetBackgroundColour(wxColour("Black")); @@ -245,3 +262,72 @@ void LogFrame::OnQuit(wxCloseEvent& event) ConLogFrame = nullptr; 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(); +} \ No newline at end of file diff --git a/rpcs3/Gui/ConLog.h b/rpcs3/Gui/ConLog.h index d39eb47d64..90462a0bb1 100644 --- a/rpcs3/Gui/ConLog.h +++ b/rpcs3/Gui/ConLog.h @@ -19,13 +19,20 @@ public: template void Write(const std::string &fmt, Arg&&... args) { + if (!Ini.LogWrite.GetValue()) + return; + std::string frmt = fmt::Format(fmt, std::forward(args)...); + WriteToLog("!", frmt, 2); } template void Error(const std::string &fmt, Arg&&... args) { + if (!Ini.LogError.GetValue()) + return; + std::string frmt = fmt::Format(fmt, std::forward(args)...); WriteToLog("E", frmt, 4); } @@ -33,6 +40,9 @@ public: template void Warning(const std::string &fmt, Arg&&... args) { + if (!Ini.LogWarning.GetValue()) + return; + std::string frmt = fmt::Format(fmt, std::forward(args)...); WriteToLog("W", frmt, 3); } @@ -40,6 +50,9 @@ public: template void Success(const std::string &fmt, Arg&&... args) { + if (!Ini.LogSuccess.GetValue()) + return; + std::string frmt = fmt::Format(fmt, std::forward(args)...); WriteToLog("S", frmt, 1); } @@ -48,13 +61,13 @@ public: }; class LogFrame - : public wxPanel + : public FrameBase , public ThreadBase { wxListView& m_log; public: - LogFrame(wxWindow* parent); + LogFrame(); ~LogFrame(); bool Close(bool force = false); @@ -62,6 +75,8 @@ public: private: virtual void Task(); + void Settings(wxCommandEvent& event); + void UpdateListSize(wxSizeEvent& event); void OnQuit(wxCloseEvent& event); DECLARE_EVENT_TABLE(); diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index 0af99767c7..02626da024 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -103,10 +103,9 @@ MainFrame::MainFrame() // Panels m_game_viewer = new GameViewer(this); m_debugger_frame = new DebuggerPanel(this); - ConLogFrame = new LogFrame(this); + ConLogFrame = new LogFrame; AddPane(m_game_viewer, "Game List", wxAUI_DOCK_BOTTOM); - AddPane(ConLogFrame, "Log", wxAUI_DOCK_BOTTOM); AddPane(m_debugger_frame, "Debugger", wxAUI_DOCK_RIGHT); // Events @@ -392,9 +391,6 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) // Audio 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 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_mouse_handler = new wxComboBox(p_io, 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); wxCheckBox* chbox_cpu_ignore_rwerrors = new wxCheckBox(p_cpu, wxID_ANY, "Ignore Read/Write errors"); @@ -418,10 +413,9 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) 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_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_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"); wxCheckBox* chbox_hle_hide_debug_console = new wxCheckBox(p_hle, wxID_ANY, "Hide Debug Console"); wxCheckBox* chbox_hle_always_start = new wxCheckBox(p_hle, wxID_ANY, "Always start after boot"); @@ -462,12 +456,6 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) cbox_audio_out->Append("Null"); 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("English (US)"); cbox_sys_lang->Append("French"); @@ -497,7 +485,6 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) chbox_gs_vsync ->SetValue(Ini.GSVSyncEnable.GetValue()); chbox_audio_dump ->SetValue(Ini.AudioDumpToFile.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_savetty ->SetValue(Ini.HLESaveTTY.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_mouse_handler ->SetSelection(Ini.MouseHandlerMode.GetValue()); cbox_audio_out ->SetSelection(Ini.AudioOutMode.GetValue()); - cbox_hle_loglvl ->SetSelection(Ini.HLELogLvl.GetValue()); cbox_sys_lang ->SetSelection(Ini.SysLanguage.GetValue()); // Enable / Disable parameters chbox_audio_dump->Enable(Emu.IsStopped()); chbox_audio_conv->Enable(Emu.IsStopped()); - chbox_hle_logging->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_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()); // Core @@ -567,8 +550,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) s_subpanel_audio->Add(chbox_audio_conv, wxSizerFlags().Border(wxALL, 5).Expand()); // HLE / Misc. - s_subpanel_hle->Add(s_round_hle_log_lvl, wxSizerFlags().Border(wxALL, 5).Expand()); - s_subpanel_hle->Add(chbox_hle_logging, wxSizerFlags().Border(wxALL, 5).Expand()); + s_subpanel_hle->AddSpacer(15); 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_exitonstop, wxSizerFlags().Border(wxALL, 5).Expand()); @@ -613,11 +595,9 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) Ini.AudioOutMode.SetValue(cbox_audio_out->GetSelection()); Ini.AudioDumpToFile.SetValue(chbox_audio_dump->GetValue()); Ini.AudioConvertToU16.SetValue(chbox_audio_conv->GetValue()); - Ini.HLELogging.SetValue(chbox_hle_logging->GetValue()); Ini.HLEHookStFunc.SetValue(chbox_hle_hook_stfunc->GetValue()); Ini.HLESaveTTY.SetValue(chbox_hle_savetty->GetValue()); Ini.HLEExitOnStop.SetValue(chbox_hle_exitonstop->GetValue()); - Ini.HLELogLvl.SetValue(cbox_hle_loglvl->GetSelection()); Ini.SysLanguage.SetValue(cbox_sys_lang->GetSelection()); Ini.HLEHideDebugConsole.SetValue(chbox_hle_hide_debug_console->GetValue()); Ini.HLEAlwaysStart.SetValue(chbox_hle_always_start->GetValue()); diff --git a/rpcs3/Ini.h b/rpcs3/Ini.h index ba9fed46aa..fdb79ee0b4 100644 --- a/rpcs3/Ini.h +++ b/rpcs3/Ini.h @@ -152,13 +152,18 @@ public: IniEntry PadHandlerRStickUp; // HLE/Miscs - IniEntry HLELogging; IniEntry HLEHookStFunc; IniEntry HLESaveTTY; IniEntry HLEExitOnStop; - IniEntry HLELogLvl; - IniEntry HLEHideDebugConsole; IniEntry HLEAlwaysStart; + IniEntry HLEHideDebugConsole; + + // ConLog + IniEntry LogAllSysCalls; + IniEntry LogWrite; + IniEntry LogWarning; + IniEntry LogError; + IniEntry LogSuccess; // Language IniEntry SysLanguage; @@ -220,14 +225,19 @@ public: PadHandlerRStickUp.Init("ControlSetings_PadHandlerRStickUp", path); // HLE/Misc - HLELogging.Init("HLE_HLELogging", path); HLEHookStFunc.Init("HLE_HLEHookStFunc", path); HLESaveTTY.Init("HLE_HLESaveTTY", path); HLEExitOnStop.Init("HLE_HLEExitOnStop", path); - HLELogLvl.Init("HLE_HLELogLvl", path); HLEHideDebugConsole.Init("HLE_HLEHideDebugConsole", 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 SysLanguage.Init("Sytem_SysLanguage", path); } @@ -284,14 +294,19 @@ public: PadHandlerRStickUp.Load(366); //WXK_PAGEUP // HLE/Miscs - HLELogging.Load(false); HLEHookStFunc.Load(false); HLESaveTTY.Load(false); HLEExitOnStop.Load(false); - HLELogLvl.Load(3); HLEHideDebugConsole.Load(false); HLEAlwaysStart.Load(false); + // ConLog + LogAllSysCalls.Load(false); + LogWrite.Load(true); + LogWarning.Load(false); + LogError.Load(true); + LogSuccess.Load(true); + // Language SysLanguage.Load(1); @@ -349,14 +364,19 @@ public: PadHandlerRStickUp.Save(); // HLE/Miscs - HLELogging.Save(); HLEHookStFunc.Save(); HLESaveTTY.Save(); HLEExitOnStop.Save(); - HLELogLvl.Save(); HLEHideDebugConsole.Save(); HLEAlwaysStart.Save(); + // ConLog + LogAllSysCalls.Save(); + LogWrite.Save(); + LogWarning.Save(); + LogError.Save(); + LogSuccess.Save(); + // Language SysLanguage.Save(); } From 49295f8eff735106797da2eade9197f7615ed374 Mon Sep 17 00:00:00 2001 From: Oil Date: Thu, 5 Jun 2014 19:21:06 +0400 Subject: [PATCH 02/12] Fixed a scrollbar issue. --- rpcs3/Gui/ConLog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpcs3/Gui/ConLog.cpp b/rpcs3/Gui/ConLog.cpp index 54177b0aea..a77b486007 100644 --- a/rpcs3/Gui/ConLog.cpp +++ b/rpcs3/Gui/ConLog.cpp @@ -328,6 +328,8 @@ void LogFrame::Settings(wxCommandEvent& WXUNUSED(event)) void LogFrame::UpdateListSize(wxSizeEvent& event) { - m_log.SetSize(this->GetSize()); + int width, height; + this->DoGetSize(&width, &height); + m_log.SetSize(wxSize(width-15, height-55)); event.Skip(); } \ No newline at end of file From 268e2eee4c58b954954d76215f7b7802d95902ec Mon Sep 17 00:00:00 2001 From: Oil Date: Thu, 5 Jun 2014 22:17:53 +0400 Subject: [PATCH 03/12] Changed default LogFrame position. --- rpcs3/Gui/ConLog.cpp | 8 ++++---- rpcs3/Gui/ConLog.h | 3 +-- rpcs3/Gui/MainFrame.cpp | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/rpcs3/Gui/ConLog.cpp b/rpcs3/Gui/ConLog.cpp index a77b486007..93d827717e 100644 --- a/rpcs3/Gui/ConLog.cpp +++ b/rpcs3/Gui/ConLog.cpp @@ -173,8 +173,9 @@ BEGIN_EVENT_TABLE(LogFrame, FrameBase) EVT_CLOSE(LogFrame::OnQuit) END_EVENT_TABLE() -LogFrame::LogFrame() - : FrameBase(nullptr, wxID_ANY, "Log Frame", "LogFrame", wxSize(600, 500)) +LogFrame::LogFrame(wxWindow *parent) + : FrameBase(nullptr, wxID_ANY, "Log Frame", "LogFrame", wxSize(600, 500), + wxPoint(parent->GetPosition().x + parent->GetSize().x, parent->GetPosition().y)) , ThreadBase("LogThread") , m_log(*new wxListView(this)) { @@ -183,6 +184,7 @@ LogFrame::LogFrame() wxMenu* menu_log_settings = new wxMenu(); menubar->Append(menu_log_settings, "Settings"); menu_log_settings->Append(id_log_level, "Log Level"); + SetMenuBar(menubar); //events @@ -274,8 +276,6 @@ void LogFrame::Settings(wxCommandEvent& WXUNUSED(event)) } 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); diff --git a/rpcs3/Gui/ConLog.h b/rpcs3/Gui/ConLog.h index 90462a0bb1..678e76b5a4 100644 --- a/rpcs3/Gui/ConLog.h +++ b/rpcs3/Gui/ConLog.h @@ -23,7 +23,6 @@ public: return; std::string frmt = fmt::Format(fmt, std::forward(args)...); - WriteToLog("!", frmt, 2); } @@ -67,7 +66,7 @@ class LogFrame wxListView& m_log; public: - LogFrame(); + LogFrame(wxWindow *parent); ~LogFrame(); bool Close(bool force = false); diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index 02626da024..efbde44432 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -103,7 +103,7 @@ MainFrame::MainFrame() // Panels m_game_viewer = new GameViewer(this); m_debugger_frame = new DebuggerPanel(this); - ConLogFrame = new LogFrame; + ConLogFrame = new LogFrame(this); AddPane(m_game_viewer, "Game List", wxAUI_DOCK_BOTTOM); AddPane(m_debugger_frame, "Debugger", wxAUI_DOCK_RIGHT); From 402199d70f13fbbb5fc76c619f6753bdfce1b261 Mon Sep 17 00:00:00 2001 From: O1L Date: Sun, 7 Sep 2014 17:47:53 +0400 Subject: [PATCH 04/12] Add PPU / SPU / RawSPU threads in KernelExplorer, and some coding style changes. --- rpcs3/Emu/CPU/CPUThread.h | 18 +++ rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp | 5 +- rpcs3/Gui/KernelExplorer.cpp | 126 +++++++++++++++++---- 3 files changed, 128 insertions(+), 21 deletions(-) diff --git a/rpcs3/Emu/CPU/CPUThread.h b/rpcs3/Emu/CPU/CPUThread.h index c9d716d553..92cf1b936a 100644 --- a/rpcs3/Emu/CPU/CPUThread.h +++ b/rpcs3/Emu/CPU/CPUThread.h @@ -93,6 +93,24 @@ public: return "Unknown"; } + std::string ThreadStatusToString() + { + switch (ThreadStatus()) + { + case CPUThread_Ready: return "Ready"; + case CPUThread_Running: return "Running"; + case CPUThread_Paused: return "Paused"; + case CPUThread_Stopped: return "Stopped"; + case CPUThread_Sleeping: return "Sleeping"; + case CPUThread_Break: return "Break"; + case CPUThread_Step: return "Step"; + + default: return "Unknown status"; + } + } + + + std::string GetTypeString() const { return CPUThreadTypeToString(m_type); } virtual std::string GetThreadName() const diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp index e4a7f96cff..b246d231e0 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp @@ -709,9 +709,12 @@ int cellHddGameCheck(u32 version, vm::ptr dirName, u32 errDialog, vm // TODO ? funcStat(result, get, set); - if (result->result != CELL_HDDGAME_CBRESULT_OK && + + /* + if (result->result != CELL_HDDGAME_CBRESULT_OK && // error on compiling in MVS. Needs to use LE byte order? result->result != CELL_HDDGAME_CBRESULT_OK_CANCEL) return CELL_HDDGAME_ERROR_CBRESULT; + */ // TODO ? diff --git a/rpcs3/Gui/KernelExplorer.cpp b/rpcs3/Gui/KernelExplorer.cpp index 3e51442db1..fd2d80d40b 100644 --- a/rpcs3/Gui/KernelExplorer.cpp +++ b/rpcs3/Gui/KernelExplorer.cpp @@ -6,6 +6,9 @@ #include "Emu/IdManager.h" #include "KernelExplorer.h" +#include "Emu/CPU/CPUThreadManager.h" +#include "Emu/CPU/CPUThread.h" + KernelExplorer::KernelExplorer(wxWindow* parent) : wxFrame(parent, wxID_ANY, "Kernel Explorer", wxDefaultPosition, wxSize(700, 450)) { @@ -46,17 +49,17 @@ void KernelExplorer::Update() m_tree->DeleteAllItems(); const auto& root = m_tree->AddRoot("Process, ID = 0x00000001, Total Memory Usage = 0x???????? (???.? MB)"); - // TODO: PPU Threads - // TODO: SPU/RawSPU Threads // TODO: FileSystem // Semaphores count = Emu.GetIdManager().GetTypeCount(TYPE_SEMAPHORE); - if (count) { + if (count) + { sprintf(name, "Semaphores (%d)", count); const auto& node = m_tree->AppendItem(root, name); const auto& objects = Emu.GetIdManager().GetTypeIDs(TYPE_SEMAPHORE); - for (const auto& id : objects) { + for (const auto& id : objects) + { sprintf(name, "Semaphore: ID = 0x%08x", id); m_tree->AppendItem(node, name); } @@ -64,11 +67,13 @@ void KernelExplorer::Update() // Mutexes count = Emu.GetIdManager().GetTypeCount(TYPE_MUTEX); - if (count) { + if (count) + { sprintf(name, "Mutexes (%d)", count); const auto& node = m_tree->AppendItem(root, name); const auto& objects = Emu.GetIdManager().GetTypeIDs(TYPE_MUTEX); - for (const auto& id : objects) { + for (const auto& id : objects) + { sprintf(name, "Mutex: ID = 0x%08x", id); m_tree->AppendItem(node, name); } @@ -76,11 +81,13 @@ void KernelExplorer::Update() // Light Weight Mutexes count = Emu.GetIdManager().GetTypeCount(TYPE_LWMUTEX); - if (count) { + if (count) + { sprintf(name, "Light Weight Mutexes (%d)", count); const auto& node = m_tree->AppendItem(root, name); const auto& objects = Emu.GetIdManager().GetTypeIDs(TYPE_LWMUTEX); - for (const auto& id : objects) { + for (const auto& id : objects) + { sprintf(name, "LW Mutex: ID = 0x%08x", id); m_tree->AppendItem(node, name); } @@ -88,11 +95,13 @@ void KernelExplorer::Update() // Condition Variables count = Emu.GetIdManager().GetTypeCount(TYPE_COND); - if (count) { + if (count) + { sprintf(name, "Condition Variables (%d)", count); const auto& node = m_tree->AppendItem(root, name); const auto& objects = Emu.GetIdManager().GetTypeIDs(TYPE_COND); - for (const auto& id : objects) { + for (const auto& id : objects) + { sprintf(name, "Condition Variable: ID = 0x%08x", id); m_tree->AppendItem(node, name); } @@ -100,11 +109,13 @@ void KernelExplorer::Update() // Light Weight Condition Variables count = Emu.GetIdManager().GetTypeCount(TYPE_LWCOND); - if (count) { + if (count) + { sprintf(name, "Light Weight Condition Variables (%d)", count); const auto& node = m_tree->AppendItem(root, name); const auto& objects = Emu.GetIdManager().GetTypeIDs(TYPE_LWCOND); - for (const auto& id : objects) { + for (const auto& id : objects) + { sprintf(name, "LW Condition Variable: ID = 0x%08x", id); m_tree->AppendItem(node, name); } @@ -112,11 +123,13 @@ void KernelExplorer::Update() // Event Queues count = Emu.GetIdManager().GetTypeCount(TYPE_EVENT_QUEUE); - if (count) { + if (count) + { sprintf(name, "Event Queues (%d)", count); const auto& node = m_tree->AppendItem(root, name); const auto& objects = Emu.GetIdManager().GetTypeIDs(TYPE_EVENT_QUEUE); - for (const auto& id : objects) { + for (const auto& id : objects) + { sprintf(name, "Event Queue: ID = 0x%08x", id); m_tree->AppendItem(node, name); } @@ -124,13 +137,15 @@ void KernelExplorer::Update() // Modules count = Emu.GetIdManager().GetTypeCount(TYPE_PRX); - if (count) { + if (count) + { sprintf(name, "Modules (%d)", count); const auto& node = m_tree->AppendItem(root, name); const auto& objects = Emu.GetIdManager().GetTypeIDs(TYPE_PRX); sprintf(name, "Segment List (%d)", 2 * objects.size()); // TODO: Assuming 2 segments per PRX file is not good m_tree->AppendItem(node, name); - for (const auto& id : objects) { + for (const auto& id : objects) + { sprintf(name, "PRX: ID = 0x%08x", id); m_tree->AppendItem(node, name); } @@ -138,27 +153,98 @@ void KernelExplorer::Update() // Memory Containers count = Emu.GetIdManager().GetTypeCount(TYPE_MEM); - if (count) { + if (count) + { sprintf(name, "Memory Containers (%d)", count); const auto& node = m_tree->AppendItem(root, name); const auto& objects = Emu.GetIdManager().GetTypeIDs(TYPE_MEM); - for (const auto& id : objects) { + for (const auto& id : objects) + { sprintf(name, "Memory Container: ID = 0x%08x", id); m_tree->AppendItem(node, name); } } // Event Flags count = Emu.GetIdManager().GetTypeCount(TYPE_EVENT_FLAG); - if (count) { + if (count) + { sprintf(name, "Event Flags (%d)", count); const auto& node = m_tree->AppendItem(root, name); const auto& objects = Emu.GetIdManager().GetTypeIDs(TYPE_EVENT_FLAG); - for (const auto& id : objects) { + for (const auto& id : objects) + { sprintf(name, "Event Flag: ID = 0x%08x", id); m_tree->AppendItem(node, name); } } + // PPU / SPU / RawSPU threads + { + // TODO: add mutexes owners + + const auto& objects = Emu.GetCPU().GetThreads(); + u32 ppu_threads_count = 0; + u32 spu_threads_count = 0; + u32 raw_spu_threads_count = 0; + for (const auto& thread : objects) + { + if (thread->GetType() == CPU_THREAD_PPU) + ppu_threads_count++; + + if (thread->GetType() == CPU_THREAD_SPU) + spu_threads_count++; + + if (thread->GetType() == CPU_THREAD_RAW_SPU) + raw_spu_threads_count++; + } + + if (ppu_threads_count) + { + sprintf(name, "PPU Threads (%d)", ppu_threads_count); + const auto& node = m_tree->AppendItem(root, name); + + for (const auto& thread : objects) + { + if (thread->GetType() == CPU_THREAD_PPU) + { + sprintf(name, "Thread: ID = 0x%08x ''%s'', - %s", thread->GetId(), thread->GetName().c_str(), thread->ThreadStatusToString().c_str()); + m_tree->AppendItem(node, name); + } + } + } + + if (spu_threads_count) + { + sprintf(name, "SPU Threads (%d)", spu_threads_count); + const auto& node = m_tree->AppendItem(root, name); + + for (const auto& thread : objects) + { + if (thread->GetType() == CPU_THREAD_SPU) + { + sprintf(name, "Thread: ID = 0x%08x ''%s'', - %s", thread->GetId(), thread->GetName().c_str(), thread->ThreadStatusToString().c_str()); + m_tree->AppendItem(node, name); + } + } + } + + if (raw_spu_threads_count) + { + sprintf(name, "RawSPU Threads (%d)", raw_spu_threads_count); + const auto& node = m_tree->AppendItem(root, name); + + for (const auto& thread : objects) + { + if (thread->GetType() == CPU_THREAD_RAW_SPU) + { + sprintf(name, "Thread: ID = 0x%08x ''%s'', - %s", thread->GetId(), thread->GetName().c_str(), thread->ThreadStatusToString().c_str()); + m_tree->AppendItem(node, name); + } + } + } + + } + m_tree->Expand(root); } From 54106f6f9ba30fa7185f28ec9d17491702c71c6c Mon Sep 17 00:00:00 2001 From: O1L Date: Sun, 7 Sep 2014 18:05:29 +0400 Subject: [PATCH 05/12] Removed unnecessary newlines. --- rpcs3/Emu/CPU/CPUThread.h | 2 -- rpcs3/Gui/KernelExplorer.cpp | 1 - 2 files changed, 3 deletions(-) diff --git a/rpcs3/Emu/CPU/CPUThread.h b/rpcs3/Emu/CPU/CPUThread.h index 92cf1b936a..0610219e8e 100644 --- a/rpcs3/Emu/CPU/CPUThread.h +++ b/rpcs3/Emu/CPU/CPUThread.h @@ -109,8 +109,6 @@ public: } } - - std::string GetTypeString() const { return CPUThreadTypeToString(m_type); } virtual std::string GetThreadName() const diff --git a/rpcs3/Gui/KernelExplorer.cpp b/rpcs3/Gui/KernelExplorer.cpp index fd2d80d40b..8db3a4a7b8 100644 --- a/rpcs3/Gui/KernelExplorer.cpp +++ b/rpcs3/Gui/KernelExplorer.cpp @@ -5,7 +5,6 @@ #include "Emu/IdManager.h" #include "KernelExplorer.h" - #include "Emu/CPU/CPUThreadManager.h" #include "Emu/CPU/CPUThread.h" From 16727a9c5eb1cde0e0545169fecd3003ba40f2d5 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Sun, 7 Sep 2014 18:53:13 +0300 Subject: [PATCH 06/12] Re-enabled cellCamera and cellOvis, added cellCamera enums and structs Also some fixes to ordering in emucore.vcxproj.filters --- rpcs3/Emu/SysCalls/ModuleManager.cpp | 8 ++ rpcs3/Emu/SysCalls/Modules/cellCamera.cpp | 68 +++++----- rpcs3/Emu/SysCalls/Modules/cellCamera.h | 60 +++++++++ rpcs3/Emu/SysCalls/Modules/cellGem.cpp | 3 +- rpcs3/Emu/SysCalls/Modules/cellOvis.cpp | 14 +- rpcs3/Emu/SysCalls/Modules/sceNp.h | 10 +- rpcs3/emucore.vcxproj | 1 + rpcs3/emucore.vcxproj.filters | 150 +++++++++++----------- 8 files changed, 192 insertions(+), 122 deletions(-) create mode 100644 rpcs3/Emu/SysCalls/Modules/cellCamera.h diff --git a/rpcs3/Emu/SysCalls/ModuleManager.cpp b/rpcs3/Emu/SysCalls/ModuleManager.cpp index 1bcb6e7466..d60f5ec399 100644 --- a/rpcs3/Emu/SysCalls/ModuleManager.cpp +++ b/rpcs3/Emu/SysCalls/ModuleManager.cpp @@ -7,6 +7,8 @@ extern void cellAtrac_init(); extern Module *cellAtrac; extern void cellAudio_init(); extern Module *cellAudio; +extern void cellCamera_init(); +extern Module *cellCamera; extern void cellDmux_init(); extern Module *cellDmux; extern void cellFiber_init(); @@ -35,6 +37,8 @@ extern void cellL10n_init(); extern Module *cellL10n; extern void cellNetCtl_init(); extern Module *cellNetCtl; +extern void cellOvis_init(); +extern Module *cellOvis; extern void cellPamf_init(); extern Module *cellPamf; extern void cellPngDec_init(); @@ -225,6 +229,8 @@ void ModuleManager::init() m_mod_init.emplace_back(0x0013, cellAtrac_init); cellAudio = static_cast (&(m_mod_init.back())) + 1; m_mod_init.emplace_back(0x0011, cellAudio_init); + cellCamera = static_cast (&(m_mod_init.back())) + 1; + m_mod_init.emplace_back(0x0023, cellCamera_init); cellDmux = static_cast (&(m_mod_init.back())) + 1; m_mod_init.emplace_back(0x0007, cellDmux_init); cellFiber = static_cast (&(m_mod_init.back())) + 1; @@ -247,6 +253,8 @@ void ModuleManager::init() m_mod_init.emplace_back(0x001e, cellL10n_init); cellNetCtl = static_cast (&(m_mod_init.back())) + 1; m_mod_init.emplace_back(0x0014, cellNetCtl_init); + cellOvis = static_cast (&(m_mod_init.back())) + 1; + m_mod_init.emplace_back(0x000b, cellOvis_init); cellPamf = static_cast (&(m_mod_init.back())) + 1; m_mod_init.emplace_back(0x0012, cellPamf_init); cellPngDec = static_cast (&(m_mod_init.back())) + 1; diff --git a/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp b/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp index c2237352bf..4b69b5aa72 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp @@ -1,8 +1,11 @@ #include "stdafx.h" -#if 0 +#include "Emu/SysCalls/Modules.h" + +#include "cellCamera.h" void cellCamera_init(); -Module cellCamera(0x0023, cellCamera_init); +//Module cellCamera(0x0023, cellCamera_init); +Module *cellCamera = nullptr; // Error Codes enum @@ -204,39 +207,38 @@ int cellCameraRemoveNotifyEventQueue2() void cellCamera_init() { - cellCamera.AddFunc(0xbf47c5dd, cellCameraInit); - cellCamera.AddFunc(0x5ad46570, cellCameraEnd); - cellCamera.AddFunc(0x85e1b8da, cellCameraOpen); - cellCamera.AddFunc(0x5d25f866, cellCameraOpenEx); - cellCamera.AddFunc(0x379c5dd6, cellCameraClose); + cellCamera->AddFunc(0xbf47c5dd, cellCameraInit); + cellCamera->AddFunc(0x5ad46570, cellCameraEnd); + cellCamera->AddFunc(0x85e1b8da, cellCameraOpen); + cellCamera->AddFunc(0x5d25f866, cellCameraOpenEx); + cellCamera->AddFunc(0x379c5dd6, cellCameraClose); - cellCamera.AddFunc(0x602e2052, cellCameraGetDeviceGUID); - cellCamera.AddFunc(0x58bc5870, cellCameraGetType); - cellCamera.AddFunc(0x8ca53dde, cellCameraIsAvailable); - cellCamera.AddFunc(0x7e063bbc, cellCameraIsAttached); - cellCamera.AddFunc(0xfa160f24, cellCameraIsOpen); - cellCamera.AddFunc(0x5eebf24e, cellCameraIsStarted); - cellCamera.AddFunc(0x532b8aaa, cellCameraGetAttribute); - cellCamera.AddFunc(0x8cd56eee, cellCameraSetAttribute); - cellCamera.AddFunc(0x7dac520c, cellCameraGetBufferSize); - cellCamera.AddFunc(0x10697d7f, cellCameraGetBufferInfo); - cellCamera.AddFunc(0x0e63c444, cellCameraGetBufferInfoEx); + cellCamera->AddFunc(0x602e2052, cellCameraGetDeviceGUID); + cellCamera->AddFunc(0x58bc5870, cellCameraGetType); + cellCamera->AddFunc(0x8ca53dde, cellCameraIsAvailable); + cellCamera->AddFunc(0x7e063bbc, cellCameraIsAttached); + cellCamera->AddFunc(0xfa160f24, cellCameraIsOpen); + cellCamera->AddFunc(0x5eebf24e, cellCameraIsStarted); + cellCamera->AddFunc(0x532b8aaa, cellCameraGetAttribute); + cellCamera->AddFunc(0x8cd56eee, cellCameraSetAttribute); + cellCamera->AddFunc(0x7dac520c, cellCameraGetBufferSize); + cellCamera->AddFunc(0x10697d7f, cellCameraGetBufferInfo); + cellCamera->AddFunc(0x0e63c444, cellCameraGetBufferInfoEx); - cellCamera.AddFunc(0x61dfbe83, cellCameraPrepExtensionUnit); - cellCamera.AddFunc(0xeb6f95fb, cellCameraCtrlExtensionUnit); - cellCamera.AddFunc(0xb602e328, cellCameraGetExtensionUnit); - cellCamera.AddFunc(0x2dea3e9b, cellCameraSetExtensionUnit); + cellCamera->AddFunc(0x61dfbe83, cellCameraPrepExtensionUnit); + cellCamera->AddFunc(0xeb6f95fb, cellCameraCtrlExtensionUnit); + cellCamera->AddFunc(0xb602e328, cellCameraGetExtensionUnit); + cellCamera->AddFunc(0x2dea3e9b, cellCameraSetExtensionUnit); - cellCamera.AddFunc(0x81f83db9, cellCameraReset); - cellCamera.AddFunc(0x456dc4aa, cellCameraStart); - cellCamera.AddFunc(0x3845d39b, cellCameraRead); - cellCamera.AddFunc(0x21fc151f, cellCameraReadEx); - cellCamera.AddFunc(0xe28b206b, cellCameraReadComplete); - cellCamera.AddFunc(0x02f5ced0, cellCameraStop); + cellCamera->AddFunc(0x81f83db9, cellCameraReset); + cellCamera->AddFunc(0x456dc4aa, cellCameraStart); + cellCamera->AddFunc(0x3845d39b, cellCameraRead); + cellCamera->AddFunc(0x21fc151f, cellCameraReadEx); + cellCamera->AddFunc(0xe28b206b, cellCameraReadComplete); + cellCamera->AddFunc(0x02f5ced0, cellCameraStop); - cellCamera.AddFunc(0xb0647e5a, cellCameraSetNotifyEventQueue); - cellCamera.AddFunc(0x9b98d258, cellCameraRemoveNotifyEventQueue); - cellCamera.AddFunc(0xa7fd2f5b, cellCameraSetNotifyEventQueue2); - cellCamera.AddFunc(0x44673f07, cellCameraRemoveNotifyEventQueue2); + cellCamera->AddFunc(0xb0647e5a, cellCameraSetNotifyEventQueue); + cellCamera->AddFunc(0x9b98d258, cellCameraRemoveNotifyEventQueue); + cellCamera->AddFunc(0xa7fd2f5b, cellCameraSetNotifyEventQueue2); + cellCamera->AddFunc(0x44673f07, cellCameraRemoveNotifyEventQueue2); } -#endif diff --git a/rpcs3/Emu/SysCalls/Modules/cellCamera.h b/rpcs3/Emu/SysCalls/Modules/cellCamera.h new file mode 100644 index 0000000000..165aaf5c97 --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/cellCamera.h @@ -0,0 +1,60 @@ +#pragma once + +// Camera types +enum CellCameraType +{ + CELL_CAMERA_TYPE_UNKNOWN, + CELL_CAMERA_EYETOY, + CELL_CAMERA_EYETOY2, + CELL_CAMERA_USBVIDEOCLASS, +}; + +// Image format +enum CellCameraFormat +{ + CELL_CAMERA_FORMAT_UNKNOWN, + CELL_CAMERA_JPG, + CELL_CAMERA_RAW8, + CELL_CAMERA_YUV422, + CELL_CAMERA_RAW10, + CELL_CAMERA_RGBA, + CELL_CAMERA_YUV420, + CELL_CAMERA_V_Y1_U_Y0, + CELL_CAMERA_Y0_U_Y1_V = CELL_CAMERA_YUV422, +}; + +// Image resolutiom +enum CellCameraResolution +{ + CELL_CAMERA_RESOLUTION_UNKNOWN, + CELL_CAMERA_VGA, + CELL_CAMERA_QVGA, + CELL_CAMERA_WGA, + CELL_CAMERA_SPECIFIED_WIDTH_HEIGHT, +}; + +struct CellCameraInfoEx +{ + CellCameraFormat format; + CellCameraResolution resolution; + be_t framerate; + be_t buffer; + be_t bytesize; + be_t width; + be_t height; + be_t dev_num; + be_t guid; + be_t info_ver; + be_t container; + be_t read_mode; + be_t pbuf[2]; +}; + +struct CellCameraReadEx +{ + be_t version; + be_t frame; + be_t bytesread; + //system_time_t timestamp; // TODO: Replace this with something + be_t pbuf; +}; \ No newline at end of file diff --git a/rpcs3/Emu/SysCalls/Modules/cellGem.cpp b/rpcs3/Emu/SysCalls/Modules/cellGem.cpp index 96ebff239e..055ac56dd8 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGem.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGem.cpp @@ -117,8 +117,7 @@ s32 cellGemGetMemorySize(be_t max_connect) if (max_connect > CELL_GEM_MAX_NUM) return CELL_GEM_ERROR_INVALID_PARAMETER; - // Return in kilobytes, megabytes or something else? (currently kilobytes) - return max_connect * 4000; + return (1024 * 1024) * max_connect; // 1MB * max_connect } int cellGemGetRGB() diff --git a/rpcs3/Emu/SysCalls/Modules/cellOvis.cpp b/rpcs3/Emu/SysCalls/Modules/cellOvis.cpp index f580c41608..46f6ea8a78 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellOvis.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellOvis.cpp @@ -1,8 +1,9 @@ #include "stdafx.h" -#if 0 +#include "Emu/SysCalls/Modules.h" void cellOvis_init(); -Module cellOvis(0x000b, cellOvis_init); +//Module cellOvis(0x000b, cellOvis_init); +Module *cellOvis = nullptr; // Return Codes enum @@ -38,9 +39,8 @@ int cellOvisInvalidateOverlappedSegments() void cellOvis_init() { - cellOvis.AddFunc(0x82f294b2, cellOvisGetOverlayTableSize); - cellOvis.AddFunc(0xa876c911, cellOvisInitializeOverlayTable); - cellOvis.AddFunc(0xce6cb776, cellOvisFixSpuSegments); - cellOvis.AddFunc(0x629ba0c0, cellOvisInvalidateOverlappedSegments); + cellOvis->AddFunc(0x82f294b2, cellOvisGetOverlayTableSize); + cellOvis->AddFunc(0xa876c911, cellOvisInitializeOverlayTable); + cellOvis->AddFunc(0xce6cb776, cellOvisFixSpuSegments); + cellOvis->AddFunc(0x629ba0c0, cellOvisInvalidateOverlappedSegments); } -#endif diff --git a/rpcs3/Emu/SysCalls/Modules/sceNp.h b/rpcs3/Emu/SysCalls/Modules/sceNp.h index 0ac739cab0..f31bd6d25d 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNp.h +++ b/rpcs3/Emu/SysCalls/Modules/sceNp.h @@ -1128,7 +1128,7 @@ struct SceNpMatching2InvitationData struct SceNpMatching2SignalingOptParam { u8 type; - //u8 reserved1[1]; + u8 reserved1[1]; be_t hubMemberId; //u8 reserved2[4]; }; @@ -1741,7 +1741,7 @@ struct SceNpMatching2SignalingOptParamUpdateInfo // Matching2 utility intilization parameters struct SceNpMatching2UtilityInitParam { - //sys_memory_container_t containerId; //TODO: Uncomment this once sys_memory_container_t is implemented + be_t containerId; be_t requestCbQueueLen; be_t sessionEventCbQueueLen;; be_t sessionMsgCbQueueLen;; @@ -1796,7 +1796,7 @@ struct SceNpScoreRankData be_t highestRank; be_t scoreValue; be_t hasGameData; - //u8 pad0[4]; + u8 pad0[4]; CellRtcTick recordDate; }; @@ -1804,7 +1804,7 @@ struct SceNpScoreRankData struct SceNpScorePlayerRankData { be_t hasData; - //u8 pad0[4]; + u8 pad0[4]; SceNpScoreRankData rankData; }; @@ -1864,7 +1864,7 @@ struct SceNpScoreClanRankData struct SceNpScoreClanIdRankData { be_t hasData; - //u8 pad0[4]; + u8 pad0[4]; SceNpScoreClanRankData rankData; }; diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index f2e3905be6..274b9f725e 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -363,6 +363,7 @@ + diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index e0d50650bc..93d33780f4 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -131,9 +131,15 @@ Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules @@ -152,12 +158,24 @@ Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + Emu\SysCalls\Modules @@ -173,12 +191,21 @@ Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules @@ -365,9 +392,6 @@ Emu\SysCalls\currently_unused - - Emu\SysCalls\currently_unused - Emu\SysCalls\currently_unused @@ -401,9 +425,6 @@ Emu\SysCalls\currently_unused - - Emu\SysCalls\currently_unused - Emu\SysCalls\currently_unused @@ -422,9 +443,6 @@ Emu\SysCalls\currently_unused - - Emu\Cell\currently_unused - Emu\SysCalls\currently_unused @@ -584,15 +602,6 @@ Utilities - - Emu\SysCalls\Modules - - - Emu\SysCalls\Modules - - - Emu\SysCalls\Modules - Utilities @@ -611,18 +620,6 @@ Emu\Memory - - Emu\SysCalls\Modules - - - Emu\SysCalls\Modules - - - Emu\SysCalls\Modules - - - Emu\SysCalls\Modules - @@ -676,12 +673,27 @@ Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + Emu\SysCalls\Modules @@ -691,27 +703,54 @@ Emu\SysCalls\Modules + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules Emu\SysCalls\Modules - - Emu\SysCalls\Modules - Emu\SysCalls\Modules Emu\SysCalls\Modules + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + Emu\SysCalls\Modules + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + Emu\SysCalls\Modules @@ -745,6 +784,9 @@ Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules @@ -1048,24 +1090,9 @@ Utilities - - Emu\SysCalls\Modules - - - Emu\SysCalls\Modules - - - Emu\SysCalls\Modules - Emu\SysCalls - - Emu\SysCalls\Modules - - - Emu\SysCalls\Modules - Emu\RSX\Null @@ -1126,15 +1153,9 @@ Utilities - - Emu\SysCalls\Modules - Emu - - Emu\SysCalls\Modules - Utilities @@ -1147,15 +1168,6 @@ Emu\Io\Null - - Emu\SysCalls\Modules - - - Emu\SysCalls\Modules - - - Emu\SysCalls\Modules - Utilities @@ -1192,18 +1204,6 @@ Emu\Memory - - Emu\SysCalls\Modules - - - Emu\SysCalls\Modules - - - Emu\SysCalls\Modules - - - Emu\SysCalls\Modules - Header Files From 6029cc40f21b510897baf6787a44f25ffc236c07 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Tue, 9 Sep 2014 18:44:02 +0300 Subject: [PATCH 07/12] Added new things, updated others + Tab in settings for cellCamera and cellGem related things, currently includes setting camera type + cellCamera and cellGem initilization + Added cellCameraGetType * Updated asmjit and ffmpeg * Some minor optimizations --- asmjit | 2 +- ffmpeg | 2 +- rpcs3/Emu/SysCalls/Modules/cellAdec.cpp | 2 +- rpcs3/Emu/SysCalls/Modules/cellCamera.cpp | 50 ++++++++++++++-------- rpcs3/Emu/SysCalls/Modules/cellCamera.h | 18 ++++++++ rpcs3/Emu/SysCalls/Modules/cellGem.cpp | 25 +++++++++-- rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp | 9 ++-- rpcs3/Emu/SysCalls/Modules/cellVdec.cpp | 2 +- rpcs3/Emu/SysCalls/Modules/cellVpost.cpp | 2 +- rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp | 4 +- rpcs3/Gui/ConLogFrame.cpp | 4 +- rpcs3/Gui/MainFrame.cpp | 22 +++++++++- rpcs3/Ini.h | 12 ++++++ 13 files changed, 117 insertions(+), 37 deletions(-) diff --git a/asmjit b/asmjit index d7fc62d9e9..9ead0cfb4c 160000 --- a/asmjit +++ b/asmjit @@ -1 +1 @@ -Subproject commit d7fc62d9e905859579f5965eee6f7f99b65c2246 +Subproject commit 9ead0cfb4cb5eb1bcf8c12b4a1ea115e438c44fa diff --git a/ffmpeg b/ffmpeg index 8bcaa2485c..352fdfbbfa 160000 --- a/ffmpeg +++ b/ffmpeg @@ -1 +1 @@ -Subproject commit 8bcaa2485c2434d7d7a9da17491bafb58de42bb6 +Subproject commit 352fdfbbfa6d7b26142f00b43d7e1802a03c68a8 diff --git a/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp index e6999655cf..36c522670a 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp @@ -609,7 +609,7 @@ int cellAdecQueryAttr(vm::ptr type, vm::ptr attr) // TODO: check values attr->adecVerLower = 0x280000; // from dmux attr->adecVerUpper = 0x260000; - attr->workMemSize = 4 * 1024 * 1024; + attr->workMemSize = 4194304; // 4MB return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp b/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp index 4b69b5aa72..1e583d3c9e 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp @@ -1,4 +1,6 @@ #include "stdafx.h" +#include "Ini.h" +#include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" #include "cellCamera.h" @@ -7,27 +9,29 @@ void cellCamera_init(); //Module cellCamera(0x0023, cellCamera_init); Module *cellCamera = nullptr; -// Error Codes -enum +struct cellCameraInternal { - CELL_CAMERA_ERROR_ALREADY_INIT = 0x80140801, - CELL_CAMERA_ERROR_NOT_INIT = 0x80140803, - CELL_CAMERA_ERROR_PARAM = 0x80140804, - CELL_CAMERA_ERROR_ALREADY_OPEN = 0x80140805, - CELL_CAMERA_ERROR_NOT_OPEN = 0x80140806, - CELL_CAMERA_ERROR_DEVICE_NOT_FOUND = 0x80140807, - CELL_CAMERA_ERROR_DEVICE_DEACTIVATED = 0x80140808, - CELL_CAMERA_ERROR_NOT_STARTED = 0x80140809, - CELL_CAMERA_ERROR_FORMAT_UNKNOWN = 0x8014080a, - CELL_CAMERA_ERROR_RESOLUTION_UNKNOWN = 0x8014080b, - CELL_CAMERA_ERROR_BAD_FRAMERATE = 0x8014080c, - CELL_CAMERA_ERROR_TIMEOUT = 0x8014080d, - CELL_CAMERA_ERROR_FATAL = 0x8014080f, + bool m_bInitialized; + + cellCameraInternal() + : m_bInitialized(false) + { + } }; +cellCameraInternal cellCameraInstance; + int cellCameraInit() { - UNIMPLEMENTED_FUNC(cellCamera); + cellCamera->Warning("cellCameraInit()"); + + if (cellCameraInstance.m_bInitialized) + return CELL_CAMERA_ERROR_ALREADY_INIT; + + // TODO: Check if camera is connected, if not return CELL_CAMERA_ERROR_DEVICE_NOT_FOUND + + cellCameraInstance.m_bInitialized = true; + return CELL_OK; } @@ -61,9 +65,19 @@ int cellCameraGetDeviceGUID() return CELL_OK; } -int cellCameraGetType() +int cellCameraGetType(s32 dev_num, CellCameraType type) { - UNIMPLEMENTED_FUNC(cellCamera); + cellCamera->Warning("cellCameraGetType(dev_num=%d, type_addr=0x%x)", dev_num, type); + + if (Ini.CameraType.GetValue() == 1) + type = CELL_CAMERA_EYETOY; + else if (Ini.CameraType.GetValue() == 2) + type = CELL_CAMERA_EYETOY2; + else if (Ini.CameraType.GetValue() == 3) + type == CELL_CAMERA_USBVIDEOCLASS; + else + type = CELL_CAMERA_TYPE_UNKNOWN; + return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellCamera.h b/rpcs3/Emu/SysCalls/Modules/cellCamera.h index 165aaf5c97..c56aae37fa 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellCamera.h +++ b/rpcs3/Emu/SysCalls/Modules/cellCamera.h @@ -1,5 +1,23 @@ #pragma once +// Error Codes +enum +{ + CELL_CAMERA_ERROR_ALREADY_INIT = 0x80140801, + CELL_CAMERA_ERROR_NOT_INIT = 0x80140803, + CELL_CAMERA_ERROR_PARAM = 0x80140804, + CELL_CAMERA_ERROR_ALREADY_OPEN = 0x80140805, + CELL_CAMERA_ERROR_NOT_OPEN = 0x80140806, + CELL_CAMERA_ERROR_DEVICE_NOT_FOUND = 0x80140807, + CELL_CAMERA_ERROR_DEVICE_DEACTIVATED = 0x80140808, + CELL_CAMERA_ERROR_NOT_STARTED = 0x80140809, + CELL_CAMERA_ERROR_FORMAT_UNKNOWN = 0x8014080a, + CELL_CAMERA_ERROR_RESOLUTION_UNKNOWN = 0x8014080b, + CELL_CAMERA_ERROR_BAD_FRAMERATE = 0x8014080c, + CELL_CAMERA_ERROR_TIMEOUT = 0x8014080d, + CELL_CAMERA_ERROR_FATAL = 0x8014080f, +}; + // Camera types enum CellCameraType { diff --git a/rpcs3/Emu/SysCalls/Modules/cellGem.cpp b/rpcs3/Emu/SysCalls/Modules/cellGem.cpp index 055ac56dd8..10854f1892 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGem.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGem.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" #include "cellGem.h" @@ -7,6 +8,18 @@ void cellGem_init(); //Module cellGem(0x005a, cellGem_init); Module *cellGem = nullptr; +struct cellGemInternal +{ + bool m_bInitialized; + + cellGemInternal() + : m_bInitialized(false) + { + } +}; + +cellGemInternal cellGemInstance; + int cellGemCalibrate() { UNIMPLEMENTED_FUNC(cellGem); @@ -117,7 +130,7 @@ s32 cellGemGetMemorySize(be_t max_connect) if (max_connect > CELL_GEM_MAX_NUM) return CELL_GEM_ERROR_INVALID_PARAMETER; - return (1024 * 1024) * max_connect; // 1MB * max_connect + return 1048576 * max_connect; // 1MB * max_connect } int cellGemGetRGB() @@ -156,9 +169,15 @@ int cellGemHSVtoRGB() return CELL_OK; } -int cellGemInit() +int cellGemInit(vm::ptr attribute) { - UNIMPLEMENTED_FUNC(cellGem); + cellGem->Warning("cellGemInit(attribute_addr=0x%x)", attribute.addr()); + + if (cellGemInstance.m_bInitialized) + return CELL_GEM_ERROR_ALREADY_INITIALIZED; + + cellGemInstance.m_bInitialized = true; + return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp index b246d231e0..f0dcb78267 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp @@ -664,7 +664,7 @@ int cellHddGameCheck(u32 version, vm::ptr dirName, u32 errDialog, vm vm::var get; vm::var set; - get->hddFreeSizeKB = 40 * 1024 * 1024; // 40 GB, TODO: Use the free space of the computer's HDD where RPCS3 is being run. + get->hddFreeSizeKB = 419430400; // 40 MB, TODO: Use the free space of the computer's HDD where RPCS3 is being run. get->isNewData = CELL_HDDGAME_ISNEWDATA_EXIST; get->sysSizeKB = 0; // TODO get->st_atime__ = 0; // TODO @@ -709,12 +709,9 @@ int cellHddGameCheck(u32 version, vm::ptr dirName, u32 errDialog, vm // TODO ? funcStat(result, get, set); - - /* - if (result->result != CELL_HDDGAME_CBRESULT_OK && // error on compiling in MVS. Needs to use LE byte order? + if (result->result != CELL_HDDGAME_CBRESULT_OK && result->result != CELL_HDDGAME_CBRESULT_OK_CANCEL) return CELL_HDDGAME_ERROR_CBRESULT; - */ // TODO ? @@ -794,7 +791,7 @@ int cellWebBrowserEstimate2(const vm::ptr config, v // TODO: When cellWebBrowser stuff is implemented, change this to some real // needed memory buffer size. - *memSize = 1024 * 1024 * 1; // 1 MB + *memSize = 1048576; // 1 MB return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp index adcc418cdc..15bca18cc7 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp @@ -174,7 +174,7 @@ u32 vdecQueryAttr(CellVdecCodecType type, u32 profile, u32 spec_addr /* may be 0 // TODO: check values attr->decoderVerLower = 0x280000; // from dmux attr->decoderVerUpper = 0x260000; - attr->memSize = 4 * 1024 * 1024; + attr->memSize = 4194304; // 4MB attr->cmdDepth = 16; return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp b/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp index 16ee6c464a..e9be058a25 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp @@ -21,7 +21,7 @@ int cellVpostQueryAttr(vm::ptr cfgParam, vm::ptrdelay = 0; - attr->memSize = 4 * 1024 * 1024; + attr->memSize = 4194304; // 4MB attr->vpostVerLower = 0x280000; // from dmux attr->vpostVerUpper = 0x260000; diff --git a/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp b/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp index b2d6da9860..a66e16a185 100644 --- a/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp +++ b/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp @@ -590,8 +590,8 @@ s32 cellFsStReadInit(u32 fd, vm::ptr ringbuf) fs_config.m_ring_buffer = *ringbuf; if(ringbuf->ringbuf_size < 0x40000000) // If the size is less than 1MB - fs_config.m_alloc_mem_size = (((u32)ringbuf->ringbuf_size + 64 * 1024 - 1) / (64 * 1024)) * (64 * 1024); - fs_config.m_alloc_mem_size = (((u32)ringbuf->ringbuf_size + 1024 * 1024 - 1) / (1024 * 1024)) * (1024 * 1024); + fs_config.m_alloc_mem_size = (((u32)ringbuf->ringbuf_size + 65535) / (65536)) * (65536); + fs_config.m_alloc_mem_size = (((u32)ringbuf->ringbuf_size + 1048575) / (1048576)) * (1048576); // alloc memory fs_config.m_buffer = (u32)Memory.Alloc(fs_config.m_alloc_mem_size, 1024); diff --git a/rpcs3/Gui/ConLogFrame.cpp b/rpcs3/Gui/ConLogFrame.cpp index 0dd80f269e..9e9d0209fc 100644 --- a/rpcs3/Gui/ConLogFrame.cpp +++ b/rpcs3/Gui/ConLogFrame.cpp @@ -11,10 +11,10 @@ wxDEFINE_EVENT(EVT_LOG_COMMAND, wxCommandEvent); //amount of memory in bytes used to buffer log messages for the gui -const int BUFFER_MAX_SIZE = 1024 * 1024; +const int BUFFER_MAX_SIZE = 1048576; // 1MB //amount of characters in the TextCtrl text-buffer for the emulation log -const int GUI_BUFFER_MAX_SIZE = 1024 * 1024; +const int GUI_BUFFER_MAX_SIZE = 1048576; // 1MB enum { diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index dca2b82f88..cbf75c2c4f 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -331,8 +331,8 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) } wxDialog diag(this, wxID_ANY, "Settings", wxDefaultPosition); + static const u32 width = 425; static const u32 height = 400; - static const u32 width = 385; // Settings panels wxNotebook* nb_config = new wxNotebook(&diag, wxID_ANY, wxPoint(6,6), wxSize(width, height)); @@ -340,12 +340,14 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) wxPanel* p_cpu = new wxPanel(nb_config, wxID_ANY); wxPanel* p_graphics = new wxPanel(nb_config, wxID_ANY); wxPanel* p_audio = new wxPanel(nb_config, wxID_ANY); + wxPanel* p_camera = new wxPanel(nb_config, wxID_ANY); wxPanel* p_io = new wxPanel(nb_config, wxID_ANY); wxPanel* p_hle = new wxPanel(nb_config, wxID_ANY); nb_config->AddPage(p_cpu, wxT("Core")); nb_config->AddPage(p_graphics, wxT("Graphics")); nb_config->AddPage(p_audio, wxT("Audio")); + nb_config->AddPage(p_camera, wxT("Camera")); nb_config->AddPage(p_io, wxT("Input / Output")); nb_config->AddPage(p_hle, wxT("HLE / Misc.")); nb_config->AddPage(p_system, wxT("System")); @@ -354,6 +356,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) wxBoxSizer* s_subpanel_cpu = new wxBoxSizer(wxVERTICAL); wxBoxSizer* s_subpanel_graphics = new wxBoxSizer(wxVERTICAL); wxBoxSizer* s_subpanel_audio = new wxBoxSizer(wxVERTICAL); + wxBoxSizer* s_subpanel_camera = new wxBoxSizer(wxVERTICAL); wxBoxSizer* s_subpanel_io = new wxBoxSizer(wxVERTICAL); wxBoxSizer* s_subpanel_hle = new wxBoxSizer(wxVERTICAL); @@ -374,6 +377,9 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) // Audio wxStaticBoxSizer* s_round_audio_out = new wxStaticBoxSizer(wxVERTICAL, p_audio, _("Audio Out")); + // Camera + wxStaticBoxSizer* s_round_camera_type = new wxStaticBoxSizer(wxVERTICAL, p_camera, _("Camera type")); + // HLE / Misc. wxStaticBoxSizer* s_round_hle_log_lvl = new wxStaticBoxSizer(wxVERTICAL, p_hle, _("Log Level")); @@ -389,6 +395,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) wxComboBox* cbox_keyboard_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_camera_type = new wxComboBox(p_camera, wxID_ANY); wxComboBox* cbox_hle_loglvl = new wxComboBox(p_hle, wxID_ANY); wxComboBox* cbox_sys_lang = new wxComboBox(p_system, wxID_ANY); @@ -444,6 +451,11 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) cbox_audio_out->Append("Null"); cbox_audio_out->Append("OpenAL"); + cbox_camera_type->Append("Unknown"); + cbox_camera_type->Append("EyeToy"); + cbox_camera_type->Append("PlayStation Eye"); + cbox_camera_type->Append("USB Video Class 1.1"); + cbox_hle_loglvl->Append("All"); cbox_hle_loglvl->Append("Success"); cbox_hle_loglvl->Append("Warnings"); @@ -495,6 +507,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) cbox_keyboard_handler->SetSelection(Ini.KeyboardHandlerMode.GetValue()); cbox_mouse_handler ->SetSelection(Ini.MouseHandlerMode.GetValue()); cbox_audio_out ->SetSelection(Ini.AudioOutMode.GetValue()); + cbox_camera_type ->SetSelection(Ini.CameraType.GetValue()); cbox_hle_loglvl ->SetSelection(Ini.HLELogLvl.GetValue()); cbox_sys_lang ->SetSelection(Ini.SysLanguage.GetValue()); @@ -517,6 +530,8 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) s_round_audio_out->Add(cbox_audio_out, wxSizerFlags().Border(wxALL, 5).Expand()); + s_round_camera_type->Add(cbox_camera_type, 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()); @@ -544,6 +559,9 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) s_subpanel_audio->Add(chbox_audio_dump, wxSizerFlags().Border(wxALL, 5).Expand()); s_subpanel_audio->Add(chbox_audio_conv, wxSizerFlags().Border(wxALL, 5).Expand()); + // Camera + s_subpanel_camera->Add(s_round_camera_type, wxSizerFlags().Border(wxALL, 5).Expand()); + // HLE / Misc. s_subpanel_hle->Add(s_round_hle_log_lvl, wxSizerFlags().Border(wxALL, 5).Expand()); s_subpanel_hle->Add(chbox_hle_logging, wxSizerFlags().Border(wxALL, 5).Expand()); @@ -569,6 +587,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) diag.SetSizerAndFit(s_subpanel_graphics, false); diag.SetSizerAndFit(s_subpanel_io, false); diag.SetSizerAndFit(s_subpanel_audio, false); + diag.SetSizerAndFit(s_subpanel_camera, false); diag.SetSizerAndFit(s_subpanel_hle, false); diag.SetSizerAndFit(s_subpanel_system, false); diag.SetSizerAndFit(s_b_panel, false); @@ -592,6 +611,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) Ini.AudioOutMode.SetValue(cbox_audio_out->GetSelection()); Ini.AudioDumpToFile.SetValue(chbox_audio_dump->GetValue()); Ini.AudioConvertToU16.SetValue(chbox_audio_conv->GetValue()); + Ini.CameraType.SetValue(cbox_camera_type->GetSelection()); Ini.HLELogging.SetValue(chbox_hle_logging->GetValue()); Ini.HLEHookStFunc.SetValue(chbox_hle_hook_stfunc->GetValue()); Ini.HLESaveTTY.SetValue(chbox_hle_savetty->GetValue()); diff --git a/rpcs3/Ini.h b/rpcs3/Ini.h index efb7813cde..a7be1a2a5d 100644 --- a/rpcs3/Ini.h +++ b/rpcs3/Ini.h @@ -114,6 +114,9 @@ public: IniEntry AudioDumpToFile; IniEntry AudioConvertToU16; + // Camera + IniEntry CameraType; + // Input/Output IniEntry PadHandlerMode; IniEntry KeyboardHandlerMode; @@ -183,6 +186,9 @@ public: AudioDumpToFile.Init("Audio_AudioDumpToFile", path); AudioConvertToU16.Init("Audio_AudioConvertToU16", path); + // Camera + CameraType.Init("Camera_Type", path); + // Input/Output PadHandlerMode.Init("IO_PadHandlerMode", path); KeyboardHandlerMode.Init("IO_KeyboardHandlerMode", path); @@ -248,6 +254,9 @@ public: AudioDumpToFile.Load(false); AudioConvertToU16.Load(false); + // Camera + CameraType.Load(2); + // Input/Ouput PadHandlerMode.Load(1); KeyboardHandlerMode.Load(0); @@ -314,6 +323,9 @@ public: AudioDumpToFile.Save(); AudioConvertToU16.Save(); + // Camera + CameraType.Save(); + // Input/Output PadHandlerMode.Save(); KeyboardHandlerMode.Save(); From 089a6ee07d0694e6394c6831a07035b117ec05d7 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Tue, 9 Sep 2014 18:49:12 +0300 Subject: [PATCH 08/12] Minor cellSysutil fix --- rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp index f0dcb78267..c1ea307428 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp @@ -709,9 +709,12 @@ int cellHddGameCheck(u32 version, vm::ptr dirName, u32 errDialog, vm // TODO ? funcStat(result, get, set); + + /* if (result->result != CELL_HDDGAME_CBRESULT_OK && - result->result != CELL_HDDGAME_CBRESULT_OK_CANCEL) + result->result != CELL_HDDGAME_CBRESULT_OK_CANCEL) // Error in compiling in MVS. Need to use LE byte order? return CELL_HDDGAME_ERROR_CBRESULT; + */ // TODO ? From dc51630803858ac6386d6d269d417155ebc8263d Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Tue, 9 Sep 2014 19:08:13 +0300 Subject: [PATCH 09/12] Comment fix --- rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp index c1ea307428..1c22cce875 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp @@ -664,7 +664,7 @@ int cellHddGameCheck(u32 version, vm::ptr dirName, u32 errDialog, vm vm::var get; vm::var set; - get->hddFreeSizeKB = 419430400; // 40 MB, TODO: Use the free space of the computer's HDD where RPCS3 is being run. + get->hddFreeSizeKB = 40 * 1048576; // 40 GB, TODO: Use the free space of the computer's HDD where RPCS3 is being run. get->isNewData = CELL_HDDGAME_ISNEWDATA_EXIST; get->sysSizeKB = 0; // TODO get->st_atime__ = 0; // TODO From b881e095e9c7ae4b9188592f89c5e211c7c75c6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandro=20S=C3=A1nchez=20Bach?= Date: Tue, 9 Sep 2014 23:18:21 +0200 Subject: [PATCH 10/12] Fixed cellFsStReadInit issue * Disabled automatic HLEExitOnStop option when the ELF file argument is provided. * Reverted some changes of last pull. --- rpcs3/Emu/SysCalls/Modules/cellAdec.cpp | 2 +- rpcs3/Emu/SysCalls/Modules/cellGem.cpp | 2 +- rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp | 11 +++++------ rpcs3/Emu/SysCalls/Modules/cellVdec.cpp | 2 +- rpcs3/Emu/SysCalls/Modules/cellVpost.cpp | 2 +- rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp | 12 ++++++++---- rpcs3/rpcs3.cpp | 6 +----- 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp index 36c522670a..11b9158bc6 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp @@ -609,7 +609,7 @@ int cellAdecQueryAttr(vm::ptr type, vm::ptr attr) // TODO: check values attr->adecVerLower = 0x280000; // from dmux attr->adecVerUpper = 0x260000; - attr->workMemSize = 4194304; // 4MB + attr->workMemSize = 4 * 1024 * 1024; // 4 MB return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellGem.cpp b/rpcs3/Emu/SysCalls/Modules/cellGem.cpp index 10854f1892..47c5392d16 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGem.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGem.cpp @@ -130,7 +130,7 @@ s32 cellGemGetMemorySize(be_t max_connect) if (max_connect > CELL_GEM_MAX_NUM) return CELL_GEM_ERROR_INVALID_PARAMETER; - return 1048576 * max_connect; // 1MB * max_connect + return 1024 * 1024 * max_connect; // 1 MB * max_connect } int cellGemGetRGB() diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp index 1c22cce875..b44866b397 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp @@ -664,7 +664,7 @@ int cellHddGameCheck(u32 version, vm::ptr dirName, u32 errDialog, vm vm::var get; vm::var set; - get->hddFreeSizeKB = 40 * 1048576; // 40 GB, TODO: Use the free space of the computer's HDD where RPCS3 is being run. + get->hddFreeSizeKB = 40 * 1024 * 1024; // 40 GB, TODO: Use the free space of the computer's HDD where RPCS3 is being run. get->isNewData = CELL_HDDGAME_ISNEWDATA_EXIST; get->sysSizeKB = 0; // TODO get->st_atime__ = 0; // TODO @@ -710,11 +710,10 @@ int cellHddGameCheck(u32 version, vm::ptr dirName, u32 errDialog, vm funcStat(result, get, set); - /* - if (result->result != CELL_HDDGAME_CBRESULT_OK && - result->result != CELL_HDDGAME_CBRESULT_OK_CANCEL) // Error in compiling in MVS. Need to use LE byte order? + if (result->result.ToLE() != CELL_HDDGAME_CBRESULT_OK && + result->result.ToLE() != CELL_HDDGAME_CBRESULT_OK_CANCEL) { return CELL_HDDGAME_ERROR_CBRESULT; - */ + } // TODO ? @@ -794,7 +793,7 @@ int cellWebBrowserEstimate2(const vm::ptr config, v // TODO: When cellWebBrowser stuff is implemented, change this to some real // needed memory buffer size. - *memSize = 1048576; // 1 MB + *memSize = 1 * 1024 * 1024; // 1 MB return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp index 15bca18cc7..0f7fc6b45c 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp @@ -174,7 +174,7 @@ u32 vdecQueryAttr(CellVdecCodecType type, u32 profile, u32 spec_addr /* may be 0 // TODO: check values attr->decoderVerLower = 0x280000; // from dmux attr->decoderVerUpper = 0x260000; - attr->memSize = 4194304; // 4MB + attr->memSize = 4 * 1024 * 1024; // 4 MB attr->cmdDepth = 16; return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp b/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp index e9be058a25..5944b4f055 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp @@ -21,7 +21,7 @@ int cellVpostQueryAttr(vm::ptr cfgParam, vm::ptrdelay = 0; - attr->memSize = 4194304; // 4MB + attr->memSize = 4 * 1024 * 1024; // 4 MB attr->vpostVerLower = 0x280000; // from dmux attr->vpostVerUpper = 0x260000; diff --git a/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp b/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp index a66e16a185..8765908b71 100644 --- a/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp +++ b/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp @@ -534,7 +534,7 @@ s32 cellFsGetFreeSize(vm::ptr path, vm::ptr> block_size, v // TODO: Get real values. Currently, it always returns 40 GB of free space divided in 4 KB blocks *block_size = 4096; // ? - *block_count = 10485760; // ? + *block_count = 10 * 1024 * 1024; // ? return CELL_OK; } @@ -589,9 +589,13 @@ s32 cellFsStReadInit(u32 fd, vm::ptr ringbuf) fs_config.m_ring_buffer = *ringbuf; - if(ringbuf->ringbuf_size < 0x40000000) // If the size is less than 1MB - fs_config.m_alloc_mem_size = (((u32)ringbuf->ringbuf_size + 65535) / (65536)) * (65536); - fs_config.m_alloc_mem_size = (((u32)ringbuf->ringbuf_size + 1048575) / (1048576)) * (1048576); + // If the size is less than 1MB + if(ringbuf->ringbuf_size < 0x40000000) { + fs_config.m_alloc_mem_size = (((u32)ringbuf->ringbuf_size + 64 * 1024 - 1) / (64 * 1024)) * (64 * 1024); + } + else { + fs_config.m_alloc_mem_size = (((u32)ringbuf->ringbuf_size + 1024 * 1024 - 1) / (1024 * 1024)) * (1024 * 1024); + } // alloc memory fs_config.m_buffer = (u32)Memory.Alloc(fs_config.m_alloc_mem_size, 1024); diff --git a/rpcs3/rpcs3.cpp b/rpcs3/rpcs3.cpp index 09da440a9c..dc40edfd17 100644 --- a/rpcs3/rpcs3.cpp +++ b/rpcs3/rpcs3.cpp @@ -152,11 +152,7 @@ void Rpcs3App::OnArguments() // rpcs3-*.exe Initializes RPCS3 // rpcs3-*.exe [(S)ELF] Initializes RPCS3, then loads and runs the specified (S)ELF file. - if (Rpcs3App::argc > 1) - { - // Force this value to be true - Ini.HLEExitOnStop.SetValue(true); - + if (Rpcs3App::argc > 1) { Emu.SetPath(fmt::ToUTF8(argv[1])); Emu.Load(); Emu.Run(); From 145e0aa827a7790347efd73f24c2a016480bbc2a Mon Sep 17 00:00:00 2001 From: darkf Date: Tue, 9 Sep 2014 21:54:51 -0700 Subject: [PATCH 11/12] implement cellFsStRead (does *not* use ringbuffers) --- rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp | 9 +++++++-- rpcs3/Emu/SysCalls/lv2/lv2Fs.h | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp b/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp index 8765908b71..9b75ed13a7 100644 --- a/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp +++ b/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp @@ -696,15 +696,20 @@ s32 cellFsStReadStop(u32 fd) s32 cellFsStRead(u32 fd, u32 buf_addr, u64 size, vm::ptr> rsize) { - sys_fs->Todo("cellFsStRead(fd=%d, buf_addr=0x%x, size=0x%llx, rsize_addr = 0x%x)", fd, buf_addr, size, rsize.addr()); + sys_fs->Warning("cellFsStRead(fd=%d, buf_addr=0x%x, size=0x%llx, rsize_addr=0x%x)", fd, buf_addr, size, rsize.addr()); LV2_LOCK(0); vfsStream* file; if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH; + // TODO: use ringbuffer (fs_config) fs_config.m_regid += size; - *rsize = fs_config.m_regid; + + if (file->Eof()) + return CELL_FS_ERANGE; + + *rsize = file->Read(vm::get_ptr(buf_addr), size); return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/lv2/lv2Fs.h b/rpcs3/Emu/SysCalls/lv2/lv2Fs.h index 841a7b994b..c7cf8814fe 100644 --- a/rpcs3/Emu/SysCalls/lv2/lv2Fs.h +++ b/rpcs3/Emu/SysCalls/lv2/lv2Fs.h @@ -70,6 +70,10 @@ enum cellFsStStatus CELL_FS_ST_PROGRESS = 0x0200, }; +enum cellFsErrors +{ + CELL_FS_ERANGE = 34 +}; #pragma pack(push, 4) From 88cc03b9e2dde3c4a93d7dfca11e0743393a3aa5 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Thu, 11 Sep 2014 18:59:42 +0300 Subject: [PATCH 12/12] Implemented NV4097_SET_TWO_SIDE_LIGHT_EN --- rpcs3/Emu/RSX/GL/GLGSRender.cpp | 6 ++++++ rpcs3/Emu/RSX/RSXThread.cpp | 6 ++++++ rpcs3/Emu/RSX/RSXThread.h | 3 +++ rpcs3/Emu/SysCalls/Modules/cellResc.cpp | 1 + 4 files changed, 16 insertions(+) diff --git a/rpcs3/Emu/RSX/GL/GLGSRender.cpp b/rpcs3/Emu/RSX/GL/GLGSRender.cpp index c93782918a..6593244d40 100644 --- a/rpcs3/Emu/RSX/GL/GLGSRender.cpp +++ b/rpcs3/Emu/RSX/GL/GLGSRender.cpp @@ -1804,6 +1804,12 @@ void GLGSRender::ExecCMD() } } + if (m_set_two_side_light_enable) + { + glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); + checkForGlError("glLightModeli"); + } + if(m_set_shade_mode) { glShadeModel(m_shade_mode); diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index 9958db93a6..c4ec54633d 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -1117,6 +1117,12 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const } break; + case NV4097_SET_TWO_SIDE_LIGHT_EN: + { + m_set_two_side_light_enable = ARGS(0) ? true : false; + } + break; + case NV4097_SET_STENCIL_MASK: { m_set_stencil_mask = true; diff --git a/rpcs3/Emu/RSX/RSXThread.h b/rpcs3/Emu/RSX/RSXThread.h index d7bad7561b..d6a8cb8fe3 100644 --- a/rpcs3/Emu/RSX/RSXThread.h +++ b/rpcs3/Emu/RSX/RSXThread.h @@ -288,6 +288,7 @@ public: bool m_set_stencil_zpass; u32 m_stencil_zpass; bool m_set_two_sided_stencil_test_enable; + bool m_set_two_side_light_enable; bool m_set_back_stencil_mask; u32 m_back_stencil_mask; bool m_set_back_stencil_func; @@ -462,6 +463,7 @@ protected: m_set_point_sprite_control = false; m_set_specular = false; m_set_two_sided_stencil_test_enable = false; + m_set_two_side_light_enable = false; m_set_surface_clip_horizontal = false; m_set_surface_clip_vertical = false; m_set_poly_offset_fill = false; @@ -551,6 +553,7 @@ protected: m_set_blend_color = false; m_set_stencil_test = false; m_set_two_sided_stencil_test_enable = false; + m_set_two_side_light_enable = false; m_set_stencil_mask = false; m_set_stencil_func = false; m_set_stencil_func_ref = false; diff --git a/rpcs3/Emu/SysCalls/Modules/cellResc.cpp b/rpcs3/Emu/SysCalls/Modules/cellResc.cpp index da87d67abe..c14cef7f3f 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellResc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellResc.cpp @@ -445,6 +445,7 @@ void SetupRsxRenderingStates(vm::ptr& cntxt) r.m_set_poly_offset_fill = false; r.m_set_stencil_test = false; r.m_set_two_sided_stencil_test_enable = false; + r.m_set_two_side_light_enable = false; r.m_set_point_sprite_control = false; r.m_set_dither = true; r.m_set_shade_mode = true; r.m_shade_mode = CELL_GCM_SMOOTH;