Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4337 → Rev 4338

/branches/dynload/uspace/srv/fb/ega.c
49,6 → 49,8
#include <ipc/ns.h>
#include <ipc/services.h>
#include <libarch/ddi.h>
#include <console/style.h>
#include <console/color.h>
 
#include "ega.h"
#include "../console/screenbuffer.h"
64,8 → 66,8
#define EGA_IO_ADDRESS 0x3d4
#define EGA_IO_SIZE 2
 
int ega_normal_color=0x0f;
int ega_inverted_color=0xf0;
int ega_normal_color = 0x0f;
int ega_inverted_color = 0xf0;
 
#define NORMAL_COLOR ega_normal_color
#define INVERTED_COLOR ega_inverted_color
127,13 → 129,13
{
int i;
if (rows > 0) {
memcpy(scr_addr, ((char *) scr_addr) + rows * scr_width * 2,
memmove(scr_addr, ((char *) scr_addr) + rows * scr_width * 2,
scr_width * scr_height * 2 - rows * scr_width * 2);
for (i = 0; i < rows * scr_width; i++)
(((short *) scr_addr) + scr_width * scr_height - rows *
scr_width)[i] = ((style << 8) + ' ');
} else if (rows < 0) {
memcpy(((char *)scr_addr) - rows * scr_width * 2, scr_addr,
memmove(((char *)scr_addr) - rows * scr_width * 2, scr_addr,
scr_width * scr_height * 2 + rows * scr_width * 2);
for (i = 0; i < -rows * scr_width; i++)
((short *)scr_addr)[i] = ((style << 8 ) + ' ');
154,8 → 156,10
 
for (i = 0; i < scr_width * scr_height; i++) {
scr_addr[i * 2] = data[i].character;
/* FIXME
scr_addr[i * 2 + 1] = EGA_STYLE(data[i].style.fg_color,
data[i].style.bg_color);
*/
}
}
 
275,8 → 279,24
retval = 0;
break;
case FB_SET_STYLE:
retval = 0;
switch (IPC_GET_ARG1(call)) {
case STYLE_NORMAL: style = INVERTED_COLOR; break;
case STYLE_EMPHASIS: style = INVERTED_COLOR | 4; break;
default: retval = EINVAL;
}
break;
case FB_SET_COLOR:
fgcolor = IPC_GET_ARG1(call);
bgcolor = IPC_GET_ARG2(call);
style = (fgcolor & 7) | ((bgcolor & 7) << 4);
if (IPC_GET_ARG3(call) & CATTR_BRIGHT)
style = style | 0x08;
retval = 0;
break;
case FB_SET_RGB_COLOR:
fgcolor = IPC_GET_ARG1(call);
bgcolor = IPC_GET_ARG2(call);
style = EGA_STYLE(fgcolor, bgcolor);
retval = 0;
break;
317,8 → 337,8
scr_height = sysinfo_value("fb.height");
if(sysinfo_value("fb.blinking"))
{
ega_normal_color&=0x77;
ega_inverted_color&=0x77;
ega_normal_color &= 0x77;
ega_inverted_color &= 0x77;
}
style = NORMAL_COLOR;