@@ 47,18 47,11 @@ ppu_pixel(Ppu *p, uint8_t fg, uint16_t x, uint16_t y, uint8_t color)
{
if(x >= WIDTH || y >= HEIGHT) return;
int offset = y * STRIDE_WORDS + x / 32;
- uint32_t *px = &p->pixels[offset * 3 + fg];
uint32_t mask = 1 << ((x & 0x18) + (7 - (x & 0x7)));
if(color & 0x01)
- p->pixels[offset * 3 + fg] |= mask;
+ p->pixels[offset * 3 + fg * 2] |= mask;
else
- p->pixels[offset * 3 + fg] &= ~mask;
- if(fg) {
- if(color)
- p->pixels[offset * 3 + 2] |= mask;
- else
- p->pixels[offset * 3 + 2] &= ~mask;
- }
+ p->pixels[offset * 3 + fg * 2] &= ~mask;
render(p, offset, 1);
}