https://fabiensanglard.net/snes_carts/index.html
FABIEN SANGLARD'S WEBSITE
---------------------------------------------------------------------
ABOUT CONTACT RSS $$$
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".
CIC
---------------------------------------------------------------------
The 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.
[cic_duo_nofont]
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!
[noah]
ROM: instructions & assets
---------------------------------------------------------------------
I was unable to find a list of all SNES games with their ROM size. So
I made my own (the ROM usage is a (bad) estimate based on the zipped
ROM size which removes most of the zero padding^[1]). That is 3,378
titles (across USA/Japan/Europe) presented in the chart below.
[SNES]
Games ROM size used to be expressed in bits instead of bytes. Zelda
III, for example, was not advertised as 706,107 bytes but the size of
its ROM in bits, (1,048,576 * 8) 8Mb. The largest game ever released
was Star Ocean (48Mb) while a masterpiece such as Super Mario World
used a single (524,288 * 8) 4Mb ROM (but roughly fit in 346,330
bytes).
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).
Game Zone Mb Estimated ROM usage
(bytes)
Star Ocean Japan 48 5,305,704
Tales of Phantasia Japan 48 4,597,214
Street Fighter Alpha 2 USA 32 3,656,898
Street Fighter Zero 2 USA 32 3,664,837
Chrono Trigger USA 32 3,082,289
Super Street Fighter II USA 32 2,831,690
Donkey Kong Country USA 32 2,580,703
Super Metroid USA 16 1,571,143
Secret of Mana USA 16 1,346,021
Street Fighter II USA 16 1,322,550
Super Mario World 2 - Yoshi's USA 16 1,287,021
Island
Mega Max X2 USA 8 1,005,245
Aladdin USA 8 828,576
Teenage Mutant Ninja Turtles IV USA 8 808,998
Contra III - The Alien Wars USA 8 753,444
Legend of Zelda, The - A Link to USA 8 706,107
the Past
Star Fox USA 8 622,583
Super Mario Kart USA 4 354,207
Super Mario World USA 4 346,330
F-Zero USA 4 290,893
SRAM
---------------------------------------------------------------------
Some 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.
[zelda3_pcb] 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 M
emory Address Decoder which arbitrates access to the ROM/RAM^[2]^[3].
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.
[SNES]
Enhancement processors: SA-1
---------------------------------------------------------------------
The "Super Accelerator 1" is the MVP of the Enhancement Chips.
Included in 34 carts^[4], 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^[5].
[sa1_pcb] Source (snescentral.com). Super Mario RPG PCB
Above, a Mario RPG PCB. 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^[6]. 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^[7]
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^[8].
SA-1 enthusiasts further demonstrated the performance difference. The
video below compares execution of sort algorithms using a LoRom (the
cheapest cart to manufacture), a HiRom (a cart with faster ROM
resulting in fewer wait-state inserted when the CPU accesses the
bus), and a SA-1.
The SA-1 has also been used by the retro-gaming community to improve
the game-play of past games suffering slowdown. Amazing projects such
as Eliminating slowdown in Super Mario World, Gradius III slowdown
removal (took three months of work^[9]) and Contra III slowdown
removal^[10] are works of beauty. Even Super Mario World^[11] 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^[12].
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"^[13]. 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^[14].
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^[15]
. 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^[16]
[cx4_pcb] Source (snescentral.com). Mega Man X2 PCB
Above, the Mega Man X2 PCB. 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-DD1
---------------------------------------------------------------------
The DD1 is a sprite decompression chip, able to feed picture
processing unit VRAM directly (and a little bit more^[17]). 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^[18]. It turned out the problem was transferring sound
samples to the DSP RAM.
[dd1_pcb] 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-1
---------------------------------------------------------------------
The series of DSP chips supports nineteen titles. The DSP-1 accounts
for sixteen of them, in particular classics like Super Mario Kart and
Pilotwings^[19]
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^[20]. 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^[21]
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^[22].
[dsp_pcb] Source (snescentral.com). Super Mario Kart PCB
Above, a packed Mario Kart PCB which leverages every component we
learned about so far. 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^[23]).
Enhancement processors: DSP-2
---------------------------------------------------------------------
Used 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-3
---------------------------------------------------------------------
Used in a single game (SD Gundam GX).
Enhancement processors: DSP-4
---------------------------------------------------------------------
Used in two games (Top Gear 3000 and The Planet's Champ TG 3000).
Enhancement processors: OBC-1
---------------------------------------------------------------------
The 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^[24]
[obc1_pcb] Source (snescentral.com). Metal Combat: Falcon's Revenge
PCB
In Metal Combat's PCB we find the OBC1 in U4. There is a CIC in U6,
an address decoder MAD-1 in U5, the game assets ROM are in U1 and U2,
the 8KiB SRAM to save games is in U3, and finally the battery to
power the SRAM is in the upper left.
Enhancement processors: S-RTC
---------------------------------------------------------------------
S-RTC is a chip to keep track of real-clock time used in a single
title, Daikaijuu Monogatari II. It is unclear why Hudson Soft
developers needed to keep track of real-time. Perhaps to display it
to players?
[srtc_pcb] Source (snescentral.com). Daikaijuu Monogatari II PCB
CIC in U6, S-RTC in U5, MAD-1 in U4, Lots of ROM in U1 and U2, 8 KiB
SRAM for savegames in U3, and the battery to power it in the upper
left.
Enhancement processors: SPC7110
---------------------------------------------------------------------
A data decompression chip by Epson, used in three games: Tengai
Makyou Zero, Momotaro Dentetsu Happy, and Super Power League 4 which
also has real-time clock capability.
[spc7110_pcb] Source (snescentral.com). Tengai Makyou Zero PCB
A novelty above is the R1513 in U5 which protects the SRAM from
voltage spikes when the power is turned on and off. The SRAM is
actually in U3 (8KiB), the CIC (F411B) is in U7, two huge ROM are in
U1 and U2. Finally, the SPC7110 is in u4.
Enhancement processor: ST-010
---------------------------------------------------------------------
The ST series of chips from SETA Corporation were reportedly aimed at
improving game AI. The ST-010 was used in a single game (Exhaust Heat
2 - F1 Driver he no Kiseki)^[25]
[st010_pcb] Source (snescentral.com). "Exhaust Heat 2" PCB
The CIC (D411A) is in U4. We find the ROM in U1, the ST010 is in U2,
notice the X1 22Mhz oscillator to clock it. Finally, a novelty is the
74LS139 in U4 which is like a MAD-1 address decoder.
Enhancement processor: ST-011
---------------------------------------------------------------------
Also used in a single game, Hayazashi Nidan: Morita Shougi^[26]
Enhancement processor: ST-018
---------------------------------------------------------------------
Used only in Hayazashi Nidan Morita Shougi 2. It seems to be an ARM
CPU with internal ROM containing its instructions^[27].
Enhancement processors: Super GFX-GSU1
---------------------------------------------------------------------
The GSU-1 was used in five games (Star Fox, Stunt Race FX, Vortex,
Dirt Racer, and Dirt Trax FX. Of all the Enhancement chips, it is the
most documented with wikis, tutorials^[28] and the Super Nintendo
Developer Manual Book II^[29].
Clocked at 10.74 MHz (master clock 21.47 MHz, halved internally), it
is able to run without starving the SNES CPU thanks to an internal
512 byte instruction cache^[30]. After it is done working on its
task, it can interrupt the console's CPU (C-CPU).
While the SNES PPU1/PPU2 are tilemap/sprite oriented, the Super-GFX
excels at rendering pixels and rasterizing polygons. It usually
renders into a framebuffer located on the cart. The content of the
framebuffer is transferred to the VRAM during VSYNC^[31].
[gsu1_pcb] Source (snescentral.com). Star Fox PCB
In the PCB above, we see the GSU-1 (the M.A.R.I.O, Mathematical,
Argonaut, Rotation, Input/Output) chip in U3, a CIC in U5, 74LS139
(the equivalent of a MAD-1) in U4, the game code and assets in the U1
ROM. The odity is that we find SRAM in U2 ....but no battery to power
it when the console is turned off. That is because the (256/8 = 32
KiB) SRAM is "partially dedicated for SuperFX framebuffer storage"^
[32].
Like the SA-1, the SNES community is investing time in the GSU-1 via
projects such as the Project Super FX^[33] to improve past titles as
much as possible.
Enhancement processors: Super GFX-GSU2
---------------------------------------------------------------------
The GSU-2 is a GSU-1 running at full speed, a.k.a 21.47 MHz. It was
used in three games Super Mario World 2: Yoshi's Island, DOOM, and
Winter Gold.
The power gain from not having its clock halved is demonstrated by
(once again) enthusiasts who swapped the GSU-1 for a GSU-2 on a Star
Fox cart.
The author of DOOM for SNES, Randy Linden, did not have access to any
documentation about the GSU chip or even DOOM source code. He reverse
engineered all of it^[34]. Randy did a superb job since this is the
only console port able to use the PC levels (other consoles had to
simplify the geometry).
[gsu2_pcb] Source (snescentral.com). Super Mario World 2: Yoshi's
Island PCB
Super Mario World 2 uses the GSU-2 mostly for sprite scaling and
stretching (sprites are manipulated and written back into the PPU
VRAM^[35]). See for example, Yohshi's Island rolling boulder
sequence.
This PCB has a battery so the SRAM is used for both hosting the
framebuffer and save game state. Oddly, we find an X1 oscillator
which should not have been necessary since the GSU-2 could have used
the Master Clock. Could it be a voltage issues^[36]
Of course the SNES community has tinkered with GSU-2 titles. DOOM,
the most polygons heavy title, was overclocked to 32Mhz which
increased the framerate from 10-11 to 14-15 fps^[37].
Enhancement processors vs Emulator community
---------------------------------------------------------------------
If EC greatly improved the player experience and reduced the cost for
publishers, they would become a thorn in the side of emulator authors
in later years. Some games, relying on peculiar ECs, were only
properly emulated in 2012^[38]!
In the early days, games such as SF2 Alpha were "emulated" by
requiring pre-decompressed sprites "graphic packs" since the
internals of the DD1 were unknown.
Great effort went into reverse engineering. Some of the chips had
hard-coded functions requiring de-capping. Some (like the ARM based
ones) had internal ROM storing their instructions. These require
emulators to be provided a BIOS file^[39]).
Even as of 2020, the emulation of some of the most obscure chips has
still not been completed^[40].
References
---------------------------------------------------------------------
Estimating based on zip size was a bad idea. A better way
^ [ 1] would be to unzip, and count zero byte padding at the end of
the file. I will update asap.
^ [ 2] The SNES Cartridge, Briefly Explained
^ [ 3] MAD-1 pins
^ [ 4] List of games using the SA-1 chip
^ [ 5] SA-1 (wikipedia)
^ [ 6] Super Nintendo Developer Manual Book II: SA-1
^ [ 7] Super Nintendo Developer Manual Book II: SA-1 1.1.2
^ [ 8] The SA-1 Demo cartridge has been dumped
^ [ 9] The SA-1 Collection Project
^ [10] Contra III Slowdown Removal
^ [11] Eliminating slowdown in Super Mario World
^ [12] 28 years later, hacker fixes rampant slowdown on SNES' Gradius
III
^ [13] Super Nintendo Developer Manual Book II: SA-1 1.1.4
^ [14] The SA-1 Collection Project
^ [15] Capcom Cx4 - Hitachi HG51B169
^ [16] How does Capcom's CX4 chip compare to the Super FX chip?
^ [17] CS-DD1
^ [18] A closer look at Street Fighter Alpha 2 on the Super Nintendo
^ [19] Games that use DSP1 / 1A / 1B
^ [20] Super Nintendo Developer Manual Book II: DPS-1
^ [21] DSP1 DR Register
^ [22] DSP-1 command summary
^ [23] Today's weird discovery
^ [24] metal combat chip (OBC-1) question
^ [25] ST010
^ [26] ST011
^ [27] It appears I was able to dump the ST-0018 program ROM
^ [28] Super NES Programming/Super FX tutorial
^ [29] Super Nintendo Developer Manual Book II: Super-FX
^ [30] SNES GSU-1 Theory of Operation
^ [31] Super FX FAQ
^ [32] Star Fox SHVC-1C0N5S-01 information page
^ [33] It's time to push SNES to the limits
^ [34] Game Engine Black Book: DOOM
^ [35] Could the Super FX 1 Chip Scale sprites?
^ [36] SuperFX GSU-1/GSU-2 pinout
^ [37] Doom SNES 32MHz overclock
^ [38] It appears I was able to dump the ST-0018 program ROM
^ [39] Why does the 'Mesen-S' SNES emulator require a separate DSP
ROM
^ [40] Mesen-S - SNES Emulator, SPC-7110 emulation
---------------------------------------------------------------------
*