emu_nes

An NES emulator for learning how the 6502 and similar computers of the era worked
Log | Files | Refs | README | LICENSE

commit efefe2acc2819adc7378d6ee33a4500442536d9f
parent e14776a4739f525ac2c5531fca94142454683563
Author: Vineet Kumar <git@vineetk.net>
Date:   Sun,  1 Sep 2024 19:48:33 -0400

add incomplete ppu

Diffstat:
Mcpu.c | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/cpu.c b/cpu.c @@ -54,6 +54,8 @@ peek(uint16_t addr) fprintf(stderr, "PRG ROG size is not 0x4000 nor 0x8000\n"), exit(1); } else if ((addr >= 0x4000 && addr <= 0x4013) || addr == 0x4015 || addr == 0x4017) return apu_read(addr); + else if (addr >= 0x2000 && addr <= 0x3FFF) + return ppu_read(addr); else return memory[addr]; } @@ -71,6 +73,9 @@ memwrite(uint16_t addr, uint8_t byte) if (addr >= 0x4000 && addr <= 0x4017) { apu_write(addr, byte); return; + } else if (addr >= 0x2000 && addr <= 0x3FFF) { + ppu_write(addr, byte); + return; } MEMORY_MIRROR(addr);