aboutsummaryrefslogtreecommitdiff
path: root/fmdsp/fmdsp-vramlookup-c.c
diff options
context:
space:
mode:
authorTakamichi Horikawa <takamichiho@gmail.com>2017-03-30 23:31:39 +0000
committerTakamichi Horikawa <takamichiho@gmail.com>2017-03-30 23:31:39 +0000
commitf47eba7d7d4c6a1d9501e027b63bbab04bb7d417 (patch)
treec6d8ebf4f84b76e9d32d4998d28a69d36fddd4a9 /fmdsp/fmdsp-vramlookup-c.c
parenta86bb48b9f3acb081afa92e5efc50d0192c4f68c (diff)
add NEON optimization
Diffstat (limited to 'fmdsp/fmdsp-vramlookup-c.c')
-rw-r--r--fmdsp/fmdsp-vramlookup-c.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fmdsp/fmdsp-vramlookup-c.c b/fmdsp/fmdsp-vramlookup-c.c
new file mode 100644
index 0000000..f900c8d
--- /dev/null
+++ b/fmdsp/fmdsp-vramlookup-c.c
@@ -0,0 +1,14 @@
+#include "fmdsp/fmdsp.h"
+
+void fmdsp_vramlookup_c(uint8_t *vram32, const uint8_t *vram, const uint8_t *palette, int stride) {
+ for (int y = 0; y < PC98_H; y++) {
+ for (int x = 0; x < PC98_W; x++) {
+ uint8_t r = palette[vram[y*PC98_W+x]*3+0];
+ uint8_t g = palette[vram[y*PC98_W+x]*3+1];
+ uint8_t b = palette[vram[y*PC98_W+x]*3+2];
+ uint32_t data = (((uint32_t)r)<<16) | (((uint32_t)g)<<8) | ((uint32_t)b);
+ uint32_t *row = (uint32_t *)(vram32 + y*stride);
+ row[x] = data;
+ }
+ }
+}