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, 38 routines.
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 12 of the 19 games, 37 routines:
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 15 of the 19 games, 23 routines:
- Blades of Steel (USA)
- Double Dribble (USA) (Rev 1)
- Goonies II, The (USA)
- Legend of Zelda, The (USA) (Rev 1)
- Metroid (USA)
- Mike Tyson's Punch-Out!! (Japan, USA) (En)
- Ninja Gaiden (USA)
- Paperboy (USA)
- Q-bert (USA)
- Super Mario Bros. + Duck Hunt (USA)
- Super Mario Bros. 2 (USA) (Rev 1)
- Super Mario Bros. 3 (USA) (Rev 1)
- Teenage Mutant Ninja Turtles (USA)
- Tetris (USA)
- Zelda II - The Adventure of Link (USA)
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, 139 routines:
- Battle Chess (USA)
- Blades of Steel (USA)
- Blaster Master (USA)
- Double Dribble (USA) (Rev 1)
- Fester's Quest (USA)
- Goonies II, The (USA)
- Legend of Zelda, The (USA) (Rev 1)
- Metroid (USA)
- Mike Tyson's Punch-Out!! (Japan, USA) (En)
- Ninja Gaiden (USA)
- Paperboy (USA)
- Q-bert (USA)
- Super Mario Bros. + Duck Hunt (USA)
- Super Mario Bros. 2 (USA) (Rev 1)
- Super Mario Bros. 3 (USA) (Rev 1)
- Teenage Mutant Ninja Turtles (USA)
- Tetris (USA)
- Zelda II - The Adventure of Link (USA)
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.
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, 30 routines.
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, 178 routines.
The scroll writer
A routine that set the scroll in the blank, in every frame it ran.
Found in all 19 games, 20 routines.
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 6 of the 19 games, 9 routines:
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.
The random byte
Memory that a routine rewrites from itself every frame, with a rotate on the byte and an exclusive-or somewhere in the same routine. These are the game's dice.
Found in 8 of the 19 games, 11 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 8 of the 19 games, 18 routines: