Rev 4537 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4537 | Rev 4668 | ||
---|---|---|---|
Line 85... | Line 85... | ||
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 | static uint8_t ega_glyph(wchar_t ch); |
87 | 87 | ||
88 | static void clrscr(void) |
88 | static void clrscr(void) |
89 | { |
89 | { |
90 | int i; |
90 | unsigned i; |
91 | 91 | ||
92 | for (i = 0; i < scr_width * scr_height; i++) { |
92 | for (i = 0; i < scr_width * scr_height; i++) { |
93 | scr_addr[i * 2] = ' '; |
93 | scr_addr[i * 2] = ' '; |
94 | scr_addr[i * 2 + 1] = style; |
94 | scr_addr[i * 2 + 1] = style; |
95 | } |
95 | } |
Line 127... | Line 127... | ||
127 | pio_write_8(EGA_IO_BASE + 1, stat & (~(1 << 5))); |
127 | pio_write_8(EGA_IO_BASE + 1, stat & (~(1 << 5))); |
128 | } |
128 | } |
129 | 129 | ||
130 | static void scroll(int rows) |
130 | static void scroll(int rows) |
131 | { |
131 | { |
132 | int i; |
132 | unsigned i; |
- | 133 | ||
133 | if (rows > 0) { |
134 | if (rows > 0) { |
134 | memmove(scr_addr, ((char *) scr_addr) + rows * scr_width * 2, |
135 | memmove(scr_addr, ((char *) scr_addr) + rows * scr_width * 2, |
135 | scr_width * scr_height * 2 - rows * scr_width * 2); |
136 | scr_width * scr_height * 2 - rows * scr_width * 2); |
136 | for (i = 0; i < rows * scr_width; i++) |
137 | for (i = 0; i < rows * scr_width; i++) |
137 | (((short *) scr_addr) + scr_width * scr_height - rows * |
138 | (((short *) scr_addr) + scr_width * scr_height - rows * |
Line 316... | Line 317... | ||
316 | retval = 0; |
317 | retval = 0; |
317 | break; |
318 | break; |
318 | case FB_GET_CSIZE: |
319 | case FB_GET_CSIZE: |
319 | ipc_answer_2(callid, EOK, scr_width, scr_height); |
320 | ipc_answer_2(callid, EOK, scr_width, scr_height); |
320 | continue; |
321 | continue; |
- | 322 | case FB_GET_COLOR_CAP: |
|
- | 323 | ipc_answer_1(callid, EOK, FB_CCAP_INDEXED); |
|
- | 324 | continue; |
|
321 | case FB_CLEAR: |
325 | case FB_CLEAR: |
322 | clrscr(); |
326 | clrscr(); |
323 | retval = 0; |
327 | retval = 0; |
324 | break; |
328 | break; |
325 | case FB_PUTCHAR: |
329 | case FB_PUTCHAR: |
Line 343... | Line 347... | ||
343 | cursor_goto(col, row); |
347 | cursor_goto(col, row); |
344 | retval = 0; |
348 | retval = 0; |
345 | break; |
349 | break; |
346 | case FB_SCROLL: |
350 | case FB_SCROLL: |
347 | i = IPC_GET_ARG1(call); |
351 | i = IPC_GET_ARG1(call); |
348 | if (i > scr_height || i < -((int) scr_height)) { |
352 | if (i > (int) scr_height || i < -((int) scr_height)) { |
349 | retval = EINVAL; |
353 | retval = EINVAL; |
350 | break; |
354 | break; |
351 | } |
355 | } |
352 | scroll(i); |
356 | scroll(i); |
353 | retval = 0; |
357 | retval = 0; |