From 9872813c7d5025e72941719ef9252b1fa4ae41c6 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 14 Jul 2005 10:02:04 +0000 Subject: introducing H1x0 style grayscale support in the X11 sim git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7137 a1c6a512-1295-4272-9138-f99709370657 --- uisimulator/x11/lcd-x11.c | 145 ++++++++++------------------------------------ 1 file changed, 31 insertions(+), 114 deletions(-) (limited to 'uisimulator/x11/lcd-x11.c') diff --git a/uisimulator/x11/lcd-x11.c b/uisimulator/x11/lcd-x11.c index d538cee9df..3ad5a79ec7 100644 --- a/uisimulator/x11/lcd-x11.c +++ b/uisimulator/x11/lcd-x11.c @@ -43,9 +43,11 @@ #if LCD_DEPTH == 2 #define YBLOCK 4 #define BITOFFS 1 /* take the MSB of each pixel */ +#define ANDBIT 3 /* AND with this to get the color number */ #else #define YBLOCK 8 #define BITOFFS 0 +#define ANDBIT 1 #endif extern void screen_resized(int width, int height); @@ -56,48 +58,8 @@ unsigned char lcd_framebuffer_copy[LCD_HEIGHT/YBLOCK][LCD_WIDTH]; void lcd_update (void) { - int x, y; - int p=0; - int bit; - struct coordinate points[LCD_WIDTH * LCD_HEIGHT]; - int cp=0; - struct coordinate clearpoints[LCD_WIDTH * LCD_HEIGHT]; - - for(y=0; y>= (bit * LCD_DEPTH); + + /* set a dot */ + colors[p] = col; +#else + colors[p] = col?3:0; +#endif + points[p].x = x + MARGIN_X; + points[p].y = y+bit + MARGIN_Y; + p++; /* increase the point counter */ } /* update the copy */ @@ -158,8 +120,7 @@ void lcd_update_rect(int x_start, int y_start, } } - drawdots(0, &clearpoints[0], cp); - drawdots(1, &points[0], p); + dots(colors, &points[0], p); /* printf("lcd_update_rect: Draws %d pixels, clears %d pixels\n", p, cp);*/ XtAppLock(app); XSync(dpy,False); @@ -175,51 +136,7 @@ unsigned char lcd_remote_framebuffer_copy[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH] void lcd_remote_update (void) { - int x, y; - int p=0; - int bit; - struct coordinate points[LCD_REMOTE_WIDTH * LCD_REMOTE_HEIGHT]; - int cp=0; - struct coordinate clearpoints[LCD_REMOTE_WIDTH * LCD_REMOTE_HEIGHT]; - - for(y=0; y