|
|
|
@@ -89,6 +89,10 @@ static inline void nes_ppu_internal_copy_y(nes_ppu* ppu) { |
|
|
|
((ppu->t & 0x7000U) >> 12); |
|
|
|
} |
|
|
|
|
|
|
|
static inline void nes_ppu_internal_copy_v(nes_ppu* ppu) { |
|
|
|
ppu->addr = ppu->t; |
|
|
|
} |
|
|
|
|
|
|
|
void nes_ppu_write(nes_ppu* ppu, uint16_t addr, uint8_t val) { |
|
|
|
PPU_LOG("PPU: W-> $%04x %02x\n", addr, val); |
|
|
|
|
|
|
|
@@ -236,6 +240,9 @@ nes_ppu_Result nes_ppu_run(nes_ppu* ppu, int cycles) { |
|
|
|
if (ppu->scanline == 0) { |
|
|
|
nes_ppu_internal_copy_y(ppu); |
|
|
|
} |
|
|
|
if (ppu->mask & (ppu_Mask_Sprite | ppu_Mask_Back)) { |
|
|
|
nes_ppu_internal_copy_v(ppu); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ( NULL != ppu->mapper->scanline && |
|
|
|
|