X-Git-Url: http://git.joshuawise.com/netwatch.git/blobdiff_plain/67109eef29514092df311f5989fcd62c31e1d20f..0b67a02c833eca817fa0e4a548dc765532c2485f:/video/generic.c diff --git a/video/generic.c b/video/generic.c index 319b5ad..95f564f 100644 --- a/video/generic.c +++ b/video/generic.c @@ -17,7 +17,7 @@ uint32_t checksum_rect_generic32(int x, int y, int width, int height) { for (i = 0; i < height; i++) { lineaddr = fb->fbaddr + (i + y) * scanline + (4 * x); - sum ^= crc32(lineaddr, width * 4); + sum = crc32(lineaddr, width * 4, sum); } return sum; @@ -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++); } }