summaryrefslogtreecommitdiff
path: root/uisimulator/common/lcd-playersim.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/common/lcd-playersim.c')
-rw-r--r--uisimulator/common/lcd-playersim.c47
1 files changed, 5 insertions, 42 deletions
diff --git a/uisimulator/common/lcd-playersim.c b/uisimulator/common/lcd-playersim.c
index 25e17b5f81..e3cadd4513 100644
--- a/uisimulator/common/lcd-playersim.c
+++ b/uisimulator/common/lcd-playersim.c
@@ -39,11 +39,10 @@
39#define CHAR_PIXEL 4 39#define CHAR_PIXEL 4
40#define BORDER_MARGIN 5 40#define BORDER_MARGIN 5
41 41
42unsigned char lcd_buffer[2][11];
43
44static int double_height=1; 42static int double_height=1;
45extern bool lcd_display_redraw; 43extern bool lcd_display_redraw;
46extern unsigned const char *lcd_ascii; 44extern const unsigned short *lcd_ascii;
45extern unsigned char hardware_buffer_lcd[11][2];
47 46
48 47
49void lcd_print_icon(int x, int icon_line, bool enable, char **icon) 48void lcd_print_icon(int x, int icon_line, bool enable, char **icon)
@@ -96,7 +95,7 @@ void lcd_print_char(int x, int y)
96 int p=0, cp=0; 95 int p=0, cp=0;
97 struct rectangle points[CHAR_HEIGHT*CHAR_WIDTH]; 96 struct rectangle points[CHAR_HEIGHT*CHAR_WIDTH];
98 struct rectangle clearpoints[CHAR_HEIGHT*CHAR_WIDTH]; 97 struct rectangle clearpoints[CHAR_HEIGHT*CHAR_WIDTH];
99 unsigned char ch=lcd_buffer[y][x]; 98 unsigned char ch=hardware_buffer_lcd[x][y];
100 99
101 if (double_height == 2 && y == 1) 100 if (double_height == 2 && y == 1)
102 return; /* Second row can't be printed in double height. ??*/ 101 return; /* Second row can't be printed in double height. ??*/
@@ -204,35 +203,7 @@ void lcd_invertpixel(int x, int y)
204 (void)y; 203 (void)y;
205} 204}
206 205
207void lcd_clear_display(void)
208{
209 int x, y;
210 for (y=0; y<2; y++) {
211 for (x=0; x<11; x++) {
212 lcd_buffer[y][x]=lcd_ascii[' '];
213 }
214 }
215 lcd_update();
216}
217 206
218void lcd_puts(int x, int y, unsigned char *str)
219{
220 int i;
221 DEBUGF("lcd_puts(%d, %d, \"", x, y);
222 for (i=0; *str && x<11; i++) {
223#ifdef DEBUGF
224 if (*str>=32 && *str<128)
225 {DEBUGF("%c", *str);}
226 else
227 {DEBUGF("(0x%02x)", *str);}
228#endif
229 lcd_buffer[y][x++]=lcd_ascii[*str++];
230 }
231 DEBUGF("\")\n");
232 for (; x<11; x++)
233 lcd_buffer[y][x]=lcd_ascii[' '];
234 lcd_update();
235}
236 207
237void lcd_double_height(bool on) 208void lcd_double_height(bool on)
238{ 209{
@@ -243,11 +214,11 @@ void lcd_double_height(bool on)
243 lcd_update(); 214 lcd_update();
244} 215}
245 216
246void lcd_define_pattern(int which, char *pattern, int length) 217void lcd_define_hw_pattern(int which, char *pattern, int length)
247{ 218{
248 int i, j; 219 int i, j;
249 int pat = which / 8; 220 int pat = which / 8;
250 char icon[8]; 221 unsigned char icon[8];
251 memset(icon, 0, sizeof icon); 222 memset(icon, 0, sizeof icon);
252 223
253 DEBUGF("Defining pattern %d:", pat); 224 DEBUGF("Defining pattern %d:", pat);
@@ -267,11 +238,3 @@ void lcd_define_pattern(int which, char *pattern, int length)
267 lcd_update(); 238 lcd_update();
268} 239}
269 240
270extern void lcd_puts(int x, int y, unsigned char *str);
271
272void lcd_putc(int x, int y, unsigned char ch)
273{
274 DEBUGF("lcd_putc(%d, %d, %d '0x%02x')\n", x, y, ch, ch);
275 lcd_buffer[y][x]=lcd_ascii[ch];
276 lcd_update();
277}