151,23 → 151,19 |
void grx_putimage(WORD x1, WORD y1, WORD x2, WORD y2, BYTE *buf) |
{ |
|
WORD bpr; |
LIN_ADDR addr, p; |
WORD dx, y; |
struct fb_image image; |
|
if (!grx_info || grx_info->var.bits_per_pixel != 16) return; |
|
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; |
} |
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; |
|
grx_info->fbops->fb_imageblit(grx_info, &image); |
|
} |
|
void grx_getimage(WORD x1, WORD y1, WORD x2, WORD y2, BYTE *buf) |
194,20 → 190,18 |
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; |
|
WORD bpr; |
DWORD addr; |
WORD dx, y; |
rect.dx = x1; |
rect.dy = y1; |
rect.width = x2-x1+1; |
rect.height = y2-y1+1; |
rect.color = color; |
rect.rop = ROP_COPY; |
|
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; |
} |
grx_info->fbops->fb_fillrect(grx_info, &rect); |
|
} |
|