NES mapper programming sounds like shitposts or elaborate pranks.
For example, MMC1. Super common chip, used on Metroid, Legend of Zelda, Bionic Commando.

To program it, you simply write five bytes to the upper half of the memory space. The LSB of each byte is added to a shift register and then for the 5th byte the 13th and 14th bit of the address are used to determine which register to program.

this is the kind of thing you'd expect to happen as part of some kind of tricky DRM system but no, the NES's DRM is implemented completely differently (and outside of the view of the CPU).

this is just how you bank switch on the MMC1

also there has to be at least one cycle between writes, or it ignores them. This is intentional behavior because of a weirdness of the 6502 where any instruction that modifies memory does two writes, once with the original value and once with the modified value.

emulating this behavior correctly is required for at least two published games, because of course it is

also some PCBs didn't bother connecting pin 14 to the MMC1.
So this behavior is different, and only address bit 13 matters.

This means you can have two games with the same ROM and the same mapper chip, but they work differently because the PCB is different.

one of the registers you program with this interface is used to select the PRG-RAM bank, which is the 4th bit on the CHR0/CHR1 registers... except for one game, A Ressha de Ikou, where it's the 5th.

it doesn't affect the MMC1, but the way some mappers are implemented on the NES also leads to a fun situation where your code needs to make sure the writes to ROM are only ever "writing" over the same value

this is caused by a bus conflict with the mapper and the CPU confusing the mapper. you try to write a 5 to $8000 to program the mapper, but the mapper has mapped 0 to $8000 and the 0 wins.

so even though the mapper is listening to writes in the entire top half of the address space, you gotta make sure the ROM has the correct values to write over, or it won't work.

every corner of the NES is like this.
you look up any section of that machine and it's like "this came in 5 flavors, none of which are compatible, none of which is properly described in any commonly used ROM format. emulating or programming it correctly is difficult. three games depend on this working exactly this way, and another two games depend on it not working this way"

Follow

@foone I had to change the header on a game for some friends because it used a cost-reduced version of a mapper, but was registered with the full one for some reason, and FPGA emulators would break by handling the mapper faithfully

· · Web · 1 · 0 · 0

@foone What specifically causes Heisei Tensai Bakabon to break on a MiSTer or Analogue Pocket when using the Namco 163 and not the 175? That's beyond my ability to discover. But break it does!

Funny game though. It's like if my chronically ill ass went on a platforming adventure

@elfi @foone If you care to know, the NESdev Wiki has details on every known mapper! :3

@NekoEd @foone yeah, it's more specifically debugging where things go wrong that's beyond me, with no NES reverse-engineering experience or FPGA hardware myself

@elfi @foone Ah. You'd have to have the docs and single-step through to do that. It should be doable in an emulator, though!

Sign in to participate in the conversation
Pixietown

Small server part of the pixie.town infrastructure. Registration is closed.