aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hw
diff options
context:
space:
mode:
authorGravatar bunnei <bunneidev@gmail.com>2015-02-22 12:44:57 -0500
committerGravatar bunnei <bunneidev@gmail.com>2015-02-22 12:44:57 -0500
commitd120757f3251af7c3737c8112dda06efeccac8b0 (patch)
tree8761d8e867d0fe37ff3db58ed7a1ae21e944db15 /src/core/hw
parent34f21334ad987bbef5e26846c99f5a12da3116ef (diff)
parentfbbfb52a2c8c9c7da0e0d684ba8af1781c4ff5e7 (diff)
Merge pull request #594 from Subv/display_transfer
GPU: Fixed the RGBA8 input format and RGB8 output format
Diffstat (limited to 'src/core/hw')
-rw-r--r--src/core/hw/gpu.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp
index bd7d92cd..53667292 100644
--- a/src/core/hw/gpu.cpp
+++ b/src/core/hw/gpu.cpp
@@ -132,12 +132,11 @@ inline void Write(u32 addr, const T data) {
switch (config.input_format) {
case Regs::PixelFormat::RGBA8:
{
- // TODO: Most likely got the component order messed up.
u8* srcptr = source_pointer + (x * pixel_skip + y * config.input_width) * 4;
- source_color.r = srcptr[0]; // blue
- source_color.g = srcptr[1]; // green
- source_color.b = srcptr[2]; // red
- source_color.a = srcptr[3]; // alpha
+ source_color.r = srcptr[3]; // red
+ source_color.g = srcptr[2]; // green
+ source_color.b = srcptr[1]; // blue
+ source_color.a = srcptr[0]; // alpha
break;
}
@@ -160,11 +159,10 @@ inline void Write(u32 addr, const T data) {
case Regs::PixelFormat::RGB8:
{
- // TODO: Most likely got the component order messed up.
u8* dstptr = dest_pointer + (x + y * output_width) * 3;
- dstptr[0] = source_color.r; // blue
+ dstptr[2] = source_color.r; // red
dstptr[1] = source_color.g; // green
- dstptr[2] = source_color.b; // red
+ dstptr[0] = source_color.b; // blue
break;
}