mirror of
https://github.com/libretro/RetroArch
synced 2025-04-15 23:42:30 +00:00
(Wii) Simplify macros in wii/video.c
This commit is contained in:
parent
fe38d090b3
commit
a853964755
42
wii/video.c
42
wii/video.c
@ -186,33 +186,33 @@ static void *wii_init(const video_info_t *video,
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
// Set MSB to get full RGB555.
|
||||
#define RGB15toRGB5A3(col) ((col) | 0x80008000u)
|
||||
|
||||
#define BLIT_LINE(off) \
|
||||
{ \
|
||||
const uint32_t *tmp_src = src; \
|
||||
uint32_t *tmp_dst = dst; \
|
||||
for (unsigned x = 0; x < width; x += 8, tmp_src += 8, tmp_dst += 32) \
|
||||
{ \
|
||||
tmp_dst[ 0 + off] = RGB15toRGB5A3(tmp_src[0]); \
|
||||
tmp_dst[ 1 + off] = RGB15toRGB5A3(tmp_src[1]); \
|
||||
tmp_dst[ 8 + off] = RGB15toRGB5A3(tmp_src[2]); \
|
||||
tmp_dst[ 9 + off] = RGB15toRGB5A3(tmp_src[3]); \
|
||||
tmp_dst[16 + off] = RGB15toRGB5A3(tmp_src[4]); \
|
||||
tmp_dst[17 + off] = RGB15toRGB5A3(tmp_src[5]); \
|
||||
tmp_dst[24 + off] = RGB15toRGB5A3(tmp_src[6]); \
|
||||
tmp_dst[25 + off] = RGB15toRGB5A3(tmp_src[7]); \
|
||||
} \
|
||||
src += pitch; \
|
||||
}
|
||||
|
||||
static void update_texture(const uint32_t *src,
|
||||
unsigned width, unsigned height, unsigned pitch)
|
||||
{
|
||||
pitch >>= 2;
|
||||
width &= ~15;
|
||||
height &= ~3;
|
||||
|
||||
// Set MSB to get full RGB555.
|
||||
#define RGB15toRGB5A3(col) ((col) | 0x80008000u)
|
||||
|
||||
#define BLIT_CHUNK(off) { \
|
||||
tmp_dst[ 0 + off] = RGB15toRGB5A3(tmp_src[0]); \
|
||||
tmp_dst[ 1 + off] = RGB15toRGB5A3(tmp_src[1]); \
|
||||
tmp_dst[ 8 + off] = RGB15toRGB5A3(tmp_src[2]); \
|
||||
tmp_dst[ 9 + off] = RGB15toRGB5A3(tmp_src[3]); \
|
||||
tmp_dst[16 + off] = RGB15toRGB5A3(tmp_src[4]); \
|
||||
tmp_dst[17 + off] = RGB15toRGB5A3(tmp_src[5]); \
|
||||
tmp_dst[24 + off] = RGB15toRGB5A3(tmp_src[6]); \
|
||||
tmp_dst[25 + off] = RGB15toRGB5A3(tmp_src[7]); }
|
||||
|
||||
#define BLIT_LINE(off) { \
|
||||
const uint32_t *tmp_src = src; \
|
||||
uint32_t *tmp_dst = dst; \
|
||||
for (unsigned x = 0; x < width; x += 8, tmp_src += 8, tmp_dst += 32) \
|
||||
BLIT_CHUNK(off) \
|
||||
src += pitch; }
|
||||
|
||||
width >>= 1;
|
||||
|
||||
// Texture data is 4x4 tiled @ 15bpp.
|
||||
|
Loading…
x
Reference in New Issue
Block a user