diff --git a/rpcs3/Emu/Cell/SPUInterpreter.h b/rpcs3/Emu/Cell/SPUInterpreter.h index d90e8e0bed..57196d10d7 100644 --- a/rpcs3/Emu/Cell/SPUInterpreter.h +++ b/rpcs3/Emu/Cell/SPUInterpreter.h @@ -244,7 +244,7 @@ private: void SHLH(u32 rt, u32 ra, u32 rb) { for (int h = 0; h < 8; h++) - CPU.GPR[rt]._u16[h] = (CPU.GPR[rb]._u16[h] & 0x1f) > 15 ? 0 : CPU.GPR[ra]._u16[h] << (CPU.GPR[rb]._u16[h] & 0x3f); + CPU.GPR[rt]._u16[h] = (CPU.GPR[rb]._u16[h] & 0x1f) > 15 ? 0 : CPU.GPR[ra]._u16[h] << (CPU.GPR[rb]._u16[h] & 0x1f); } void ROTI(u32 rt, u32 ra, s32 i7) { @@ -413,6 +413,7 @@ private: } void HBR(u32 p, u32 ro, u32 ra) { + UNIMPLEMENTED(); } void GB(u32 rt, u32 ra) { @@ -558,7 +559,7 @@ private: CPU.GPR[rt]._u32[0] = (temp._u32[0] >> t) | (temp._u32[1] << (32 - t)); CPU.GPR[rt]._u32[1] = (temp._u32[1] >> t) | (temp._u32[2] << (32 - t)); CPU.GPR[rt]._u32[2] = (temp._u32[2] >> t) | (temp._u32[3] << (32 - t)); - CPU.GPR[rt]._u32[3] = (CPU.GPR[ra]._u32[3] >> t); + CPU.GPR[rt]._u32[3] = (temp._u32[3] >> t); } void SHLQBI(u32 rt, u32 ra, u32 rb) { @@ -934,7 +935,7 @@ private: CPU.GPR[rt]._f[1] = (float)CPU.GPR[ra]._d[0]; CPU.GPR[rt]._u32[0] = 0x00000000; CPU.GPR[rt]._f[3] = (float)CPU.GPR[ra]._d[1]; - CPU.GPR[rt]._u32[1] = 0x00000000; + CPU.GPR[rt]._u32[2] = 0x00000000; } void FSCRWR(u32 rt, u32 ra) { @@ -1430,9 +1431,11 @@ private: //0 - 6 void HBRA(s32 ro, s32 i16) { //i16 is shifted left by 2 while decoding + UNIMPLEMENTED(); } void HBRR(s32 ro, s32 i16) { + UNIMPLEMENTED(); } void ILA(u32 rt, u32 i18) { diff --git a/rpcs3/Emu/SysCalls/SysCalls.h b/rpcs3/Emu/SysCalls/SysCalls.h index 0bfc4c09a4..d4f052fcde 100644 --- a/rpcs3/Emu/SysCalls/SysCalls.h +++ b/rpcs3/Emu/SysCalls/SysCalls.h @@ -223,7 +223,7 @@ extern int sys_memory_free(u32 start_addr); extern int sys_memory_get_user_memory_size(u32 mem_info_addr); extern int sys_memory_get_page_attribute(u32 addr, mem_ptr_t a); extern int sys_mmapper_allocate_address(u32 size, u64 flags, u32 alignment, u32 alloc_addr); -extern int sys_mmapper_allocate_memory(u32 size, u64 flags, u32 mem_id_addr); +extern int sys_mmapper_allocate_memory(u32 size, u64 flags, mem32_t mem_id); extern int sys_mmapper_map_memory(u32 start_addr, u32 mem_id, u64 flags); extern int sys_mmapper_free_memory(u32 mem_id); diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Process.cpp b/rpcs3/Emu/SysCalls/lv2/SC_Process.cpp index 031686f098..f64907ce88 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Process.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_Process.cpp @@ -42,6 +42,12 @@ int sys_process_exit(int errorcode) sc_p.Warning("sys_process_exit(%d)", errorcode); Emu.Pause(); // Emu.Stop() does crash ConLog.Success("Process finished"); + + if (Ini.HLEExitOnStop.GetValue()) + { + Ini.HLEExitOnStop.SetValue(false); + // TODO: Find a way of calling Emu.Stop() and/or exiting RPCS3 (that is, TheApp->Exit()) without crashes + } return CELL_OK; } diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index 33dd5ccb8a..e37799a3c5 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -345,7 +345,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) wxStaticBoxSizer* s_round_audio( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Audio") ) ); wxStaticBoxSizer* s_round_audio_out( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Audio Out") ) ); - wxStaticBoxSizer* s_round_hle( new wxStaticBoxSizer( wxVERTICAL, &diag, _("HLE") ) ); + wxStaticBoxSizer* s_round_hle( new wxStaticBoxSizer( wxVERTICAL, &diag, _("HLE / Misc.") ) ); wxComboBox* cbox_cpu_decoder = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_gs_render = new wxComboBox(&diag, wxID_ANY); @@ -364,6 +364,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) wxCheckBox* chbox_audio_dump = new wxCheckBox(&diag, wxID_ANY, "Dump to file"); wxCheckBox* chbox_hle_logging = new wxCheckBox(&diag, wxID_ANY, "Log all SysCalls"); wxCheckBox* chbox_hle_savetty = new wxCheckBox(&diag, wxID_ANY, "Save TTY output to file"); + wxCheckBox* chbox_hle_exitonstop = new wxCheckBox(&diag, wxID_ANY, "Exit RPCS3 when process finishes"); //cbox_cpu_decoder->Append("DisAsm"); cbox_cpu_decoder->Append("Interpreter & DisAsm"); @@ -403,6 +404,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) chbox_audio_dump->SetValue(Ini.AudioDumpToFile.GetValue()); chbox_hle_logging->SetValue(Ini.HLELogging.GetValue()); chbox_hle_savetty->SetValue(Ini.HLESaveTTY.GetValue()); + chbox_hle_exitonstop->SetValue(Ini.HLEExitOnStop.GetValue()); chbox_audio_dump->Enable(Emu.IsStopped()); chbox_hle_logging->Enable(Emu.IsStopped()); @@ -444,6 +446,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) s_round_hle->Add(chbox_hle_logging, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_hle->Add(chbox_hle_savetty, wxSizerFlags().Border(wxALL, 5).Expand()); + s_round_hle->Add(chbox_hle_exitonstop, wxSizerFlags().Border(wxALL, 5).Expand()); wxBoxSizer* s_b_panel(new wxBoxSizer(wxHORIZONTAL)); @@ -482,6 +485,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) Ini.AudioDumpToFile.SetValue(chbox_audio_dump->GetValue()); Ini.HLELogging.SetValue(chbox_hle_logging->GetValue()); Ini.HLESaveTTY.SetValue(chbox_hle_savetty->GetValue()); + Ini.HLEExitOnStop.SetValue(chbox_hle_exitonstop->GetValue()); Ini.Save(); } diff --git a/rpcs3/Ini.h b/rpcs3/Ini.h index cb9dad8111..940e9e876a 100644 --- a/rpcs3/Ini.h +++ b/rpcs3/Ini.h @@ -108,6 +108,7 @@ public: IniEntry AudioDumpToFile; IniEntry HLELogging; IniEntry HLESaveTTY; + IniEntry HLEExitOnStop; IniEntry PadHandlerLeft; IniEntry PadHandlerDown; @@ -174,6 +175,7 @@ public: path = DefPath + "\\" + "HLE"; HLELogging.Init("HLELogging", path); HLESaveTTY.Init("HLESaveTTY", path); + HLEExitOnStop.Init("HLEExitOnStop", path); } void Load() @@ -194,6 +196,7 @@ public: AudioDumpToFile.Load(0); HLELogging.Load(false); HLESaveTTY.Load(false); + HLEExitOnStop.Load(false); PadHandlerLeft.Load(static_cast('A')); PadHandlerDown.Load(static_cast('S')); @@ -231,6 +234,7 @@ public: AudioDumpToFile.Save(); HLELogging.Save(); HLESaveTTY.Save(); + HLEExitOnStop.Save(); PadHandlerLeft.Save(); PadHandlerDown.Save(); diff --git a/rpcs3/rpcs3.cpp b/rpcs3/rpcs3.cpp index 8a3dd7b007..5d0c941318 100644 --- a/rpcs3/rpcs3.cpp +++ b/rpcs3/rpcs3.cpp @@ -40,6 +40,9 @@ void Rpcs3App::OnArguments() if (Rpcs3App::argc > 1) { + // Force this value to be true + Ini.HLEExitOnStop.SetValue(true); + Emu.SetPath(argv[1]); Emu.Load(); Emu.Run(); diff --git a/rpcs3/rpcs3.vcxproj b/rpcs3/rpcs3.vcxproj index 7946c3f2db..e26b99909b 100644 --- a/rpcs3/rpcs3.vcxproj +++ b/rpcs3/rpcs3.vcxproj @@ -298,6 +298,7 @@ + diff --git a/rpcs3/rpcs3.vcxproj.filters b/rpcs3/rpcs3.vcxproj.filters index 93b68d3de7..94f355e832 100644 --- a/rpcs3/rpcs3.vcxproj.filters +++ b/rpcs3/rpcs3.vcxproj.filters @@ -418,6 +418,9 @@ Loader + + Emu\SysCalls\Modules +