From 20d169e4a1753bf85c19c2799ace8b50fa2e3fa3 Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 26 Aug 2014 17:34:52 -0400 Subject: VideoCore: Fixes rendering issues on Qt and corrects framebuffer output size. --- src/core/hw/gpu.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/core/hw') diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp index 87cf93ba..f1f3e7ab 100644 --- a/src/core/hw/gpu.cpp +++ b/src/core/hw/gpu.cpp @@ -84,7 +84,7 @@ inline void Write(u32 addr, const T data) { for (int y = 0; y < config.output_height; ++y) { // TODO: Why does the register seem to hold twice the framebuffer width? - for (int x = 0; x < config.output_width / 2; ++x) { + for (int x = 0; x < config.output_width; ++x) { struct { int r, g, b, a; } source_color = { 0, 0, 0, 0 }; @@ -93,7 +93,7 @@ inline void Write(u32 addr, const T data) { case Regs::FramebufferFormat::RGBA8: { // TODO: Most likely got the component order messed up. - u8* srcptr = source_pointer + x * 4 + y * config.input_width * 4 / 2; + u8* srcptr = source_pointer + x * 4 + y * config.input_width * 4; source_color.r = srcptr[0]; // blue source_color.g = srcptr[1]; // green source_color.b = srcptr[2]; // red @@ -121,7 +121,7 @@ inline void Write(u32 addr, const T data) { case Regs::FramebufferFormat::RGB8: { // TODO: Most likely got the component order messed up. - u8* dstptr = dest_pointer + x * 3 + y * config.output_width * 3 / 2; + u8* dstptr = dest_pointer + x * 3 + y * config.output_width * 3; dstptr[0] = source_color.r; // blue dstptr[1] = source_color.g; // green dstptr[2] = source_color.b; // red @@ -217,16 +217,15 @@ void Init() { framebuffer_sub.address_right1 = 0x184C7800; //framebuffer_sub.address_right2 = unknown; - // TODO: Width should be 240 instead? - framebuffer_top.width = 480; + framebuffer_top.width = 240; framebuffer_top.height = 400; - framebuffer_top.stride = 480*3; + framebuffer_top.stride = 3 * 240; framebuffer_top.color_format = Regs::FramebufferFormat::RGB8; framebuffer_top.active_fb = 0; - framebuffer_sub.width = 480; - framebuffer_sub.height = 400; - framebuffer_sub.stride = 480*3; + framebuffer_sub.width = 240; + framebuffer_sub.height = 320; + framebuffer_sub.stride = 3 * 240; framebuffer_sub.color_format = Regs::FramebufferFormat::RGB8; framebuffer_sub.active_fb = 0; -- cgit v1.2.3