Due to the way the concept of bankswapping works, most mappers
require a power-of-two size to function properly (not just for PRG, but for CHR as well). NEStopia likely just does a sort of "smart" correction to get games with funky sizes working -- which I would really
NOT advise you rely on, since doing this is bad practice all around.
Mappers which
don't require an even power-of-two size (I can really only think of one: 225 or something -- which ever one Action 52 uses, can't look it up right now) get away with this by having multiple chips of variable sizes (but each chip having a power-of-two size. For instance, Action 52 can have 1.5 MB of PRG because it has either two PRG chips (one with 1 MB PRG and one with 512k), or 3 PRG chips (each with 512k) -- I forget which.
For further reading on the subject, you might find this thread interesting:
http://nesdev.parodius.com/bbs/viewtopic.php?t=2769The reason power-of-two is more or less required is because bankswapping doesn't really "swap in" a bank like the misleading name suggests. What's really going on is the desired bank number is stored in a register internal to the mapper, which it uses to index a larger area of memory. The easiest way to visualize this is with 32k PRG swapping (mapper 7, for example). When a game writes to a mapper reg at $8000-FFFF it sets the internal register. The low bits of that registers simply
replace the high bits of the address on the 6502 during reads.
For example, if the game swaps to bank 2, it would write $02 to the reg. Then if it read from, say, $9314, the mapper would replace the high bits of that address with the low bits of the mapper reg:
mapper reg address
$02 = %0010 $9314 = %10010011 00010100
|| |||||||| ||||||||
\\\\ x||||||| ||||||||
\\\\ ||||||| ||||||||
\\\\ /////// ////////
\\\\ /////// ////////
\\\\ /////// ////////
|\\ /////// ////////
| | /////// ////////
%1 00010011 00010100 = $11314
final PRG address (add $10 for .nes rom offset)
The logic gets a bit more complex when you get into smaller swapping ranges (ie, 8k swapping at $8000 and $A000 a la MMC3) where the mapper has multiple registers (one for each swappable region) and determines which register to use based on the high bits of the read address.
For mappers with "hardwired" banks, the mapper-fed bits are usually all pulled high (as if the swap reg always contained $FF). This results in the last PRG bank being "hardwired" to wherever. This also is why emulators might bork the job if the the PRG size isn't a power-of-two. If the emu simply switches to page $FF for the hardwired bank, this may or may not be the last PRG page depending on the size of the PRG. For example, if the game has a total of $7F PRG pages (one shy of a nice even power-of-two $80), the emu might hardwire page $01 instead of the last page $7E (since $FF mod $7F is $01).
As for how it behaves on the "real thing" -- it's sort of moot, since I doubt you'll be able to find any ROM/RAM chip that isn't an even power-of-two size. Or if you can, they're at least a lot harder to find and probably much more expensive. Not to mention you'll probably have a hell of a time trying to get one to work how you want with any NES MMC.
So in short:
You
need to have power-of-two PRG/CHR sizes (barring very special circumstances). So if you want to expand, you MUST double the PRG.