Rev 4167 | Rev 4325 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4167 | Rev 4235 | ||
|---|---|---|---|
| Line 81... | Line 81... | ||
| 81 | static uint8_t *scr_addr; |
81 | static uint8_t *scr_addr; |
| 82 | 82 | ||
| 83 | static unsigned int style; |
83 | static unsigned int style; |
| 84 | 84 | ||
| 85 | static unsigned attr_to_ega_style(const attrs_t *a); |
85 | static unsigned attr_to_ega_style(const attrs_t *a); |
| - | 86 | static uint8_t ega_glyph(wchar_t ch); |
|
| 86 | 87 | ||
| 87 | static void clrscr(void) |
88 | static void clrscr(void) |
| 88 | { |
89 | { |
| 89 | int i; |
90 | int i; |
| 90 | 91 | ||
| Line 141... | Line 142... | ||
| 141 | for (i = 0; i < -rows * scr_width; i++) |
142 | for (i = 0; i < -rows * scr_width; i++) |
| 142 | ((short *)scr_addr)[i] = ((style << 8 ) + ' '); |
143 | ((short *)scr_addr)[i] = ((style << 8 ) + ' '); |
| 143 | } |
144 | } |
| 144 | } |
145 | } |
| 145 | 146 | ||
| 146 | static void printchar(char c, unsigned int row, unsigned int col) |
147 | static void printchar(wchar_t c, unsigned int row, unsigned int col) |
| 147 | { |
148 | { |
| 148 | scr_addr[(row * scr_width + col) * 2] = c; |
149 | scr_addr[(row * scr_width + col) * 2] = ega_glyph(c); |
| 149 | scr_addr[(row * scr_width + col) * 2 + 1] = style; |
150 | scr_addr[(row * scr_width + col) * 2 + 1] = style; |
| 150 | 151 | ||
| 151 | cursor_goto(row, col + 1); |
152 | cursor_goto(row, col + 1); |
| 152 | } |
153 | } |
| 153 | 154 | ||
| Line 170... | Line 171... | ||
| 170 | for (j = 0; j < h; j++) { |
171 | for (j = 0; j < h; j++) { |
| 171 | for (i = 0; i < w; i++) { |
172 | for (i = 0; i < w; i++) { |
| 172 | field = &data[j * w + i]; |
173 | field = &data[j * w + i]; |
| 173 | dp = &scr_addr[2 * ((y + j) * scr_width + (x + i))]; |
174 | dp = &scr_addr[2 * ((y + j) * scr_width + (x + i))]; |
| 174 | 175 | ||
| 175 | dp[0] = field->character; |
176 | dp[0] = ega_glyph(field->character); |
| 176 | dp[1] = attr_to_ega_style(&field->attrs); |
177 | dp[1] = attr_to_ega_style(&field->attrs); |
| 177 | } |
178 | } |
| 178 | } |
179 | } |
| 179 | } |
180 | } |
| 180 | 181 | ||
| Line 246... | Line 247... | ||
| 246 | a->a.i.bg_color, a->a.i.flags); |
247 | a->a.i.bg_color, a->a.i.flags); |
| 247 | default: return INVERTED_COLOR; |
248 | default: return INVERTED_COLOR; |
| 248 | } |
249 | } |
| 249 | } |
250 | } |
| 250 | 251 | ||
| - | 252 | static uint8_t ega_glyph(wchar_t ch) |
|
| - | 253 | { |
|
| - | 254 | if (ch >= 0 && ch < 128) |
|
| - | 255 | return ch; |
|
| - | 256 | ||
| - | 257 | return '?'; |
|
| - | 258 | } |
|
| - | 259 | ||
| 251 | static void ega_client_connection(ipc_callid_t iid, ipc_call_t *icall) |
260 | static void ega_client_connection(ipc_callid_t iid, ipc_call_t *icall) |
| 252 | { |
261 | { |
| 253 | int retval; |
262 | int retval; |
| 254 | ipc_callid_t callid; |
263 | ipc_callid_t callid; |
| 255 | ipc_call_t call; |
264 | ipc_call_t call; |
| 256 | char c; |
265 | wchar_t c; |
| 257 | unsigned int row, col, w, h; |
266 | unsigned int row, col, w, h; |
| 258 | int bg_color, fg_color, attr; |
267 | int bg_color, fg_color, attr; |
| 259 | uint32_t bg_rgb, fg_rgb; |
268 | uint32_t bg_rgb, fg_rgb; |
| 260 | keyfield_t *interbuf = NULL; |
269 | keyfield_t *interbuf = NULL; |
| 261 | size_t intersize = 0; |
270 | size_t intersize = 0; |