Skip to content
HN On Hacker News ↗

Inside the Super Nintendo cartridges

▲ 175 points 29 comments by offbyone42 4w ago HN discussion ↗

Pangram verdict · v3.3

We believe that this document is fully human-written

1 %

AI likelihood · overall

Human
100% human-written 0% AI-generated
SEGMENTS · HUMAN 7 of 7
SEGMENTS · AI 0 of 7
WORD COUNT 1,885
PEAK AI % 2% · §4
Analyzed
Apr 26
backend: pangram/v3.3
Segments scanned
7 windows
avg 269 words each
Distribution
100 / 0%
human / AI fraction
Verdict
Human
Pangram v3.3

Article text · 1,885 words · 7 segments analyzed

Human AI-generated
§1 Human · 0%

April 21, 2024 Inside the Super Nintendo cartridges

One of the remarkable characteristics of the Super Nintendo was the ability for game cartridges (cart) to pack more than instructions and assets into ROM chips. If we open and look at the PCBs, we can find inside things like the CIC copy protection chip, SRAM, and even "enhancement processors".

CICThe copy-protection mechanism of the SNES is something I already dig into in my 10NES article. It works by having two chips talking in lockstep. One chip is in the console, the other in the cart. If the console CIC sees something it does not like, it resets every processor.

Not every SNES cart has a CIC. Unsanctioned games such as "Super 3D Noah's Ark" don't have one. To play the game, one needs to first insert the game in the console and then plug an official cartridge on top. The CIC bus lines are forwarded from Noah's towards the official game's CIC!

ROM: instructions & assetsI was unable to find a list of all SNES games with their ROM size. So I made my own. That is 3,378 titles (across USA/Japan/Europe) presented in the chart below.

Games ROM size used to be expressed in bits instead of bytes. Zelda III, for example, was not advertised as 1,048,576 bytes but the size of its ROM in bits, that is 1,048,576 * 8 / (1024*1024) = 8Mb. The largest game ever released was Star Ocean (48Mb or 6,291,456 bytes) while a masterpiece such as Super Mario World used a mere 524,288 bytes (4Mb) ROM.

If you don't want to click on the .csv, here are the most noteworthy games (feel free to scream me an email if your favorite game is not in the list).

§2 Human · 2%

Game Zone  Mb  Bytes

Star Ocean Japan 48 6,291,456

Tales of Phantasia Japan 48 6,291,456

Street Fighter Alpha 2 USA 32 4,194,304

Street Fighter Zero 2 USA 32 4,194,304

Chrono Trigger USA 32 4,194,304

Super Street Fighter II USA 32 4,194,304

Donkey Kong Country USA 32 4,194,304

Super Metroid USA 24 1,571,143

Secret of Mana USA 16 2,097,152

Street Fighter II USA 16 2,097,152

Super Mario World 2 - Yoshi's Island USA 16 2,097,152

Mega Man X2 USA 12 1,572,864

Aladdin USA 8 1,048,576

Teenage Mutant Ninja Turtles IV USA 8 1,048,576

Contra III - The Alien Wars USA 8 1,048,576

Legend of Zelda,

§3 Human · 2%

The - A Link to the Past USA 8 1,048,576

Star Fox USA 8 1,048,576

Super Mario Kart USA 4 524,288

Super Mario World USA 4 524,288

F-Zero USA 4 524,288

SRAMSome titles offered the ability to save progress. This was done by having a SRAM chip powered by a battery. The SRAM went into low-power mode when the console was turned off to reduce the drain.

Source (snescentral.com). Zelda III PCB

In this Zelda III PCB above, we find the CIC (D413A) mentioned previously in U4. In U1, 0x80000 = 524,288 bytes of ROM. In U2, a LH5268AF-10TLL, 64 Kbits (8 KiB) of SRAM. In U3 the MAD-1 chip is a Memory Address Decoder which arbitrates access to the ROM/RAM[1][2].

