Mapper Writes: Bankswitching

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
beneficii
Posts: 127
Joined: Tue Jul 12, 2005 4:37 pm

Mapper Writes: Bankswitching

Post by beneficii »

Hmm, I wonder, how many cycles does it take to bankswitch on, say, the MMC3, aside from the cycles spent executing the instructions? Additionally, are there any limits on the number of bank switches you can make in any given time peroid?
bunnyboy
Posts: 449
Joined: Thu Oct 27, 2005 1:44 pm
Location: CA
Contact:

Post by bunnyboy »

Bank switches happen instantly on all mappers, so the next instruction comes from the new bank. Only limit to the speed is how fast you can do the write. Could set it up to do 3 bank switches in 3 instructions using a/x/y.

That is the reason a microprocessor cant be used as a replacement for a mapper like mmc3, it cant respond fast enough to do the instant bank switch.
WedNESday
Posts: 1231
Joined: Thu Sep 15, 2005 9:23 am
Location: Berlin, Germany
Contact:

Post by WedNESday »

All the mapper does is change a pointer, there's no actual switching of 32k or ROM or anything.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Most mappers finish changing this pointer by the start of the next opcode fetch. For instance, the protection code in the Earthworm Jim HKO that Kevin Horton RE'd depends on this behavior. But some mappers do need multiple cycles to change the pointer, the most prominent of which is Squeedo.
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Post by Bregalad »

bunnyboy wrote: That is the reason a microprocessor cant be used as a replacement for a mapper like mmc3, it cant respond fast enough to do the instant bank switch.
One could get insane and have a PLL circuit build from M2 and then have a microprocessor run fast enough to simulate decently a mapper. (however, that mapper would hardly be able to, say, handle CHR bankswitching on the fly for banks smaller than 8k, because this would be a really hard thing to do)
User avatar
blargg
Posts: 3717
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

The reason mappers are fast is that they are built from basic logic gates, like latches. They have no clock so they run as fast as the logic itself runs.
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Post by Bregalad »

blargg wrote:They have no clock so they run as fast as the logic itself runs.
Actually, their bankswitching value is latched just when the clock (M2) line goes low after a write to the mapper, so they definitely have a clock, but the mapper reacts instantly after mapper writes.
Post Reply