pgsize = vm->ysz * vm->pitch;
fbsize = pgcount * pgsize;
+ if(vm->bpp > 8) {
+ printf("rgb mask: %x %x %x\n", (unsigned int)vm->rmask,
+ (unsigned int)vm->gmask, (unsigned int)vm->bmask);
+ printf("rgb shift: %d %d %d\n", vm->rshift, vm->gshift, vm->bshift);
+ }
printf("pgcount: %d, pgsize: %d, fbsize: %d\n", pgcount, pgsize, fbsize);
- printf("phys addr: %p\n", (void*)vm->fb_addr);
+ if(vm->fb_addr) {
+ printf("phys addr: %p\n", (void*)vm->fb_addr);
+ }
fflush(stdout);
if(vm->fb_addr) {
{
}
+#ifdef NOZOOM
+#define XORRGB(x, y, dx, dy, zoom, r, g, b) \
+ do { \
+ int xor = (((x) - fb_width/2) + (dx)) ^ (((y) - fb_height/2) + (dy)); \
+ (r) = xor >> 2; \
+ (g) = xor >> 1; \
+ (b) = xor; \
+ } while(0)
+#else
#define XORRGB(x, y, dx, dy, zoom, r, g, b) \
do { \
int xor = ((((x) - fb_width/2) * (zoom) >> 16) + (dx)) ^ ((((y) - fb_height/2) * (zoom) >> 16) + (dy)); \
(g) = xor >> 1; \
(b) = xor; \
} while(0)
+#endif
void redraw(void)
{
- int i, j, r, g, b, xoffs, yoffs, zoom;
+ int i, j, r, g, b, xoffs, yoffs;
+#ifndef NOZOOM
+ int zoom;
+#endif
unsigned char *fbptr;
uint16_t *fbptr16;
uint32_t *fbptr32;
xoffs = COS(time_msec >> 2) * fb_width >> 14;
yoffs = SIN(time_msec >> 1) * fb_height >> 15;
+#ifndef NOZOOM
zoom = (SIN(time_msec >> 3) << 1) + 0x18000;
+#endif
switch(fb_bpp) {
case 15: