From 4b0d8557b4d1a0061f54e26fb2a44632ec379b6b Mon Sep 17 00:00:00 2001 From: vlj Date: Tue, 26 May 2015 16:26:46 +0200 Subject: [PATCH 1/6] RSXDebugger: Disasm a couple more command --- rpcs3/Gui/RSXDebugger.cpp | 172 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) diff --git a/rpcs3/Gui/RSXDebugger.cpp b/rpcs3/Gui/RSXDebugger.cpp index 99ce16e0ae..48dba77009 100644 --- a/rpcs3/Gui/RSXDebugger.cpp +++ b/rpcs3/Gui/RSXDebugger.cpp @@ -836,6 +836,178 @@ wxString RSXDebugger::DisAsmCommand(u32 cmd, u32 count, u32 currentAddr, u32 ioA u32 index = 0; switch(cmd & 0x3ffff) { + case NV406E_SEMAPHORE_OFFSET: + DISASM("Semaphore offset 0x%x", (u32)args[0]); + break; + + case NV406E_SEMAPHORE_ACQUIRE: + DISASM("Semaphore acquire at 0x%x", (u32)args[0]); + break; + + case NV406E_SEMAPHORE_RELEASE: + DISASM("Semaphore release value 0x%x", (u32)args[0]); + break; + + case NV4097_SET_SURFACE_FORMAT: + DISASM("Set surface format"); + break; + + case NV4097_SET_SURFACE_COLOR_TARGET: + DISASM("Set surface color target"); + break; + + case NV4097_SET_SHADER_WINDOW: + DISASM("Set shader windows"); + break; + + case NV4097_SET_DEPTH_TEST_ENABLE: + DISASM("Set depth test enable"); + break; + + case NV4097_SET_DEPTH_FUNC: + DISASM("Set depth func"); + break; + + case NV4097_SET_ZSTENCIL_CLEAR_VALUE: + DISASM("Set ZSTENCIL clear value"); + break; + + case NV4097_CLEAR_SURFACE: + DISASM("Clear surface"); + break; + + case NV4097_SET_TRANSFORM_CONSTANT_LOAD: + DISASM("Set transform constant load"); + break; + + case NV4097_SET_VERTEX_DATA_ARRAY_FORMAT: + DISASM("Set vertex data array format"); + break; + + case NV4097_SET_VERTEX_DATA_ARRAY_OFFSET: + DISASM("Set vertex data array offset"); + break; + + case NV4097_SET_SHADER_PROGRAM: + DISASM("Set shader program"); + break; + + case NV4097_SET_VERTEX_ATTRIB_OUTPUT_MASK: + DISASM("Set vertex attrib output mask"); + break; + + case NV4097_SET_TEX_COORD_CONTROL: + DISASM("Set tex coord control"); + break; + + case NV4097_SET_TRANSFORM_PROGRAM_LOAD: + DISASM("Set transform program load"); + break; + + case NV4097_SET_TRANSFORM_PROGRAM: + DISASM("Set transform program"); + break; + + case NV4097_SET_VERTEX_ATTRIB_INPUT_MASK: + DISASM("Set vertex attrib input mask"); + break; + + case NV4097_SET_TRANSFORM_TIMEOUT: + DISASM("Set transform timeout"); + break; + + case NV4097_INVALIDATE_VERTEX_CACHE_FILE: + DISASM("Invalidate vertex cache file"); + break; + + case NV4097_SET_SHADER_CONTROL: + DISASM("Set shader control"); + break; + + case NV4097_SET_SEMAPHORE_OFFSET: + DISASM("Set semaphore offset 0x%x", (u32)args[0]); + break; + + case NV4097_BACK_END_WRITE_SEMAPHORE_RELEASE: + DISASM("Back end write semaphore release %x", (u32)args[0]); + break; + + case NV4097_SET_COLOR_MASK_MRT: + DISASM("Set color mask MRT"); + break; + + case NV4097_SET_TEXTURE_IMAGE_RECT: + DISASM("Set texture image rect"); + break; + + case NV4097_SET_TEXTURE_CONTROL3: + DISASM("Set texture control 3"); + break; + + case NV4097_SET_TEXTURE_CONTROL1: + DISASM("Set texture control 1"); + break; + + case NV4097_SET_TEXTURE_CONTROL0: + DISASM("Set texture control 0"); + break; + + case NV4097_SET_TEXTURE_ADDRESS: + DISASM("Set texture address"); + break; + + case NV4097_SET_TEXTURE_FILTER: + DISASM("Set texture filter"); + break; + + case NV4097_SET_BLEND_FUNC_SFACTOR: + DISASM("Set blend func sfactor"); + break; + + case NV4097_SET_FRONT_POLYGON_MODE: + DISASM("Set front polygon mode"); + break; + + case NV4097_SET_VIEWPORT_HORIZONTAL: + DISASM("Set viewport horizontal"); + break; + + case NV4097_SET_CLIP_MIN: + DISASM("Set clip min"); + break; + + case NV4097_SET_VIEWPORT_OFFSET: + DISASM("Set viewport offset"); + break; + + case NV4097_SET_SCISSOR_HORIZONTAL: + DISASM("Set scissor horizontal"); + break; + + case NV4097_INVALIDATE_L2: + DISASM("Invalidate L2"); + break; + + case NV4097_INVALIDATE_VERTEX_FILE: + DISASM("Invalidate vertex file"); + break; + + case NV4097_SET_BEGIN_END: + DISASM("Set BEGIN END"); + break; + + case NV4097_DRAW_ARRAYS: + DISASM("Draw arrays"); + break; + + case NV4097_SET_WINDOW_OFFSET: + DISASM("Set window offset"); + break; + + case NV4097_SET_SURFACE_CLIP_HORIZONTAL: + DISASM("Set surface clip horizontal"); + break; + case 0x3fead: DISASM("Flip and change current buffer: %d", (u32)args[0]); break; From 629c290faa4a83a27d96cca652d288fab3bae1ba Mon Sep 17 00:00:00 2001 From: vlj Date: Tue, 26 May 2015 18:35:40 +0200 Subject: [PATCH 2/6] RSXDebugger: Print more accurate semaphore --- rpcs3/Gui/RSXDebugger.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rpcs3/Gui/RSXDebugger.cpp b/rpcs3/Gui/RSXDebugger.cpp index 48dba77009..3edf6de83b 100644 --- a/rpcs3/Gui/RSXDebugger.cpp +++ b/rpcs3/Gui/RSXDebugger.cpp @@ -837,15 +837,15 @@ wxString RSXDebugger::DisAsmCommand(u32 cmd, u32 count, u32 currentAddr, u32 ioA switch(cmd & 0x3ffff) { case NV406E_SEMAPHORE_OFFSET: - DISASM("Semaphore offset 0x%x", (u32)args[0]); + DISASM("PFIFO: Semaphore offset 0x%x", (u32)args[0]); break; case NV406E_SEMAPHORE_ACQUIRE: - DISASM("Semaphore acquire at 0x%x", (u32)args[0]); + DISASM("PFIFO: Semaphore acquire at 0x%x", (u32)args[0]); break; case NV406E_SEMAPHORE_RELEASE: - DISASM("Semaphore release value 0x%x", (u32)args[0]); + DISASM("PFIFO: Semaphore release value 0x%x", (u32)args[0]); break; case NV4097_SET_SURFACE_FORMAT: @@ -925,11 +925,11 @@ wxString RSXDebugger::DisAsmCommand(u32 cmd, u32 count, u32 currentAddr, u32 ioA break; case NV4097_SET_SEMAPHORE_OFFSET: - DISASM("Set semaphore offset 0x%x", (u32)args[0]); + DISASM("PGRAPH: Set semaphore offset 0x%x", (u32)args[0]); break; case NV4097_BACK_END_WRITE_SEMAPHORE_RELEASE: - DISASM("Back end write semaphore release %x", (u32)args[0]); + DISASM("PGRAPH: Back end write semaphore release %x", (u32)args[0]); break; case NV4097_SET_COLOR_MASK_MRT: From cf7e5028a423a9a459b6288a24051749fcc2ae75 Mon Sep 17 00:00:00 2001 From: vlj Date: Sat, 6 Jun 2015 21:45:38 +0200 Subject: [PATCH 3/6] RSXDebugger: Add surface detail when parsing set surface format --- rpcs3/Gui/RSXDebugger.cpp | 67 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/rpcs3/Gui/RSXDebugger.cpp b/rpcs3/Gui/RSXDebugger.cpp index 3edf6de83b..64d804ac95 100644 --- a/rpcs3/Gui/RSXDebugger.cpp +++ b/rpcs3/Gui/RSXDebugger.cpp @@ -849,7 +849,72 @@ wxString RSXDebugger::DisAsmCommand(u32 cmd, u32 count, u32 currentAddr, u32 ioA break; case NV4097_SET_SURFACE_FORMAT: - DISASM("Set surface format"); + { + const u32 a0 = (u32)args[0]; + const u32 surface_format = a0 & 0x1f; + const u32 surface_depth_format = (a0 >> 5) & 0x7; + + const char *depth_type_name, *color_type_name; + switch (surface_depth_format) + { + case CELL_GCM_SURFACE_Z16: + depth_type_name = "CELL_GCM_SURFACE_Z16"; + break; + case CELL_GCM_SURFACE_Z24S8: + depth_type_name = "CELL_GCM_SURFACE_Z24S8"; + break; + default: depth_type_name = ""; + break; + } + switch (surface_format) + { + case CELL_GCM_SURFACE_X1R5G5B5_Z1R5G5B5: + color_type_name = "CELL_GCM_SURFACE_X1R5G5B5_Z1R5G5B5"; + break; + case CELL_GCM_SURFACE_X1R5G5B5_O1R5G5B5: + color_type_name = "CELL_GCM_SURFACE_X1R5G5B5_O1R5G5B5"; + break; + case CELL_GCM_SURFACE_R5G6B5: + color_type_name = "CELL_GCM_SURFACE_R5G6B5"; + break; + case CELL_GCM_SURFACE_X8R8G8B8_Z8R8G8B8: + color_type_name = "CELL_GCM_SURFACE_X8R8G8B8_Z8R8G8B8"; + break; + case CELL_GCM_SURFACE_X8R8G8B8_O8R8G8B8: + color_type_name = "CELL_GCM_SURFACE_X8R8G8B8_O8R8G8B8"; + break; + case CELL_GCM_SURFACE_A8R8G8B8: + color_type_name = "CELL_GCM_SURFACE_A8R8G8B8"; + break; + case CELL_GCM_SURFACE_B8: + color_type_name = "CELL_GCM_SURFACE_B8"; + break; + case CELL_GCM_SURFACE_G8B8: + color_type_name = "CELL_GCM_SURFACE_G8B8"; + break; + case CELL_GCM_SURFACE_F_W16Z16Y16X16: + color_type_name = "CELL_GCM_SURFACE_F_W16Z16Y16X16"; + break; + case CELL_GCM_SURFACE_F_W32Z32Y32X32: + color_type_name = "CELL_GCM_SURFACE_F_W32Z32Y32X32"; + break; + case CELL_GCM_SURFACE_F_X32: + color_type_name = "CELL_GCM_SURFACE_F_X32"; + break; + case CELL_GCM_SURFACE_X8B8G8R8_Z8B8G8R8: + color_type_name = "CELL_GCM_SURFACE_X8B8G8R8_Z8B8G8R8"; + break; + case CELL_GCM_SURFACE_X8B8G8R8_O8B8G8R8: + color_type_name = "CELL_GCM_SURFACE_X8B8G8R8_O8B8G8R8"; + break; + case CELL_GCM_SURFACE_A8B8G8R8: + color_type_name = "CELL_GCM_SURFACE_A8B8G8R8"; + break; + default: color_type_name = ""; + break; + } + DISASM("Set surface format : C %s Z %s", color_type_name, depth_type_name); + } break; case NV4097_SET_SURFACE_COLOR_TARGET: From e7b459573ef9b31d76febd60515d97abf26fe705 Mon Sep 17 00:00:00 2001 From: vlj Date: Sat, 6 Jun 2015 22:19:30 +0200 Subject: [PATCH 4/6] RSXDebugger: Add clip details when parsing clip horizontal --- rpcs3/Gui/RSXDebugger.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/rpcs3/Gui/RSXDebugger.cpp b/rpcs3/Gui/RSXDebugger.cpp index 64d804ac95..217b88db0b 100644 --- a/rpcs3/Gui/RSXDebugger.cpp +++ b/rpcs3/Gui/RSXDebugger.cpp @@ -1070,7 +1070,24 @@ wxString RSXDebugger::DisAsmCommand(u32 cmd, u32 count, u32 currentAddr, u32 ioA break; case NV4097_SET_SURFACE_CLIP_HORIZONTAL: - DISASM("Set surface clip horizontal"); + { + const u32 a0 = (u32)args[0]; + + u32 clip_x = a0; + u32 clip_w = a0 >> 16; + + if (count == 2) + { + const u32 a1 = (u32)args[1]; + u32 clip_y = a1; + u32 clip_h = a1 >> 16; + DISASM("Set surface clip horizontal : %d %d", clip_w, clip_h); + } + else + DISASM("Set surface clip horizontal : %d", clip_w); + break; + } + break; case 0x3fead: From b353cd4ecb00c37de5249e71f19de838f80fdeda Mon Sep 17 00:00:00 2001 From: vlj Date: Tue, 16 Jun 2015 16:14:18 +0200 Subject: [PATCH 5/6] RSXDebugger: Display viewport size --- rpcs3/Gui/RSXDebugger.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/rpcs3/Gui/RSXDebugger.cpp b/rpcs3/Gui/RSXDebugger.cpp index 217b88db0b..a4b71b3102 100644 --- a/rpcs3/Gui/RSXDebugger.cpp +++ b/rpcs3/Gui/RSXDebugger.cpp @@ -1034,8 +1034,20 @@ wxString RSXDebugger::DisAsmCommand(u32 cmd, u32 count, u32 currentAddr, u32 ioA break; case NV4097_SET_VIEWPORT_HORIZONTAL: - DISASM("Set viewport horizontal"); + { + u32 m_viewport_x = (u32)args[0] & 0xffff; + u32 m_viewport_w = (u32)args[0] >> 16; + + if (count == 2) + { + u32 m_viewport_y = (u32)args[1] & 0xffff; + u32 m_viewport_h = (u32)args[1] >> 16; + DISASM("Set viewport horizontal %d %d", m_viewport_w, m_viewport_h); + } + else + DISASM("Set viewport horizontal %d", m_viewport_w); break; + } case NV4097_SET_CLIP_MIN: DISASM("Set clip min"); From 712a514c6dd825ecc367d7237b11ebc4fb3728bb Mon Sep 17 00:00:00 2001 From: vlj Date: Tue, 26 May 2015 16:35:58 +0200 Subject: [PATCH 6/6] RSXDebugger: Make bigger command list window --- rpcs3/Gui/RSXDebugger.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rpcs3/Gui/RSXDebugger.cpp b/rpcs3/Gui/RSXDebugger.cpp index a4b71b3102..aa1487a187 100644 --- a/rpcs3/Gui/RSXDebugger.cpp +++ b/rpcs3/Gui/RSXDebugger.cpp @@ -25,7 +25,7 @@ enum GCMEnumTypes RSXDebugger::RSXDebugger(wxWindow* parent) : wxFrame(parent, wxID_ANY, "RSX Debugger", wxDefaultPosition, wxSize(700, 450)) - , m_item_count(23) + , m_item_count(37) , m_addr(0x0) , m_cur_texture(0) , exit(false) @@ -77,7 +77,7 @@ RSXDebugger::RSXDebugger(wxWindow* parent) s_controls->Add(s_controls_breaks); //Tabs - wxNotebook* nb_rsx = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(482,475)); + wxNotebook* nb_rsx = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(732, 732)); wxPanel* p_commands = new wxPanel(nb_rsx, wxID_ANY); wxPanel* p_flags = new wxPanel(nb_rsx, wxID_ANY); wxPanel* p_programs = new wxPanel(nb_rsx, wxID_ANY); @@ -93,12 +93,12 @@ RSXDebugger::RSXDebugger(wxWindow* parent) nb_rsx->AddPage(p_settings, wxT("Settings")); //Tabs: Lists - m_list_commands = new wxListView(p_commands, wxID_ANY, wxPoint(1,3), wxSize(470,444)); - m_list_flags = new wxListView(p_flags, wxID_ANY, wxPoint(1,3), wxSize(470,444)); - m_list_programs = new wxListView(p_programs, wxID_ANY, wxPoint(1,3), wxSize(470,444)); - m_list_lightning = new wxListView(p_lightning, wxID_ANY, wxPoint(1,3), wxSize(470,444)); - m_list_texture = new wxListView(p_texture, wxID_ANY, wxPoint(1,3), wxSize(470,444)); - m_list_settings = new wxListView(p_settings, wxID_ANY, wxPoint(1,3), wxSize(470,444)); + m_list_commands = new wxListView(p_commands, wxID_ANY, wxPoint(1,3), wxSize(720, 720)); + m_list_flags = new wxListView(p_flags, wxID_ANY, wxPoint(1,3), wxSize(720, 720)); + m_list_programs = new wxListView(p_programs, wxID_ANY, wxPoint(1,3), wxSize(720, 720)); + m_list_lightning = new wxListView(p_lightning, wxID_ANY, wxPoint(1,3), wxSize(720, 720)); + m_list_texture = new wxListView(p_texture, wxID_ANY, wxPoint(1,3), wxSize(720, 720)); + m_list_settings = new wxListView(p_settings, wxID_ANY, wxPoint(1,3), wxSize(720, 720)); //Tabs: List Style m_list_commands ->SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL)); @@ -111,7 +111,7 @@ RSXDebugger::RSXDebugger(wxWindow* parent) //Tabs: List Columns m_list_commands->InsertColumn(0, "Address", 0, 80); m_list_commands->InsertColumn(1, "Value", 0, 80); - m_list_commands->InsertColumn(2, "Command", 0, 250); + m_list_commands->InsertColumn(2, "Command", 0, 500); m_list_commands->InsertColumn(3, "Count", 0, 40); m_list_flags->InsertColumn(0, "Name", 0, 170); m_list_flags->InsertColumn(1, "Value", 0, 270);