Metroid (USA)
Metroid (USA) is on a MMC1 board with 131,072 bytes of program. A crawl of 400 steps from power-on kept 22 paths that found new code. Played back over 12,802 frames, they executed 6,967 bytes of it, 5 percent.
What the rules named
- The poll: 2
- The wait for the frame: 2
- The jump engine: 1
- The bank switch: 11
- The picture writer: 1
- The palette writers: 2
- The sprite writers: 7
- The scroll writer: 1
- The split: 1
- The sound driver: 1
The 193 routines the runs entered
Every place the game's code was entered, by a call, an interrupt or a jump through a table. The ones a rule named come first, with what the rule saw.
| at | entered by | times | what it is, and the evidence |
|---|---|---|---|
| $C1E0 (bank 7) | a call | 1,940 | The palette writers: frames it ran in 1,962, writes 1,571 The picture writer: frames it ran in 1,962, writes 16,971, in the blank 3,243, while drawing 13,728 |
| $C215 (bank 7) | a call | 1,940 | The poll: port $4017, reads a frame 8, strobes a frame 2 |
| $C21F (bank 7) | a call | 1,940 | The poll: port $4016, reads a frame 8, strobes a frame 2 |
| $C29A (bank 7) | a call | 1,940 | The scroll writer: frames it ran in 1,936, writes in the blank 3,828 |
| $C4D9 (bank 7) | a call | 1,940 | The bank switch: writes 9,700, in the blank 9,570, while drawing 130 |
| $C27C (bank 7) | a call | 1,820 | The jump engine: tables 4, jumps through them 1,820 |
| $B3B4 (bank 0) | a call | 1,761 | The sound driver: frames it ran in 1,804, writes 1,761 |
| $C1A3 (bank 7) | a call | 936 | The sprite writers: frames it ran in 936, writes to the sprite page 240,896 |
| $C30C (bank 7) | a call | 720 | The palette writers: frames it ran in 724, writes 168 |
| $9147 (bank 0) | a table | 672 | The sprite writers: frames it ran in 682, writes to the sprite page 2,496 |
| $C1BC (bank 7) | a call | 452 | The sprite writers: frames it ran in 456, writes to the sprite page 43,392 |
| $90D7 (bank 0) | a table | 426 | The sprite writers: frames it ran in 426, writes to the sprite page 1,704 |
| $C4EF (bank 7) | a call | 238 | The bank switch: writes 1,190, in the blank 340, while drawing 850 |
| $C9D7 (bank 7) | a table | 200 | The sprite writers: frames it ran in 200, writes to the sprite page 96 |
| $C7AB (bank 7) | a call | 188 | The bank switch: writes 940, in the blank 100, while drawing 840 |
| $C4E8 (bank 7) | a call | 26 | The bank switch: writes 130, in the blank 0, while drawing 130 |
| $C4B2 (bank 7) | a call | 22 | The bank switch: writes 110, in the blank 0, while drawing 110 |
| $C4FA (bank 7) | a call | 22 | The bank switch: writes 110, in the blank 110, while drawing 0 |
| $C5D7 (bank 7) | a call | 22 | The bank switch: writes 110, in the blank 110, while drawing 0 |
| $FFB0 (bank 7) | an interrupt (IRQ) | 22 | The bank switch: writes 308, in the blank 308, while drawing 0 The sprite writers: frames it ran in 2,002, writes to the sprite page 5,632 |
| $C6D6 (bank 7) | a call | 16 | The bank switch: writes 80, in the blank 0, while drawing 80 |
| $8071 (bank 0) | a table | 4 | The sprite writers: frames it ran in 8, writes to the sprite page 640 |
| $C20E (bank 7) | a call | 4 | The split: frames it ran in 8, scroll writes while drawing 8, status reads while drawing 148 |
| $C5DC (bank 7) | a call | 4 | The bank switch: writes 20, in the blank 0, while drawing 20 |
| $C604 (bank 7) | a call | 4 | The bank switch: writes 20, in the blank 0, while drawing 20 |
| $B4BD (bank 0) | a call | 17,292 | |
| $C36B (bank 7) | a call | 12,632 | |
| $BC53 (bank 0) | a call | 5,220 | |
| $B4EE (bank 0) | a table | 5,027 | |
| $B4BD (bank 1) | a call | 2,323 | |
| $C2A8 (bank 7) | a call | 2,047 | |
| $C0D9 (bank 7) | each frame (NMI) | 1,998 | |
| $C97E (bank 7) | a call | 1,976 | |
| $C2CA (bank 7) | a call | 1,940 | |
| $C44D (bank 7) | a call | 1,940 | |
| $C4DE (bank 7) | a call | 1,814 | |
| $C000 (bank 7) | a call | 1,792 | |
| $C114 (bank 7) | a call | 1,792 | |
| $C266 (bank 7) | a call | 1,792 | |
| $B31B (bank 0) | a call | 1,757 | |
| $B322 (bank 0) | a table | 1,757 | |
| $B34B (bank 0) | a call | 1,745 | |
| $B33D (bank 0) | a call | 1,740 | |
| $BC36 (bank 0) | a call | 1,740 | |
| $BC3D (bank 0) | a table | 1,740 | |
| $BC4B (bank 0) | a table | 1,740 | |
| $BC64 (bank 0) | a call | 1,740 | |
| $B35C (bank 0) | a table | 1,734 | |
| $9A07 (bank 0) | a call | 1,720 | |
| $B344 (bank 0) | a table | 1,705 | |
| $B329 (bank 0) | a call | 1,687 | |
| $B330 (bank 0) | a table | 1,687 | |
| $B364 (bank 0) | a table | 1,687 | |
| $C318 (bank 7) | a call | 1,330 | |
| $BA08 (bank 0) | a call | 920 | |
| $BA41 (bank 0) | a call | 920 | |
| $B4EE (bank 1) | a table | 697 | |
| $BC53 (bank 1) | a call | 697 | |
| $B9F3 (bank 0) | a call | 460 | |
| $BA37 (bank 0) | a call | 460 | |
| $812C (bank 0) | a table | 437 | |
| $EF9E (bank 7) | a call | 416 | |
| $BA41 (bank 1) | a call | 406 | |
| $B31B (bank 1) | a call | 236 | |
| $B322 (bank 1) | a table | 236 | |
| $B34B (bank 1) | a call | 236 | |
| $B3B4 (bank 1) | a call | 236 | |
| $C7D5 (bank 7) | a call | 234 | |
| $BC64 (bank 1) | a call | 233 | |
| $B33D (bank 1) | a call | 232 | |
| $B344 (bank 1) | a table | 232 | |
| $BC36 (bank 1) | a call | 232 | |
| $BC3D (bank 1) | a table | 232 | |
| $BC4B (bank 1) | a table | 232 | |
| $B329 (bank 1) | a call | 229 | |
| $B330 (bank 1) | a table | 229 | |
| $B35C (bank 1) | a table | 229 | |
| $B364 (bank 1) | a table | 229 | |
| $B9F3 (bank 1) | a call | 203 | |
| $BA08 (bank 1) | a call | 203 | |
| $BA37 (bank 1) | a call | 203 | |
| $C2BF (bank 7) | a call | 191 | |
| $B4A9 (bank 0) | a call | 157 | |
| $C434 (bank 7) | a call | 148 | |
| $B7E7 (bank 0) | a table | 102 | |
| $F1F4 (bank 7) | a call | 92 | |
| $C158 (bank 7) | a call | 86 | |
| $C16D (bank 7) | a call | 86 | |
| $C376 (bank 7) | a call | 77 | |
| $C3C6 (bank 7) | a call | 60 | |
| $C2C5 (bank 7) | a call | 48 | |
| $B6A1 (bank 0) | a table | 47 | |
| $C439 (bank 7) | a call | 42 | |
| $EAC0 (bank 7) | a call | 40 | |
| $C487 (bank 7) | a call | 38 | |
| $B493 (bank 0) | a call | 37 | |
| $8FF1 (bank 0) | a call | 36 | |
| $9001 (bank 0) | a call | 36 | |
| $9011 (bank 0) | a call | 36 | |
| $B4A2 (bank 0) | a call | 36 | |
| $EB85 (bank 7) | a call | 36 | |
| $EF8C (bank 7) | a call | 36 | |
| $B36C (bank 0) | a call | 35 | |
| $909F (bank 0) | a call | 34 | |
| $9449 (bank 0) | a call | 34 | |
| $B7D9 (bank 0) | a table | 34 | |
| $C42C (bank 7) | a call | 34 | |
| $C43D (bank 7) | a call | 30 | |
| $C45D (bank 7) | a call | 30 | |
| $C2B3 (bank 7) | a call | 28 | |
| $C37E (bank 7) | a call | 28 | |
| $EA2B (bank 7) | a call | 24 | |
| $A93E (bank 0) | a call | 22 | |
| $C531 (bank 7) | a table | 22 | |
| $90BA (bank 0) | a table | 18 | |
| $911A (bank 0) | a table | 16 | |
| $940B (bank 0) | a call | 16 | |
| $DF6B (bank 7) | a call | 16 | |
| $DFA3 (bank 7) | a call | 16 | |
| $EF09 (bank 7) | a call | 16 | |
| $9450 (bank 0) | a call | 13 | |
| $8A8C (bank 0) | a call | 12 | |
| $E564 (bank 7) | a call | 12 | |
| $ED7A (bank 7) | a call | 12 | |
| $80B0 (bank 1) | a call | 8 | |
| $B40E (bank 0) | a call | 8 | |
| $B41D (bank 0) | a call | 8 | |
| $B43E (bank 0) | a call | 8 | |
| $B87F (bank 0) | a table | 8 | |
| $C1D4 (bank 7) | a call | 8 | |
| $C45C (bank 7) | a table | 8 | |
| $C578 (bank 7) | a call | 8 | |
| $E5E2 (bank 7) | a table | 8 | |
| $EB06 (bank 7) | a table | 8 | |
| $EB0C (bank 7) | a call | 8 | |
| $EB28 (bank 7) | a call | 8 | |
| $EB4D (bank 7) | a call | 8 | |
| $EB7A (bank 7) | a call | 8 | |
| $ED51 (bank 7) | a call | 8 | |
| $ED8C (bank 7) | a call | 8 | |
| $FB7B (bank 7) | a call | 8 | |
| $8DDE (bank 0) | a call | 6 | |
| $8E21 (bank 0) | a call | 6 | |
| $8E4E (bank 0) | a call | 6 | |
| $8F60 (bank 0) | a call | 6 | |
| $80D0 (bank 0) | a table | 4 | |
| $80F9 (bank 0) | a table | 4 | |
| $8BD4 (bank 0) | a call | 4 | |
| $8D12 (bank 0) | a call | 4 | |
| $8D3D (bank 0) | a call | 4 | |
| $B3FC (bank 0) | a call | 4 | |
| $B3FC (bank 1) | a call | 4 | |
| $B404 (bank 0) | a call | 4 | |
| $B9E4 (bank 0) | a call | 4 | |
| $B9E4 (bank 1) | a call | 4 | |
| $BC7A (bank 0) | a table | 4 | |
| $BC80 (bank 1) | a table | 4 | |
| $BF19 (bank 0) | a call | 4 | |
| $BF19 (bank 1) | a call | 4 | |
| $C2C0 (bank 7) | a call | 4 | |
| $C552 (bank 7) | a table | 4 | |
| $C801 (bank 7) | a table | 4 | |
| $C8B0 (bank 7) | a call | 4 | |
| $C8BB (bank 7) | a call | 4 | |
| $C8D1 (bank 7) | a table | 4 | |
| $CA18 (bank 7) | a call | 4 | |
| $CB8E (bank 7) | a call | 4 | |
| $CBFD (bank 7) | a call | 4 | |
| $E193 (bank 7) | a call | 4 | |
| $E720 (bank 7) | a call | 4 | |
| $EA05 (bank 7) | a call | 4 | |
| $EA26 (bank 7) | a table | 4 | |
| $EC93 (bank 7) | a call | 4 | |
| $EC9B (bank 7) | a call | 4 | |
| $ED5B (bank 7) | a call | 4 | |
| $ED65 (bank 7) | a call | 4 | |
| $ED98 (bank 7) | a call | 4 | |
| $EF00 (bank 7) | a call | 4 | |
| $EFF8 (bank 7) | a call | 4 | |
| $F01C (bank 7) | a call | 4 | |
| $8142 (bank 0) | a table | 3 | |
| $B40E (bank 1) | a call | 3 | |
| $B41D (bank 1) | a call | 3 | |
| $B43E (bank 1) | a call | 3 | |
| $B368 (bank 0) | a call | 2 | |
| $B374 (bank 0) | a call | 2 | |
| $B695 (bank 0) | a table | 2 | |
| $CF6B (bank 7) | a call | 2 | |
| $DC8F (bank 7) | a call | 2 | |
| $DCC3 (bank 7) | a call | 2 | |
| $DE3D (bank 7) | a call | 2 | |
| $DFDF (bank 7) | a call | 2 | |
| $B878 (bank 0) | a table | 1 |
Where it waits
Loops a rule named that sit inside a routine and are not themselves a place the code is entered.
| at | what it is, and the evidence |
|---|---|
| $C42F (bank 7) | The wait for the frame: waits on the byte at $001A, times entered 34, turns 20,860, writes of it under the frame interrupt 1,976, frames in all 2,302 |
| $C442 (bank 7) | The wait for the frame: waits on the byte at $001A, times entered 114, turns 410,730, writes of it under the frame interrupt 1,976, frames in all 2,302 |
The jump engine's tables
Each table sits right after a call to the engine. An entry is counted as far as the runs saw one taken; the true table may be longer. The last column is the byte of memory whose value picked the entry, where we could follow it: the game's mode, or what one of its objects is doing.
| at | entries | taken | chosen by the byte at |
|---|---|---|---|
| $802A (bank 0) | 28 | 9 | $001F |
| $C141 (bank 7) | 9 | 3 | $001E |
| $EA1C (bank 7) | 5 | 3 | |
| $EAE4 (bank 7) | 2 | 1 |
The memory its routines share
926 bytes of memory were written by one routine and read by another, and 60 places were reached through an index, which is what a table or a set of object slots in memory looks like.
Reaches through an index: those that hold positions, then the longest
| from | bytes reached | instructions | positions it holds |
|---|---|---|---|
| $0300 | 255 | 3 | |
| $0000 | 224 | 2 | |
| $0500 | 193 | 1 | |
| $0509 | 193 | 1 | |
| $0260 | 160 | 2 | |
| $007A | 101 | 1 | |
| $0405 | 81 | 3 | |
| $040F | 81 | 2 | |
| $0400 | 81 | 1 | |
| $0401 | 81 | 1 | |
| $0404 | 81 | 1 | |
| $0409 | 81 | 1 |
The 24 busiest shared bytes
| byte | reads and writes | routines writing | routines reading |
|---|---|---|---|
| $001A | 4,469,530 | 3 | 6 |
| $0001 | 766,025 | 6 | 6 |
| $0000 | 676,135 | 6 | 6 |
| $064D | 534,003 | 4 | 6 |
| $00E4 | 117,699 | 2 | 3 |
| $00E5 | 117,699 | 2 | 3 |
| $00E2 | 59,249 | 6 | 6 |
| $00E3 | 59,225 | 6 | 6 |
| $00E0 | 39,856 | 6 | 6 |
| $00E1 | 39,856 | 6 | 6 |
| $0002 | 37,877 | 6 | 6 |
| $0003 | 36,592 | 6 | 6 |
| $0014 | 23,510 | 1 | 4 |
| $002E | 19,756 | 2 | 2 |
| $002F | 17,964 | 2 | 2 |
| $065C | 15,102 | 3 | 6 |
| $002A | 14,164 | 1 | 2 |
| $00EB | 11,378 | 2 | 3 |
| $001D | 11,052 | 3 | 6 |
| $0018 | 9,837 | 1 | 3 |
| $6997 | 9,256 | 3 | 4 |
| $0012 | 8,947 | 1 | 6 |
| $001F | 8,572 | 6 | 6 |
| $0015 | 7,800 | 1 | 2 |
This page shows none of the game's bytes. The listing these figures were read from stays with the cartridge.