all repos — mgba @ b399afdf9f2113bfefee04d89c481b4ca1a8a61f

mGBA Game Boy Advance Emulator

Core: Fix BGR ordering
Vicki Pfau vi@endrift.com
Sat, 24 Jun 2017 09:57:39 -0700
commit

b399afdf9f2113bfefee04d89c481b4ca1a8a61f

parent

a2c1ef2fcc0d3aab083962eb1efa09feee819c54

1 files changed, 3 insertions(+), 2 deletions(-)

jump to
M include/mgba/core/interface.hinclude/mgba/core/interface.h

@@ -31,8 +31,9 @@ #define M_R8(X) (((((X) << 3) & 0xF8) * 0x21) >> 5)

#define M_G8(X) (((((X) >> 2) & 0xF8) * 0x21) >> 5) #define M_B8(X) (((((X) >> 7) & 0xF8) * 0x21) >> 5) -#define M_RGB5_TO_RGB8(X) ((M_R5(X) << 3) | (M_G5(X) << 11) | (M_B5(X) << 19)) -#define M_RGB8_TO_RGB5(X) ((((X) & 0xF8) >> 3) | (((X) & 0xF800) >> 6) | (((X) & 0xF80000) >> 9)) +#define M_RGB5_TO_BGR8(X) ((M_R5(X) << 3) | (M_G5(X) << 11) | (M_B5(X) << 19)) +#define M_RGB8_TO_BGR5(X) ((((X) & 0xF8) >> 3) | (((X) & 0xF800) >> 6) | (((X) & 0xF80000) >> 9)) +#define M_RGB8_TO_RGB5(X) ((((X) & 0xF8) << 7) | (((X) & 0xF800) >> 6) | (((X) & 0xF80000) >> 19)) struct blip_t;