added COLOR32 structure (for those like me converting colors :))
This commit is contained in:
parent
f05310c559
commit
1b06735f17
|
@ -90,11 +90,11 @@ typedef union
|
||||||
} DISPCNT;
|
} DISPCNT;
|
||||||
#define BGxENABLED(cnt,num) ((num<8)? ((cnt.integer>>8) & num):0)
|
#define BGxENABLED(cnt,num) ((num<8)? ((cnt.integer>>8) & num):0)
|
||||||
|
|
||||||
struct _COLOR {
|
struct _COLOR { // abgr x555
|
||||||
unsigned red:5;
|
unsigned red:5;
|
||||||
unsigned green:5;
|
unsigned green:5;
|
||||||
unsigned blue:5;
|
unsigned blue:5;
|
||||||
unsigned alpha:1; // sometimes it is unused
|
unsigned alpha:1; // sometimes it is unused (pad)
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef union
|
typedef union
|
||||||
|
@ -103,6 +103,38 @@ typedef union
|
||||||
u16 val;
|
u16 val;
|
||||||
} COLOR;
|
} COLOR;
|
||||||
|
|
||||||
|
struct _COLOR32 { // ARGB
|
||||||
|
unsigned :3;
|
||||||
|
unsigned blue:5;
|
||||||
|
unsigned :3;
|
||||||
|
unsigned green:5;
|
||||||
|
unsigned :3;
|
||||||
|
unsigned red:5;
|
||||||
|
unsigned :7;
|
||||||
|
unsigned alpha:1; // sometimes it is unused (pad)
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef union
|
||||||
|
{
|
||||||
|
struct _COLOR32 bitfield;
|
||||||
|
u32 val;
|
||||||
|
} COLOR32;
|
||||||
|
|
||||||
|
#define COLOR_16_32(w,i) \
|
||||||
|
/* doesnt matter who's 16bit who's 32bit */ \
|
||||||
|
i.bitfield.red = w.bitfield.red; \
|
||||||
|
i.bitfield.green = w.bitfield.green; \
|
||||||
|
i.bitfield.blue = w.bitfield.blue; \
|
||||||
|
i.bitfield.alpha = w.bitfield.alpha;
|
||||||
|
|
||||||
|
|
||||||
|
typedef union
|
||||||
|
{
|
||||||
|
struct _COLOR bitfield;
|
||||||
|
u16 val;
|
||||||
|
} COLOR;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct _BGxCNT
|
struct _BGxCNT
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue