Merge TCX and VGA pixel operations
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2973 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
2a1086d91c
commit
9447084492
@ -592,6 +592,10 @@ cpu-exec.o: cpu-exec.c
|
|||||||
signal.o: signal.c
|
signal.o: signal.c
|
||||||
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
|
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
vga.o: pixel_ops.h
|
||||||
|
|
||||||
|
tcx.o: pixel_ops.h
|
||||||
|
|
||||||
ifeq ($(TARGET_BASE_ARCH), i386)
|
ifeq ($(TARGET_BASE_ARCH), i386)
|
||||||
op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h
|
op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h
|
||||||
endif
|
endif
|
||||||
|
22
hw/tcx.c
22
hw/tcx.c
@ -22,6 +22,7 @@
|
|||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#include "vl.h"
|
#include "vl.h"
|
||||||
|
#include "pixel_ops.h"
|
||||||
|
|
||||||
#define MAXX 1024
|
#define MAXX 1024
|
||||||
#define MAXY 768
|
#define MAXY 768
|
||||||
@ -47,27 +48,6 @@ static void tcx24_screen_dump(void *opaque, const char *filename);
|
|||||||
static void tcx_invalidate_display(void *opaque);
|
static void tcx_invalidate_display(void *opaque);
|
||||||
static void tcx24_invalidate_display(void *opaque);
|
static void tcx24_invalidate_display(void *opaque);
|
||||||
|
|
||||||
/* XXX: unify with vga draw line functions */
|
|
||||||
static inline unsigned int rgb_to_pixel8(unsigned int r, unsigned int g, unsigned b)
|
|
||||||
{
|
|
||||||
return ((r >> 5) << 5) | ((g >> 5) << 2) | (b >> 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline unsigned int rgb_to_pixel15(unsigned int r, unsigned int g, unsigned b)
|
|
||||||
{
|
|
||||||
return ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline unsigned int rgb_to_pixel16(unsigned int r, unsigned int g, unsigned b)
|
|
||||||
{
|
|
||||||
return ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline unsigned int rgb_to_pixel32(unsigned int r, unsigned int g, unsigned b)
|
|
||||||
{
|
|
||||||
return (r << 16) | (g << 8) | b;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void update_palette_entries(TCXState *s, int start, int end)
|
static void update_palette_entries(TCXState *s, int start, int end)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
26
hw/vga.c
26
hw/vga.c
@ -23,6 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "vl.h"
|
#include "vl.h"
|
||||||
#include "vga_int.h"
|
#include "vga_int.h"
|
||||||
|
#include "pixel_ops.h"
|
||||||
|
|
||||||
//#define DEBUG_VGA
|
//#define DEBUG_VGA
|
||||||
//#define DEBUG_VGA_MEM
|
//#define DEBUG_VGA_MEM
|
||||||
@ -812,31 +813,6 @@ typedef void vga_draw_glyph9_func(uint8_t *d, int linesize,
|
|||||||
typedef void vga_draw_line_func(VGAState *s1, uint8_t *d,
|
typedef void vga_draw_line_func(VGAState *s1, uint8_t *d,
|
||||||
const uint8_t *s, int width);
|
const uint8_t *s, int width);
|
||||||
|
|
||||||
static inline unsigned int rgb_to_pixel8(unsigned int r, unsigned int g, unsigned b)
|
|
||||||
{
|
|
||||||
return ((r >> 5) << 5) | ((g >> 5) << 2) | (b >> 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline unsigned int rgb_to_pixel15(unsigned int r, unsigned int g, unsigned b)
|
|
||||||
{
|
|
||||||
return ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline unsigned int rgb_to_pixel16(unsigned int r, unsigned int g, unsigned b)
|
|
||||||
{
|
|
||||||
return ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline unsigned int rgb_to_pixel32(unsigned int r, unsigned int g, unsigned b)
|
|
||||||
{
|
|
||||||
return (r << 16) | (g << 8) | b;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline unsigned int rgb_to_pixel32bgr(unsigned int r, unsigned int g, unsigned b)
|
|
||||||
{
|
|
||||||
return (b << 16) | (g << 8) | r;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define DEPTH 8
|
#define DEPTH 8
|
||||||
#include "vga_template.h"
|
#include "vga_template.h"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user