From 16311b36b024d849c14b08a3aeca3c4a9137d2f3 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Sat, 10 Oct 2015 21:06:17 +0200 Subject: [PATCH] Remove viewport clip --- rpcs3/Emu/RSX/RSXThread.cpp | 21 --------------------- rpcs3/Emu/RSX/RSXThread.h | 8 -------- rpcs3/Emu/SysCalls/Modules/cellResc.cpp | 7 ++----- rpcs3/Gui/RSXDebugger.cpp | 8 ++++---- 4 files changed, 6 insertions(+), 38 deletions(-) diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index f705617ca4..7b561a80e2 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -688,31 +688,10 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const // Viewport case NV4097_SET_VIEWPORT_HORIZONTAL: - { - m_set_viewport_horizontal = true; - m_viewport_x = ARGS(0) & 0xffff; - m_viewport_w = ARGS(0) >> 16; - - if (count == 2) - { - m_set_viewport_vertical = true; - m_viewport_y = ARGS(1) & 0xffff; - m_viewport_h = ARGS(1) >> 16; - } - - //LOG_NOTICE(RSX, "NV4097_SET_VIEWPORT_HORIZONTAL: x=%d, y=%d, w=%d, h=%d", m_viewport_x, m_viewport_y, m_viewport_w, m_viewport_h); break; - } case NV4097_SET_VIEWPORT_VERTICAL: - { - m_set_viewport_vertical = true; - m_viewport_y = ARGS(0) & 0xffff; - m_viewport_h = ARGS(0) >> 16; - - //LOG_NOTICE(RSX, "NV4097_SET_VIEWPORT_VERTICAL: y=%d, h=%d", m_viewport_y, m_viewport_h); break; - } case NV4097_SET_VIEWPORT_SCALE: case NV4097_SET_VIEWPORT_OFFSET: diff --git a/rpcs3/Emu/RSX/RSXThread.h b/rpcs3/Emu/RSX/RSXThread.h index e4c10cd278..b0bae34860 100644 --- a/rpcs3/Emu/RSX/RSXThread.h +++ b/rpcs3/Emu/RSX/RSXThread.h @@ -205,12 +205,6 @@ public: bool m_set_line_smooth; // Viewport & scissor - bool m_set_viewport_horizontal; - bool m_set_viewport_vertical; - u16 m_viewport_x; - u16 m_viewport_y; - u16 m_viewport_w; - u16 m_viewport_h; bool m_set_scissor_horizontal; bool m_set_scissor_vertical; u16 m_scissor_x; @@ -481,8 +475,6 @@ protected: m_set_clip = false; m_set_depth_bounds_test = false; m_set_depth_bounds = false; - m_set_viewport_horizontal = false; - m_set_viewport_vertical = false; m_set_scissor_horizontal = false; m_set_scissor_vertical = false; m_set_front_polygon_mode = false; diff --git a/rpcs3/Emu/SysCalls/Modules/cellResc.cpp b/rpcs3/Emu/SysCalls/Modules/cellResc.cpp index 22108aac6a..0a66006f99 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellResc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellResc.cpp @@ -486,11 +486,8 @@ void SetupRsxRenderingStates(vm::ptr& cntxt) r.m_set_shade_mode = true; r.m_shade_mode = CELL_GCM_SMOOTH; r.m_set_frequency_divider_operation = CELL_GCM_FREQUENCY_DIVIDE; - r.m_set_viewport_horizontal = r.m_set_viewport_vertical = true; - r.m_viewport_x = 0; - r.m_viewport_y = 0; - r.m_viewport_w = s_rescInternalInstance->m_dstWidth; - r.m_viewport_h = s_rescInternalInstance->m_dstHeight; + rsx::method_registers[NV4097_SET_SURFACE_CLIP_HORIZONTAL] = s_rescInternalInstance->m_dstWidth << 16; + rsx::method_registers[NV4097_SET_SURFACE_CLIP_VERTICAL] = s_rescInternalInstance->m_dstHeight << 16; r.m_set_scissor_horizontal = r.m_set_scissor_vertical = true; r.m_scissor_x = 0; diff --git a/rpcs3/Gui/RSXDebugger.cpp b/rpcs3/Gui/RSXDebugger.cpp index 18b4dc5105..fcd81a12c1 100644 --- a/rpcs3/Gui/RSXDebugger.cpp +++ b/rpcs3/Gui/RSXDebugger.cpp @@ -637,10 +637,10 @@ void RSXDebugger::GetSettings() LIST_SETTINGS_ADD("Surface Offset D", wxString::Format("0x%x", render.m_surface_offset_d)); LIST_SETTINGS_ADD("Surface Offset Z", wxString::Format("0x%x", render.m_surface_offset_z)); LIST_SETTINGS_ADD("Viewport", wxString::Format("X:%d, Y:%d, W:%d, H:%d", - render.m_viewport_x, - render.m_viewport_y, - render.m_viewport_w, - render.m_viewport_h)); + rsx::method_registers[NV4097_SET_SURFACE_CLIP_HORIZONTAL] & 0xFFFF, + rsx::method_registers[NV4097_SET_SURFACE_CLIP_VERTICAL] & 0xFFFF, + rsx::method_registers[NV4097_SET_SURFACE_CLIP_HORIZONTAL] >> 16, + rsx::method_registers[NV4097_SET_SURFACE_CLIP_VERTICAL] >> 16)); #undef LIST_SETTINGS_ADD }