3gengames wrote:
So I take it the mode that you can only write during rendering is the mode where you extend the table attributes?.....Why must you write during rendering? Wouldn't that cause the PPU and CPU be trying to use both at the same time, so shouldn't you be trying to change it during VBlank?
You write to it directly via the CPU, instead of using 2006/2007 like when you're trying to access the internal PPU ram. However, we don't actually understand the MMC5 very well at all to know how exactly this is able to work. The MMC5
must do something to allow simultaneous accesses to the ExRAM though, since Nintendo made the decision to only allow writes (in mode 0 and mode 1) during rendering, which is when the PPU is constantly fetching bytes, meaning the MMC5 would need to also be constantly accessing its ExRAM.
My hypothesis is that there's a pipeline, much like the read-pipeline in the PPU when you read 2007. When you write to ExRAM, the MMC5 stores it in the pipeline until the PPU is in between ExRAM accesses, during which it commits the write the CPU made. There are 3 PPU cycles for each CPU cycle, and when the PPU is fetching BG tiles, it spends two of its cycles fetching the bitmap data from the pattern table, so the MMC5 probably commits ExRAM writes during this time. There's a LOT of time in between sequential CPU accesses in which the MMC5 can commit writes, so this would work out flawlessly. This is just a hypothesis though, so don't take this to heart.
