X-Git-Url: http://git.joshuawise.com/netwatch.git/blobdiff_plain/2e581707f488e66ecce37a7343c813e071fd6beb..c1cc31ac5cc581f2142c15794ef7c6cfaa3ec6d9:/video/generic.c diff --git a/video/generic.c b/video/generic.c index d8b320b..8c6866d 100644 --- a/video/generic.c +++ b/video/generic.c @@ -15,7 +15,7 @@ uint32_t checksum_rect_generic32(int x, int y, int width, int height) { uint32_t sum = 0; for (i = 0; i < height; i++) { - lineaddr = fb->fbaddr + (i + y) * scanline; + lineaddr = fb->fbaddr + (i + y) * scanline + (4 * x); sum ^= crc32(lineaddr, width * 4); } @@ -28,11 +28,11 @@ void copy_pixels_generic32(char *buf, int x, int y, int width, int height) int cx, cy; unsigned int *ibuf = (unsigned int *)buf; unsigned int *fbuf; - for (cy = y; cy < (y + height); cy++) + for (cy = 0; cy < height; cy++) { fbuf = (unsigned int *)fb->fbaddr; - fbuf += cy * (fb->curmode.xres) + x; - for (cx = x; cx < (x + width); cx++) + fbuf += (cy + y) * (fb->curmode.xres) + x; + for (cx = 0; cx < width; cx++) *(ibuf++) = *(fbuf++); } }