summaryrefslogtreecommitdiff
path: root/src/core/hw/gpu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hw/gpu.cpp')
-rw-r--r--src/core/hw/gpu.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp
index dd619cb16..0ff6c6cde 100644
--- a/src/core/hw/gpu.cpp
+++ b/src/core/hw/gpu.cpp
@@ -94,11 +94,15 @@ inline void Write(u32 addr, const T data) {
94 int r, g, b, a; 94 int r, g, b, a;
95 } source_color = { 0, 0, 0, 0 }; 95 } source_color = { 0, 0, 0, 0 };
96 96
97 // Cheap emulation of horizontal scaling: Just skip each second pixel of the
98 // input framebuffer. We keep track of this in the pixel_skip variable.
99 unsigned pixel_skip = (config.scale_horizontally != 0) ? 2 : 1;
100
97 switch (config.input_format) { 101 switch (config.input_format) {
98 case Regs::PixelFormat::RGBA8: 102 case Regs::PixelFormat::RGBA8:
99 { 103 {
100 // TODO: Most likely got the component order messed up. 104 // TODO: Most likely got the component order messed up.
101 u8* srcptr = source_pointer + x * 4 + y * config.input_width * 4; 105 u8* srcptr = source_pointer + x * 4 * pixel_skip + y * config.input_width * 4 * pixel_skip;
102 source_color.r = srcptr[0]; // blue 106 source_color.r = srcptr[0]; // blue
103 source_color.g = srcptr[1]; // green 107 source_color.g = srcptr[1]; // green
104 source_color.b = srcptr[2]; // red 108 source_color.b = srcptr[2]; // red