The patterns

A pattern is something games keep doing. Each one here is found by a rule over what the code did while it ran, never by what its bytes look like, and when the evidence is not there nothing is named.

Read the counts with care. The sound driver and the picture writer are found in every game because their rules pick the routine that did the most of it, and there is always one. The others are found only where the evidence was.

The poll

The routine that reads the controller. We name it by what it did: it read the pad's port at least eight times, once for each button, in every frame it ran.

Found in all 19 games, 40 routines.

Shown in a cartridge of our own, where the same rule finds it: A jump that feels like Mario's, Running, and why a running jump goes higher, A stomp and a hit, told apart the way Mario does, A box inside the picture, the way Mario's is, Ground, a block and a wall, solid the way Mario's are, A moving platform that carries you, the way Mario's lifts do, A coin from a block and the score, the way Mario's are, Walkers that turn at walls and at each other, the way Mario's Goombas do, A picture that scrolls the way Mario's does, The camera's dead zone, the way Mario's is, Rooms that slide in the way Zelda's do, One byte chooses the screen, the way Mario's does, A status bar that stays still, the way Mario's does, Too many sprites on a line flicker rather than vanish, the way Mario's do, A title drawn into the level, the way Mario's is, A name typed from a grid, the way Zelda's is, A pause that holds the world still, the way Mario's does, Losing a life and starting again, the way Mario does, The level's end, the way Mario's is, Falling into a hole, the way Mario does, The last life, and what comes after it, the way Mario does, An item screen the picture slides away to show, the way Zelda's does, A jump sound that borrows the music's channel, the way Mario's does

The idle spin

One instruction that jumps to itself. The main program has nothing to do until the next frame, and this is where it waits.

Found in 4 of the 19 games, 4 routines:

The counting spin

A few instructions in a circle with no way out, that do nothing but change one byte of memory. The main program sits here between frames, as it does in an idle spin, and the byte is as good as a random number to anything that reads it, because how far it got depends on how long the frame's work took.

Found in 4 of the 19 games, 4 routines:

The game inside the interrupt

When the main program only spins, the whole game runs in the handler of the interrupt the picture chip raises once a frame. We name that handler when there is an idle spin or a counting spin and the handler ran in at least half the frames.

Found in 8 of the 19 games, 8 routines:

The wait for the frame

A loop that only reads a byte of memory and tests it, over and over. Nothing in the loop can change that byte, so the game stays there until the interrupt the picture chip raises once a frame changes it. We name the loop when that interrupt's handler, or a routine the handler calls, wrote the byte. A game may wait like this in several places, on a flag or on a counter the handler runs down, and some do a small chore on each turn of the wait.

Found in 13 of the 19 games, 49 routines:

Shown in a cartridge of our own, where the same rule finds it: A jump that feels like Mario's, Running, and why a running jump goes higher, A stomp and a hit, told apart the way Mario does, A box inside the picture, the way Mario's is, Ground, a block and a wall, solid the way Mario's are, A moving platform that carries you, the way Mario's lifts do, A coin from a block and the score, the way Mario's are, Walkers that turn at walls and at each other, the way Mario's Goombas do, A picture that scrolls the way Mario's does, The camera's dead zone, the way Mario's is, Rooms that slide in the way Zelda's do, One byte chooses the screen, the way Mario's does, A status bar that stays still, the way Mario's does, Too many sprites on a line flicker rather than vanish, the way Mario's do, A splash screen that moves without drawing, the way Zelda's does, A title drawn into the level, the way Mario's is, A name typed from a grid, the way Zelda's is, A pause that holds the world still, the way Mario's does, Losing a life and starting again, the way Mario does, The level's end, the way Mario's is, Falling into a hole, the way Mario does, The last life, and what comes after it, the way Mario does, An item screen the picture slides away to show, the way Zelda's does, Words that crawl up the screen, the way Zelda's story does, A jump sound that borrows the music's channel, the way Mario's does

The jump engine

A routine other code calls to choose where to go next. The call is followed by a table of addresses, and the engine jumps through it by a number. We name it as the routine those calls reach, and write each table down as far as the runs saw entries taken.

Found in 16 of the 19 games, 29 routines:

Shown in a cartridge of our own, where the same rule finds it: One byte chooses the screen, the way Mario's does

The handler kept in memory

A routine that jumps through an address it copied out of memory, where a jump engine would look one up in the cartridge. Each thing on the screen keeps the address of its own code beside its position, and this routine runs them in turn. We follow the address back to the bytes it was copied from.

Found in 4 of the 19 games, 9 routines:

The bank switch

A routine that wrote into the cartridge's own address range. On a board with a register there, that write selects which part of the program the console sees.

Found in 18 of the 19 games, 178 routines:

The picture writer

Of the routines that wrote picture memory, the one that wrote the most among those that ran in most frames. The evidence says how many of its writes fell in the blank between pictures and how many while one was drawing.

Found in all 19 games, 19 routines.

Shown in a cartridge of our own, where the same rule finds it: A jump that feels like Mario's, Running, and why a running jump goes higher, A stomp and a hit, told apart the way Mario does, A box inside the picture, the way Mario's is, Ground, a block and a wall, solid the way Mario's are, A moving platform that carries you, the way Mario's lifts do, A coin from a block and the score, the way Mario's are, Walkers that turn at walls and at each other, the way Mario's Goombas do, A picture that scrolls the way Mario's does, The camera's dead zone, the way Mario's is, Rooms that slide in the way Zelda's do, One byte chooses the screen, the way Mario's does, A status bar that stays still, the way Mario's does, Too many sprites on a line flicker rather than vanish, the way Mario's do, A splash screen that moves without drawing, the way Zelda's does, A title drawn into the level, the way Mario's is, A name typed from a grid, the way Zelda's is, A pause that holds the world still, the way Mario's does, Losing a life and starting again, the way Mario does, The level's end, the way Mario's is, Falling into a hole, the way Mario does, The last life, and what comes after it, the way Mario does, An item screen the picture slides away to show, the way Zelda's does, Words that crawl up the screen, the way Zelda's story does, A jump sound that borrows the music's channel, the way Mario's does