Enhancement processors The most famous enhancement processor is the Super FX (a.k.a "MARIO", a.k.a "GSU-1") which was used for Starfox in 1993. But EC chips were used prior to this date.

A complete list of Enhanced SNES games is available on wikipedia and snescentral.com. In total, 13 ECs powered 72 games.

Enhancement processors: SA-1 The "Super Accelerator 1" is the MVP of the Enhancement Chips. Included in 34 carts[3], it is a 65C816 CPU (the same as the one in the SNES) but running 4x faster at 10.74 MHz. It also features 2KiB of SRAM and an integrated CIC[4].

Source (snescentral.com). Super Mario RPG PCB

Above, a Mario RPG PCB.

§4 Human · 2%

Notice the absence of CIC chip (since the SA-1 has one), a ROM chip in U1 containing the game instructions and assets, a SRAM chip in U2 (with an integrated decoder which void the needs for a MAD-1), and the SA-1 in U3.

Notice there is no oscillator since the SA-1 uses the System Master clock line from the cart port and halves it internally. The result is a 21.4772700 MHz / 2 = 10.74 MHz frequency.

How does it work?

We can find the full description in the SNES Developer Documentation Volume II[5]. Upon startup, the SA-1 is in "stop" state. The SNES CPU creates a Reset Vector and resumes the SA-1. The initial SA-1 Instruction Pointer is retrieved from that dedicated Reset Vector.

The SA-1 has three modes of operations named Accelerator, Parallel Processing, and Mixed Processing. In the most powerful configuration, it makes the overall system five times more capable.

The SA-1 CPU and the Super NES CPU operate simultaneously, which results in five times greater performance of the Super Accelerator System (SAS) over the current Super NES.- Super Nintendo Developer Manual Book II[6]

Thanks to the improved processing, the SNES is able to animate and detect collisions on all 128 sprites available in the PPU. The horsepower also allowed to transform sprites on the fly (rotate/scale them) and write them back into the PPU VRAM. The dramatic improvements were demonstrated in a Nintendo SA-1 demo cart[7].

SA-1 enthusiasts further demonstrated the performance difference. The video below compares execution of sort algorithms using a SlowROM (access time of 200n) vs FastROMs (access time of 120ns), and a SA-1.

The video author was confused. They labeled "LoRom" instead of "SlowROM" and "HiRom" instead of 'FastROMs" (LoRom vs HiRom has to do only in memory mapping[8][9]).

The SA-1 has also been used by the retro-gaming community to improve the game-play of past games suffering slowdown.

§5 Human · 1%

Amazing projects such as Eliminating slowdown in Super Mario World, Gradius III slowdown removal (took three months of work[10]) and Contra III slowdown removal[11] are works of beauty. Even Super Mario World[12] got the treatment (I can't remember slowdowns but I was only twelve back then).

Super R-Type (SNES) - Original x SA-1 Comparison.

Contra III (SNES) - Original x SA-1 Comparison.

Gradius III - SNES Original x SA-1 Comparison[13].

Gradius III (SNES) - Original x SA-1 Comparison.

The process of converting a title to SA-1 seems fairly involved, requiring in particular to remap RAM/ROM accesses. This is puzzling since the documentation of the SA-1 states that "The SNES and the SA-1 uses the same memory mapping"[14]. If you know why, please shot me an email.

Efforts to automatize the remapping and sa1-ize more SNES games were underway as recently as 2019 via the SA-1 Collection Project[15].

Enhancement processors: CX4 The CX4 is Capcom's baby powering both Mega Man X2 and Mega Man X3. It is capable of 3-D wire-frame rendering and numerous math operations along with scaling and rotating sprites into the VRAM[16]. You can find examples in MMX2 intro or in MMX2 boss fights.

Most associate it with wire-frame effects but it most definitely is not used for just that. It provides sprite functions, wire-frame effects, Propulsion, Vector. triangle, trigonometric functions and result tables and coordinate transform functions.

In MMX2 and MMX3, it handles all sprites, so it's literally used throughout the entire game. This basically allows for more sprites on-screen than the SNES would otherwise allow without flicker. I think this is how some of the large bosses like the intro bosses are done.- Source[17]

Source (snescentral.com). Mega Man X2 PCB

Above, the Mega Man X2 PCB.

§6 Human · 1%

Notice the copy protection CIC in U4, 8M (8 Mbis = 1MiB) ROM containing game instructions and assets in U1, more ROM in U2, and the CX4 in U3.

Notice the 20Mhz oscillator in X1 since the CX4 does not use the console Master Clock.

Enhancement processors: CS-DD1The DD1 is a sprite decompression chip, able to feed picture processing unit VRAM directly (and a little bit more[18]). It was used in two games, Star Ocean and Street Fighter Alpha 2.

The DD1 was rumored to be responsible for Street Fighter Alpha 2 blank before a round started. The reason was detailed by Modern Vintage Gamer[19]. It turned out the problem was transferring sound samples to the DSP RAM.

Source (snescentral.com). Street Fighter Alpha 2 PCB

The simplest PCB we will look at today, Street Fighter Alpha 2 ships with a lot of ROM in U1 (4 MiB) and the DD1 to decompress assets on the fly. Notice how there is no CIC so it is integrated into the DD1.

Enhancement processors: DSP-1The series of DSP chips supports nineteen titles. The DSP-1 accounts for sixteen of them, in particular classics like Super Mario Kart and Pilotwings[20]

The name is poorly chosen since DSP stands for Digital Signal Processor but they do not operate on a continuous signal like most DSPs.

The chip is extensively documented in the Super Nintendo Developer Manual Book II[21]. In these pages, we learn that it works in blocking mode (the CPU does nothing while the DSP operates).

The Super NES CPU waits while DSP1 processes data, before sending the next data.- Developer Manual[22]

The DSP offers instructions such as fast 16-bit multiplication, inverse, sin/cos projection, vector size, rotation and so on which were obviously paramount to program the HDMA and update the 3D view in Mode 7[23].

Source (snescentral.com). Super Mario Kart PCB

Above, a packed Mario Kart PCB which leverages every component we learned about so far.

§7 Human · 1%

There is an external CIC in U5, a ROM in U1, SRAM to save games in U3, and finally a MAD-1 address decoder for ROM/RAM addressing in U4. Of course to allow savegame to survive console power off, we find a battery in the upper left.

Like the CX4, the DSP does not use the Master Clock from the cart line. Instead it requires an oscillator (found here in X1). The resulting frequency is 8 MHz.

DSP-1 powered game Pilot Wings was "improved" when enthusiasts found out the game used texture at much higher resolution than Mode 7 could display. bsnes was modified to give Mode 7 an HD resolution for the result below.

There were three versions of the DSP-1 named DSP-1, DSP-1a, and DSP-1b. While introducing bug fixing and improving the process, the chip behavior was slightly altered which resulted in planes in Pilot Wings demo crashing into the ground (as unveiled by Foone[24]).

Enhancement processors: DSP-2Used in a single game (Dungeon Master) to convert the Atari ST routines. It seems that it was mostly to help scaling sprites as seen here.

Enhancement processors: DSP-3Used in a single game (SD Gundam GX).

Enhancement processors: DSP-4Used in two games (Top Gear 3000 and The Planet's Champ TG 3000).

Enhancement processors: OBC-1The OBC-1 was used in a single game Metal Combat: Falcon's by Revenge Intelligent Systems. It was rumored to be used to manipulate sprites. However this is debated on nesdev.org.

It's essentially a very, very simplistic save RAM mapper. It helps build OAM (sprite) tables in RAM (without the need for bit manipulation), that are then DMA'ed into OAM memory.

Honestly, it seems like a serious waste of an engineering effort. It should be a weekend project for an experienced programmer to remove the need for the chip entirely. [...]

I think the biggest justification for it was the anti-piracy benefits.- Near[25]

Source (snescentral.com). Metal Combat: Falcon's Revenge PCB

In Metal Combat's PCB we find the OBC1 in U4.