diff options
| author | 2014-12-15 21:28:45 +0100 | |
|---|---|---|
| committer | 2014-12-20 18:06:53 +0100 | |
| commit | 40f123b7c0eaf1507d51f6b87192ec2f956e5d5e (patch) | |
| tree | 7f87847435d510ed0e70a10cd67129a3b2511335 /src/citra_qt/debugger | |
| parent | Pica: Further improve Tev emulation. (diff) | |
| download | yuzu-40f123b7c0eaf1507d51f6b87192ec2f956e5d5e.tar.gz yuzu-40f123b7c0eaf1507d51f6b87192ec2f956e5d5e.tar.xz yuzu-40f123b7c0eaf1507d51f6b87192ec2f956e5d5e.zip | |
Pica: Unify ugly address translation hacks.
Diffstat (limited to 'src/citra_qt/debugger')
| -rw-r--r-- | src/citra_qt/debugger/graphics_cmdlists.cpp | 8 | ||||
| -rw-r--r-- | src/citra_qt/debugger/graphics_framebuffer.cpp | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp index 01ff31d44..bf35f035f 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics_cmdlists.cpp | |||
| @@ -47,7 +47,7 @@ public: | |||
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| 49 | TextureInfoDockWidget::TextureInfoDockWidget(const Pica::DebugUtils::TextureInfo& info, QWidget* parent) | 49 | TextureInfoDockWidget::TextureInfoDockWidget(const Pica::DebugUtils::TextureInfo& info, QWidget* parent) |
| 50 | : QDockWidget(tr("Texture 0x%1").arg(info.address, 8, 16, QLatin1Char('0'))), | 50 | : QDockWidget(tr("Texture 0x%1").arg(info.physical_address, 8, 16, QLatin1Char('0'))), |
| 51 | info(info) { | 51 | info(info) { |
| 52 | 52 | ||
| 53 | QWidget* main_widget = new QWidget; | 53 | QWidget* main_widget = new QWidget; |
| @@ -60,7 +60,7 @@ TextureInfoDockWidget::TextureInfoDockWidget(const Pica::DebugUtils::TextureInfo | |||
| 60 | phys_address_spinbox->SetBase(16); | 60 | phys_address_spinbox->SetBase(16); |
| 61 | phys_address_spinbox->SetRange(0, 0xFFFFFFFF); | 61 | phys_address_spinbox->SetRange(0, 0xFFFFFFFF); |
| 62 | phys_address_spinbox->SetPrefix("0x"); | 62 | phys_address_spinbox->SetPrefix("0x"); |
| 63 | phys_address_spinbox->SetValue(info.address); | 63 | phys_address_spinbox->SetValue(info.physical_address); |
| 64 | connect(phys_address_spinbox, SIGNAL(ValueChanged(qint64)), this, SLOT(OnAddressChanged(qint64))); | 64 | connect(phys_address_spinbox, SIGNAL(ValueChanged(qint64)), this, SLOT(OnAddressChanged(qint64))); |
| 65 | 65 | ||
| 66 | QComboBox* format_choice = new QComboBox; | 66 | QComboBox* format_choice = new QComboBox; |
| @@ -125,7 +125,7 @@ TextureInfoDockWidget::TextureInfoDockWidget(const Pica::DebugUtils::TextureInfo | |||
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | void TextureInfoDockWidget::OnAddressChanged(qint64 value) { | 127 | void TextureInfoDockWidget::OnAddressChanged(qint64 value) { |
| 128 | info.address = value; | 128 | info.physical_address = value; |
| 129 | emit UpdatePixmap(ReloadPixmap()); | 129 | emit UpdatePixmap(ReloadPixmap()); |
| 130 | } | 130 | } |
| 131 | 131 | ||
| @@ -150,7 +150,7 @@ void TextureInfoDockWidget::OnStrideChanged(int value) { | |||
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | QPixmap TextureInfoDockWidget::ReloadPixmap() const { | 152 | QPixmap TextureInfoDockWidget::ReloadPixmap() const { |
| 153 | u8* src = Memory::GetPointer(info.address); | 153 | u8* src = Memory::GetPointer(Pica::PAddrToVAddr(info.physical_address)); |
| 154 | return QPixmap::fromImage(LoadTexture(src, info)); | 154 | return QPixmap::fromImage(LoadTexture(src, info)); |
| 155 | } | 155 | } |
| 156 | 156 | ||
diff --git a/src/citra_qt/debugger/graphics_framebuffer.cpp b/src/citra_qt/debugger/graphics_framebuffer.cpp index c055299a4..484be1db5 100644 --- a/src/citra_qt/debugger/graphics_framebuffer.cpp +++ b/src/citra_qt/debugger/graphics_framebuffer.cpp | |||
| @@ -199,7 +199,7 @@ void GraphicsFramebufferWidget::OnUpdate() | |||
| 199 | auto framebuffer = Pica::registers.framebuffer; | 199 | auto framebuffer = Pica::registers.framebuffer; |
| 200 | using Framebuffer = decltype(framebuffer); | 200 | using Framebuffer = decltype(framebuffer); |
| 201 | 201 | ||
| 202 | framebuffer_address = framebuffer.GetColorBufferAddress(); | 202 | framebuffer_address = framebuffer.GetColorBufferPhysicalAddress(); |
| 203 | framebuffer_width = framebuffer.GetWidth(); | 203 | framebuffer_width = framebuffer.GetWidth(); |
| 204 | framebuffer_height = framebuffer.GetHeight(); | 204 | framebuffer_height = framebuffer.GetHeight(); |
| 205 | framebuffer_format = static_cast<Format>(framebuffer.color_format); | 205 | framebuffer_format = static_cast<Format>(framebuffer.color_format); |
| @@ -224,7 +224,7 @@ void GraphicsFramebufferWidget::OnUpdate() | |||
| 224 | case Format::RGBA8: | 224 | case Format::RGBA8: |
| 225 | { | 225 | { |
| 226 | QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); | 226 | QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); |
| 227 | u32* color_buffer = (u32*)Memory::GetPointer(framebuffer_address); | 227 | u32* color_buffer = (u32*)Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address)); |
| 228 | for (unsigned y = 0; y < framebuffer_height; ++y) { | 228 | for (unsigned y = 0; y < framebuffer_height; ++y) { |
| 229 | for (unsigned x = 0; x < framebuffer_width; ++x) { | 229 | for (unsigned x = 0; x < framebuffer_width; ++x) { |
| 230 | u32 value = *(color_buffer + x + y * framebuffer_width); | 230 | u32 value = *(color_buffer + x + y * framebuffer_width); |
| @@ -239,7 +239,7 @@ void GraphicsFramebufferWidget::OnUpdate() | |||
| 239 | case Format::RGB8: | 239 | case Format::RGB8: |
| 240 | { | 240 | { |
| 241 | QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); | 241 | QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); |
| 242 | u8* color_buffer = Memory::GetPointer(framebuffer_address); | 242 | u8* color_buffer = Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address)); |
| 243 | for (unsigned y = 0; y < framebuffer_height; ++y) { | 243 | for (unsigned y = 0; y < framebuffer_height; ++y) { |
| 244 | for (unsigned x = 0; x < framebuffer_width; ++x) { | 244 | for (unsigned x = 0; x < framebuffer_width; ++x) { |
| 245 | u8* pixel_pointer = color_buffer + x * 3 + y * 3 * framebuffer_width; | 245 | u8* pixel_pointer = color_buffer + x * 3 + y * 3 * framebuffer_width; |
| @@ -254,7 +254,7 @@ void GraphicsFramebufferWidget::OnUpdate() | |||
| 254 | case Format::RGBA5551: | 254 | case Format::RGBA5551: |
| 255 | { | 255 | { |
| 256 | QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); | 256 | QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); |
| 257 | u32* color_buffer = (u32*)Memory::GetPointer(framebuffer_address); | 257 | u32* color_buffer = (u32*)Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address)); |
| 258 | for (unsigned y = 0; y < framebuffer_height; ++y) { | 258 | for (unsigned y = 0; y < framebuffer_height; ++y) { |
| 259 | for (unsigned x = 0; x < framebuffer_width; ++x) { | 259 | for (unsigned x = 0; x < framebuffer_width; ++x) { |
| 260 | u16 value = *(u16*)(((u8*)color_buffer) + x * 2 + y * framebuffer_width * 2); | 260 | u16 value = *(u16*)(((u8*)color_buffer) + x * 2 + y * framebuffer_width * 2); |