aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/video_core/color.h
diff options
context:
space:
mode:
authorGravatar archshift <admin@archshift.com>2015-02-26 19:11:39 -0800
committerGravatar archshift <admin@archshift.com>2015-02-27 19:15:08 -0800
commit7f9ee69a2bc769042433dba3970137b7be9afa03 (patch)
tree096b6debc487a7a87037808130484fe763bb4f6e /src/video_core/color.h
parentc9ef377afaa038797de6c08da9f204acf67ed1fc (diff)
Added RGBA5551 compatibility in the rasterizer
This allows Virtual Console games to display properly.
Diffstat (limited to 'src/video_core/color.h')
-rw-r--r--src/video_core/color.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/video_core/color.h b/src/video_core/color.h
index e86ac126..f095d8ac 100644
--- a/src/video_core/color.h
+++ b/src/video_core/color.h
@@ -28,5 +28,24 @@ static inline u8 Convert6To8(u8 value) {
return (value << 2) | (value >> 4);
}
+/// Convert a 8-bit color component to 1 bit
+static inline u8 Convert8To1(u8 value) {
+ return value >> 7;
+}
+
+/// Convert a 8-bit color component to 4 bit
+static inline u8 Convert8To4(u8 value) {
+ return value >> 4;
+}
+
+/// Convert a 8-bit color component to 5 bit
+static inline u8 Convert8To5(u8 value) {
+ return value >> 3;
+}
+
+/// Convert a 8-bit color component to 6 bit
+static inline u8 Convert8To6(u8 value) {
+ return value >> 2;
+}
} // namespace