mirror of
https://github.com/brain-hackers/lab
synced 2024-12-22 20:20:04 +09:00
24 lines
517 B
C
24 lines
517 B
C
#pragma pack(1)
|
|
|
|
#define readl(a) (*(volatile unsigned int *)(a))
|
|
#define writel(v, a) (*(volatile unsigned int *)(a) = (v))
|
|
|
|
typedef unsigned int u32;
|
|
typedef unsigned short u16;
|
|
typedef unsigned char u8;
|
|
|
|
typedef struct _pixel_t {
|
|
u8 r;
|
|
u8 g;
|
|
u8 b;
|
|
} pixel_t;
|
|
|
|
#define pack_pixel(p) (((u16)(p.r & 0x1f) << 11) | ((u16)(p.g & 0x3f) << 5) | ((u16)(p.b & 0x1f)))
|
|
|
|
#define WNATIVE 10
|
|
#define HNATIVE 854
|
|
|
|
void rot(u16* x, u16* y);
|
|
void prepare_fb(u16** fb);
|
|
void bitblt(u16** fb, pixel_t px, u16 x, u16 y);
|