MMC5 extended RAM and fill mode

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
User avatar
SusiKette
Posts: 138
Joined: Fri Mar 16, 2018 1:52 pm
Location: Finland

MMC5 extended RAM and fill mode

Post by SusiKette » Sat Dec 05, 2020 10:58 am

According to the wiki MMC5 has the PRG RAM at $6000-$7FFF. When you are using the extended RAM modes 0 or 1, what parts of the PRG RAM are used for these features? Mode 1 can also be used as a extended nametable. How does this work with the additional attribute data used in that mode? The wiki mentions that the fill mode can be used for screen transitions. Are there any games/test programs that demonstrate how these screen transitions work?
Avatar is pixel art of Noah Prime from Astral Chain

User avatar
Quietust
Posts: 1687
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Re: MMC5 extended RAM and fill mode

Post by Quietust » Sat Dec 05, 2020 11:08 am

SusiKette wrote:
Sat Dec 05, 2020 10:58 am
According to the wiki MMC5 has the PRG RAM at $6000-$7FFF. When you are using the extended RAM modes 0 or 1, what parts of the PRG RAM are used for these features? Mode 1 can also be used as a extended nametable. How does this work with the additional attribute data used in that mode? The wiki mentions that the fill mode can be used for screen transitions. Are there any games/test programs that demonstrate how these screen transitions work?
The RAM used for nametable expansion is not part of PRG RAM - it is internal to the MMC5 chip itself, since it needs to be dual-port (i.e. writable from the CPU bus and readable from the PPU bus). In fact, one of the modes allows it to be used as general-purpose RAM mapped at $5C00-$5FFF in addition to whatever PRG RAM is available (and mapped anywhere within $6000-$DFFF).

As for fill mode, I believe the game "Laser Invasion" uses it during takeoff/landing.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.

User avatar
SusiKette
Posts: 138
Joined: Fri Mar 16, 2018 1:52 pm
Location: Finland

Re: MMC5 extended RAM and fill mode

Post by SusiKette » Sun Dec 06, 2020 9:36 am

The wiki also mentio s that the expansion RAM can only be written while PPU is rendering. Is this right? And does this mean rendering as in rendering begin enabled from PPU registers or while a frame is begin rendered?
Avatar is pixel art of Noah Prime from Astral Chain

User avatar
tokumaru
Posts: 12000
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: MMC5 extended RAM and fill mode

Post by tokumaru » Sun Dec 06, 2020 10:41 am

This rendering thing is weird as hell... I always wondered if this information was correct myself, because it makes zero sense.

lidnariq
Posts: 10260
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: MMC5 extended RAM and fill mode

Post by lidnariq » Sun Dec 06, 2020 11:46 am

I haven't tested this, but it does make sense.

In order to know when it's safe to write to the extended RAM, it needs to know that there's enough time to complete a write. The only way it can know this is when the PPU is doing its normal fetch cadence: after each rising edge of PPU /RD, it knows there's guaranteed to be at least 180ns before the next falling edge of PPU /RD.

Also, you could switch the mode using $5104 during vblank as long as you switch it back before rendering starts.

User avatar
Bregalad
Posts: 8008
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Re: MMC5 extended RAM and fill mode

Post by Bregalad » Sun Dec 06, 2020 1:55 pm

SusiKette wrote:
Sun Dec 06, 2020 9:36 am
The wiki also mentio s that the expansion RAM can only be written while PPU is rendering. Is this right? And does this mean rendering as in rendering begin enabled from PPU registers or while a frame is begin rendered?
According to my memories, if it is written during VBlank a #$00 is written instead of the desired value. I'm unsure about forced VBlank... be sure to never trust emulators for this kind of thing.
Useless, lumbering half-wits don't scare us.

Post Reply