The palette writers

Routines that wrote picture memory while its address pointed into the palette. We follow the address the game sets, so each write lands somewhere.

Found in all 19 games, 31 routines.

Shown in a cartridge of our own, where the same rule finds it: A jump that feels like Mario's, Running, and why a running jump goes higher, A stomp and a hit, told apart the way Mario does, A box inside the picture, the way Mario's is, Ground, a block and a wall, solid the way Mario's are, A moving platform that carries you, the way Mario's lifts do, A coin from a block and the score, the way Mario's are, Walkers that turn at walls and at each other, the way Mario's Goombas do, A picture that scrolls the way Mario's does, The camera's dead zone, the way Mario's is, Rooms that slide in the way Zelda's do, One byte chooses the screen, the way Mario's does, A status bar that stays still, the way Mario's does, Too many sprites on a line flicker rather than vanish, the way Mario's do, A splash screen that moves without drawing, the way Zelda's does, A title drawn into the level, the way Mario's is, A name typed from a grid, the way Zelda's is, A pause that holds the world still, the way Mario's does, Losing a life and starting again, the way Mario does, The level's end, the way Mario's is, Falling into a hole, the way Mario does, The last life, and what comes after it, the way Mario does, An item screen the picture slides away to show, the way Zelda's does, Words that crawl up the screen, the way Zelda's story does, A jump sound that borrows the music's channel, the way Mario's does

The sprite writers

Routines that wrote into the page of memory the console copies to the sprite table every frame. These are the routines that put things on the screen that move.

Found in all 19 games, 261 routines.

Shown in a cartridge of our own, where the same rule finds it: A jump that feels like Mario's, Running, and why a running jump goes higher, A stomp and a hit, told apart the way Mario does, A box inside the picture, the way Mario's is, Ground, a block and a wall, solid the way Mario's are, A moving platform that carries you, the way Mario's lifts do, A coin from a block and the score, the way Mario's are, Walkers that turn at walls and at each other, the way Mario's Goombas do, A picture that scrolls the way Mario's does, The camera's dead zone, the way Mario's is, Rooms that slide in the way Zelda's do, One byte chooses the screen, the way Mario's does, A status bar that stays still, the way Mario's does, Too many sprites on a line flicker rather than vanish, the way Mario's do, A splash screen that moves without drawing, the way Zelda's does, A title drawn into the level, the way Mario's is, A name typed from a grid, the way Zelda's is, A pause that holds the world still, the way Mario's does, Losing a life and starting again, the way Mario does, The level's end, the way Mario's is, Falling into a hole, the way Mario does, The last life, and what comes after it, the way Mario does, An item screen the picture slides away to show, the way Zelda's does, Words that crawl up the screen, the way Zelda's story does, A jump sound that borrows the music's channel, the way Mario's does

The scroll writer

A routine that set the scroll in the blank, in every frame it ran.

Found in all 19 games, 21 routines.

Shown in a cartridge of our own, where the same rule finds it: A jump that feels like Mario's, Running, and why a running jump goes higher, A stomp and a hit, told apart the way Mario does, A box inside the picture, the way Mario's is, Ground, a block and a wall, solid the way Mario's are, A coin from a block and the score, the way Mario's are, A picture that scrolls the way Mario's does, The camera's dead zone, the way Mario's is, Rooms that slide in the way Zelda's do, One byte chooses the screen, the way Mario's does, A status bar that stays still, the way Mario's does, A title drawn into the level, the way Mario's is, A pause that holds the world still, the way Mario's does, An item screen the picture slides away to show, the way Zelda's does, Words that crawl up the screen, the way Zelda's story does, A jump sound that borrows the music's channel, the way Mario's does

The split

A routine that watches the picture chip's status while the picture is drawing, many times a frame, and then moves the scroll there. That is how a status bar holds still above a field that scrolls.

Found in 11 of the 19 games, 16 routines:

Shown in a cartridge of our own, where the same rule finds it: A status bar that stays still, the way Mario's does

The sound driver

Of the routines that wrote the sound chip's registers, the one that wrote the most among those that ran in most frames.

Found in all 19 games, 19 routines.

Shown in a cartridge of our own, where the same rule finds it: A name typed from a grid, the way Zelda's is, A pause that holds the world still, the way Mario's does, A jump sound that borrows the music's channel, the way Mario's does

The random byte

Memory that a routine rewrites from itself, with a rotate on the byte and an exclusive-or in the same routine, where the routine also looks at the old value and the byte keeps its value from one frame to the next. These are the game's dice.

Found in 14 of the 19 games, 20 routines:

Where two things are compared

A routine that compares or subtracts the positions of two different things on the screen. We follow each value from the byte of memory it was loaded from, through whatever the game copies it into, to see which bytes end up as a sprite's position; then we name the routine where two of those bytes meet. That is the heart of a collision test. It is also how an enemy finds which side the player is on, and how a game sorts what it draws by depth, and the rule does not tell these apart.

Found in 14 of the 19 games, 91 routines:

Shown in a cartridge of our own, where the same rule finds it: A stomp and a hit, told apart the way Mario does, A box inside the picture, the way Mario's is, A moving platform that carries you, the way Mario's lifts do, Walkers that turn at walls and at each other, the way Mario's Goombas do, Losing a life and starting again, the way Mario does, Falling into a hole, the way Mario does, The last life, and what comes after it, the way Mario does