From 5d59dae73045cf70cf70ba95eda3f42e028cd6eb Mon Sep 17 00:00:00 2001 From: DH Date: Sun, 16 Feb 2014 11:39:03 +0200 Subject: [PATCH] Fixed RSXDebugger --- rpcs3/Gui/RSXDebugger.cpp | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/rpcs3/Gui/RSXDebugger.cpp b/rpcs3/Gui/RSXDebugger.cpp index 085d449c67..db0f1341ba 100644 --- a/rpcs3/Gui/RSXDebugger.cpp +++ b/rpcs3/Gui/RSXDebugger.cpp @@ -293,9 +293,11 @@ void RSXDebugger::OnClickBuffer(wxMouseEvent& event) if (event.GetId() == p_buffer_colorD->GetId()) SHOW_BUFFER(3); if (event.GetId() == p_buffer_tex->GetId()) { - if(Memory.IsGoodAddr(GetAddress(render.m_textures[m_cur_texture].GetOffset(), render.m_textures[m_cur_texture].GetLocation())) && render.m_textures[m_cur_texture].GetWidth() && render.m_textures[m_cur_texture].GetHeight()) + u8 location = render.m_textures[m_cur_texture].GetLocation(); + if(location <= 1 && Memory.IsGoodAddr(GetAddress(render.m_textures[m_cur_texture].GetOffset(), location)) + && render.m_textures[m_cur_texture].GetWidth() && render.m_textures[m_cur_texture].GetHeight()) MemoryViewerPanel::ShowImage(this, - GetAddress(render.m_textures[m_cur_texture].GetOffset(), render.m_textures[m_cur_texture].GetLocation()), 1, + GetAddress(render.m_textures[m_cur_texture].GetOffset(), location), 1, render.m_textures[m_cur_texture].GetWidth(), render.m_textures[m_cur_texture].GetHeight(), false); } @@ -417,7 +419,20 @@ void RSXDebugger::GetBuffers() } // Draw Texture - u32 TexBuffer_addr = GetAddress(render.m_textures[m_cur_texture].GetOffset(), render.m_textures[m_cur_texture].GetLocation()); + if(!render.m_textures[m_cur_texture].IsEnabled()) + return; + + u32 offset = render.m_textures[m_cur_texture].GetOffset(); + + if(!offset) + return; + + u8 location = render.m_textures[m_cur_texture].GetLocation(); + + if(location > 1) + return; + + u32 TexBuffer_addr = GetAddress(offset, location); if(!Memory.IsGoodAddr(TexBuffer_addr)) return; @@ -487,7 +502,17 @@ void RSXDebugger::GetTexture() if(render.m_textures[i].IsEnabled()) { m_list_texture->InsertItem(i, wxString::Format("%d", i)); - m_list_texture->SetItem(i, 1, wxString::Format("0x%x", GetAddress(render.m_textures[i].GetOffset(), render.m_textures[i].GetLocation()))); + u8 location = render.m_textures[i].GetLocation(); + if(location > 1) + { + m_list_texture->SetItem(i, 1, + wxString::Format("Bad address (offset=0x%x, location=%d)", render.m_textures[i].GetOffset(), location)); + } + else + { + m_list_texture->SetItem(i, 1, wxString::Format("0x%x", GetAddress(render.m_textures[i].GetOffset(), location))); + } + m_list_texture->SetItem(i, 2, render.m_textures[i].isCubemap() ? "True" : "False"); m_list_texture->SetItem(i, 3, wxString::Format("%dD", render.m_textures[i].GetDimension())); m_list_texture->SetItem(i, 4, render.m_textures[i].IsEnabled() ? "True" : "False");