Rev 3674 | Rev 4342 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3674 | Rev 4338 | ||
---|---|---|---|
Line 47... | Line 47... | ||
47 | #include <ipc/fb.h> |
47 | #include <ipc/fb.h> |
48 | #include <ipc/ipc.h> |
48 | #include <ipc/ipc.h> |
49 | #include <ipc/ns.h> |
49 | #include <ipc/ns.h> |
50 | #include <ipc/services.h> |
50 | #include <ipc/services.h> |
51 | #include <libarch/ddi.h> |
51 | #include <libarch/ddi.h> |
- | 52 | #include <console/style.h> |
|
- | 53 | #include <console/color.h> |
|
52 | 54 | ||
53 | #include "ega.h" |
55 | #include "ega.h" |
54 | #include "../console/screenbuffer.h" |
56 | #include "../console/screenbuffer.h" |
55 | #include "main.h" |
57 | #include "main.h" |
56 | 58 | ||
Line 125... | Line 127... | ||
125 | 127 | ||
126 | static void scroll(int rows) |
128 | static void scroll(int rows) |
127 | { |
129 | { |
128 | int i; |
130 | int i; |
129 | if (rows > 0) { |
131 | if (rows > 0) { |
130 | memcpy(scr_addr, ((char *) scr_addr) + rows * scr_width * 2, |
132 | memmove(scr_addr, ((char *) scr_addr) + rows * scr_width * 2, |
131 | scr_width * scr_height * 2 - rows * scr_width * 2); |
133 | scr_width * scr_height * 2 - rows * scr_width * 2); |
132 | for (i = 0; i < rows * scr_width; i++) |
134 | for (i = 0; i < rows * scr_width; i++) |
133 | (((short *) scr_addr) + scr_width * scr_height - rows * |
135 | (((short *) scr_addr) + scr_width * scr_height - rows * |
134 | scr_width)[i] = ((style << 8) + ' '); |
136 | scr_width)[i] = ((style << 8) + ' '); |
135 | } else if (rows < 0) { |
137 | } else if (rows < 0) { |
136 | memcpy(((char *)scr_addr) - rows * scr_width * 2, scr_addr, |
138 | memmove(((char *)scr_addr) - rows * scr_width * 2, scr_addr, |
137 | scr_width * scr_height * 2 + rows * scr_width * 2); |
139 | scr_width * scr_height * 2 + rows * scr_width * 2); |
138 | for (i = 0; i < -rows * scr_width; i++) |
140 | for (i = 0; i < -rows * scr_width; i++) |
139 | ((short *)scr_addr)[i] = ((style << 8 ) + ' '); |
141 | ((short *)scr_addr)[i] = ((style << 8 ) + ' '); |
140 | } |
142 | } |
141 | } |
143 | } |
Line 152... | Line 154... | ||
152 | { |
154 | { |
153 | int i; |
155 | int i; |
154 | 156 | ||
155 | for (i = 0; i < scr_width * scr_height; i++) { |
157 | for (i = 0; i < scr_width * scr_height; i++) { |
156 | scr_addr[i * 2] = data[i].character; |
158 | scr_addr[i * 2] = data[i].character; |
- | 159 | /* FIXME |
|
157 | scr_addr[i * 2 + 1] = EGA_STYLE(data[i].style.fg_color, |
160 | scr_addr[i * 2 + 1] = EGA_STYLE(data[i].style.fg_color, |
158 | data[i].style.bg_color); |
161 | data[i].style.bg_color); |
- | 162 | */ |
|
159 | } |
163 | } |
160 | } |
164 | } |
161 | 165 | ||
162 | static int save_screen(void) |
166 | static int save_screen(void) |
163 | { |
167 | { |
Line 273... | Line 277... | ||
273 | else |
277 | else |
274 | cursor_disable(); |
278 | cursor_disable(); |
275 | retval = 0; |
279 | retval = 0; |
276 | break; |
280 | break; |
277 | case FB_SET_STYLE: |
281 | case FB_SET_STYLE: |
- | 282 | retval = 0; |
|
- | 283 | switch (IPC_GET_ARG1(call)) { |
|
- | 284 | case STYLE_NORMAL: style = INVERTED_COLOR; break; |
|
- | 285 | case STYLE_EMPHASIS: style = INVERTED_COLOR | 4; break; |
|
- | 286 | default: retval = EINVAL; |
|
- | 287 | } |
|
- | 288 | break; |
|
- | 289 | case FB_SET_COLOR: |
|
- | 290 | fgcolor = IPC_GET_ARG1(call); |
|
- | 291 | bgcolor = IPC_GET_ARG2(call); |
|
- | 292 | style = (fgcolor & 7) | ((bgcolor & 7) << 4); |
|
- | 293 | if (IPC_GET_ARG3(call) & CATTR_BRIGHT) |
|
- | 294 | style = style | 0x08; |
|
- | 295 | retval = 0; |
|
- | 296 | break; |
|
- | 297 | case FB_SET_RGB_COLOR: |
|
278 | fgcolor = IPC_GET_ARG1(call); |
298 | fgcolor = IPC_GET_ARG1(call); |
279 | bgcolor = IPC_GET_ARG2(call); |
299 | bgcolor = IPC_GET_ARG2(call); |
280 | style = EGA_STYLE(fgcolor, bgcolor); |
300 | style = EGA_STYLE(fgcolor, bgcolor); |
281 | retval = 0; |
301 | retval = 0; |
282 | break; |
302 | break; |