From f894a4c2691fbde1758a05407cb5eadcaec4a6c8 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Wed, 6 Jul 2005 22:58:02 +0000 Subject: 4-shades greyscale graphics core for iriver H1x0. 4-grey rockbox logo and light grey background in splash() boxes. Simplified the splash() box creation as the new graphics core does clipping. Adapted screendump feature and added flexible preprocessing to construct the bmp header. Rockboy now uses 4-grey mode as well. 4-grey support for win32 simulator. Fixed win32 player sim to not use double bitmap conversion via a recorder-like framebuffer, and correctly display double-height text. X11 simulator temporarily adapted. The display won't be distorted, but it still shows b&w only. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7046 a1c6a512-1295-4272-9138-f99709370657 --- uisimulator/x11/lcd-x11.c | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) (limited to 'uisimulator/x11') diff --git a/uisimulator/x11/lcd-x11.c b/uisimulator/x11/lcd-x11.c index 1ee15f9169..d538cee9df 100644 --- a/uisimulator/x11/lcd-x11.c +++ b/uisimulator/x11/lcd-x11.c @@ -40,11 +40,19 @@ #include "lcd-x11.h" #include "lcd-playersim.h" -extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; +#if LCD_DEPTH == 2 +#define YBLOCK 4 +#define BITOFFS 1 /* take the MSB of each pixel */ +#else +#define YBLOCK 8 +#define BITOFFS 0 +#endif + extern void screen_resized(int width, int height); #ifdef HAVE_LCD_BITMAP -unsigned char lcd_framebuffer_copy[LCD_HEIGHT/8][LCD_WIDTH]; +extern unsigned char lcd_framebuffer[LCD_HEIGHT/YBLOCK][LCD_WIDTH]; +unsigned char lcd_framebuffer_copy[LCD_HEIGHT/YBLOCK][LCD_WIDTH]; void lcd_update (void) { @@ -55,21 +63,21 @@ void lcd_update (void) int cp=0; struct coordinate clearpoints[LCD_WIDTH * LCD_HEIGHT]; - for(y=0; y LCD_WIDTH) xmax = LCD_WIDTH; - if(ymax >= LCD_HEIGHT/8) - ymax = LCD_HEIGHT/8-1; + if(ymax >= LCD_HEIGHT/YBLOCK) + ymax = LCD_HEIGHT/YBLOCK-1; for(; yline<=ymax; yline++) { - y = yline * 8; + y = yline * YBLOCK; for(x=x_start; x