summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-02-25 01:14:18 +0100
committerbunnei <bunneidev@gmail.com>2015-02-25 01:58:33 +0100
commited255ebaecbfa57258b70dfb1e7da3f0cd2c1e58 (patch)
tree81b7381809d03016e374542d9b3d4e332b164b7f /src
parentMerge pull request #595 from linkmauve/new-3ds-input (diff)
downloadyuzu-ed255ebaecbfa57258b70dfb1e7da3f0cd2c1e58.tar
yuzu-ed255ebaecbfa57258b70dfb1e7da3f0cd2c1e58.tar.gz
yuzu-ed255ebaecbfa57258b70dfb1e7da3f0cd2c1e58.tar.bz2
yuzu-ed255ebaecbfa57258b70dfb1e7da3f0cd2c1e58.tar.lz
yuzu-ed255ebaecbfa57258b70dfb1e7da3f0cd2c1e58.tar.xz
yuzu-ed255ebaecbfa57258b70dfb1e7da3f0cd2c1e58.tar.zst
yuzu-ed255ebaecbfa57258b70dfb1e7da3f0cd2c1e58.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/rasterizer.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp
index 17f8f70ca..24dc37856 100644
--- a/src/video_core/rasterizer.cpp
+++ b/src/video_core/rasterizer.cpp
@@ -8,6 +8,7 @@
#include "common/math_util.h"
#include "math.h"
+#include "color.h"
#include "pica.h"
#include "rasterizer.h"
#include "vertex_shader.h"
@@ -37,6 +38,14 @@ static void DrawPixel(int x, int y, const Math::Vec4<u8>& color) {
break;
}
+ case registers.framebuffer.RGBA4:
+ {
+ u8* pixel = color_buffer + (x + y * registers.framebuffer.GetWidth()) * 2;
+ pixel[1] = (color.r() & 0xF0) | (color.g() >> 4);
+ pixel[0] = (color.b() & 0xF0) | (color.a() >> 4);
+ break;
+ }
+
default:
LOG_CRITICAL(Render_Software, "Unknown framebuffer color format %x", registers.framebuffer.color_format);
UNIMPLEMENTED();
@@ -60,6 +69,18 @@ static const Math::Vec4<u8> GetPixel(int x, int y) {
ret.a() = pixel[0];
return ret;
}
+
+ case registers.framebuffer.RGBA4:
+ {
+ Math::Vec4<u8> ret;
+ u8* pixel = color_buffer + (x + y * registers.framebuffer.GetWidth()) * 2;
+ ret.r() = Color::Convert4To8(pixel[1] >> 4);
+ ret.g() = Color::Convert4To8(pixel[1] & 0x0F);
+ ret.b() = Color::Convert4To8(pixel[0] >> 4);
+ ret.a() = Color::Convert4To8(pixel[0] & 0x0F);
+ return ret;
+ }
+
default:
LOG_CRITICAL(Render_Software, "Unknown framebuffer color format %x", registers.framebuffer.color_format);
UNIMPLEMENTED();