Commit 9447084492da7ca69ce0c16a35971157f690e631
1 parent
2a1086d9
Merge TCX and VGA pixel operations
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2973 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
6 additions
and
46 deletions
Makefile.target
| ... | ... | @@ -592,6 +592,10 @@ cpu-exec.o: cpu-exec.c |
| 592 | 592 | signal.o: signal.c |
| 593 | 593 | $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
| 594 | 594 | |
| 595 | +vga.o: pixel_ops.h | |
| 596 | + | |
| 597 | +tcx.o: pixel_ops.h | |
| 598 | + | |
| 595 | 599 | ifeq ($(TARGET_BASE_ARCH), i386) |
| 596 | 600 | op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h |
| 597 | 601 | endif | ... | ... |
hw/tcx.c
| ... | ... | @@ -22,6 +22,7 @@ |
| 22 | 22 | * THE SOFTWARE. |
| 23 | 23 | */ |
| 24 | 24 | #include "vl.h" |
| 25 | +#include "pixel_ops.h" | |
| 25 | 26 | |
| 26 | 27 | #define MAXX 1024 |
| 27 | 28 | #define MAXY 768 |
| ... | ... | @@ -47,27 +48,6 @@ static void tcx24_screen_dump(void *opaque, const char *filename); |
| 47 | 48 | static void tcx_invalidate_display(void *opaque); |
| 48 | 49 | static void tcx24_invalidate_display(void *opaque); |
| 49 | 50 | |
| 50 | -/* XXX: unify with vga draw line functions */ | |
| 51 | -static inline unsigned int rgb_to_pixel8(unsigned int r, unsigned int g, unsigned b) | |
| 52 | -{ | |
| 53 | - return ((r >> 5) << 5) | ((g >> 5) << 2) | (b >> 6); | |
| 54 | -} | |
| 55 | - | |
| 56 | -static inline unsigned int rgb_to_pixel15(unsigned int r, unsigned int g, unsigned b) | |
| 57 | -{ | |
| 58 | - return ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3); | |
| 59 | -} | |
| 60 | - | |
| 61 | -static inline unsigned int rgb_to_pixel16(unsigned int r, unsigned int g, unsigned b) | |
| 62 | -{ | |
| 63 | - return ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3); | |
| 64 | -} | |
| 65 | - | |
| 66 | -static inline unsigned int rgb_to_pixel32(unsigned int r, unsigned int g, unsigned b) | |
| 67 | -{ | |
| 68 | - return (r << 16) | (g << 8) | b; | |
| 69 | -} | |
| 70 | - | |
| 71 | 51 | static void update_palette_entries(TCXState *s, int start, int end) |
| 72 | 52 | { |
| 73 | 53 | int i; | ... | ... |
hw/vga.c
| ... | ... | @@ -23,6 +23,7 @@ |
| 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,31 +813,6 @@ typedef void vga_draw_glyph9_func(uint8_t *d, int linesize, |
| 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 | ... | ... |