diff options
| -rw-r--r-- | src/citra_qt/debugger/graphics_framebuffer.cpp | 34 | ||||
| -rw-r--r-- | src/citra_qt/debugger/graphics_framebuffer.h | 5 |
2 files changed, 33 insertions, 6 deletions
diff --git a/src/citra_qt/debugger/graphics_framebuffer.cpp b/src/citra_qt/debugger/graphics_framebuffer.cpp index d9e73a46a..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 | |||
| 55 | framebuffer_format_control->addItem(tr("RGBA4")); | 55 | framebuffer_format_control->addItem(tr("RGBA4")); |
| 56 | framebuffer_format_control->addItem(tr("D16")); | 56 | framebuffer_format_control->addItem(tr("D16")); |
| 57 | framebuffer_format_control->addItem(tr("D24")); | 57 | framebuffer_format_control->addItem(tr("D24")); |
| 58 | framebuffer_format_control->addItem(tr("D24S8")); | 58 | framebuffer_format_control->addItem(tr("D24X8")); |
| 59 | framebuffer_format_control->addItem(tr("X24S8")); | ||
| 60 | framebuffer_format_control->addItem(tr("(unknown)")); | ||
| 59 | 61 | ||
| 60 | // TODO: This QLabel should shrink the image to the available space rather than just expanding... | 62 | // TODO: This QLabel should shrink the image to the available space rather than just expanding... |
| 61 | framebuffer_picture_label = new QLabel; | 63 | framebuffer_picture_label = new QLabel; |
| @@ -221,7 +223,24 @@ void GraphicsFramebufferWidget::OnUpdate() | |||
| 221 | framebuffer_address = framebuffer.GetDepthBufferPhysicalAddress(); | 223 | framebuffer_address = framebuffer.GetDepthBufferPhysicalAddress(); |
| 222 | framebuffer_width = framebuffer.GetWidth(); | 224 | framebuffer_width = framebuffer.GetWidth(); |
| 223 | framebuffer_height = framebuffer.GetHeight(); | 225 | framebuffer_height = framebuffer.GetHeight(); |
| 224 | framebuffer_format = Format::D16; | 226 | |
| 227 | switch (framebuffer.depth_format) { | ||
| 228 | case Pica::Regs::DepthFormat::D16: | ||
| 229 | framebuffer_format = Format::D16; | ||
| 230 | break; | ||
| 231 | |||
| 232 | case Pica::Regs::DepthFormat::D24: | ||
| 233 | framebuffer_format = Format::D24; | ||
| 234 | break; | ||
| 235 | |||
| 236 | case Pica::Regs::DepthFormat::D24S8: | ||
| 237 | framebuffer_format = Format::D24X8; | ||
| 238 | break; | ||
| 239 | |||
| 240 | default: | ||
| 241 | framebuffer_format = Format::Unknown; | ||
| 242 | break; | ||
| 243 | } | ||
| 225 | 244 | ||
| 226 | break; | 245 | break; |
| 227 | } | 246 | } |
| @@ -282,7 +301,7 @@ void GraphicsFramebufferWidget::OnUpdate() | |||
| 282 | color.b() = (data >> 16) & 0xFF; | 301 | color.b() = (data >> 16) & 0xFF; |
| 283 | break; | 302 | break; |
| 284 | } | 303 | } |
| 285 | case Format::D24S8: | 304 | case Format::D24X8: |
| 286 | { | 305 | { |
| 287 | Math::Vec2<u32> data = Color::DecodeD24S8(pixel); | 306 | Math::Vec2<u32> data = Color::DecodeD24S8(pixel); |
| 288 | color.r() = data.x & 0xFF; | 307 | color.r() = data.x & 0xFF; |
| @@ -290,6 +309,12 @@ void GraphicsFramebufferWidget::OnUpdate() | |||
| 290 | color.b() = (data.x >> 16) & 0xFF; | 309 | color.b() = (data.x >> 16) & 0xFF; |
| 291 | break; | 310 | break; |
| 292 | } | 311 | } |
| 312 | case Format::X24S8: | ||
| 313 | { | ||
| 314 | Math::Vec2<u32> data = Color::DecodeD24S8(pixel); | ||
| 315 | color.r() = color.g() = color.b() = data.y; | ||
| 316 | break; | ||
| 317 | } | ||
| 293 | default: | 318 | default: |
| 294 | qDebug() << "Unknown fb color format " << static_cast<int>(framebuffer_format); | 319 | qDebug() << "Unknown fb color format " << static_cast<int>(framebuffer_format); |
| 295 | break; | 320 | break; |
| @@ -310,7 +335,8 @@ void GraphicsFramebufferWidget::OnUpdate() | |||
| 310 | u32 GraphicsFramebufferWidget::BytesPerPixel(GraphicsFramebufferWidget::Format format) { | 335 | u32 GraphicsFramebufferWidget::BytesPerPixel(GraphicsFramebufferWidget::Format format) { |
| 311 | switch (format) { | 336 | switch (format) { |
| 312 | case Format::RGBA8: | 337 | case Format::RGBA8: |
| 313 | case Format::D24S8: | 338 | case Format::D24X8: |
| 339 | case Format::X24S8: | ||
| 314 | return 4; | 340 | return 4; |
| 315 | case Format::RGB8: | 341 | case Format::RGB8: |
| 316 | case Format::D24: | 342 | case Format::D24: |
diff --git a/src/citra_qt/debugger/graphics_framebuffer.h b/src/citra_qt/debugger/graphics_framebuffer.h index 267c81983..e9eae679f 100644 --- a/src/citra_qt/debugger/graphics_framebuffer.h +++ b/src/citra_qt/debugger/graphics_framebuffer.h | |||
| @@ -35,8 +35,9 @@ class GraphicsFramebufferWidget : public BreakPointObserverDock { | |||
| 35 | RGBA4 = 4, | 35 | RGBA4 = 4, |
| 36 | D16 = 5, | 36 | D16 = 5, |
| 37 | D24 = 6, | 37 | D24 = 6, |
| 38 | D24S8 = 7, | 38 | D24X8 = 7, |
| 39 | Unknown = 8 | 39 | X24S8 = 8, |
| 40 | Unknown = 9 | ||
| 40 | }; | 41 | }; |
| 41 | 42 | ||
| 42 | static u32 BytesPerPixel(Format format); | 43 | static u32 BytesPerPixel(Format format); |