diff options
author | bunnei <bunneidev@gmail.com> | 2015-01-02 02:54:45 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2015-01-02 02:54:45 +0100 |
commit | 7c8f6ca0511b35c8a56dce466df01f6364728581 (patch) | |
tree | bd1fa3b50c090786dd0f91669702ebf010d2a900 /src/core/hw | |
parent | Merge pull request #379 from lioncash/sh (diff) | |
parent | Pica/Rasterizer: Remove some redundant casts. (diff) | |
download | yuzu-7c8f6ca0511b35c8a56dce466df01f6364728581.tar yuzu-7c8f6ca0511b35c8a56dce466df01f6364728581.tar.gz yuzu-7c8f6ca0511b35c8a56dce466df01f6364728581.tar.bz2 yuzu-7c8f6ca0511b35c8a56dce466df01f6364728581.tar.lz yuzu-7c8f6ca0511b35c8a56dce466df01f6364728581.tar.xz yuzu-7c8f6ca0511b35c8a56dce466df01f6364728581.tar.zst yuzu-7c8f6ca0511b35c8a56dce466df01f6364728581.zip |
Diffstat (limited to 'src/core/hw')
-rw-r--r-- | src/core/hw/gpu.cpp | 6 | ||||
-rw-r--r-- | src/core/hw/gpu.h | 3 |
2 files changed, 8 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 diff --git a/src/core/hw/gpu.h b/src/core/hw/gpu.h index 292f496c1..7de055232 100644 --- a/src/core/hw/gpu.h +++ b/src/core/hw/gpu.h @@ -157,6 +157,9 @@ struct Regs { BitField< 8, 3, PixelFormat> input_format; BitField<12, 3, PixelFormat> output_format; BitField<16, 1, u32> output_tiled; // stores output in a tiled format + + // TODO: Not really sure if this actually scales, or even resizes at all. + BitField<24, 1, u32> scale_horizontally; }; INSERT_PADDING_WORDS(0x1); |