356,8 → 356,7 |
lines, vport->style.bg_color); |
} else if (lines < 0) { |
lines = -lines; |
for (y = vport->y + vport->height-1; y >= vport->y + lines; |
y--) |
for (y = vport->y + vport->height-1; y >= vport->y + lines; y--) |
memcpy(&screen.fbaddress[POINTPOS(vport->x,y)], |
&screen.fbaddress[POINTPOS(vport->x,y - lines)], |
screen.pixelbytes * vport->width); |
380,8 → 379,7 |
dsty = vport->y + y; |
|
memcpy(&screen.fbaddress[POINTPOS(dstx,dsty)], |
&vport->dbdata[srcoff], |
vport->width*screen.pixelbytes); |
&vport->dbdata[srcoff], vport->width * screen.pixelbytes); |
} |
} |
|
397,9 → 395,8 |
vport->dboffset %= vport->height; |
} else if (lines < 0) { |
lines = -lines; |
draw_rectangle(vport, 0, vport->height-lines, |
vport->width, lines, |
vport->style.bg_color); |
draw_rectangle(vport, 0, vport->height-lines, vport->width, |
lines, vport->style.bg_color); |
|
if (vport->dboffset < lines) |
vport->dboffset += vport->height; |
441,8 → 438,8 |
* @param transparent If false, print background color |
*/ |
static void |
draw_glyph(viewport_t *vport,uint8_t glyph, unsigned int sx, |
unsigned int sy, style_t style, int transparent) |
draw_glyph(viewport_t *vport,uint8_t glyph, unsigned int sx, unsigned int sy, |
style_t style, int transparent) |
{ |
int i; |
unsigned int y; |
452,11 → 449,9 |
glline = fb_font[glyph * FONT_SCANLINES + y]; |
for (i = 0; i < 8; i++) { |
if (glline & (1 << (7 - i))) |
putpixel(vport, sx + i, sy + y, |
style.fg_color); |
putpixel(vport, sx + i, sy + y, style.fg_color); |
else if (!transparent) |
putpixel(vport, sx + i, sy + y, |
style.bg_color); |
putpixel(vport, sx + i, sy + y, style.bg_color); |
} |
} |
} |
664,8 → 659,8 |
col = i % vport->cols; |
row = i / vport->cols; |
draw_glyph(vport, data[i].character, col * COL_WIDTH, row * |
FONT_SCANLINES, data[i].style, |
style_same(data[i].style,vport->style)); |
FONT_SCANLINES, data[i].style, style_same(data[i].style, |
vport->style)); |
} |
cursor_print(vport); |
} |
757,7 → 752,7 |
if (IPC_GET_ARG1(*call) == shm_id) { |
void *dest = as_get_mappable_page(IPC_GET_ARG2(*call)); |
shm_size = IPC_GET_ARG2(*call); |
if (!ipc_answer_fast(callid, 0, (sysarg_t) dest, 0)) |
if (!ipc_answer_1(callid, EOK, (sysarg_t) dest)) |
shm = dest; |
else |
shm_id = 0; |
805,8 → 800,8 |
} |
|
ppm_draw(shm, shm_size, IPC_GET_ARG1(*call), |
IPC_GET_ARG2(*call), vport->width - x, |
vport->height - y, (putpixel_cb_t)putpixel, vport); |
IPC_GET_ARG2(*call), vport->width - x, vport->height - y, |
(putpixel_cb_t)putpixel, vport); |
break; |
case FB_DRAW_TEXT_DATA: |
if (!interbuffer) { |
825,7 → 820,7 |
} |
|
if (handled) |
ipc_answer_fast(callid, retval, 0, 0); |
ipc_answer_0(callid, retval); |
return handled; |
} |
|
983,8 → 978,8 |
visibility = pointer_mask_bits[bytepos] & |
(1 << (j % 8)); |
if (visibility) { |
color = pointer_bits[bytepos] & (1 << (j % 8)) |
? 0 : 0xffffff; |
color = pointer_bits[bytepos] & |
(1 << (j % 8)) ? 0 : 0xffffff; |
if (pointer_x + j < screen.xres && pointer_y + |
i < screen.yres) |
putpixel(&viewports[0], pointer_x + j, |
1106,7 → 1101,7 |
handled = 0; |
} |
if (handled) |
ipc_answer_fast(callid, retval, 0, 0); |
ipc_answer_0(callid, retval); |
return handled; |
} |
|
1157,7 → 1152,7 |
} |
|
if (handled) |
ipc_answer_fast(callid, retval, 0, 0); |
ipc_answer_0(callid, retval); |
return handled; |
|
} |
1179,11 → 1174,11 |
viewport_t *vport = &viewports[0]; |
|
if (client_connected) { |
ipc_answer_fast(iid, ELIMIT, 0,0); |
ipc_answer_0(iid, ELIMIT); |
return; |
} |
client_connected = 1; |
ipc_answer_fast(iid, 0, 0, 0); /* Accept connection */ |
ipc_answer_0(iid, EOK); /* Accept connection */ |
|
while (1) { |
if (vport->cursor_active || anims_enabled) |
1222,7 → 1217,7 |
retval = EINVAL; |
break; |
} |
ipc_answer_fast(callid, 0, 0, 0); |
ipc_answer_0(callid, EOK); |
|
draw_char(vport, c, row, col, vport->style, |
IPC_GET_METHOD(call) == FB_TRANS_PUTCHAR); |
1252,7 → 1247,7 |
retval = 0; |
break; |
case FB_GET_CSIZE: |
ipc_answer_fast(callid, 0, vport->rows, vport->cols); |
ipc_answer_2(callid, EOK, vport->rows, vport->cols); |
continue; |
case FB_SCROLL: |
i = IPC_GET_ARG1(call); |
1280,9 → 1275,9 |
} |
viewports[i].dboffset = 0; |
if (IPC_GET_ARG2(call) == 1 && !viewports[i].dbdata) |
viewports[i].dbdata = malloc(screen.pixelbytes |
* viewports[i].width * |
viewports[i].height); |
viewports[i].dbdata = |
malloc(screen.pixelbytes * |
viewports[i].width * viewports[i].height); |
else if (IPC_GET_ARG2(call) == 0 && |
viewports[i].dbdata) { |
free(viewports[i].dbdata); |
1335,7 → 1330,7 |
retval = 0; |
break; |
case FB_GET_RESOLUTION: |
ipc_answer_fast(callid, 0, screen.xres,screen.yres); |
ipc_answer_2(callid, EOK, screen.xres, screen.yres); |
continue; |
case FB_POINTER_MOVE: |
pointer_enabled = 1; |
1345,7 → 1340,7 |
default: |
retval = ENOENT; |
} |
ipc_answer_fast(callid,retval, 0, 0); |
ipc_answer_0(callid, retval); |
} |
} |
|