summaryrefslogtreecommitdiffstats
path: root/uisimulator/x11
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-07-06 22:58:02 +0000
committerJens Arnold <amiconn@rockbox.org>2005-07-06 22:58:02 +0000
commitf894a4c2691fbde1758a05407cb5eadcaec4a6c8 (patch)
tree46cb7ce63c794020175ab251cf0299663be8bf3c /uisimulator/x11
parent1076eb1d2720b88757616f642be0c39c6a3b76df (diff)
downloadrockbox-f894a4c2691fbde1758a05407cb5eadcaec4a6c8.tar.gz
rockbox-f894a4c2691fbde1758a05407cb5eadcaec4a6c8.tar.bz2
rockbox-f894a4c2691fbde1758a05407cb5eadcaec4a6c8.zip
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
Diffstat (limited to 'uisimulator/x11')
-rw-r--r--uisimulator/x11/lcd-x11.c42
1 files changed, 25 insertions, 17 deletions
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_HEIGHT; y+=8) {
+ for(y=0; y<LCD_HEIGHT; y+=YBLOCK) {
for(x=0; x<LCD_WIDTH; x++) {
- if(lcd_framebuffer[y/8][x] || lcd_framebuffer_copy[y/8][x]) {
+ if(lcd_framebuffer[y/YBLOCK][x] || lcd_framebuffer_copy[y/YBLOCK][x]) {
/* one or more bits/pixels are changed */
unsigned char diff =
- lcd_framebuffer[y/8][x] ^ lcd_framebuffer_copy[y/8][x];
+ lcd_framebuffer[y/YBLOCK][x] ^ lcd_framebuffer_copy[y/YBLOCK][x];
- for(bit=0; bit<8; bit++) {
- if(lcd_framebuffer[y/8][x]&(1<<bit)) {
+ for(bit=0; bit<YBLOCK; bit++) {
+ if(lcd_framebuffer[y/YBLOCK][x]&(1<<(bit*LCD_DEPTH+BITOFFS))) {
/* set a dot */
points[p].x = x + MARGIN_X;
points[p].y = y+bit + MARGIN_Y;
p++; /* increase the point counter */
}
- else if(diff &(1<<bit)) {
+ else if(diff &(1<<(bit*LCD_DEPTH+BITOFFS))) {
/* clear a dot */
clearpoints[cp].x = x + MARGIN_X;
clearpoints[cp].y = y+bit + MARGIN_Y;
@@ -110,33 +118,33 @@ void lcd_update_rect(int x_start, int y_start,
fprintf(stderr, "%04d: lcd_update_rect(%d, %d, %d, %d)\n",
counter++, x_start, y_start, width, height);
#endif
- /* The Y coordinates have to work on even 8 pixel rows */
- ymax = (yline + height)/8;
- yline /= 8;
+ /* The Y coordinates have to work on even YBLOCK pixel rows */
+ ymax = (yline + height)/YBLOCK;
+ yline /= YBLOCK;
xmax = x_start + width;
if(xmax > 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<xmax; x++) {
if(lcd_framebuffer[yline][x] || lcd_framebuffer_copy[yline][x]) {
/* one or more bits/pixels are changed */
unsigned char diff =
lcd_framebuffer[yline][x] ^ lcd_framebuffer_copy[yline][x];
- for(bit=0; bit<8; bit++) {
- if(lcd_framebuffer[yline][x]&(1<<bit)) {
+ for(bit=0; bit<YBLOCK; bit++) {
+ if(lcd_framebuffer[yline][x]&(1<<(bit*LCD_DEPTH+BITOFFS))) {
/* set a dot */
points[p].x = x + MARGIN_X;
points[p].y = y+bit + MARGIN_Y;
p++; /* increase the point counter */
}
- else if(diff &(1<<bit)) {
+ else if(diff &(1<<(bit*LCD_DEPTH+BITOFFS))) {
/* clear a dot */
clearpoints[cp].x = x + MARGIN_X;
clearpoints[cp].y = y+bit + MARGIN_Y;