Super Nintendo Architecture

A practical analysis by Rodrigo Copetti

Classic edition - Last updated: August 10, 2022

Languages available: 🇬🇧 - English, 👋 - Add translation


About this edition

The ‘classic’ edition is an alternative version to the ‘modern’ counterpart. It doesn‘t require Javascript, state-of-the-art CSS or convoluted HTML to work, which makes it ideal for readers who use accessibility tools or legacy internet browsers. On the other hand, eBook users can now check the eBook edition.

This edition is identical content-wise. However, interactive widgets have been simplified to work with pure HTML, though these will offer an link to the original article in case the reader wants to try the ‘full version’.

As always, this article is available on Github to enable readers to report mistakes or propose changes. There‘s also a supporting reading list available to help understand the series. The author also accepts donations to help improve the quality of current articles and upcoming ones.


Table of Contents

  1. Supporting imagery
  2. A quick introduction
  3. CPU
    1. Ricoh’s additions
      1. Segmentation Fault
  4. Graphics
    1. Design
    2. Organising the content
    3. Constructing the frame
      1. Tiles
      2. Background
      3. Modes
      4. Tiles
      5. Result
    4. Unique features
    5. A convenient video out
  5. Audio
    1. Pitch control
    2. Evolution from the NES
    3. Advanced usage
    4. Stereo confusion
  6. Games
    1. Expansion
    2. Recognisable behaviour
  7. Anti-piracy / Region Lock
  8. That’s all folks
  9. Referencing
  10. Sources / Keep Reading
  11. Contributing
  12. Changelog

Supporting imagery

Model

Image
The Super Nintendo (in Europe) or Super Famicom (in Japan).
Released on 21/11/1990 in Japan and 11/04/1992 in Europe.
Image
The Super Nintendo.
Released on 13/08/1991 in America.

Motherboard

Image
Motherboard
Showing revision 'SNS-RGB-CPU-01'.
Earlier revisions had the Sound Subsystem connected as a daughterboard, later ones unified both PPUs.
Image
Motherboard with important parts labelled

Diagram

Image
Main architecture diagram
Bus 'A' and 'B' are address buses, the data bus follows the trail of bus 'B' and it's 8 bits wide.

A quick introduction

Nintendo managed to bring the next generation of graphics and sounds without using expensive off-the-shelf components. Consequently, the Super Nintendo was designed with expandability in mind: In a world where CPUs are evolving faster than the speed of light, Nintendo depended on game cartridges to make its console shine.


CPU

The main processor is a Ricoh 5A22. It’s based on the Western 65C816, a 16-bit upgrade of the classic MOS Technology 6502. Since the SNES shares the same foundation as the NES’ CPU, there’s a slight possibility that the SNES was originally planned to be compatible with NES games.

The CPU employs a variable clock speed that will reach up to 3.58 MHz during register operations and down to 1.79 MHz when accessing slow external buses (i.e. the serial/controller port).

In summary, the 5A22 features:

Ricoh’s additions

Apart from the extra registers, Ricoh customised the core design to include two exclusive DMAs (Direct Memory Access) that enable to move data around without the intervention of the CPU (resulting in faster speeds).

For this design to work, regions of memory are referenced using two different address buses [2]:

When a DMA is being set up, the origin must come from a different bus than the destination.

There are two DMAs to choose from depending on the needs [3]:

The system provides eight channels to set up DMA transfers, thus enabling to dispatch up to eight independent transfers at once.

Segmentation Fault

This console also features a special ‘anomaly’ called Open Bus: If there is an instruction trying to read from an unmapped/invalid address, the last value read is supplied instead (the CPU stores this value in a register called Memory Data Register or MDR).

I guess this is Ricoh’s way of applying the popular ‘keep calm and carry on’ philosophy whenever the program reaches the unexpected. After all, from the user’s perspective, carrying on with the execution can be more favourable than a crash… at the expense of the game becoming unpredictable.


Graphics

Before we go in-depth I strongly recommend reading the NES article first since it introduces useful concepts that will be revisited here.

Design

Nintendo improved their previous architecture by using two different PPU chips to build the graphics sub-system, both combined are known as Super PPU or ‘S-PPU’.

The system outputs a standard resolution of 256x224 [4]. PAL systems output 256×240, however, most games don’t use the extra pixels and show a letterbox (black lines) instead.

