From c0c5fc274f74cf9b3809acf565aa626f52b183cb Mon Sep 17 00:00:00 2001 From: Peter Moraliyski Date: Sat, 30 Nov 2002 16:03:46 +0000 Subject: gp32 port stuff svn-id: r5761 --- common/util.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'common/util.h') diff --git a/common/util.h b/common/util.h index 3218a8546d..37576bd8af 100644 --- a/common/util.h +++ b/common/util.h @@ -45,6 +45,13 @@ static inline void SWAP(int &a, int &b) { int tmp=a; a=b; b=tmp; } #define GREEN_FROM_16(x) ((((x)>>5)&0x1F) << 3) #define BLUE_FROM_16(x) (((x)&0x1F) << 3) +#elif defined(__GP32__) //ph0x +// GP32 format 5-5-5-1 (first bit means intensity) +#define RGB_TO_16(r,g,b) (((((r)>>3)&0x1F) << 11) | ((((g)>>3)&0x1F) << 6) | (((b)>>3)&0x1F)<<1) +#define RED_FROM_16(x) ((((x)>>11)&0x1F) << 3) +#define GREEN_FROM_16(x) ((((x)>>6) &0x1F) << 3) +#define BLUE_FROM_16(x) ((((x)>>1) &0x1F) << 3) + #else // Assume the 16 bit graphics data is in 5-6-5 format #define RGB_TO_16(r,g,b) (((((r)>>3)&0x1F) << 11) | ((((g)>>2)&0x3F) << 5) | (((b)>>3)&0x1F)) -- cgit v1.2.3