summaryrefslogtreecommitdiff
path: root/uisimulator
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/x11/lcd-x11.c45
1 files changed, 37 insertions, 8 deletions
diff --git a/uisimulator/x11/lcd-x11.c b/uisimulator/x11/lcd-x11.c
index a5cc5c0965..1b9949b26b 100644
--- a/uisimulator/x11/lcd-x11.c
+++ b/uisimulator/x11/lcd-x11.c
@@ -37,24 +37,23 @@
37 */ 37 */
38 38
39#include "lcd-x11.h" 39#include "lcd-x11.h"
40#include "lcd-playersim.h"
40 41
41extern unsigned char lcd_framebuffer[LCD_WIDTH][LCD_HEIGHT/8]; 42extern unsigned char lcd_framebuffer[LCD_WIDTH][LCD_HEIGHT/8];
42extern void screen_resized(int width, int height); 43extern void screen_resized(int width, int height);
43extern Display *dpy; 44extern Display *dpy;
44 45
46#ifdef HAVE_LCD_BITMAP
45unsigned char lcd_framebuffer_copy[LCD_WIDTH][LCD_HEIGHT/8]; 47unsigned char lcd_framebuffer_copy[LCD_WIDTH][LCD_HEIGHT/8];
46 48
47/* this is in uibasic.c */
48extern void drawdots(int color, XPoint *points, int count);
49
50void lcd_update (void) 49void lcd_update (void)
51{ 50{
52 int x, y; 51 int x, y;
53 int p=0; 52 int p=0;
54 int bit; 53 int bit;
55 XPoint points[LCD_WIDTH * LCD_HEIGHT]; 54 struct coordinate points[LCD_WIDTH * LCD_HEIGHT];
56 int cp=0; 55 int cp=0;
57 XPoint clearpoints[LCD_WIDTH * LCD_HEIGHT]; 56 struct coordinate clearpoints[LCD_WIDTH * LCD_HEIGHT];
58 57
59 for(y=0; y<LCD_HEIGHT; y+=8) { 58 for(y=0; y<LCD_HEIGHT; y+=8) {
60 for(x=0; x<LCD_WIDTH; x++) { 59 for(x=0; x<LCD_WIDTH; x++) {
@@ -86,7 +85,7 @@ void lcd_update (void)
86 85
87 drawdots(0, &clearpoints[0], cp); 86 drawdots(0, &clearpoints[0], cp);
88 drawdots(1, &points[0], p); 87 drawdots(1, &points[0], p);
89 /* printf("lcd_update: Draws %d pixels, clears %d pixels (max %d/%d)\n", 88/* printf("lcd_update: Draws %d pixels, clears %d pixels (max %d/%d)\n",
90 p, cp, p+cp, LCD_HEIGHT*LCD_WIDTH); */ 89 p, cp, p+cp, LCD_HEIGHT*LCD_WIDTH); */
91 XSync(dpy,False); 90 XSync(dpy,False);
92} 91}
@@ -102,8 +101,8 @@ void lcd_update_rect(int x_start, int y_start,
102 int cp=0; 101 int cp=0;
103 int xmax; 102 int xmax;
104 int ymax; 103 int ymax;
105 XPoint points[LCD_WIDTH * LCD_HEIGHT]; 104 struct coordinate points[LCD_WIDTH * LCD_HEIGHT];
106 XPoint clearpoints[LCD_WIDTH * LCD_HEIGHT]; 105 struct coordinate clearpoints[LCD_WIDTH * LCD_HEIGHT];
107 106
108 /* The Y coordinates have to work on even 8 pixel rows */ 107 /* The Y coordinates have to work on even 8 pixel rows */
109 ymax = (yline + height)/8; 108 ymax = (yline + height)/8;
@@ -150,7 +149,37 @@ void lcd_update_rect(int x_start, int y_start,
150 /* printf("lcd_update_rect: Draws %d pixels, clears %d pixels\n", p, cp);*/ 149 /* printf("lcd_update_rect: Draws %d pixels, clears %d pixels\n", p, cp);*/
151 XSync(dpy,False); 150 XSync(dpy,False);
152} 151}
152#endif
153#ifdef HAVE_LCD_CHARCELLS
154
155/* Defined in lcd-playersim.c */
156extern void lcd_print_char(int x, int y);
157extern unsigned char lcd_buffer[2][11];
158extern void drawrect(int color, int x1, int y1, int x2, int y2);
159extern bool lcd_display_redraw;
160
161static unsigned char lcd_buffer_copy[2][11];
162
163void lcd_update (void)
164{
165 bool changed=false;
166 int x, y;
167 for (y=0; y<2; y++) {
168 for (x=0; x<11; x++) {
169 if (lcd_display_redraw ||
170 lcd_buffer_copy[y][x] != lcd_buffer[y][x]) {
171 lcd_buffer_copy[y][x] = lcd_buffer[y][x];
172 lcd_print_char(x, y);
173 changed=true;
174 }
175 }
176 }
177 if (changed)
178 XSync(dpy,False);
179 lcd_display_redraw=false;
180}
153 181
182#endif
154/* ----------------------------------------------------------------- 183/* -----------------------------------------------------------------
155 * local variables: 184 * local variables:
156 * eval: (load-file "../../firmware/rockbox-mode.el") 185 * eval: (load-file "../../firmware/rockbox-mode.el")