78,7 → 78,7 |
|
static unsigned int scr_width; |
static unsigned int scr_height; |
static char *scr_addr; |
static uint8_t *scr_addr; |
|
static unsigned int style; |
|
151,13 → 151,30 |
cursor_goto(row, col + 1); |
} |
|
static void draw_text_data(keyfield_t *data) |
/** Draw text data to viewport. |
* |
* @param vport Viewport id |
* @param data Text data. |
* @param x Leftmost column of the area. |
* @param y Topmost row of the area. |
* @param w Number of rows. |
* @param h Number of columns. |
*/ |
static void draw_text_data(keyfield_t *data, unsigned int x, |
unsigned int y, unsigned int w, unsigned int h) |
{ |
int i; |
unsigned int i, j; |
keyfield_t *field; |
uint8_t *dp; |
|
for (i = 0; i < scr_width * scr_height; i++) { |
scr_addr[i * 2] = data[i].character; |
scr_addr[i * 2 + 1] = attr_to_ega_style(&data[i].attrs); |
for (j = 0; j < h; j++) { |
for (i = 0; i < w; i++) { |
field = &data[j * w + i]; |
dp = &scr_addr[2 * ((y + j) * scr_width + (x + i))]; |
|
dp[0] = field->character; |
dp[1] = attr_to_ega_style(&field->attrs); |
} |
} |
} |
|
237,7 → 254,7 |
ipc_callid_t callid; |
ipc_call_t call; |
char c; |
unsigned int row, col; |
unsigned int row, col, w, h; |
int bg_color, fg_color, attr; |
uint32_t bg_rgb, fg_rgb; |
keyfield_t *interbuf = NULL; |
270,11 → 287,19 |
retval = EINVAL; |
break; |
case FB_DRAW_TEXT_DATA: |
col = IPC_GET_ARG1(call); |
row = IPC_GET_ARG2(call); |
w = IPC_GET_ARG3(call); |
h = IPC_GET_ARG4(call); |
if (!interbuf) { |
retval = EINVAL; |
break; |
} |
draw_text_data(interbuf); |
if (col + w > scr_width || row + h > scr_height) { |
retval = EINVAL; |
break; |
} |
draw_text_data(interbuf, col, row, w, h); |
retval = 0; |
break; |
case FB_GET_CSIZE: |
359,7 → 384,7 |
break; |
|
default: |
retval = ENOENT; |
retval = EINVAL; |
} |
ipc_answer_0(callid, retval); |
} |