When I asked the question, “what made the NES so interesting”, my answer was to describe the memory mappers used by the console. But what’s interesting is that the very first cartridge to feature a memory mapper was not from Nintendo themselves; they were late to the game of expansion hardware on cartridges, since their plan to expand the console was the Famicom Disk System. So it fell to humble arcade developer Jaleco to introduce the concept.

Connect me to the city

City Connection title screen

City Connection is a maze chase arcade game where, like Pac-Man, the goal is to pass over every tile. Instead of collecting dots in a top-down maze, you’re in a car viewed from the side, and can jump. Instead of ghosts, you’re pursued by the police. It’s pretty good, and the Famicom port is also pretty good. It also has a good commercial!

City Connection gameplay

The Famicom port is, as far as my research goes, the very first game for the console to use additional hardware that goes beyond the limits of the console. For a quick overview, up until this point, there were three types of hardware that was attached to the cartridge port.

  • 32kiB of program ROM mapped between 0x8000 to 0xFFFF on the CPU bus. Oftentimes this is a 16kiB ROM mapped twice. (As in Aspect Star “N”)
  • On-cartridge expansion RAM on the CPU bus between 0x6000 to 0x7FFF (an 8kiB window), used only by Family BASIC.
  • 8kiB of Video ROM attached to the PPU bus. This could be video RAM instead, the cartridge is clearly designed for it, but that hasn’t happened.

City Connection is actually a pretty small NES game, at 32kiB– smaller than 40kiB NROM Super Mario Bros.. But while only 16kiB of that is the program ROM, there’s 16kiB of data ROM. The astute will note that that is twice the amount the cartridge actually has room for. The NES isn’t the sort of console where you could just attach more; there’s only an 8kiB window.

City Connection plugged into the RGB blaster

What’s my question

This game switches the graphics ROM in a single 8kib bank. That is to say, all of the graphics on the ROM are switched out at once. This is pretty much the easiest way to implement this, but it’s not nearly as flexible as some of the later mappers.

Common source on this blog NESdev notes that the City Connection mapper has been assigned mapper 87. It has a single register, mapped to 0x6000-0x7FFF, a range that Family BASIC used for expansion RAM but no other game had used up until that point. And it lays out the bits as follows:

7  bit  0
---- ----
xxxx xxLH
       ||
       |+- High CHR bit
       +-- Low CHR bit

The reverse order of bits is kind of strange. Now, this also includes later games like Ninja JaJaMaru no Daibouken which used larger character ROMs. But City Connection only uses a 16kiB ROM, so it doesn’t need two bits. That being the case, it seemed very strange to me that it’d put the low CHR bit there, since it doesn’t even have a high CHR bit. And when things are a bit strange, I wanted to confirm it myself.

What the game does

So to figure out what the game is doing, I’ll use FCEUX’s conditional breakpoints feature. This is because if I just set a breakpoint on the mapper address range, it’d update every frame. But when you start the game for the first level and the title screen, it’s only ever writing 0x00.

A blue haired anime girl winks at the screen. NOW YOU HAVE DRIVEN ALL THE HIGHWAY!

Finally, after passing the level, we see the game write 0xFF to the mapper. And even better, Clarice has driven all the highway! You have to play at least a whole stage into the game to get the mapper to write a non-zero value; many CNROM games would use the mapper for the title screen. (This includes the US port of City Connection, which replaced Clarice with a guy because in American culture, girls are considered “icky”)

Writing only 0x00 and 0xFF means that it doesn’t care what bits the register is mapped to. So the game could be wired either way and it’d still grab the right page. Convenient for Jaleco, but doesn’t answer my question.

What’s inside the cartridge

City Connection cartridge

If you want to open a City Connection game, or any other Famicom cartridge, my advice is: do not. These things are a real pain with their plastic clamshells; even though Jaleco could make their own mold, they followed the same way. I honestly haven’t been able to open one without damaging them.

But I do now have the PCB for City Connection, so we can take a look at Jaleco’s JF-05. Here’s the back.

City Connection PCB rear

The back has some interesting jumpers. You can see “H” and “V”; City Connection uses horizontal arrangement (vertical mirroring), so “H” is connected and “V” is not. I talked about this in the recent post on AxROM mappers.

H and V jumpers

Finally, you can also see jumpers labeled “128” and “256”. So even at the time of this JF-05 board, Jaleco was indeed looking ahead at supporting larger ROMs. As far as I or NESCartDB knows, the only game that used JF-05 was City Connection.

128 and 256 jumpers

The front is where all the chips are. This has two chips of note in addition to the two ROMs:

  1. A 74HC139, which is a two-to-four multiplexer. In this case, it decodes the address range for the mapper to respond to; by mapping it somewhere other than the cartridge space, this eliminates bus conflicts at the expense of no longer supporting on-cartridge RAM. City Connection doesn’t need the space.
  2. A 74HC74, which is a two-bit D-type flip-flop. That is to say, this is just two bits of RAM.

Here’s the pinout of the 74HC74 from Texas Instruments.

Pinout of a 74HC74. Standard layout.

And we can trace it out with a multimeter. 1D, the first bit’s data input, connects to data bit D1 on the cartridge edge connector. 2D, the second bit’s data input, connects to data bit D0. And if we look at the pinout of a standard 27128 ROM:

Pinout of a standard ROM.

Q1, the output of that first data bit, is connected to the highest address line, A13. So yes, they are reversed even in this one. Q2 would presumably be used for A14 on games that had 32kiB (256 kilobits) of CHR space.

That’s it

Now you have driven all the highway!

I quite like City Connection. It’s not the most polished game, but it’s a fun way to spend some time. The fact that they pulled off parallax scrolling on the NES is pretty impressive, even if it’s a little choppy.

The CNROM board above. The chips are clearly labeled now. On the top row, NES-1F-0 PRG, NES-1F-0 CHR, and a small Nintendo-labeled IC. On the bottom, a 74HC161 branded Toshiba.

As for JF-05, it mostly died out in favor of CNROM (and similar boards from companies like Bandai), which used a single 74HC161 that provided four bits of registers overlapping the address space. All the JF-05-style mapper games used CNROM when they came to America as well, as Nintendo didn’t manufacture anything to this spec.

Hit a cat, game over

Overall, I just find it interesting that Jaleco’s mapper beat Nintendo’s to the market on their own system.