diff options
author | Takamichi Horikawa <takamichiho@gmail.com> | 2017-03-30 23:31:39 +0000 |
---|---|---|
committer | Takamichi Horikawa <takamichiho@gmail.com> | 2017-03-30 23:31:39 +0000 |
commit | f47eba7d7d4c6a1d9501e027b63bbab04bb7d417 (patch) | |
tree | c6d8ebf4f84b76e9d32d4998d28a69d36fddd4a9 /fmdsp/fmdsp.c | |
parent | a86bb48b9f3acb081afa92e5efc50d0192c4f68c (diff) |
add NEON optimization
Diffstat (limited to 'fmdsp/fmdsp.c')
-rw-r--r-- | fmdsp/fmdsp.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/fmdsp/fmdsp.c b/fmdsp/fmdsp.c index 3d082af..2f708dd 100644 --- a/fmdsp/fmdsp.c +++ b/fmdsp/fmdsp.c @@ -5,6 +5,8 @@ #include <stdio.h> #include "libopna/opna.h" +fmdsp_vramlookup_type fmdsp_vramlookup_func = fmdsp_vramlookup_c; + static void vramblit(uint8_t *vram, int x, int y, const uint8_t *data, int w, int h) { for (int yi = 0; yi < h; yi++) { @@ -727,17 +729,9 @@ void fmdsp_update(struct fmdsp *fmdsp, } fmdsp_palette_fade(fmdsp); } + void fmdsp_vrampalette(struct fmdsp *fmdsp, const uint8_t *vram, uint8_t *vram32, int stride) { - for (int y = 0; y < PC98_H; y++) { - for (int x = 0; x < PC98_W; x++) { - uint8_t r = fmdsp->palette[vram[y*PC98_W+x]*3+0]; - uint8_t g = fmdsp->palette[vram[y*PC98_W+x]*3+1]; - uint8_t b = fmdsp->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; - } - } + fmdsp_vramlookup_func(vram32, vram, fmdsp->palette, stride); } void fmdsp_dispstyle_set(struct fmdsp *fmdsp, enum FMDSP_DISPSTYLE style) { |