From 9c25dfc4996aa5afc3efe474020620ad60d9391c Mon Sep 17 00:00:00 2001 From: Zangetsu38 Date: Wed, 10 Aug 2016 20:13:24 +0200 Subject: [PATCH] d3d12: Fix typo and little clean up in D3D12Formats. rsx: add value for Kung Fu Rider. PPU: register Unknown functions in cellSysmodule. PPU: register Unknown functions in sceNp. PPU: register Unknown functions in cellSysutil. --- rpcs3/Emu/Cell/Modules/cellSysmodule.cpp | 7 ++++ rpcs3/Emu/Cell/Modules/cellSysutil.cpp | 7 ++++ rpcs3/Emu/Cell/Modules/sceNp.cpp | 6 ++++ rpcs3/Emu/RSX/Common/BufferUtils.cpp | 3 +- rpcs3/Emu/RSX/D3D12/D3D12Formats.cpp | 45 ++++++++++++------------ 5 files changed, 44 insertions(+), 24 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellSysmodule.cpp b/rpcs3/Emu/Cell/Modules/cellSysmodule.cpp index f288526468..58547092a4 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysmodule.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSysmodule.cpp @@ -356,6 +356,12 @@ s32 cellSysmodule_D9B8C0EE() return CELL_OK; } +s32 cellSysmodule_1A267F98() +{ + UNIMPLEMENTED_FUNC(cellSysmodule); + return CELL_OK; +} + DECLARE(ppu_module_manager::cellSysmodule)("cellSysmodule", []() { REG_FUNC(cellSysmodule, cellSysmoduleInitialize); @@ -368,4 +374,5 @@ DECLARE(ppu_module_manager::cellSysmodule)("cellSysmodule", []() REG_FUNC(cellSysmodule, cellSysmoduleFetchImage); REG_FNID(cellSysmodule, 0xB498BF77, cellSysmodule_B498BF77); REG_FNID(cellSysmodule, 0xD9B8C0EE, cellSysmodule_D9B8C0EE); + REG_FNID(cellSysmodule, 0x1A267F98, cellSysmodule_1A267F98); }); diff --git a/rpcs3/Emu/Cell/Modules/cellSysutil.cpp b/rpcs3/Emu/Cell/Modules/cellSysutil.cpp index ea4dcff2cf..677d3aee1c 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSysutil.cpp @@ -413,6 +413,12 @@ s32 cellSysutilGameReboot_I() fmt::throw_exception("Unimplemented" HERE); } +s32 cellSysutil_E1EC7B6A() +{ + UNIMPLEMENTED_FUNC(cellSysutil); + return CELL_OK; +} + extern void cellSysutil_SaveData_init(); extern void cellSysutil_GameData_init(); extern void cellSysutil_MsgDialog_init(); @@ -463,4 +469,5 @@ DECLARE(ppu_module_manager::cellSysutil)("cellSysutil", []() REG_FUNC(cellSysutil, cellSysutilGameExit_I); REG_FUNC(cellSysutil, cellSysutilGamePowerOff_I); REG_FUNC(cellSysutil, cellSysutilGameReboot_I); + REG_FNID(cellSysutil, 0xE1EC7B6A, cellSysutil_E1EC7B6A); }); diff --git a/rpcs3/Emu/Cell/Modules/sceNp.cpp b/rpcs3/Emu/Cell/Modules/sceNp.cpp index 62c50e4823..85f9a9617a 100644 --- a/rpcs3/Emu/Cell/Modules/sceNp.cpp +++ b/rpcs3/Emu/Cell/Modules/sceNp.cpp @@ -1521,6 +1521,11 @@ s32 _Z32_sce_np_sysutil_cxml_prepare_docPN16sysutil_cxmlutil11FixedMemoryERN4cxm fmt::throw_exception("Unimplemented" HERE); } +s32 sceNp_AFC62605() +{ + UNIMPLEMENTED_FUNC(sceNp); + return CELL_OK; +} DECLARE(ppu_module_manager::sceNp)("sceNp", []() { @@ -1755,4 +1760,5 @@ DECLARE(ppu_module_manager::sceNp)("sceNp", []() REG_FUNC(sceNp, _Z31_sce_np_sysutil_send_packet_subiRN4cxml8DocumentE); REG_FUNC(sceNp, _Z37sce_np_matching_set_matching2_runningb); REG_FUNC(sceNp, _Z32_sce_np_sysutil_cxml_prepare_docPN16sysutil_cxmlutil11FixedMemoryERN4cxml8DocumentEPKcRNS2_7ElementES6_i); + REG_FNID(sceNp, 0xAFC62605, sceNp_AFC62605); }); diff --git a/rpcs3/Emu/RSX/Common/BufferUtils.cpp b/rpcs3/Emu/RSX/Common/BufferUtils.cpp index f6a16c1419..7d2029ff1b 100644 --- a/rpcs3/Emu/RSX/Common/BufferUtils.cpp +++ b/rpcs3/Emu/RSX/Common/BufferUtils.cpp @@ -390,9 +390,10 @@ namespace case rsx::primitive_type::triangle_fan: return expand_indexed_triangle_fan(src.subspan(first), dst, restart_index_enabled, restart_index); case rsx::primitive_type::quads: + case rsx::primitive_type::quad_strip: return expand_indexed_quads(src.subspan(first), dst, restart_index_enabled, restart_index); } - fmt::throw_exception("Don't know how to expand draw mode" HERE); + fmt::throw_exception("Unknown draw mode (0x%x)" HERE, (u32)draw_mode); } } diff --git a/rpcs3/Emu/RSX/D3D12/D3D12Formats.cpp b/rpcs3/Emu/RSX/D3D12/D3D12Formats.cpp index b2effbe3d5..c850502c4a 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12Formats.cpp +++ b/rpcs3/Emu/RSX/D3D12/D3D12Formats.cpp @@ -20,7 +20,7 @@ D3D12_BLEND_OP get_blend_op(rsx::blend_equation op) case rsx::blend_equation::reverse_substract_signed: break; } - fmt::throw_exception("Invalid or unsupported blend op (0x%x)" HERE, (u32)op); + fmt::throw_exception("Unknown or unsupported blend op (0x%x)" HERE, (u32)op); } D3D12_BLEND get_blend_factor(rsx::blend_factor factor) @@ -45,7 +45,7 @@ D3D12_BLEND get_blend_factor(rsx::blend_factor factor) case rsx::blend_factor::one_minus_constant_alpha: return D3D12_BLEND_INV_BLEND_FACTOR; } - fmt::throw_exception("Invalid blend factor (0x%x)" HERE, (u32)factor); + fmt::throw_exception("Unknown blend factor (0x%x)" HERE, (u32)factor); } D3D12_BLEND get_blend_factor_alpha(rsx::blend_factor factor) @@ -70,7 +70,7 @@ D3D12_BLEND get_blend_factor_alpha(rsx::blend_factor factor) case rsx::blend_factor::one_minus_constant_alpha: return D3D12_BLEND_INV_BLEND_FACTOR; } - fmt::throw_exception("Invalid blend alpha factor (0x%x)" HERE, (u32)factor); + fmt::throw_exception("Unknown blend alpha factor (0x%x)" HERE, (u32)factor); } /** @@ -96,7 +96,7 @@ D3D12_LOGIC_OP get_logic_op(rsx::logic_op op) case rsx::logic_op::logic_or_inverted: return D3D12_LOGIC_OP_OR_INVERTED; case rsx::logic_op::logic_nand: return D3D12_LOGIC_OP_NAND; } - fmt::throw_exception("Invalid logic op (0x%x)" HERE, (u32)op); + fmt::throw_exception("Unknown logic op (0x%x)" HERE, (u32)op); } /** @@ -115,7 +115,7 @@ D3D12_STENCIL_OP get_stencil_op(rsx::stencil_op op) case rsx::stencil_op::incr_wrap: return D3D12_STENCIL_OP_INCR; case rsx::stencil_op::decr_wrap: return D3D12_STENCIL_OP_DECR; } - fmt::throw_exception("Invalid stencil op (0x%x)" HERE, (u32)op); + fmt::throw_exception("Unknown stencil op (0x%x)" HERE, (u32)op); } D3D12_COMPARISON_FUNC get_compare_func(rsx::comparison_function op) @@ -131,7 +131,7 @@ D3D12_COMPARISON_FUNC get_compare_func(rsx::comparison_function op) case rsx::comparison_function::greater_or_equal: return D3D12_COMPARISON_FUNC_GREATER_EQUAL; case rsx::comparison_function::always: return D3D12_COMPARISON_FUNC_ALWAYS; } - fmt::throw_exception("Invalid or unsupported compare func (0x%x)" HERE, (u32)op); + fmt::throw_exception("Unknown compare func (0x%x)" HERE, (u32)op); } DXGI_FORMAT get_texture_format(u8 format) @@ -167,9 +167,8 @@ DXGI_FORMAT get_texture_format(u8 format) case CELL_GCM_TEXTURE_COMPRESSED_HILO_S8: return DXGI_FORMAT_R8G8_SNORM; case ~(CELL_GCM_TEXTURE_LN | CELL_GCM_TEXTURE_UN) & CELL_GCM_TEXTURE_COMPRESSED_B8R8_G8R8: return DXGI_FORMAT_G8R8_G8B8_UNORM; case ~(CELL_GCM_TEXTURE_LN | CELL_GCM_TEXTURE_UN) & CELL_GCM_TEXTURE_COMPRESSED_R8B8_R8G8: return DXGI_FORMAT_R8G8_B8G8_UNORM; - break; } - fmt::throw_exception("Invalid or unsupported texture format (0x%x)" HERE, (u32)format); + fmt::throw_exception("Unknown texture format (0x%x)" HERE, (u32)format); } UINT get_texture_max_aniso(rsx::texture_max_anisotropy aniso) @@ -185,7 +184,7 @@ UINT get_texture_max_aniso(rsx::texture_max_anisotropy aniso) case rsx::texture_max_anisotropy::x12: return 12; case rsx::texture_max_anisotropy::x16: return 16; } - fmt::throw_exception("Invalid texture max aniso (0x%x)" HERE, (u32)aniso); + fmt::throw_exception("Unknown texture max aniso (0x%x)" HERE, (u32)aniso); } D3D12_TEXTURE_ADDRESS_MODE get_texture_wrap_mode(rsx::texture_wrap_mode wrap) @@ -201,7 +200,7 @@ D3D12_TEXTURE_ADDRESS_MODE get_texture_wrap_mode(rsx::texture_wrap_mode wrap) case rsx::texture_wrap_mode::mirror_once_border: return D3D12_TEXTURE_ADDRESS_MODE_MIRROR_ONCE; case rsx::texture_wrap_mode::mirror_once_clamp: return D3D12_TEXTURE_ADDRESS_MODE_MIRROR_ONCE; } - fmt::throw_exception("Invalid texture wrap mode (0x%x)" HERE, (u32)wrap); + fmt::throw_exception("Unknown texture wrap mode (0x%x)" HERE, (u32)wrap); } namespace @@ -239,7 +238,7 @@ namespace mip = D3D12_FILTER_TYPE_POINT; return; } - fmt::throw_exception("Invalid max filter" HERE); + fmt::throw_exception("Unknown max filter" HERE); } D3D12_FILTER_TYPE get_mag_filter(rsx::texture_magnify_filter mag_filter) @@ -250,7 +249,7 @@ namespace case rsx::texture_magnify_filter::linear: return D3D12_FILTER_TYPE_LINEAR; case rsx::texture_magnify_filter::convolution_mag: return D3D12_FILTER_TYPE_LINEAR; } - fmt::throw_exception("Invalid mag filter" HERE); + fmt::throw_exception("Unknown mag filter" HERE); } } @@ -277,7 +276,7 @@ D3D12_PRIMITIVE_TOPOLOGY get_primitive_topology(rsx::primitive_type draw_mode) case rsx::primitive_type::quad_strip: return D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST; case rsx::primitive_type::polygon: return D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST; } - fmt::throw_exception("Invalid draw mode (0x%x)" HERE, (u32)draw_mode); + fmt::throw_exception("Unknown draw mode (0x%x)" HERE, (u32)draw_mode); } D3D12_PRIMITIVE_TOPOLOGY_TYPE get_primitive_topology_type(rsx::primitive_type draw_mode) @@ -295,7 +294,7 @@ D3D12_PRIMITIVE_TOPOLOGY_TYPE get_primitive_topology_type(rsx::primitive_type dr case rsx::primitive_type::polygon: return D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; case rsx::primitive_type::line_loop: return D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE; } - fmt::throw_exception("Invalid or unsupported draw mode (0x%x)" HERE, (u32)draw_mode); + fmt::throw_exception("Unknown draw mode (0x%x)" HERE, (u32)draw_mode); } DXGI_FORMAT get_color_surface_format(rsx::surface_color_format format) @@ -318,7 +317,7 @@ DXGI_FORMAT get_color_surface_format(rsx::surface_color_format format) case rsx::surface_color_format::w32z32y32x32: return DXGI_FORMAT_R32G32B32A32_FLOAT; case rsx::surface_color_format::x32: return DXGI_FORMAT_R32_FLOAT; } - fmt::throw_exception("Invalid format (0x%x)" HERE, (u32)format); + fmt::throw_exception("Unknown format (0x%x)" HERE, (u32)format); } DXGI_FORMAT get_depth_stencil_surface_format(rsx::surface_depth_format format) @@ -328,7 +327,7 @@ DXGI_FORMAT get_depth_stencil_surface_format(rsx::surface_depth_format format) case rsx::surface_depth_format::z16: return DXGI_FORMAT_D16_UNORM; case rsx::surface_depth_format::z24s8: return DXGI_FORMAT_D24_UNORM_S8_UINT; } - fmt::throw_exception("Invalid format (0x%x)" HERE, (u32)format); + fmt::throw_exception("Unknown format (0x%x)" HERE, (u32)format); } DXGI_FORMAT get_depth_stencil_surface_clear_format(rsx::surface_depth_format format) @@ -338,7 +337,7 @@ DXGI_FORMAT get_depth_stencil_surface_clear_format(rsx::surface_depth_format for case rsx::surface_depth_format::z16: return DXGI_FORMAT_D16_UNORM; case rsx::surface_depth_format::z24s8: return DXGI_FORMAT_D24_UNORM_S8_UINT; } - fmt::throw_exception("Invalid format (0x%x)" HERE, (u32)format); + fmt::throw_exception("Unknown format (0x%x)" HERE, (u32)format); } DXGI_FORMAT get_depth_stencil_typeless_surface_format(rsx::surface_depth_format format) @@ -348,7 +347,7 @@ DXGI_FORMAT get_depth_stencil_typeless_surface_format(rsx::surface_depth_format case rsx::surface_depth_format::z16: return DXGI_FORMAT_R16_TYPELESS; case rsx::surface_depth_format::z24s8: return DXGI_FORMAT_R24G8_TYPELESS; } - fmt::throw_exception("Invalid format (0x%x)" HERE, (u32)format); + fmt::throw_exception("Unknown format (0x%x)" HERE, (u32)format); } DXGI_FORMAT get_depth_samplable_surface_format(rsx::surface_depth_format format) @@ -358,7 +357,7 @@ DXGI_FORMAT get_depth_samplable_surface_format(rsx::surface_depth_format format) case rsx::surface_depth_format::z16: return DXGI_FORMAT_R16_UNORM; case rsx::surface_depth_format::z24s8: return DXGI_FORMAT_R24_UNORM_X8_TYPELESS; } - fmt::throw_exception("Invalid format (0x%x)" HERE, (u32)format); + fmt::throw_exception("Unknown format (0x%x)" HERE, (u32)format); } BOOL get_front_face_ccw(rsx::front_face ffv) @@ -368,7 +367,7 @@ BOOL get_front_face_ccw(rsx::front_face ffv) case rsx::front_face::cw: return FALSE; case rsx::front_face::ccw: return TRUE; } - fmt::throw_exception("Invalid front face value (0x%x)" HERE, (u32)ffv); + fmt::throw_exception("Unknown front face value (0x%x)" HERE, (u32)ffv); } D3D12_CULL_MODE get_cull_face(rsx::cull_face cfv) @@ -379,7 +378,7 @@ D3D12_CULL_MODE get_cull_face(rsx::cull_face cfv) case rsx::cull_face::back: return D3D12_CULL_MODE_BACK; case rsx::cull_face::front_and_back: return D3D12_CULL_MODE_NONE; } - fmt::throw_exception("Invalid cull face value (0x%x)" HERE, (u32)cfv); + fmt::throw_exception("Unknown cull face value (0x%x)" HERE, (u32)cfv); } DXGI_FORMAT get_index_type(rsx::index_array_type index_type) @@ -389,7 +388,7 @@ DXGI_FORMAT get_index_type(rsx::index_array_type index_type) case rsx::index_array_type::u16: return DXGI_FORMAT_R16_UINT; case rsx::index_array_type::u32: return DXGI_FORMAT_R32_UINT; } - fmt::throw_exception("Invalid index_type (0x%x)" HERE, (u32)index_type); + fmt::throw_exception("Unknown index_type (0x%x)" HERE, (u32)index_type); } DXGI_FORMAT get_vertex_attribute_format(rsx::vertex_base_type type, u8 size) @@ -468,7 +467,7 @@ DXGI_FORMAT get_vertex_attribute_format(rsx::vertex_base_type type, u8 size) } } - fmt::throw_exception("Invalid or unsupported type or size (type=0x%x, size=0x%x)" HERE, (u32)type, size); + fmt::throw_exception("Unknown or unsupported type or size (type=0x%x, size=0x%x)" HERE, (u32)type, size); } D3D12_RECT get_scissor(u16 clip_origin_x, u16 clip_origin_y, u16 clip_w, u16 clip_h)