Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4234 → Rev 4235

/trunk/uspace/srv/fb/serial_console.c
53,10 → 53,12
#define MAX_CONTROL 20
 
static void serial_sgr(const unsigned int mode);
void serial_putchar(wchar_t ch);
 
static int scr_width;
static int scr_height;
static bool color = true; /** True if producing color output. */
static bool utf8 = false; /** True if producing UTF8 output. */
static putc_function_t putc_function;
 
/* Allow only 1 connection */
104,7 → 106,26
 
void serial_putchar(wchar_t ch)
{
(*putc_function)(ch);
uint8_t buf[STR_BOUNDS(1)];
size_t offs;
size_t i;
 
if (utf8 != true) {
if (ch >= 0 && ch < 128)
(*putc_function)((uint8_t) ch);
else
(*putc_function)('?');
return;
}
 
offs = 0;
if (chr_encode(ch, buf, &offs, STR_BOUNDS(1)) == EOK) {
for (i = 0; i < offs; i++)
(*putc_function)(buf[i]);
} else {
(*putc_function)('?');
}
 
}
 
void serial_goto(const unsigned int row, const unsigned int col)
/trunk/uspace/srv/fb/ega.c
83,6 → 83,7
static unsigned int style;
 
static unsigned attr_to_ega_style(const attrs_t *a);
static uint8_t ega_glyph(wchar_t ch);
 
static void clrscr(void)
{
143,9 → 144,9
}
}
 
static void printchar(char c, unsigned int row, unsigned int col)
static void printchar(wchar_t c, unsigned int row, unsigned int col)
{
scr_addr[(row * scr_width + col) * 2] = c;
scr_addr[(row * scr_width + col) * 2] = ega_glyph(c);
scr_addr[(row * scr_width + col) * 2 + 1] = style;
cursor_goto(row, col + 1);
172,7 → 173,7
field = &data[j * w + i];
dp = &scr_addr[2 * ((y + j) * scr_width + (x + i))];
 
dp[0] = field->character;
dp[0] = ega_glyph(field->character);
dp[1] = attr_to_ega_style(&field->attrs);
}
}
248,12 → 249,20
}
}
 
static uint8_t ega_glyph(wchar_t ch)
{
if (ch >= 0 && ch < 128)
return ch;
 
return '?';
}
 
static void ega_client_connection(ipc_callid_t iid, ipc_call_t *icall)
{
int retval;
ipc_callid_t callid;
ipc_call_t call;
char c;
wchar_t c;
unsigned int row, col, w, h;
int bg_color, fg_color, attr;
uint32_t bg_rgb, fg_rgb;