aboutsummaryrefslogtreecommitdiff
path: root/frontend/cspace.c
diff options
context:
space:
mode:
authorGlenn2017-12-10 23:25:01 +1100
committerGlenn2017-12-10 23:25:01 +1100
commit8fb0f7c5551ed450ef3ed56615e0d86f1b56739d (patch)
tree9c7aebfe1558afb2c99b3bd4ee2e923299d96b36 /frontend/cspace.c
parentc7dde5efda060c5baf259c6ad39090e1cb1defd6 (diff)
downloadpcsx_rearmed-8fb0f7c5551ed450ef3ed56615e0d86f1b56739d.tar.gz
pcsx_rearmed-8fb0f7c5551ed450ef3ed56615e0d86f1b56739d.tar.bz2
pcsx_rearmed-8fb0f7c5551ed450ef3ed56615e0d86f1b56739d.zip
Fixed building for arm64 (iOS)
Diffstat (limited to 'frontend/cspace.c')
-rw-r--r--frontend/cspace.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/frontend/cspace.c b/frontend/cspace.c
index 33a981d..26f311f 100644
--- a/frontend/cspace.c
+++ b/frontend/cspace.c
@@ -34,6 +34,28 @@ void bgr555_to_rgb565(void *dst_, const void *src_, int bytes)
#endif
+#ifndef __ARM64__
+
+void bgr888_to_rgb565(void *dst_, const void *src_, int bytes)
+{
+ const unsigned char *src = src_;
+ unsigned int *dst = dst_;
+ unsigned int r1, g1, b1, r2, g2, b2;
+
+ for (; bytes >= 6; bytes -= 6, src += 6, dst++) {
+ r1 = src[0] & 0xf8;
+ g1 = src[1] & 0xfc;
+ b1 = src[2] & 0xf8;
+ r2 = src[3] & 0xf8;
+ g2 = src[4] & 0xfc;
+ b2 = src[5] & 0xf8;
+ *dst = (r2 << 24) | (g2 << 19) | (b2 << 13) |
+ (r1 << 8) | (g1 << 3) | (b1 >> 3);
+ }
+}
+
+#endif
+
#ifndef __ARM_NEON__
void bgr888_to_rgb565(void *dst_, const void *src_, int bytes)