fixed colors on the PPU

This commit is contained in:
2026-08-09 22:05:49 -05:00
parent 9767b348e1
commit 1235717c54
2 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -238,10 +238,10 @@ impl Ppu {
let addr = 0x23C0
| (self.vram_addr & 0x0C00)
| ((self.vram_addr >> 4) & 0x38)
| (self.vram_addr & 0x07);
| ((self.vram_addr >> 2) & 0x07);
let byte = self.nametable_read(cart, addr);
// select the 2 bits for this tile's 2x2 block
let shift = ((self.vram_addr & 0x20) >> 3) | ((self.vram_addr & 0x01) << 1);
let shift = ((self.vram_addr & 0x40) >> 4) | (self.vram_addr & 0x02);
self.attr_latch = (byte >> shift) & 0x03;
}
4 => {