Overall, both PPU packages are designed to serve different functionality [5]:

This separation, from the programming point of view, is unnecessary since both chips are virtually treated as one.

Organising the content

Image
Memory architecture of the S-PPU.

Graphics data is distributed across three regions of memory:

Constructing the frame

For demonstration purposes, Super Mario World will be used to show how graphics are rendered.

Tiles

Image
Some 16x16 Tiles found in VRAM.

Just like its predecessor, the S-PPU uses tiles to build sophisticated graphics. Although, there are significant improvements compared to the original PPU:

Background

Image
Background Layer (BG1).
Image
Background Layer (BG2).
Image
Background Layer (BG3).
Background maps in VRAM.
Image
Rendered Background Layer (BG1).
Image
Rendered Background Layer (BG2).
Image
Rendered Background Layer (BG3).
Image
Rendered Background Layers combined.
Rendered Background layers after selection and transparency are applied.

The Super Nintendo can generate up to four different background planes. Using either 8x8 or 16x16 tiles, blocks will take up to 32x32 pixels (2x2 tiles). That being said, the size of each background layer can be up to 1024x1024 pixels wide (32x32 tiles). The region in VRAM where these layers are configured is called Tilemap and is structured as a table (continuous values in memory).

Each entry in the Tilemap contains the following attributes:

As always, these planes are scrollable, though the number of features available (colour, number of layers, independent scrolling region and size of selection) will depend on the Background mode selected.

Modes

This system provides eight background modes to choose from, each one provides a different set of features [6]:

As you can see, programmers now have the choice to prioritize either the number of colours, layers, effects or resolution of the selected area.

Tiles

Image
Rendered Sprite layer.

An area on memory called Object Attribute Memory (OAM) stores a table with references of up to 128 sprites with these properties [7]:

The S-PPU can draw up to 32 sprites per scan-line (overflowing this will only make it discard the ones with the lowest priority).

Result

Image
Tada!

The S-PPU draws each scan-line on-the-fly by first processing the respective portion of each layer and then mixing them together.

One of the main constraints of NES games was the fact that they could only update their graphics during V-Blank, the moment from which the CRT’s beam was returning to the starting point provided with a reasonable time frame to reshuffle some tiles without breaking the image.

Well, now thanks to the new capabilities of the SNES, this limitation gained a different meaning.

You see, because DMA/HDMA allows performing memory transfers without waiting for V-Scan [8], games can now update tiles, colours and registers without waiting for the whole frame to be drawn. However, we can think beyond that: Since games can now change the S-PPU settings during mid-frame, this means that it’s possible to activate different background modes at different stages of the same frame, opening the door to new and original game designs!

Unique features

Truth to be told, I still haven’t mentioned the most important characteristic of this console…

Image
Rendered Background layer.
Image
Allocated Background map.
Image
Rendered frame on the screen.
The first quarter of scan-lines use another mode to simulate distance, Mode 7 starts at the second quarter (this is possible thanks to HDMA).
F-Zero (1990).

Introducing Mode 7, yet another background mode, but this time, with a completely different way of working. While it can only render a single 8bpp background layer, it provides the exclusive ability to apply the following affine transformations on that plane [9]:

The S-PPU uses a rotation matrix to control the parameters of this mode. I won’t go into the math here, but depending on the desired effect, the CPU will have to perform some trigonometric functions (sine and cosine) to fill the entries of this table accordingly. This is really expensive for the 65C816, even with the use of fixed-point math. Luckily, with the 5A22, Ricoh added multiplication and division registers to offload some cycles.

By the way, notice that the list of transformations doesn’t mention perspective, which is what you see in the example game (F-Zero). This is achieved by altering the rotation matrix at each HDMA call, creating a pseudo-3D effect in the process.

Finally, due to the high number of calculations needed, the memory map is changed to optimise the pipeline of the two PPUs, the first one processes the Tilemap (where tiles are referenced) while the other fetches the Tileset (where tiles are stored).

A convenient video out

All of the aforementioned advancements will be futile unless the console sends the picture to the TV in a format both can understand. With the Super Nintendo, the company debuted some sort of universal-but-proprietary connection called Multi Out which can transport many types of signals at the same time, including Composite, S-Video and RGB [10].

