Rev 4525 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4525 | Rev 4548 | ||
---|---|---|---|
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 343... | Line 344... | ||
343 | cursor_goto(col, row); |
344 | cursor_goto(col, row); |
344 | retval = 0; |
345 | retval = 0; |
345 | break; |
346 | break; |
346 | case FB_SCROLL: |
347 | case FB_SCROLL: |
347 | i = IPC_GET_ARG1(call); |
348 | i = IPC_GET_ARG1(call); |
348 | if (i > scr_height || i < -((int) scr_height)) { |
349 | if (i > (int) scr_height || i < -((int) scr_height)) { |
349 | retval = EINVAL; |
350 | retval = EINVAL; |
350 | break; |
351 | break; |
351 | } |
352 | } |
352 | scroll(i); |
353 | scroll(i); |
353 | retval = 0; |
354 | retval = 0; |