From e1144e364e61d51b6ea8f950f6defd69d1b9f3fe Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Sun, 21 Dec 2014 02:47:44 +0100 Subject: citra-qt: Always show pica framebuffers as RGBA8. We actually don't really know yet how the format is encoded. Hence just use what works. --- src/citra_qt/debugger/graphics_framebuffer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/citra_qt/debugger/graphics_framebuffer.cpp') diff --git a/src/citra_qt/debugger/graphics_framebuffer.cpp b/src/citra_qt/debugger/graphics_framebuffer.cpp index dd41c3880..28d5519fb 100644 --- a/src/citra_qt/debugger/graphics_framebuffer.cpp +++ b/src/citra_qt/debugger/graphics_framebuffer.cpp @@ -202,7 +202,8 @@ void GraphicsFramebufferWidget::OnUpdate() framebuffer_address = framebuffer.GetColorBufferPhysicalAddress(); framebuffer_width = framebuffer.GetWidth(); framebuffer_height = framebuffer.GetHeight(); - framebuffer_format = static_cast(framebuffer.color_format); + // TODO: It's unknown how this format is actually specified + framebuffer_format = Format::RGBA8; break; } -- cgit v1.2.3 From b03a97e0b86bd49111fffee22c5ab28c73d6d7bf Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Sun, 21 Dec 2014 02:48:15 +0100 Subject: citra-qt: Fix displaying RGBA5551 framebuffers. (not that it matters at the moment, because this code is not used yet) --- src/citra_qt/debugger/graphics_framebuffer.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/citra_qt/debugger/graphics_framebuffer.cpp') diff --git a/src/citra_qt/debugger/graphics_framebuffer.cpp b/src/citra_qt/debugger/graphics_framebuffer.cpp index 28d5519fb..4a45027b8 100644 --- a/src/citra_qt/debugger/graphics_framebuffer.cpp +++ b/src/citra_qt/debugger/graphics_framebuffer.cpp @@ -263,6 +263,10 @@ void GraphicsFramebufferWidget::OnUpdate() u8 g = (value >> 6) & 0x1F; u8 b = (value >> 1) & 0x1F; u8 a = value & 1; + r = (r << 3) | (r >> 2); + g = (g << 3) | (g >> 2); + b = (b << 3) | (b >> 2); + a *= 255; decoded_image.setPixel(x, y, qRgba(r, g, b, 255/*a*/)); } -- cgit v1.2.3 From 47543d62cf9e982598f58438ad24769c2b36ec77 Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Wed, 31 Dec 2014 15:17:07 +0100 Subject: Pica: Cleanup color conversion. --- src/citra_qt/debugger/graphics_framebuffer.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/citra_qt/debugger/graphics_framebuffer.cpp') diff --git a/src/citra_qt/debugger/graphics_framebuffer.cpp b/src/citra_qt/debugger/graphics_framebuffer.cpp index 4a45027b8..a9e9de652 100644 --- a/src/citra_qt/debugger/graphics_framebuffer.cpp +++ b/src/citra_qt/debugger/graphics_framebuffer.cpp @@ -10,6 +10,7 @@ #include #include +#include "video_core/color.h" #include "video_core/pica.h" #include "graphics_framebuffer.hxx" @@ -259,14 +260,10 @@ void GraphicsFramebufferWidget::OnUpdate() for (unsigned y = 0; y < framebuffer_height; ++y) { for (unsigned x = 0; x < framebuffer_width; ++x) { u16 value = *(u16*)(((u8*)color_buffer) + x * 2 + y * framebuffer_width * 2); - u8 r = (value >> 11) & 0x1F; - u8 g = (value >> 6) & 0x1F; - u8 b = (value >> 1) & 0x1F; - u8 a = value & 1; - r = (r << 3) | (r >> 2); - g = (g << 3) | (g >> 2); - b = (b << 3) | (b >> 2); - a *= 255; + u8 r = Color::Convert5To8((value >> 11) & 0x1F); + u8 g = Color::Convert5To8((value >> 6) & 0x1F); + u8 b = Color::Convert5To8((value >> 1) & 0x1F); + u8 a = Color::Convert1To8(value & 1); decoded_image.setPixel(x, y, qRgba(r, g, b, 255/*a*/)); } -- cgit v1.2.3