How should we use mirrored memory on a NES 6502?

69 views Asked by At

I am not sure to understand a concept of the NES 6502. It is stated that PPU's memory range $2000-$2FFF is mirrored to $3000-$3FFF which is great, but I am not sure to understand how I could benefit from that while programming?

Could someone explain to me while giving me an example of usage?

Thank you!

1

There are 1 answers

0
JeremyP On

I am not sure to understand how I could benefit from that while programming?

You can't. It's of no benefit to you whatsoever.

The PPU, in fact, has only eight registers and only needs three bits to select one of those eight registers. If you look at the pinout of the PPU, you will see pins for A0, A1, A2. These are directly connected to pins A0 to A2 of the CPU.

There's also a pin called /CSwhich stands for "not chip select". If it's high, the PPU ignores anything from the CPU and if it's low, it pays attention to what the CPU wants it to do. /CS is wired via some logic to the top three address lines of the CPU A15, A14, A13 and if they are 001 /CS goes low and the PPU is enabled.

All the CPU lines in between, i.e. A12 to A3 inclusive are completely ignored by the PPU and the chip select logic. Thus you can set them to any value and it has the same effect on the PPU. There's no advantage to you, it just means the decoding logic is much simpler which reduces the cost of manufacture slightly.