summaryrefslogtreecommitdiff
path: root/src/core/hw/gpu.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-01-01 20:54:45 -0500
committerbunnei <bunneidev@gmail.com>2015-01-01 20:54:45 -0500
commit7c8f6ca0511b35c8a56dce466df01f6364728581 (patch)
treebd1fa3b50c090786dd0f91669702ebf010d2a900 /src/core/hw/gpu.cpp
parentfa4cc502e7f30d496d757ef7c52ecee89266a89f (diff)
parentbc187be0c13f66b1a714d868ab8aa18214550bdc (diff)
Merge pull request #358 from neobrain/pica_progress2
pica_progress followups
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) {
int r, g, b, a;
} source_color = { 0, 0, 0, 0 };
+ // Cheap emulation of horizontal scaling: Just skip each second pixel of the
+ // input framebuffer. We keep track of this in the pixel_skip variable.
+ unsigned pixel_skip = (config.scale_horizontally != 0) ? 2 : 1;
+
switch (config.input_format) {
case Regs::PixelFormat::RGBA8:
{
// TODO: Most likely got the component order messed up.
- u8* srcptr = source_pointer + x * 4 + y * config.input_width * 4;
+ u8* srcptr = source_pointer + x * 4 * pixel_skip + y * config.input_width * 4 * pixel_skip;
source_color.r = srcptr[0]; // blue
source_color.g = srcptr[1]; // green
source_color.b = srcptr[2]; // red