2 * Helper functions for dealing with generic RGB888 framebuffers
3 * NetWatch system management mode administration console
5 * Copyright (c) 2008 Jacob Potter and Joshua Wise. All rights reserved.
6 * This program is free software; you can redistribute and/or modify it under
7 * the terms found in the file LICENSE in the root of this source tree.
15 uint32_t checksum_rect_generic32(int x, int y, int width, int height) {
17 /* Generic checksum_rect function for video modes with 32-bit pixels
18 * (i.e. fb->curmode.bytestride = 4).
21 int scanline = fb->curmode.xres * 4;
22 unsigned char * lineaddr;
27 for (i = 0; i < height; i++) {
28 lineaddr = fb->fbaddr + (i + y) * scanline + (4 * x);
30 sum = crc32(lineaddr, width * 4, sum);
36 void copy_pixels_generic32(char *buf, int x, int y, int width, int height)
39 unsigned int *ibuf = (unsigned int *)buf;
41 for (cy = 0; cy < height; cy++)
43 fbuf = (unsigned int *)fb->fbaddr;
44 fbuf += (cy + y) * (fb->curmode.xres) + x;
45 for (cx = 0; cx < width; cx++)
46 *(ibuf++) = *(fbuf++);