diff options
Diffstat (limited to 'src/citra_qt')
-rw-r--r-- | src/citra_qt/debugger/graphics_framebuffer.cpp | 62 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics_framebuffer.h | 4 |
2 files changed, 59 insertions, 7 deletions
diff --git a/src/citra_qt/debugger/graphics_framebuffer.cpp b/src/citra_qt/debugger/graphics_framebuffer.cpp index 6bbe7572c..39eefbf75 100644 --- a/src/citra_qt/debugger/graphics_framebuffer.cpp +++ b/src/citra_qt/debugger/graphics_framebuffer.cpp @@ -55,7 +55,9 @@ GraphicsFramebufferWidget::GraphicsFramebufferWidget(std::shared_ptr<Pica::Debug framebuffer_format_control->addItem(tr("RGBA4")); framebuffer_format_control->addItem(tr("D16")); framebuffer_format_control->addItem(tr("D24")); - framebuffer_format_control->addItem(tr("D24S8")); + framebuffer_format_control->addItem(tr("D24X8")); + framebuffer_format_control->addItem(tr("X24S8")); + framebuffer_format_control->addItem(tr("(unknown)")); // TODO: This QLabel should shrink the image to the available space rather than just expanding... framebuffer_picture_label = new QLabel; @@ -184,8 +186,32 @@ void GraphicsFramebufferWidget::OnUpdate() framebuffer_address = framebuffer.GetColorBufferPhysicalAddress(); framebuffer_width = framebuffer.GetWidth(); framebuffer_height = framebuffer.GetHeight(); - // TODO: It's unknown how this format is actually specified - framebuffer_format = Format::RGBA8; + + switch (framebuffer.color_format) { + case Pica::Regs::ColorFormat::RGBA8: + framebuffer_format = Format::RGBA8; + break; + + case Pica::Regs::ColorFormat::RGB8: + framebuffer_format = Format::RGB8; + break; + + case Pica::Regs::ColorFormat::RGB5A1: + framebuffer_format = Format::RGB5A1; + break; + + case Pica::Regs::ColorFormat::RGB565: + framebuffer_format = Format::RGB565; + break; + + case Pica::Regs::ColorFormat::RGBA4: + framebuffer_format = Format::RGBA4; + break; + + default: + framebuffer_format = Format::Unknown; + break; + } break; } @@ -197,7 +223,24 @@ void GraphicsFramebufferWidget::OnUpdate() framebuffer_address = framebuffer.GetDepthBufferPhysicalAddress(); framebuffer_width = framebuffer.GetWidth(); framebuffer_height = framebuffer.GetHeight(); - framebuffer_format = Format::D16; + + switch (framebuffer.depth_format) { + case Pica::Regs::DepthFormat::D16: + framebuffer_format = Format::D16; + break; + + case Pica::Regs::DepthFormat::D24: + framebuffer_format = Format::D24; + break; + + case Pica::Regs::DepthFormat::D24S8: + framebuffer_format = Format::D24X8; + break; + + default: + framebuffer_format = Format::Unknown; + break; + } break; } @@ -258,7 +301,7 @@ void GraphicsFramebufferWidget::OnUpdate() color.b() = (data >> 16) & 0xFF; break; } - case Format::D24S8: + case Format::D24X8: { Math::Vec2<u32> data = Color::DecodeD24S8(pixel); color.r() = data.x & 0xFF; @@ -266,6 +309,12 @@ void GraphicsFramebufferWidget::OnUpdate() color.b() = (data.x >> 16) & 0xFF; break; } + case Format::X24S8: + { + Math::Vec2<u32> data = Color::DecodeD24S8(pixel); + color.r() = color.g() = color.b() = data.y; + break; + } default: qDebug() << "Unknown fb color format " << static_cast<int>(framebuffer_format); break; @@ -286,7 +335,8 @@ void GraphicsFramebufferWidget::OnUpdate() u32 GraphicsFramebufferWidget::BytesPerPixel(GraphicsFramebufferWidget::Format format) { switch (format) { case Format::RGBA8: - case Format::D24S8: + case Format::D24X8: + case Format::X24S8: return 4; case Format::RGB8: case Format::D24: diff --git a/src/citra_qt/debugger/graphics_framebuffer.h b/src/citra_qt/debugger/graphics_framebuffer.h index 4cb396ffe..e9eae679f 100644 --- a/src/citra_qt/debugger/graphics_framebuffer.h +++ b/src/citra_qt/debugger/graphics_framebuffer.h @@ -35,7 +35,9 @@ class GraphicsFramebufferWidget : public BreakPointObserverDock { RGBA4 = 4, D16 = 5, D24 = 6, - D24S8 = 7 + D24X8 = 7, + X24S8 = 8, + Unknown = 9 }; static u32 BytesPerPixel(Format format); |