Add 15bpp ABGR format

This commit is contained in:
Francisco José García García 2015-08-30 01:06:49 +02:00
parent 0db5c0da94
commit 9231103344
2 changed files with 43 additions and 35 deletions

View File

@ -470,8 +470,11 @@ INLINE void WRITE_LONG(void *address, uint32 data)
/* 5:5:5 RGB */ /* 5:5:5 RGB */
#elif defined(USE_15BPP_RENDERING) #elif defined(USE_15BPP_RENDERING)
#if defined(USE_ABGR)
#define MAKE_PIXEL(r,g,b) ((1 << 15) | (b) << 11 | ((b) >> 3) << 10 | (g) << 6 | ((g) >> 3) << 5 | (r) << 1 | (r) >> 3)
#else
#define MAKE_PIXEL(r,g,b) ((1 << 15) | (r) << 11 | ((r) >> 3) << 10 | (g) << 6 | ((g) >> 3) << 5 | (b) << 1 | (b) >> 3) #define MAKE_PIXEL(r,g,b) ((1 << 15) | (r) << 11 | ((r) >> 3) << 10 | (g) << 6 | ((g) >> 3) << 5 | (b) << 1 | (b) >> 3)
#endif
/* 5:6:5 RGB */ /* 5:6:5 RGB */
#elif defined(USE_16BPP_RENDERING) #elif defined(USE_16BPP_RENDERING)
#define MAKE_PIXEL(r,g,b) ((r) << 12 | ((r) >> 3) << 11 | (g) << 7 | ((g) >> 2) << 5 | (b) << 1 | (b) >> 3) #define MAKE_PIXEL(r,g,b) ((r) << 12 | ((r) >> 3) << 11 | (g) << 7 | ((g) >> 2) << 5 | (b) << 1 | (b) >> 3)

View File

@ -51,11 +51,17 @@
/* 5:5:5 RGB */ /* 5:5:5 RGB */
#elif defined(USE_15BPP_RENDERING) #elif defined(USE_15BPP_RENDERING)
#if defined(USE_ABGR)
#define PIXEL(r,g,b) ((1 << 15) | ((b) << 10) | ((g) << 5) | (r))
#define GET_B(pixel) (((pixel) & 0x7c00) >> 10)
#define GET_G(pixel) (((pixel) & 0x03e0) >> 5)
#define GET_R(pixel) (((pixel) & 0x001f) >> 0)
#else
#define PIXEL(r,g,b) ((1 << 15) | ((r) << 10) | ((g) << 5) | (b)) #define PIXEL(r,g,b) ((1 << 15) | ((r) << 10) | ((g) << 5) | (b))
#define GET_R(pixel) (((pixel) & 0x7c00) >> 10) #define GET_R(pixel) (((pixel) & 0x7c00) >> 10)
#define GET_G(pixel) (((pixel) & 0x03e0) >> 5) #define GET_G(pixel) (((pixel) & 0x03e0) >> 5)
#define GET_B(pixel) (((pixel) & 0x001f) >> 0) #define GET_B(pixel) (((pixel) & 0x001f) >> 0)
#endif
/* 5:6:5 RGB */ /* 5:6:5 RGB */
#elif defined(USE_16BPP_RENDERING) #elif defined(USE_16BPP_RENDERING)
#define PIXEL(r,g,b) (((r) << 11) | ((g) << 5) | (b)) #define PIXEL(r,g,b) (((r) << 11) | ((g) << 5) | (b))
@ -134,4 +140,3 @@ extern void (*parse_satb)(int line);
extern void (*update_bg_pattern_cache)(int index); extern void (*update_bg_pattern_cache)(int index);
#endif /* _RENDER_H_ */ #endif /* _RENDER_H_ */