summaryrefslogtreecommitdiff
path: root/uisimulator
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/lcd-x11.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/uisimulator/lcd-x11.c b/uisimulator/lcd-x11.c
index 9acbf00c91..cd2b22b354 100644
--- a/uisimulator/lcd-x11.c
+++ b/uisimulator/lcd-x11.c
@@ -39,29 +39,33 @@
39#include "lcd-x11.h" 39#include "lcd-x11.h"
40 40
41extern unsigned char display[LCD_WIDTH][LCD_HEIGHT/8]; 41extern unsigned char display[LCD_WIDTH][LCD_HEIGHT/8];
42extern void screen_resized(int width, int height);
43extern Display *dpy;
42 44
43void lcd_update (void) 45void lcd_update (void)
44{ 46{
45 int x, y; 47 int x, y;
46 int p=0; 48 int p=0;
47 int bit; 49 int bit;
48 XPoint points[LCD_WIDTH * LCD_HEIGHT]; 50 XPoint points[LCD_WIDTH * LCD_HEIGHT];
49 51
50 for(y=0; y<LCD_HEIGHT; y+=8) { 52 screen_resized(LCD_WIDTH, LCD_HEIGHT);
51 for(x=0; x<LCD_WIDTH; x++) { 53
52 if(display[x][y/8]) { 54 for(y=0; y<LCD_HEIGHT; y+=8) {
53 /* one or more bits/pixels are set */ 55 for(x=0; x<LCD_WIDTH; x++) {
54 for(bit=0; bit<8; bit++) { 56 if(display[x][y/8]) {
55 if(display[x][y/8]&(1<<bit)) { 57 /* one or more bits/pixels are set */
56 points[p].x = x + MARGIN_X; 58 for(bit=0; bit<8; bit++) {
57 points[p].y = y+bit + MARGIN_Y; 59 if(display[x][y/8]&(1<<bit)) {
58 p++; /* increase the point counter */ 60 points[p].x = x + MARGIN_X;
59 } 61 points[p].y = y+bit + MARGIN_Y;
62 p++; /* increase the point counter */
63 }
64 }
65 }
60 } 66 }
61
62 }
63 } 67 }
64 } 68 drawdots(&points[0], p);
65 drawdots(&points[0], p); 69 fprintf(stderr, "lcd_update: Draws %d pixels\n", p);
66 fprintf(stderr, "lcd_update: Draws %d pixels\n", p); 70 XSync(dpy,False);
67} 71}