Why Do NES Games Flicker - A Visual Explanation

Pixel closeup of NES Batman, and MOS 6502 chip

While playing recently on my NES, I saw game characters start to flicker, and it reminded me how much things have changed since the 80s. Vintage hardware had real limitations, and creative workarounds led to some familiar behaviors, like “sprite flicker” where characters sometimes flash quickly - a clever solution to maxing out the system’s abilities.

When playing the NES, game characters sometimes flicker. Why? It’s called “sprite flicker,” and nothing’s wrong with your NES. Part of retro gaming’s charm is the quirks of early technology. In this case, the limited ability of the PPU (Picture Processing Unit). See why flicker happens.

Table of Contents

Looking back from the present-day at retro gaming experiences can be a little confusing at times, because we’re just so used to holding full color, advanced computing devices in our hands, and that seems normal to us. We forget that back in the day, even though the systems seemed terribly cutting edge at the time (Play GAMES! On your TV! At home, not the arcade!), the reality was that video game makers creating systems and cartridges for the home market were pushing the edges of what could be done. They had to juggle performance and cost, since there just was not a big market for highly capable, arcade-level experiences in the home, that necessarily cost a ton of money. In order to bring fun and affordable gaming to the masses, they had to cleverly create fun on cheap hardware that normal people could buy.

Please note that this explanation needs to get into a fair bit of geeky tech, but it’s all carefully explained for regular folk. If you don’t want all the foundational stuff, feel free to jump down to “OK, So What Exactly is a Video Game Sprite?

The Power of Retro 8-Bit Machines!

The NES was built around a processor (the main chip, or “brain” of the system) called the MOS 6502. Introduced in 1975, it drove the explosion of home computers and video game systems that happened in the late 70s and into the 80s. It was the heart of not only the NES, but the Atari 2600, the Apple II, and the Commodore 64 (it was in Commodore’s VIC-20 and PET computers as well). The 6502 was so popular because it was at a sweet spot of price and performance, coming in at less that 1/6 the cost of similar chips from other makers, according to Wikipedia.

The famous MOS 6502 microprocessor chip
This is actually the 6502 out of my Commodore VIC-20. The 6502 in the NES is not labeled as a MOS 6502.

As snazzy as the 6502 was at the time, it is an 8-bit processor (also referred to as 8-bit chip), and was the reason these were called 8-bit machines. I know this term “8-bit” is commonly thrown around, so now’s a great time to get a quick understanding of why.

Computers speak “binary”, that is, just 1s and 0s. Each 1 or 0 is called a “bit.” So information is stored, moved, and processed in bits. In normal (decimal) counting, the “columns” in a multi-digit number go: ones, tens, hundreds, thousands, etc… so that 57 is 7 ones, and 5 tens. Each place moving toward the left has a value of 10 TIMES MORE than the one to its right. In binary, each column is only TWO TIMES MORE than the one to its left, so it’s 1s, 2s, 4s, 8s, 16s, etc. So 8 bits all set to a value of 1 looks like 11111111, and is actually 255 in our normal decimal counting system (1 one, 1 two, 1 four, 1 eight, 1 sixteen, 1 thirty-two, 1 sixty-four, and 1 one-hundred-twenty-eight = 255). An 8-bit processor can move things around for processing in 8-bit chunks - that it is can only work with chunks whose value ranges between 0 and 255, or 256 different values (counting 0 as one of them).

A series of 8 bits is also referred to as a byte. More on that in a second.

The NES PPU, and Limited Memory

By comparison, my current phone, a Samsung Galaxy S7 has a 64-bit chip, with 8 different cores in it (as opposed to the 1 core the 6502 had). It’s also a LOT faster, with 4 cores running at 2,300,000,000 (2 billion, 300 million) cycles per second and 4 cores running at 1,600,000,000 (one billion, 600 million) cycles per second. By contrast, the 6502 in the NES runs a single core at 1,790,000 (one million, seven hundred ninety thousand) cycles per second. So the NES ran a LOT slower, only had one core, and had to move data around in 8-bit chunks (values between 0 - 255), versus a not-even-current mobile phone of today, which in addition to its speed and 8 cores working together at the same time, moves data around in 64-bit chunks (values between 0 - 18,446,744,073,709,551,616 - that’s eighteen quintillion, four hundred forty six quadrillion, seven hundred forty four trillion, seventy three billion, seven hundred nine million, five hundred fifty one thousand, six hundred sixteen). That’s a lot less getting done with each pass back in the 8-bit day.

Now not only were processors pricey, but memory (RAM, or Random Access Memory) was too. That meant the graphics processor in the NES (the Picture Processing Unit, or PPU) had a total working area (complete RAM capacity) of 2K, or 2 Kilobytes, or 2,000 bytes.

