brewpanel/slcd.c

changeset 443
6b80a37fdf8d
parent 431
b3895cd6edd3
child 637
21e542c15832
equal deleted inserted replaced
442:1193bd7d460f 443:6b80a37fdf8d
139 void slcdCharDef(SGOBJ *dlg, int fd, int index, Uint8 data[8]) 139 void slcdCharDef(SGOBJ *dlg, int fd, int index, Uint8 data[8])
140 { 140 {
141 struct slcdDataStruct *lcd = slcds [fd]; 141 struct slcdDataStruct *lcd = slcds [fd];
142 int i; 142 int i;
143 143
144 for (i = 0 ; i < 8 ; i++) 144 for (i = 0 ; i < 8 ; i++) {
145 lcd->cgram[index][i] = data[i]; 145 lcd->cgram[index][i] = data[i];
146 }
146 } 147 }
147 148
148 149
149 150
150 151
151 void slcdPutchar(SGOBJ *dlg, int fd, Uint8 data) 152 void slcdPutchar(SGOBJ *dlg, int fd, Uint8 data)
152 { 153 {
153 struct slcdDataStruct *lcd = slcds [fd]; 154 struct slcdDataStruct *lcd = slcds [fd];
154 155
155 SDLGui_Char(dlg, fd, lcd->x + (lcd->cx * 12) + 12, lcd->y + (lcd->cy * 18) + 8, data); 156 if (data < 16)
157 /*
158 * Character 0..7 and 8..15 are the same.
159 */
160 SDLGui_CGChar(dlg, fd, lcd->x + (lcd->cx * 12) + 12, lcd->y + (lcd->cy * 18) + 8, lcd->cgram[data & 0x07]);
161 else
162 SDLGui_Char(dlg, fd, lcd->x + (lcd->cx * 12) + 12, lcd->y + (lcd->cy * 18) + 8, data);
156 163
157 if (++lcd->cx == lcd->cols) { 164 if (++lcd->cx == lcd->cols) {
158 lcd->cx = 0; 165 lcd->cx = 0;
159 if (++lcd->cy == lcd->rows) 166 if (++lcd->cy == lcd->rows)
160 lcd->cy = 0; 167 lcd->cy = 0;

mercurial