diff options
-rw-r--r-- | firmware/drivers/lcd-player.c | 1 | ||||
-rw-r--r-- | uisimulator/common/lcd-playersim.c | 70 |
2 files changed, 39 insertions, 32 deletions
diff --git a/firmware/drivers/lcd-player.c b/firmware/drivers/lcd-player.c index 6e62358da7..6f58f8ec1a 100644 --- a/firmware/drivers/lcd-player.c +++ b/firmware/drivers/lcd-player.c | |||
@@ -271,7 +271,6 @@ bool lcdx_putc(int x, int y, unsigned short ch) | |||
271 | buffer_lcd_mirror[x][y]=lcd_char; | 271 | buffer_lcd_mirror[x][y]=lcd_char; |
272 | #ifdef SIMULATOR | 272 | #ifdef SIMULATOR |
273 | hardware_buffer_lcd[x][y]=lcd_char; | 273 | hardware_buffer_lcd[x][y]=lcd_char; |
274 | lcd_update(); | ||
275 | #else | 274 | #else |
276 | lcd_write(true, LCD_CURSOR(x, y)); | 275 | lcd_write(true, LCD_CURSOR(x, y)); |
277 | lcd_write(false, lcd_char); | 276 | lcd_write(false, lcd_char); |
diff --git a/uisimulator/common/lcd-playersim.c b/uisimulator/common/lcd-playersim.c index e3cadd4513..70a9dd9f40 100644 --- a/uisimulator/common/lcd-playersim.c +++ b/uisimulator/common/lcd-playersim.c | |||
@@ -83,8 +83,11 @@ void lcd_print_icon(int x, int icon_line, bool enable, char **icon) | |||
83 | } | 83 | } |
84 | row++; | 84 | row++; |
85 | } | 85 | } |
86 | drawdots(0, &clearpoints[0], cp); | 86 | /* DEBUGF("icon draw %d/%d\n", p, cp);*/ |
87 | drawdots(1, &points[0], p); | 87 | if (cp) |
88 | drawdots(0, &clearpoints[0], cp); | ||
89 | if (p) | ||
90 | drawdots(1, &points[0], p); | ||
88 | } | 91 | } |
89 | 92 | ||
90 | void lcd_print_char(int x, int y) | 93 | void lcd_print_char(int x, int y) |
@@ -96,46 +99,51 @@ void lcd_print_char(int x, int y) | |||
96 | struct rectangle points[CHAR_HEIGHT*CHAR_WIDTH]; | 99 | struct rectangle points[CHAR_HEIGHT*CHAR_WIDTH]; |
97 | struct rectangle clearpoints[CHAR_HEIGHT*CHAR_WIDTH]; | 100 | struct rectangle clearpoints[CHAR_HEIGHT*CHAR_WIDTH]; |
98 | unsigned char ch=hardware_buffer_lcd[x][y]; | 101 | unsigned char ch=hardware_buffer_lcd[x][y]; |
102 | static char bitmap_content[11*8][2*8]; | ||
99 | 103 | ||
100 | if (double_height == 2 && y == 1) | 104 | if (double_height == 2 && y == 1) |
101 | return; /* Second row can't be printed in double height. ??*/ | 105 | return; /* Second row can't be printed in double height. ??*/ |
102 | 106 | ||
103 | /* Clear all char | ||
104 | clearpoints[cp].x = xpos +BORDER_MARGIN; | ||
105 | clearpoints[cp].y = ypos +BORDER_MARGIN; | ||
106 | clearpoints[cp].width=CHAR_WIDTH*CHAR_PIXEL; | ||
107 | clearpoints[cp].height=7*CHAR_PIXEL*double_height; | ||
108 | cp++; | ||
109 | */ | ||
110 | for (col=0; col<5; col++) { | 107 | for (col=0; col<5; col++) { |
108 | unsigned char fontbitmap=(*font_player)[ch][col]; | ||
111 | for (row=0; row<7; row++) { | 109 | for (row=0; row<7; row++) { |
112 | char fontbit=(*font_player)[ch][col]&(1<<row); | 110 | char fontbit=fontbitmap&(1<<row); |
113 | int height=CHAR_PIXEL*double_height; | 111 | int height=CHAR_PIXEL*double_height; |
112 | int ypixel; | ||
113 | if (bitmap_content[x*8+col][y*8+row*double_height]!=fontbit || | ||
114 | bitmap_content[x*8+col][y*8+row*double_height+double_height-1]!= | ||
115 | fontbit) { | ||
116 | bitmap_content[x*8+col][y*8+row*double_height]=fontbit; | ||
117 | bitmap_content[x*8+col][y*8+row*double_height+double_height-1]=fontbit; | ||
118 | |||
119 | ypixel=CHAR_PIXEL*(double_height*row)+ypos; | ||
120 | if (double_height==2) { | ||
121 | if (row == 3) /* Adjust for blank row in the middle */ | ||
122 | height=CHAR_PIXEL; | ||
123 | } | ||
114 | 124 | ||
115 | y=CHAR_PIXEL*(double_height*row)+ypos; | 125 | if (fontbit) { |
116 | if (double_height==2) { | 126 | /* set a dot */ |
117 | if (row == 3) /* Adjust for blank row in the middle */ | 127 | points[p].x = xpos + col*CHAR_PIXEL +BORDER_MARGIN; |
118 | height=CHAR_PIXEL; | 128 | points[p].y = ypixel +BORDER_MARGIN; |
119 | } | 129 | points[p].width=CHAR_PIXEL; |
120 | 130 | points[p].height=height; | |
121 | if (fontbit) { | 131 | p++; /* increase the point counter */ |
122 | /* set a dot */ | 132 | } else { |
123 | points[p].x = xpos + col*CHAR_PIXEL +BORDER_MARGIN; | 133 | clearpoints[cp].x = xpos + col*CHAR_PIXEL +BORDER_MARGIN; |
124 | points[p].y = y +BORDER_MARGIN; | 134 | clearpoints[cp].y = ypixel +BORDER_MARGIN; |
125 | points[p].width=CHAR_PIXEL; | 135 | clearpoints[cp].width=CHAR_PIXEL; |
126 | points[p].height=height; | 136 | clearpoints[cp].height=height; |
127 | p++; /* increase the point counter */ | 137 | cp++; |
128 | } else { | 138 | } |
129 | clearpoints[cp].x = xpos + col*CHAR_PIXEL +BORDER_MARGIN; | ||
130 | clearpoints[cp].y = y +BORDER_MARGIN; | ||
131 | clearpoints[cp].width=CHAR_PIXEL; | ||
132 | clearpoints[cp].height=height; | ||
133 | cp++; | ||
134 | } | 139 | } |
135 | } | 140 | } |
136 | } | 141 | } |
137 | drawrectangles(0, &clearpoints[0], cp); | 142 | /* DEBUGF("print_char %d/%d\n", p, cp);*/ |
138 | drawrectangles(1, &points[0], p); | 143 | if (cp) |
144 | drawrectangles(0, &clearpoints[0], cp); | ||
145 | if (p) | ||
146 | drawrectangles(1, &points[0], p); | ||
139 | } | 147 | } |
140 | 148 | ||
141 | 149 | ||