Revision a0f42610 hw/vga.c

b/hw/vga.c
2373 2373
                v = *(uint32_t *)d;
2374 2374
            else
2375 2375
                v = (uint32_t) (*(uint16_t *)d);
2376
            r = ((v >> ds->pf.rshift) & ds->pf.rmax) * 256 /
2377
                (ds->pf.rmax + 1);
2378
            g = ((v >> ds->pf.gshift) & ds->pf.gmax) * 256 /
2379
                (ds->pf.gmax + 1);
2380
            b = ((v >> ds->pf.bshift) & ds->pf.bmax) * 256 /
2381
                (ds->pf.bmax + 1);
2376
            /* Limited to 8 or fewer bits per channel: */
2377
            r = ((v >> ds->pf.rshift) & ds->pf.rmax) << (8 - ds->pf.rbits);
2378
            g = ((v >> ds->pf.gshift) & ds->pf.gmax) << (8 - ds->pf.gbits);
2379
            b = ((v >> ds->pf.bshift) & ds->pf.bmax) << (8 - ds->pf.bbits);
2382 2380
            *pbuf++ = r;
2383 2381
            *pbuf++ = g;
2384 2382
            *pbuf++ = b;

Also available in: Unified diff