From efefe2acc2819adc7378d6ee33a4500442536d9f Mon Sep 17 00:00:00 2001 From: Vineet Kumar Date: Sun, 1 Sep 2024 19:48:33 -0400 Subject: add incomplete ppu --- cpu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpu.c b/cpu.c index a04c603..bf8ab90 100644 --- 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); -- cgit v1.2.3