diff --git a/rpcs3/Emu/RSX/GL/GLGSRender.cpp b/rpcs3/Emu/RSX/GL/GLGSRender.cpp index 2a460fb235..84290186df 100644 --- a/rpcs3/Emu/RSX/GL/GLGSRender.cpp +++ b/rpcs3/Emu/RSX/GL/GLGSRender.cpp @@ -1806,6 +1806,7 @@ void GLGSRender::ExecCMD() if (m_set_two_side_light_enable) { + // TODO: Use other glLightModel functions? glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); checkForGlError("glLightModeli"); } diff --git a/rpcs3/Emu/SysCalls/ModuleManager.cpp b/rpcs3/Emu/SysCalls/ModuleManager.cpp index 5d5f77b3aa..8fa1774ef5 100644 --- a/rpcs3/Emu/SysCalls/ModuleManager.cpp +++ b/rpcs3/Emu/SysCalls/ModuleManager.cpp @@ -4,6 +4,7 @@ extern void cellAdec_init(Module* pxThis); extern void cellAtrac_init(Module* pxThis); extern void cellAudio_init(Module* pxThis); +extern void cellAvconfExt_init(Module* pxThis); extern void cellCamera_init(Module* pxThis); extern void cellCamera_unload(); extern void cellDmux_init(Module *pxThis); @@ -119,7 +120,7 @@ static const g_modules_list[] = { 0x002a, "cellDmuxPamf", nullptr, nullptr, nullptr }, { 0x002e, "cellLv2dbg", nullptr, nullptr, nullptr }, { 0x0030, "cellUsbpspcm", nullptr, nullptr, nullptr }, - { 0x0031, "cellAvconfExt", nullptr, nullptr, nullptr }, + { 0x0031, "cellAvconfExt", cellAvconfExt_init, nullptr, nullptr }, { 0x0032, "cellUserInfo", cellUserInfo_init, nullptr, nullptr }, { 0x0033, "cellSysutilSavedata", nullptr, nullptr, nullptr }, { 0x0034, "cellSubdisplay", nullptr, nullptr, nullptr }, diff --git a/rpcs3/Emu/SysCalls/Modules/cellAvconfExt.cpp b/rpcs3/Emu/SysCalls/Modules/cellAvconfExt.cpp new file mode 100644 index 0000000000..a29056057a --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/cellAvconfExt.cpp @@ -0,0 +1,60 @@ +#include "stdafx.h" +#include "Ini.h" +#include "Emu/Memory/Memory.h" +#include "Emu/SysCalls/Modules.h" +#include "Emu/RSX/sysutil_video.h" + +Module *cellAvconfExt = nullptr; + +int cellVideoOutConvertCursorColor() +{ + UNIMPLEMENTED_FUNC(cellAvconfExt); + return CELL_OK; +} + +int cellVideoOutGetScreenSize(u32 videoOut, vm::ptr screenSize) +{ + cellAvconfExt->Warning("cellVideoOutGetScreenSize(videoOut=%d, screenSize_addr=0x%x)", videoOut, screenSize.addr()); + + if (!videoOut == CELL_VIDEO_OUT_PRIMARY) + return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT; + +#ifdef _WIN32 + HDC screen = GetDC(NULL); + u32 diagonal = round(sqrt((pow(GetDeviceCaps(screen, HORZSIZE), 2) + pow(GetDeviceCaps(screen, VERTSIZE), 2))) * 0.0393); +#else + // TODO: Linux implementation, without using wx + // u32 diagonal = round(sqrt((pow(wxGetDisplaySizeMM().GetWidth(), 2) + pow(wxGetDisplaySizeMM().GetHeight(), 2))) * 0.0393); +#endif + + if (Ini.GS3DTV.GetValue()) + { +#ifdef _WIN32 + *screenSize = diagonal; +#endif + return CELL_OK; + } + + return CELL_VIDEO_OUT_ERROR_VALUE_IS_NOT_SET; +} + +int cellVideoOutGetGamma() +{ + UNIMPLEMENTED_FUNC(cellAvconfExt); + return CELL_OK; +} + +int cellVideoOutSetGamma() +{ + UNIMPLEMENTED_FUNC(cellAvconfExt); + return CELL_OK; +} + +void cellAvconfExt_init(Module *pxThis) +{ + cellAvconfExt = pxThis; + + cellAvconfExt->AddFunc(0x4ec8c141, cellVideoOutConvertCursorColor); + cellAvconfExt->AddFunc(0xfaa275a4, cellVideoOutGetScreenSize); + cellAvconfExt->AddFunc(0xc7020f62, cellVideoOutSetGamma); +} \ No newline at end of file diff --git a/rpcs3/Emu/SysCalls/Modules/cellNetCtl.cpp b/rpcs3/Emu/SysCalls/Modules/cellNetCtl.cpp index 9c7f0d2ac8..35de99246c 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellNetCtl.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellNetCtl.cpp @@ -44,7 +44,7 @@ int cellNetCtlTerm() return CELL_OK; } -int cellNetCtlGetState(vm::ptr> state) +int cellNetCtlGetState(vm::ptr state) { cellNetCtl->Log("cellNetCtlGetState(state_addr=0x%x)", state.addr()); @@ -53,7 +53,7 @@ int cellNetCtlGetState(vm::ptr> state) return CELL_OK; } -int cellNetCtlAddHandler(vm::ptr handler, vm::ptr arg, vm::ptr> hid) +int cellNetCtlAddHandler(vm::ptr handler, vm::ptr arg, vm::ptr hid) { cellNetCtl->Todo("cellNetCtlAddHandler(handler_addr=0x%x, arg_addr=0x%x, hid=0x%x)", handler.addr(), arg.addr(), hid.addr()); diff --git a/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp b/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp index a1e162c3cb..a9102f1865 100644 --- a/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp @@ -85,7 +85,7 @@ s64 sys_prx_exitspawn_with_level() int sys_spu_elf_get_information(u32 elf_img, vm::ptr> entry, vm::ptr> nseg) { - sysPrxForUser->Todo("sys_spu_elf_get_information(elf_img=0x%x, entry_addr=0x%x, nseg_addr=0x%x", elf_img, entry.addr(), nseg.addr()); + sysPrxForUser->Todo("sys_spu_elf_get_information(elf_img=0x%x, entry_addr=0x%x, nseg_addr=0x%x)", elf_img, entry.addr(), nseg.addr()); return CELL_OK; } diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index 902b079d0c..a11a094c35 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -406,6 +406,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) wxCheckBox* chbox_gs_dump_depth = new wxCheckBox(p_graphics, wxID_ANY, "Write Depth Buffer"); wxCheckBox* chbox_gs_dump_color = new wxCheckBox(p_graphics, wxID_ANY, "Write Color Buffers"); wxCheckBox* chbox_gs_vsync = new wxCheckBox(p_graphics, wxID_ANY, "VSync"); + wxCheckBox* chbox_gs_3dmonitor = new wxCheckBox(p_graphics, wxID_ANY, "3D Monitor"); 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"); @@ -424,7 +425,11 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) cbox_spu_decoder->Append("SPU Interpreter"); cbox_spu_decoder->Append("SPU JIT (asmjit)"); - for(int i=1; iAppend("Null"); + cbox_gs_render->Append("OpenGL"); + //cbox_gs_render->Append("Software"); + + for(int i = 1; i < WXSIZEOF(ResolutionTable); ++i) { cbox_gs_resolution->Append(wxString::Format("%dx%d", ResolutionTable[i].width.ToLE(), ResolutionTable[i].height.ToLE())); } @@ -432,10 +437,6 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) cbox_gs_aspect->Append("4:3"); cbox_gs_aspect->Append("16:9"); - cbox_gs_render->Append("Null"); - cbox_gs_render->Append("OpenGL"); - //cbox_gs_render->Append("Software"); - cbox_pad_handler->Append("Null"); cbox_pad_handler->Append("Windows"); #if defined (_WIN32) @@ -491,6 +492,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) chbox_gs_dump_depth ->SetValue(Ini.GSDumpDepthBuffer.GetValue()); chbox_gs_dump_color ->SetValue(Ini.GSDumpColorBuffers.GetValue()); chbox_gs_vsync ->SetValue(Ini.GSVSyncEnable.GetValue()); + chbox_gs_3dmonitor ->SetValue(Ini.GS3DTV.GetValue()); chbox_audio_dump ->SetValue(Ini.AudioDumpToFile.GetValue()); chbox_audio_conv ->SetValue(Ini.AudioConvertToU16.GetValue()); chbox_hle_logging ->SetValue(Ini.HLELogging.GetValue()); @@ -555,6 +557,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) s_subpanel_graphics->Add(chbox_gs_dump_depth, wxSizerFlags().Border(wxALL, 5).Expand()); s_subpanel_graphics->Add(chbox_gs_dump_color, wxSizerFlags().Border(wxALL, 5).Expand()); s_subpanel_graphics->Add(chbox_gs_vsync, wxSizerFlags().Border(wxALL, 5).Expand()); + s_subpanel_graphics->Add(chbox_gs_3dmonitor, wxSizerFlags().Border(wxALL, 5).Expand()); // Input - Output s_subpanel_io->Add(s_round_io_pad_handler, wxSizerFlags().Border(wxALL, 5).Expand()); @@ -609,10 +612,11 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) Ini.GSRenderMode.SetValue(cbox_gs_render->GetSelection()); Ini.GSResolution.SetValue(ResolutionNumToId(cbox_gs_resolution->GetSelection() + 1)); Ini.GSAspectRatio.SetValue(cbox_gs_aspect->GetSelection() + 1); - Ini.GSVSyncEnable.SetValue(chbox_gs_vsync->GetValue()); Ini.GSLogPrograms.SetValue(chbox_gs_log_prog->GetValue()); Ini.GSDumpDepthBuffer.SetValue(chbox_gs_dump_depth->GetValue()); Ini.GSDumpColorBuffers.SetValue(chbox_gs_dump_color->GetValue()); + Ini.GSVSyncEnable.SetValue(chbox_gs_vsync->GetValue()); + Ini.GS3DTV.SetValue(chbox_gs_3dmonitor->GetValue()); Ini.PadHandlerMode.SetValue(cbox_pad_handler->GetSelection()); Ini.KeyboardHandlerMode.SetValue(cbox_keyboard_handler->GetSelection()); Ini.MouseHandlerMode.SetValue(cbox_mouse_handler->GetSelection()); diff --git a/rpcs3/Gui/RSXDebugger.cpp b/rpcs3/Gui/RSXDebugger.cpp index 28f755e20e..227156a449 100644 --- a/rpcs3/Gui/RSXDebugger.cpp +++ b/rpcs3/Gui/RSXDebugger.cpp @@ -492,23 +492,24 @@ void RSXDebugger::GetFlags() #define LIST_FLAGS_ADD(name, value) \ m_list_flags->InsertItem(i, name); m_list_flags->SetItem(i, 1, value ? "Enabled" : "Disabled"); i++; - LIST_FLAGS_ADD("Alpha test", render.m_set_alpha_test); - LIST_FLAGS_ADD("Blend", render.m_set_blend); - LIST_FLAGS_ADD("Scissor", render.m_set_scissor_horizontal && render.m_set_scissor_vertical); - LIST_FLAGS_ADD("Cull face", render.m_set_cull_face); - LIST_FLAGS_ADD("Depth bounds test", render.m_set_depth_bounds_test); - LIST_FLAGS_ADD("Depth test", render.m_set_depth_test); - LIST_FLAGS_ADD("Dither", render.m_set_dither); - LIST_FLAGS_ADD("Line smooth", render.m_set_line_smooth); - LIST_FLAGS_ADD("Logic op", render.m_set_logic_op); - LIST_FLAGS_ADD("Poly smooth", render.m_set_poly_smooth); - LIST_FLAGS_ADD("Poly offset fill", render.m_set_poly_offset_fill); - LIST_FLAGS_ADD("Poly offset line", render.m_set_poly_offset_line); - LIST_FLAGS_ADD("Poly offset point", render.m_set_poly_offset_point); - LIST_FLAGS_ADD("Stencil test", render.m_set_stencil_test); - LIST_FLAGS_ADD("Primitive restart", render.m_set_restart_index); - LIST_FLAGS_ADD("Point Sprite", render.m_set_point_sprite_control); - LIST_FLAGS_ADD("Lighting ", render.m_set_specular); + LIST_FLAGS_ADD("Alpha test", render.m_set_alpha_test); + LIST_FLAGS_ADD("Blend", render.m_set_blend); + LIST_FLAGS_ADD("Scissor", render.m_set_scissor_horizontal && render.m_set_scissor_vertical); + LIST_FLAGS_ADD("Cull face", render.m_set_cull_face); + LIST_FLAGS_ADD("Depth bounds test", render.m_set_depth_bounds_test); + LIST_FLAGS_ADD("Depth test", render.m_set_depth_test); + LIST_FLAGS_ADD("Dither", render.m_set_dither); + LIST_FLAGS_ADD("Line smooth", render.m_set_line_smooth); + LIST_FLAGS_ADD("Logic op", render.m_set_logic_op); + LIST_FLAGS_ADD("Poly smooth", render.m_set_poly_smooth); + LIST_FLAGS_ADD("Poly offset fill", render.m_set_poly_offset_fill); + LIST_FLAGS_ADD("Poly offset line", render.m_set_poly_offset_line); + LIST_FLAGS_ADD("Poly offset point", render.m_set_poly_offset_point); + LIST_FLAGS_ADD("Stencil test", render.m_set_stencil_test); + LIST_FLAGS_ADD("Primitive restart", render.m_set_restart_index); + LIST_FLAGS_ADD("Two sided lighting", render.m_set_two_side_light_enable); + LIST_FLAGS_ADD("Point Sprite", render.m_set_point_sprite_control); + LIST_FLAGS_ADD("Lighting ", render.m_set_specular); #undef LIST_FLAGS_ADD } diff --git a/rpcs3/Ini.h b/rpcs3/Ini.h index 96a217a286..8315648075 100644 --- a/rpcs3/Ini.h +++ b/rpcs3/Ini.h @@ -104,10 +104,11 @@ public: IniEntry GSRenderMode; IniEntry GSResolution; IniEntry GSAspectRatio; - IniEntry GSVSyncEnable; IniEntry GSLogPrograms; IniEntry GSDumpColorBuffers; IniEntry GSDumpDepthBuffer; + IniEntry GSVSyncEnable; + IniEntry GS3DTV; // Audio IniEntry AudioOutMode; @@ -177,10 +178,11 @@ public: GSRenderMode.Init("GS_RenderMode", path); GSResolution.Init("GS_Resolution", path); GSAspectRatio.Init("GS_AspectRatio", path); - GSVSyncEnable.Init("GS_VSyncEnable", path); GSLogPrograms.Init("GS_LogPrograms", path); GSDumpColorBuffers.Init("GS_DumpColorBuffers", path); GSDumpDepthBuffer.Init("GS_DumpDepthBuffer", path); + GSVSyncEnable.Init("GS_VSyncEnable", path); + GS3DTV.Init("GS_3DTV", path); // Audio AudioOutMode.Init("Audio_AudioOutMode", path); @@ -246,10 +248,11 @@ public: GSRenderMode.Load(1); GSResolution.Load(4); GSAspectRatio.Load(2); - GSVSyncEnable.Load(false); GSLogPrograms.Load(false); GSDumpColorBuffers.Load(false); GSDumpDepthBuffer.Load(false); + GSVSyncEnable.Load(false); + GS3DTV.Load(false); // Audio AudioOutMode.Load(1); @@ -316,10 +319,11 @@ public: GSRenderMode.Save(); GSResolution.Save(); GSAspectRatio.Save(); - GSVSyncEnable.Save(); GSLogPrograms.Save(); GSDumpColorBuffers.Save(); GSDumpDepthBuffer.Save(); + GSVSyncEnable.Save(); + GS3DTV.Save(); // Audio AudioOutMode.Save(); diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index f09d6a99d5..0280445ed3 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -128,6 +128,7 @@ + diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index 038502f880..907847d5ce 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -130,6 +130,9 @@ Emu\SysCalls\Modules + + + Emu\SysCalls\Modules Emu\SysCalls\Modules @@ -346,6 +349,9 @@ Emu\Memory + + + Emu\Memory Loader @@ -617,9 +623,6 @@ Utilities - - Emu\Memory - @@ -723,6 +726,9 @@ Emu\SysCalls\Modules + + + Emu\SysCalls\Modules Emu\SysCalls\Modules @@ -1210,9 +1216,6 @@ Header Files - - Emu\SysCalls\Modules - Emu\SysCalls