Merge pull request #822 from tambry/cellAvconfExtAndVideoOut

Add cellAvconfExt and cellVideoOutGetScreenSize
This commit is contained in:
Hykem 2014-09-28 17:54:47 +01:00
commit 5b18e90cac
10 changed files with 112 additions and 37 deletions

View File

@ -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");
}

View File

@ -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 },

View File

@ -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<float> 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);
}

View File

@ -44,7 +44,7 @@ int cellNetCtlTerm()
return CELL_OK;
}
int cellNetCtlGetState(vm::ptr<be_t<u32>> state)
int cellNetCtlGetState(vm::ptr<u32> state)
{
cellNetCtl->Log("cellNetCtlGetState(state_addr=0x%x)", state.addr());
@ -53,7 +53,7 @@ int cellNetCtlGetState(vm::ptr<be_t<u32>> state)
return CELL_OK;
}
int cellNetCtlAddHandler(vm::ptr<cellNetCtlHandler> handler, vm::ptr<void> arg, vm::ptr<be_t<s32>> hid)
int cellNetCtlAddHandler(vm::ptr<cellNetCtlHandler> handler, vm::ptr<void> arg, vm::ptr<s32> hid)
{
cellNetCtl->Todo("cellNetCtlAddHandler(handler_addr=0x%x, arg_addr=0x%x, hid=0x%x)", handler.addr(), arg.addr(), hid.addr());

View File

@ -85,7 +85,7 @@ s64 sys_prx_exitspawn_with_level()
int sys_spu_elf_get_information(u32 elf_img, vm::ptr<be_t<u32>> entry, vm::ptr<be_t<u32>> 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;
}

View File

@ -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; i<WXSIZEOF(ResolutionTable); ++i)
cbox_gs_render->Append("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());

View File

@ -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
}

View File

@ -104,10 +104,11 @@ public:
IniEntry<u8> GSRenderMode;
IniEntry<u8> GSResolution;
IniEntry<u8> GSAspectRatio;
IniEntry<bool> GSVSyncEnable;
IniEntry<bool> GSLogPrograms;
IniEntry<bool> GSDumpColorBuffers;
IniEntry<bool> GSDumpDepthBuffer;
IniEntry<bool> GSVSyncEnable;
IniEntry<bool> GS3DTV;
// Audio
IniEntry<u8> 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();

View File

@ -128,6 +128,7 @@
<ClCompile Include="Emu\SysCalls\Modules\cellAdec.cpp" />
<ClCompile Include="Emu\SysCalls\Modules\cellAtrac.cpp" />
<ClCompile Include="Emu\SysCalls\Modules\cellAudio.cpp" />
<ClCompile Include="Emu\SysCalls\Modules\cellAvconfExt.cpp" />
<ClCompile Include="Emu\SysCalls\Modules\cellBgdl.cpp" />
<ClCompile Include="Emu\SysCalls\Modules\cellCamera.cpp" />
<ClCompile Include="Emu\SysCalls\Modules\cellCelp8Enc.cpp" />

View File

@ -130,6 +130,9 @@
</ClCompile>
<ClCompile Include="Emu\SysCalls\Modules\cellAudio.cpp">
<Filter>Emu\SysCalls\Modules</Filter>
</ClCompile>
<ClCompile Include="Emu\SysCalls\Modules\cellAvconfExt.cpp">
<Filter>Emu\SysCalls\Modules</Filter>
</ClCompile>
<ClCompile Include="Emu\SysCalls\Modules\cellCamera.cpp">
<Filter>Emu\SysCalls\Modules</Filter>
@ -346,6 +349,9 @@
</ClCompile>
<ClCompile Include="Emu\Memory\Memory.cpp">
<Filter>Emu\Memory</Filter>
</ClCompile>
<ClCompile Include="Emu\Memory\vm.cpp">
<Filter>Emu\Memory</Filter>
</ClCompile>
<ClCompile Include="Loader\ELF.cpp">
<Filter>Loader</Filter>
@ -617,9 +623,6 @@
<ClCompile Include="..\Utilities\rXml.cpp">
<Filter>Utilities</Filter>
</ClCompile>
<ClCompile Include="Emu\Memory\vm.cpp">
<Filter>Emu\Memory</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Crypto\aes.h">
@ -723,6 +726,9 @@
</ClInclude>
<ClInclude Include="Emu\SysCalls\Modules\cellPamf.h">
<Filter>Emu\SysCalls\Modules</Filter>
</ClInclude>
<ClInclude Include="Emu\SysCalls\Modules\cellPng.h">
<Filter>Emu\SysCalls\Modules</Filter>
</ClInclude>
<ClInclude Include="Emu\SysCalls\Modules\cellPngDec.h">
<Filter>Emu\SysCalls\Modules</Filter>
@ -1210,9 +1216,6 @@
<ClInclude Include="define_new_memleakdetect.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Emu\SysCalls\Modules\cellPng.h">
<Filter>Emu\SysCalls\Modules</Filter>
</ClInclude>
<ClInclude Include="Emu\SysCalls\CB_FUNC.h">
<Filter>Emu\SysCalls</Filter>
</ClInclude>