diff options
Diffstat (limited to 'src/citra_qt/debugger/graphics_framebuffer.cpp')
| -rw-r--r-- | src/citra_qt/debugger/graphics_framebuffer.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/citra_qt/debugger/graphics_framebuffer.cpp b/src/citra_qt/debugger/graphics_framebuffer.cpp index b4e585c2b..7ef699f37 100644 --- a/src/citra_qt/debugger/graphics_framebuffer.cpp +++ b/src/citra_qt/debugger/graphics_framebuffer.cpp | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <QPushButton> | 10 | #include <QPushButton> |
| 11 | #include <QSpinBox> | 11 | #include <QSpinBox> |
| 12 | 12 | ||
| 13 | #include "video_core/color.h" | ||
| 13 | #include "video_core/pica.h" | 14 | #include "video_core/pica.h" |
| 14 | 15 | ||
| 15 | #include "graphics_framebuffer.hxx" | 16 | #include "graphics_framebuffer.hxx" |
| @@ -202,7 +203,8 @@ void GraphicsFramebufferWidget::OnUpdate() | |||
| 202 | framebuffer_address = framebuffer.GetColorBufferPhysicalAddress(); | 203 | framebuffer_address = framebuffer.GetColorBufferPhysicalAddress(); |
| 203 | framebuffer_width = framebuffer.GetWidth(); | 204 | framebuffer_width = framebuffer.GetWidth(); |
| 204 | framebuffer_height = framebuffer.GetHeight(); | 205 | framebuffer_height = framebuffer.GetHeight(); |
| 205 | framebuffer_format = static_cast<Format>(framebuffer.color_format); | 206 | // TODO: It's unknown how this format is actually specified |
| 207 | framebuffer_format = Format::RGBA8; | ||
| 206 | 208 | ||
| 207 | break; | 209 | break; |
| 208 | } | 210 | } |
| @@ -258,10 +260,10 @@ void GraphicsFramebufferWidget::OnUpdate() | |||
| 258 | for (unsigned int y = 0; y < framebuffer_height; ++y) { | 260 | for (unsigned int y = 0; y < framebuffer_height; ++y) { |
| 259 | for (unsigned int x = 0; x < framebuffer_width; ++x) { | 261 | for (unsigned int x = 0; x < framebuffer_width; ++x) { |
| 260 | u16 value = *(u16*)(((u8*)color_buffer) + x * 2 + y * framebuffer_width * 2); | 262 | u16 value = *(u16*)(((u8*)color_buffer) + x * 2 + y * framebuffer_width * 2); |
| 261 | u8 r = (value >> 11) & 0x1F; | 263 | u8 r = Color::Convert5To8((value >> 11) & 0x1F); |
| 262 | u8 g = (value >> 6) & 0x1F; | 264 | u8 g = Color::Convert5To8((value >> 6) & 0x1F); |
| 263 | u8 b = (value >> 1) & 0x1F; | 265 | u8 b = Color::Convert5To8((value >> 1) & 0x1F); |
| 264 | u8 a = value & 1; | 266 | u8 a = Color::Convert1To8(value & 1); |
| 265 | 267 | ||
| 266 | decoded_image.setPixel(x, y, qRgba(r, g, b, 255/*a*/)); | 268 | decoded_image.setPixel(x, y, qRgba(r, g, b, 255/*a*/)); |
| 267 | } | 269 | } |