Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 487 → Rev 488

/shark/trunk/drivers/fb/fun16.c
151,19 → 151,23
void grx_putimage(WORD x1, WORD y1, WORD x2, WORD y2, BYTE *buf)
{
 
struct fb_image image;
WORD bpr;
LIN_ADDR addr, p;
WORD dx, y;
 
if (!grx_info || grx_info->var.bits_per_pixel != 16) return;
 
image.depth = grx_info->var.bits_per_pixel;
image.data = buf;
image.width = x2-x1+1;
image.height = y2-y1+1;
image.dy = y1;
image.dx = x1;
bpr = grx_info->var.xres * 2;
p = buf;
addr = (LIN_ADDR)(grx_info->screen_base + x1 * 2 + bpr * y1);
dx = (x2 - x1 + 1) * 2;
for (y = y1; y <= y2; y++) {
memcpy(addr, p, dx);
p += dx;
addr += bpr;
}
 
grx_info->fbops->fb_imageblit(grx_info, &image);
 
}
 
void grx_getimage(WORD x1, WORD y1, WORD x2, WORD y2, BYTE *buf)
190,18 → 194,20
void grx_box(WORD x1, WORD y1, WORD x2, WORD y2, DWORD color)
{
struct fb_fillrect rect;
 
if (!grx_info || grx_info->var.bits_per_pixel != 16) return;
rect.dx = x1;
rect.dy = y1;
rect.width = x2-x1+1;
rect.height = y2-y1+1;
rect.color = color;
rect.rop = ROP_COPY;
WORD bpr;
DWORD addr;
WORD dx, y;
grx_info->fbops->fb_fillrect(grx_info, &rect);
bpr = grx_info->var.xres * 2;;
addr = (DWORD)(grx_info->screen_base + x1 * 2 + bpr * y1);
dx = (x2 - x1 + 1) * 2;
for (y = y1; y <= y2; y++) {
memsetw((LIN_ADDR)addr, color, dx);
addr += bpr;
}
}