Revision 94470844 hw/vga.c
b/hw/vga.c | ||
---|---|---|
23 | 23 |
*/ |
24 | 24 |
#include "vl.h" |
25 | 25 |
#include "vga_int.h" |
26 |
#include "pixel_ops.h" |
|
26 | 27 |
|
27 | 28 |
//#define DEBUG_VGA |
28 | 29 |
//#define DEBUG_VGA_MEM |
... | ... | |
812 | 813 |
typedef void vga_draw_line_func(VGAState *s1, uint8_t *d, |
813 | 814 |
const uint8_t *s, int width); |
814 | 815 |
|
815 |
static inline unsigned int rgb_to_pixel8(unsigned int r, unsigned int g, unsigned b) |
|
816 |
{ |
|
817 |
return ((r >> 5) << 5) | ((g >> 5) << 2) | (b >> 6); |
|
818 |
} |
|
819 |
|
|
820 |
static inline unsigned int rgb_to_pixel15(unsigned int r, unsigned int g, unsigned b) |
|
821 |
{ |
|
822 |
return ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3); |
|
823 |
} |
|
824 |
|
|
825 |
static inline unsigned int rgb_to_pixel16(unsigned int r, unsigned int g, unsigned b) |
|
826 |
{ |
|
827 |
return ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3); |
|
828 |
} |
|
829 |
|
|
830 |
static inline unsigned int rgb_to_pixel32(unsigned int r, unsigned int g, unsigned b) |
|
831 |
{ |
|
832 |
return (r << 16) | (g << 8) | b; |
|
833 |
} |
|
834 |
|
|
835 |
static inline unsigned int rgb_to_pixel32bgr(unsigned int r, unsigned int g, unsigned b) |
|
836 |
{ |
|
837 |
return (b << 16) | (g << 8) | r; |
|
838 |
} |
|
839 |
|
|
840 | 816 |
#define DEPTH 8 |
841 | 817 |
#include "vga_template.h" |
842 | 818 |
|
Also available in: Unified diff