Along with the console, Nintendo included a ‘Multi Out to composite’ cable since that was pretty much the common denominator of TVs back then. In Europe however, the SCART port was also very popular as many set-top boxes and VCRs relied on it. A great thing about SCART is that it can also carry many types of signals, this enables AV equipment to use the most optimal signal type without encountering compatibility issues. Unfortunately, Nintendo never shipped an official SCART cable that took advantage of the RGB pins exposed in the Super Nintendo.

Nonetheless, Nintendo altered the pinout of its PAL consoles to comply with the SCART protocol, and in doing so it replaced the ‘composite sync’ signal for a 12 Volts one (which tells the TV to set the 4:3 aspect ratio). So, even though Multi out is ‘universal’, the resulting RGB cables, if any, are region-specific.

I think the real benefits of Multi Out started to become evident during present times, as it allowed users to take advantage of the RGB signal with their state-of-the-art tellies without tampering with the internals of this console. Although, unlike composite and S-Video, RGB requires an extra ‘sync’ signal. For this, the cable can be wired up to capture the sync signal from composite or s-video; or for best results, use a dedicated sync line called ‘composite sync’. But, as mentioned in the previous paragraph, only NTSC consoles carried the latter.


Audio

This console provided some unique audio capabilities thanks to a dedicated set of chips designed by no other than Sony. The most important components of the audio subsystem are:

This sub-system functions independently: When the console is turned on, the SPC700 boots a 64-byte internal ROM that enables it to receive commands from the main CPU [12]. After that, it stays idle.

Channels used for melody.
Drums are discriminated for demonstration purposes.
All audio channels.
StarFox (1993).

In order for the S-SMP to start doing some useful work, it needs to load a type of program called Sound Driver. The latter instructs the chip on how to manipulate the raw audio data that the main CPU sends to PSRAM. The driver also directs how to command the S-DSP.

As you can see, the sound subsystem was a huge advancement compared to the previous generation, but it was challenging to program as well. The documentation that Nintendo provided was notably known for including unintelligible sections and skipping important features altogether, so it was up to the programmers to carry out their own research.

As a consequence, there were tons of different sound drivers found on the market [13], and some of them ended up uncovering impressive features. The flexibility that this system allowed meant that programmers could make their soundtrack shine or fade into oblivion…

Pitch control

Pitch modulation enabled to play different notes using the same sample, the S-SMP also included a useful bender to alter the pitch in a smooth manner. Take a look at this extracted channel from Mother 2/Earthbound, both examples come from the original soundtrack, however, the first one has the pitch control disabled.

No pitch bend.
With pitch bend enabled.

Evolution from the NES

In order to demonstrate the evolution of sounds from the NES to the Super NES, here are two music scores, one from a NES game and another from its Super NES sequel. Both used the same composition:

Mother (1989).
Mother 2/Earthbound (1994).

Advanced usage

Channels used for melody.
Drums are discriminated for demonstration purposes.
All audio channels.
Kirby’s Dream Land 3 (1997).

Here’s a more instrument-rich composition that takes great advantage of pitch modulation, echo and envelope.

This combination of techniques allowed the music to only require five channels in total, leaving the other three for sound effects.

Stereo confusion

The DSP’s volume controls are organised in chunks of 8-bits signed values [14], this means that the volume can be set up with negative values. But hang on, if ‘0’ means mute, what would a number like ‘-1’ do? Well, it will invert the signal.

This is notably used for creating a special surrounding effect, which is accomplished by setting the stereo channels to output out of phase (one channel outputs the normal signal and the other outputs the same signal but inverted).

Unfortunately, abusing this feature results in very unpleasant results (e.g. the feeling that the music is coming from inside your head), so you will notice that most SNES emulators just skip this setting altogether.

Additionally, out-of-phase stereo gets cancelled out on mono devices, so games included a ‘stereo-mono’ selector to avoid muting their own soundtrack.


Games

Overall, games are written in 65816 assembly and when it comes to designing the cartridge, there are two ways of electrically connecting the address pins between the ROM and the CPU [15]:

Expansion

The modular architecture of the Super Nintendo allows for numerous types of Enhancement chips that are included on cartridges and provide extra features such as the ‘SuperFX’ for 3D polygon composition or the ‘SA-1’ for co-processing, some of these chips complemented already complex functions like Mode 7 (which allowed to transform the background but not the sprites).