The NES PPU chip
This is the bottom of the circuit board out of my NES console. The PPU is the chip outlined in red. BONUS: The actual NES 6502 chip is the one outlined in yellow.

To envision that, understand that a single character of text - just one letter - normally uses 1 byte. Look at this snippet from the first page of H.G. Wells’ War of the Worlds to see how ridiculously short 2K really is.

OK, So What Exactly is a Video Game Sprite?

Wikipedia says that the term “sprite” was first used in reference to computer graphics at Texas Instruments. Following in the longstanding tradition of embedding fantasy literature concepts into computers (a byproduct of geek culture, apparently), an engineer used the term “sprite” to refer to a separate bit of image information that was able to float around on top of the main screen image, independently from the background. This means that to make something move onscreen, these independent, small image pieces could be used very efficiently, instead of having to redraw everything on the screen for each frame of animation. Efficiency means performance, which means better gaming.

As for the fantasy lit connection, sprites are mythical creatures akin to fairies. The conceptual tie-in to something small that magically floats around within a scene makes sense, then. Now you know, and can impress your friends.

Famous fairies

How Many Sprites Can Dance on the Head of an NES PPU?

But wait - there’s less! While the NES Picture Processing Unit has a total of 2K (2,046 to be exact) bytes of RAM, it only has 256 bytes of storage for sprites - the little graphic pieces used to make our animated onscreen items. Now look at this chopped bit of the above War of the Worlds text to see how much 256 bytes is, if 1 letter is 1 byte. Yikes. That’s not much. In the game world, it meant 64 8X8 pixel sprite graphics - the top left quadrant separated out here from this Super Mario sprite sheet:

64 sprites from the Super Mario Bros game
The upper left quadrant (outlined in green) shows 64 sprites from Super Mario Bros (NES). Note how they look jumbled, because they are only pieces. It takes 8 sprites to make Mario (see below).

While the PPU will hold 64 sprites, it is further limited by the fact that only 8 sprites can exist on a TV scanline together, due to how the memory space is set up. A scanline is a horizontal line of pixels in the full screen image the NES sends to the TV.

CRT closeup showing scanlines
Green indicators show individual horizontal scanlines in Batman for the NES.

Keep in mind that a sprite and an onscreen character are not at all the same thing. Sprites are 8-pixel-by-8-pixel graphical pieces that can be animated and separately floated “in front of” the background. A good example to demonstrate the distinction is that Mario, from Super Mario Bros is 16 pixels wide, by 32 pixels tall, requiring a total of 8 sprites to put him onscreen. Feeling the squeeze yet?

Mario separated out to show 8 sprites, and individual pixels
Dark lines divide up the eight 8 pixel X 8 pixel sprites, and light lines divide up the individual pixels making up the sprites.

So then, since Mario is 2 sprites wide, any given scanline he’s on will already have 2 sprites on it. Add in some other animated sprites, and you’ll quickly hit your ceiling of 8-to-a-scanline.

Crowded Sprites Have to Take Turns

The hardware can’t show anything beyond 8 sprites to a scanline, so it doesn’t. However, if game developers just let this happen, your character, a bad guy, or some portion thereof would just disappear. Poof. He’s still there, but totally invisible. Obviously, this would create serious play problems, so clever video game programmers came up with a compromise. They keep track of all the sprites that should show on a given scanline, and trade off between them:

  • FRAME 1: show sprites 1-8 of 10
  • FRAME 2: show sprites 2-9 of 10
  • FRAME 3: show sprites 3-10 of 10
  • FRAME 4: show sprites 1 & 4-10 of 10
  • FRAME 5: show sprites 1-2 & 5-10 of 10
Diagram of rolling sprite visibility when there are more than the 8 maximum
Blocks 1-10 across each row represent the total number of sprites, with the orange outline indicating the 8 sprites the PPU is showing during that frame. Each row of blocks represents a frame of our 5 frames of animation. You can clearly see how this “shifting” of which sprites show and which don’t creates a rolling blackout, which is the flicker you see.

This way, the sprites that are left invisible keep changing, so you have a kind of rolling blackout of 2 sprites (in this instance of 10 sharing a scanline) for each frame of onscreen animation, instead of a total blackout on anything beyond 8. The result is the familiar shimmering flicker you’ve seen.

Next time you play, notice when sprites crossing into busy scanlines starts things flickering. Notice how flickering gets heavier as a scanline gets busier, and the list of sprites beyond 8 grows. Note that this heavy flicker only occurs in some special cases, since game developers were very careful to minimize flicker as much as possible. It’s not an optimal behavior, and makes the simulated reality break down, feeling less solid. Note also how games will often keep sprites separated from each other, so they don’t share scanlines - like the animated items on different platforms on the same screen in a “platformer” game like Super Mario Bros.

Now you understand the limitation, and the inventive smoke-and-mirrors tricks used to hide them. Happy gaming!