summaryrefslogtreecommitdiff
path: root/src/core/hw/gpu.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2014-08-26 17:34:52 -0400
committerGravatar bunnei2014-08-26 17:34:52 -0400
commit20d169e4a1753bf85c19c2799ace8b50fa2e3fa3 (patch)
tree9b90eb8eda2a89eeb7302d9fa5af79a466cd695b /src/core/hw/gpu.cpp
parentMerge pull request #74 from kevinhartman/master (diff)
downloadyuzu-20d169e4a1753bf85c19c2799ace8b50fa2e3fa3.tar.gz
yuzu-20d169e4a1753bf85c19c2799ace8b50fa2e3fa3.tar.xz
yuzu-20d169e4a1753bf85c19c2799ace8b50fa2e3fa3.zip
VideoCore: Fixes rendering issues on Qt and corrects framebuffer output size.
Diffstat (limited to 'src/core/hw/gpu.cpp')
-rw-r--r--src/core/hw/gpu.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp
index 87cf93bac..f1f3e7ab3 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) {
84 84
85 for (int y = 0; y < config.output_height; ++y) { 85 for (int y = 0; y < config.output_height; ++y) {
86 // TODO: Why does the register seem to hold twice the framebuffer width? 86 // TODO: Why does the register seem to hold twice the framebuffer width?
87 for (int x = 0; x < config.output_width / 2; ++x) { 87 for (int x = 0; x < config.output_width; ++x) {
88 struct { 88 struct {
89 int r, g, b, a; 89 int r, g, b, a;
90 } source_color = { 0, 0, 0, 0 }; 90 } source_color = { 0, 0, 0, 0 };
@@ -93,7 +93,7 @@ inline void Write(u32 addr, const T data) {
93 case Regs::FramebufferFormat::RGBA8: 93 case Regs::FramebufferFormat::RGBA8:
94 { 94 {
95 // TODO: Most likely got the component order messed up. 95 // TODO: Most likely got the component order messed up.
96 u8* srcptr = source_pointer + x * 4 + y * config.input_width * 4 / 2; 96 u8* srcptr = source_pointer + x * 4 + y * config.input_width * 4;
97 source_color.r = srcptr[0]; // blue 97 source_color.r = srcptr[0]; // blue
98 source_color.g = srcptr[1]; // green 98 source_color.g = srcptr[1]; // green
99 source_color.b = srcptr[2]; // red 99 source_color.b = srcptr[2]; // red
@@ -121,7 +121,7 @@ inline void Write(u32 addr, const T data) {
121 case Regs::FramebufferFormat::RGB8: 121 case Regs::FramebufferFormat::RGB8:
122 { 122 {
123 // TODO: Most likely got the component order messed up. 123 // TODO: Most likely got the component order messed up.
124 u8* dstptr = dest_pointer + x * 3 + y * config.output_width * 3 / 2; 124 u8* dstptr = dest_pointer + x * 3 + y * config.output_width * 3;
125 dstptr[0] = source_color.r; // blue 125 dstptr[0] = source_color.r; // blue
126 dstptr[1] = source_color.g; // green 126 dstptr[1] = source_color.g; // green
127 dstptr[2] = source_color.b; // red 127 dstptr[2] = source_color.b; // red
@@ -217,16 +217,15 @@ void Init() {
217 framebuffer_sub.address_right1 = 0x184C7800; 217 framebuffer_sub.address_right1 = 0x184C7800;
218 //framebuffer_sub.address_right2 = unknown; 218 //framebuffer_sub.address_right2 = unknown;
219 219
220 // TODO: Width should be 240 instead? 220 framebuffer_top.width = 240;
221 framebuffer_top.width = 480;
222 framebuffer_top.height = 400; 221 framebuffer_top.height = 400;
223 framebuffer_top.stride = 480*3; 222 framebuffer_top.stride = 3 * 240;
224 framebuffer_top.color_format = Regs::FramebufferFormat::RGB8; 223 framebuffer_top.color_format = Regs::FramebufferFormat::RGB8;
225 framebuffer_top.active_fb = 0; 224 framebuffer_top.active_fb = 0;
226 225
227 framebuffer_sub.width = 480; 226 framebuffer_sub.width = 240;
228 framebuffer_sub.height = 400; 227 framebuffer_sub.height = 320;
229 framebuffer_sub.stride = 480*3; 228 framebuffer_sub.stride = 3 * 240;
230 framebuffer_sub.color_format = Regs::FramebufferFormat::RGB8; 229 framebuffer_sub.color_format = Regs::FramebufferFormat::RGB8;
231 framebuffer_sub.active_fb = 0; 230 framebuffer_sub.active_fb = 0;
232 231