Recognisable behaviour

Have you ever wondered what causes games to lag? When the V-Blank interrupt is called to allow graphics update, sometimes the game is still executing some heavy code and skips the V-Blank window, graphics can’t be updated until the next V-Blank call and since the frame wasn’t updated, this is manifested as a drop in frame-rate. It can also happen the other way around, extensive processing during a V-Blank won’t allow the PPU to output the video signal (as the bus is blocked). Thus, black lines during a scan will be shown, although this is barely noticeable since the frames update 50 or 60 times per second.


Anti-piracy / Region Lock

Cartridges are physically different between regions, so they won’t fit on consoles from different regions. This was addressed by using third-party adapters.

This console, like the NES, still incorporates the 10NES system, which locks any non-authorised distributors. This was cracked when the CIC chip was successfully cloned.

To protect against bootleg cartridges, games also included a chain of piracy checks:

  1. Comparing the SRAM size (bootlegs normally include a bigger size to fit any game).
  2. A series of checksums on the code that check if the previous check was removed. These checks would be dispersed at different stages of the game, so they’d be difficult to find.

This could be defeated by manually removing these routines but would take a long time to find all of them. After all, they would be scattered around the game only to upset the player (and hopefully make them buy a legitimate copy…). Truth to be told, you’ll notice that most ROMs surfing the internet had all their piracy checks removed.


That’s all folks

Image
My modded SNES with an American cartridge.
That game was only released in the states. Luckily, a lad was selling it in Glasgow!

Contributing

This article is part of the Architecture of Consoles series. If you found it interesting then please consider donating. Your contribution will be used to fund the purchase of tools and resources that will help me to improve the quality of existing articles and upcoming ones.

Donate with PayPal
Become a Patreon

You can also buy the eBook edition in English. I treat profits as donations.

Image

A list of desirable tools and latest acquisitions for this article are tracked in here:

Interesting hardware to get (ordered by priority)

Acquired tools used

Alternatively, you can help out by suggesting changes and/or adding translations.


Copyright and permissions

This work is licensed under a Creative Commons Attribution 4.0 International License. You may use it for your work at no cost, even for commercial purposes. But you have to respect the license and reference the article properly. Please take a look at the following guidelines and permissions:

Article information and referencing

For any referencing style, you can use the following information:

For instance, to use with BibTeX:

@misc{copetti-snes,
    url = {https://classic.copetti.org/writings/consoles/super-nintendo/},
    title = {Super Nintendo Architecture - A Practical Analysis},
    author = {{Rodrigo Copetti}},
    year = {2019}
}

or a IEEE style citation:

[1]R. Copetti, "Super Nintendo Architecture - A Practical Analysis", Copetti.org, 2019. [Online]. Available: https://classic.copetti.org/writings/consoles/super-nintendo/. [Accessed: day- month- year].

Special use in multimedia (Youtube, Twitch, etc)

I only ask that you at least state the author’s name, the title of the article and the URL of the article, using any style of choice.

You don’t have to include all the information in the same place if it’s not feasible. For instance, if you use the article’s imagery in a Youtube video, you may state either the author’s name or URL of the article at the bottom of the image, and then include the complete reference in the video description. In other words, for any resource used from this website, let your viewers know where it originates from.

This is a very nice example because the channel shows this website directly and their viewers know where to find it. In fact, I was so impressed with their content and commentary that I gave them an interview 🙂.

Appreciated additions

If this article has significantly contributed to your work, I would appreciate it if you could dedicate an acknowledgement section, just like I do with the people and communities that helped me.

This is of course optional and beyond the requirements of the CC license, but I think it’s a nice detail that makes us, the random authors on the net, feel part of something bigger.

Third-party publishing

If you are interested in publishing this article on a third-party website, please get in touch.

If you have translated an article and wish to publish it on a third-party website, I tend to be open about it, but please contact me first.


Sources / Keep Reading

Audio

CPU

Games

Graphics

Photography


Changelog

It's always nice to keep a record of changes.

2021-07-10

2020-09-23

2020-08-23

2019-12-08

2019-10-28

2019-09-17

2019-09-01

2019-08-29

2019-06-28