MMC1 help

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
MMC1 help
by on (#1229)
I'm trying to re-implement the MMC1 chip in an FPGA and am having some trouble understanding a few things about it.

1. Why is the PRG A13 line connected to the MMC1 chip? I don't see any reason why it should need this line, as it only distinguishes between 8KB banks and MMC1 operates on banks of at least 16KB. What is it used for?

2. PRG_CE line also goes to MMC1, and I'm not sure why. I don't see any reason for this. As far as I can tell MMC1 takes PRG_CE in from the 2A03 and outputs another CE line that goes to the ROM chip, but I don't see any difference in the two signals. Is MMC1 just a passthrough for this signal, and if so, why not just route the line from the 2A03 to the ROM?

3. CHR A10 is an output of the 2C02 and is connected to both the MMC1 chip and the CHR ROM. To do mirroring the MMC1 chip has to force this line low in certain situations. How is this not a bus contention problem if both the 2C02 and the MMC1 are driving this pin?

Thanks for the help, I'll post my schematics and Verilog code as soon as I've tested it in a real cart.

by on (#1230)
Ok, I think I've answered one of these questions. A13 is required to distinguish which of the 4 internal registers to write to. I was working on the PRG address decoder last night, and while I needed A14 I did not use A13. I totally forgot about the upper level register selection.

by on (#1231)
There's two cart pins for CHR A10. The output one for the cart's CHR, and the input one that goes to the internal CHR-RAM (nametables).

by on (#1232)
1. PRG A13 is used to select between 8000-9FFF/A000-BFFF and C000-DFFF/E000-FFFF, as you just realized.

2. PRG_CE is used, along with R/W, to detect writes to $8000-$FFFF so the MMC1 can catch them.

3. CHR A10 is a PPU output - mirroring is determined based on VRAM A10, an input on the 2KB onboard nametable RAM. VRAM A10 is usually connected to either PPU A10 or PPU A11; in this case, it's connected directly to the MMC1.