Palette mirroring => Super Mario Bros. background corrected.
This commit is contained in:
parent
542f4c8149
commit
0acba53bd1
1 changed files with 5 additions and 5 deletions
|
@ -51,7 +51,7 @@ template <bool wr> u8 mem_access(u16 addr, u8 v = 0)
|
|||
else if (addr < 0x2800) ref = &ciRam[addr - 0x2000]; // Nametables.
|
||||
else if (addr < 0x3000) return 0x00;
|
||||
else if (addr < 0x3F00) ref = &ciRam[addr - 0x3000]; // Nametables (mirror).
|
||||
else ref = &palette[addr % 0x20]; // Palettes.
|
||||
else ref = &palette[(addr % 4) ? addr % 0x20 : 0]; // Palettes.
|
||||
|
||||
if (wr) return *ref = v;
|
||||
else return *ref;
|
||||
|
@ -151,7 +151,7 @@ void pixel()
|
|||
u8 palInd = (atBits << 2) | bgBits;
|
||||
|
||||
if (scanline < 240 and cycle >= 1 and cycle <= 256)
|
||||
((u32*) s->pixels) [scanline * 256 + (cycle - 1)] = rendering() ? nes_rgb[palette[palInd]] : 0;
|
||||
((u32*) s->pixels) [scanline * 256 + (cycle - 1)] = rendering() ? nes_rgb[rd(0x3F00 | palInd)] : 0;
|
||||
|
||||
bgShiftL <<= 1; bgShiftH <<= 1;
|
||||
}
|
||||
|
|
Reference in a new issue