X-Git-Url: http://git.joshuawise.com/netwatch.git/blobdiff_plain/67109eef29514092df311f5989fcd62c31e1d20f..8e7d9af004f36ed0d2dc94d1e8254e2ff5a32503:/video/generic.c?ds=sidebyside diff --git a/video/generic.c b/video/generic.c index 319b5ad..c35cd5d 100644 --- a/video/generic.c +++ b/video/generic.c @@ -1,3 +1,13 @@ +/* generic.c + * Helper functions for dealing with generic RGB888 framebuffers + * NetWatch system management mode administration console + * + * Copyright (c) 2008 Jacob Potter and Joshua Wise. All rights reserved. + * This program is free software; you can redistribute and/or modify it under + * the terms found in the file LICENSE in the root of this source tree. + * + */ + #include #include #include @@ -17,7 +27,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 +38,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++); } }