Zelda II - The Adventure of Link (USA)
Zelda II - The Adventure of Link (USA) is on a MMC1 board with 131,072 bytes of program. A crawl of 6,400 steps from power-on kept 73 paths that found new code. Played back over 235,313 frames, they executed 12,967 bytes of it, 10 percent.
What the rules named
- The poll: 2
- The wait for the frame: 3
- The jump engine: 2
- The bank switch: 16
- The picture writer: 1
- The palette writers: 1
- The sprite writers: 18
- The scroll writer: 1
- The split: 2
- The sound driver: 1
- The random byte: 2
The 246 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, and their names in the listing say what they are: a poll, an engine, a drain.
| at | its name in the listing | entered by | times | what it is, and the evidence |
|---|---|---|---|---|
| $D385 (bank 7) | b7_engine_D385 | a call | 162,665 | The jump engine: tables 19, jumps through them 162,643 |
| $D367 (bank 7) | b7_poll_D367 | a call | 128,450 | The poll: port $4016, reads a frame 16, strobes a frame 4 The poll: port $4017, reads a frame 16, strobes a frame 4 |
| $FFCC (bank 7) | b7_bank_FFCC | a call | 64,522 | The bank switch: writes 322,610, in the blank 321,205, while drawing 1,405 |
| $C07B (bank 7) | b7_nmi | each frame (NMI) | 64,345 | The random byte: frames it ran in 64,377, bytes $051A,$051B,$051C,$051D, rotates 4, exclusive-ors 1 The scroll writer: frames it ran in 64,377, writes in the blank 236,320 |
| $D2EC (bank 7) | b7_drain_D2EC | a call | 64,221 | The palette writers: frames it ran in 64,221, writes 6,496 The picture writer: frames it ran in 64,221, writes 589,837, in the blank 529,595, while drawing 60,242 |
| $8000 (bank 6) | b6_sound_8000 | a call | 54,157 | The sound driver: frames it ran in 53,939, writes 108,314 |
| $C032 (bank 7) | b7_bank_C032 | a call | 54,157 | The bank switch: writes 270,785, in the blank 269,150, while drawing 1,635 |
| $A8CF (bank 5) | b5_sprites_A8CF | a call | 35,060 | The sprite writers: frames it ran in 34,795, writes to the sprite page 210,883 |
| $A918 (bank 5) | b5_sprites_A918 | a call | 35,060 | The sprite writers: frames it ran in 32,596, writes to the sprite page 145,563 |
| $FFC9 (bank 7) | b7_bank_FFC9 | a call | 22,804 | The bank switch: writes 114,020, in the blank 620, while drawing 113,400 |
| $FFC5 (bank 7) | b7_bank_FFC5 | a call | 19,603 | The bank switch: writes 98,007, in the blank 22,477, while drawing 75,530 |
| $D24C (bank 7) | b7_sprites_D24C | a call | 18,901 | The sprite writers: frames it ran in 19,058, writes to the sprite page 1,209,664 |
| $B574 (bank 5) | b5_sprites_B574 | a call | 17,961 | The sprite writers: frames it ran in 17,961, writes to the sprite page 71,844 |
| $B596 (bank 5) | b5_sprites_B596 | a call | 17,961 | The sprite writers: frames it ran in 17,961, writes to the sprite page 215,532 |
| $ED7A (bank 7) | b7_sprites_ED7A | a call | 16,820 | The sprite writers: frames it ran in 8,410, writes to the sprite page 234,108 |
| $B678 (bank 5) | b5_dispatch_B678 | a table | 10,212 | The sprite writers: frames it ran in 10,212, writes to the sprite page 416,098 |
| $D250 (bank 7) | b7_sprites_D250 | a call | 10,084 | The sprite writers: frames it ran in 10,083, writes to the sprite page 635,292 |
| $C1C1 (bank 7) | b7_bank_C1C1 | a call | 10,064 | The bank switch: writes 50,315, in the blank 44,921, while drawing 5,394 |
| $C1CD (bank 7) | b7_bank_C1CD | a call | 5,208 | The bank switch: writes 25,900, in the blank 13,320, while drawing 12,580 |
| $968D (bank 0) | b0_sprites_968D | a call | 5,205 | The sprite writers: frames it ran in 5,204, writes to the sprite page 41,640 |
| $E070 (bank 7) | b7_bank_E070 | a call | 4,993 | The bank switch: writes 24,965, in the blank 0, while drawing 24,965 |
| $80E5 (bank 0) | b0_sprites_80E5 | a call | 4,962 | The sprite writers: frames it ran in 4,962, writes to the sprite page 104,672 |
| $9888 (bank 0) | b0_sprites_9888 | a call | 4,962 | The sprite writers: frames it ran in 4,962, writes to the sprite page 1,352 |
| $D3CC (bank 7) | b7_dispatch_D3CC | a table | 4,962 | The split: frames it ran in 4,962, scroll writes while drawing 9,924, status reads while drawing 1,028,693 |
| $E1DD (bank 7) | b7_bank_E1DD | a call | 4,962 | The bank switch: writes 24,810, in the blank 0, while drawing 24,810 |
| $EBF0 (bank 7) | b7_sprites_EBF0 | a call | 4,962 | The sprite writers: frames it ran in 4,962, writes to the sprite page 9,834 |
| $C3ED (bank 7) | b7_dispatch_C3ED | a table | 3,448 | The sprite writers: frames it ran in 3,448, writes to the sprite page 6,896 |
| $FED0 (bank 7) | b7_bank_FED0 | a call | 2,053 | The bank switch: writes 10,265, in the blank 0, while drawing 10,265 |
| $D382 (bank 7) | b7_engine_D382 | a call | 1,090 | The jump engine: tables 1, jumps through them 1,090 |
| $9DB0 (bank 0) | b0_split_9DB0 | a call | 243 | The split: frames it ran in 243, scroll writes while drawing 486, status reads while drawing 62,584 |
| $C24F (bank 7) | b7_bank_C24F | a call | 140 | The bank switch: writes 700, in the blank 0, while drawing 700 |
| $FFB1 (bank 7) | b7_bank_FFB1 | a call | 135 | The bank switch: writes 675, in the blank 365, while drawing 310 |
| $FF9D (bank 7) | b7_bank_FF9D | a call | 104 | The bank switch: writes 520, in the blank 365, while drawing 155 |
| $A8C1 (bank 5) | b5_sprites_A8C1 | a call | 74 | The sprite writers: frames it ran in 74, writes to the sprite page 18,944 |
| $BF9D (bank 5) | b5_bank_BF9D | a call | 73 | The bank switch: writes 365, in the blank 0, while drawing 365 |
| $BFB1 (bank 5) | b5_bank_BFB1 | a call | 73 | The bank switch: writes 365, in the blank 0, while drawing 365 |
| $FF70 (bank 7) | b7_reset | power-on | 73 | The bank switch: writes 292, in the blank 292, while drawing 0 |
| $DFDB (bank 7) | b7_bank_DFDB | a call | 70 | The bank switch: writes 350, in the blank 0, while drawing 350 |
| $96A8 (bank 0) | b0_random_96A8 | a call | 62 | The random byte: frames it ran in 31, bytes $074F, rotates 2, exclusive-ors 1 The sprite writers: frames it ran in 31, writes to the sprite page 496 |
| $C62F (bank 7) | b7_dispatch_C62F | a table | 30 | The sprite writers: frames it ran in 30, writes to the sprite page 120 |
| $98A6 (bank 0) | b0_sprites_98A6 | a call | 28 | The sprite writers: frames it ran in 28, writes to the sprite page 168 |
| $D55E (bank 7) | b7_sprites_D55E | a call | 28 | The sprite writers: frames it ran in 28, writes to the sprite page 56 |
| $BAB8 (bank 5) | a call | 91,168 | ||
| $F27D (bank 7) | a call | 64,811 | ||
| $D346 (bank 7) | a call | 64,220 | ||
| $D174 (bank 7) | a call | 63,938 | ||
| $D168 (bank 7) | a call | 63,852 | ||
| $821B (bank 6) | a call | 54,157 | ||
| $826A (bank 6) | a call | 54,157 | ||
| $A6D9 (bank 5) | a call | 54,154 | ||
| $810F (bank 6) | a call | 36,062 | ||
| $8116 (bank 6) | a call | 36,062 | ||
| $A6F0 (bank 5) | a table | 35,425 | ||
| $EAE8 (bank 7) | a call | 30,622 | ||
| $D56D (bank 7) | a call | 29,772 | ||
| $D5DA (bank 7) | a call | 29,772 | ||
| $D603 (bank 7) | a table | 29,772 | ||
| $815E (bank 6) | a call | 27,316 | ||
| $816B (bank 6) | a call | 27,316 | ||
| $D625 (bank 7) | a call | 26,082 | ||
| $850C (bank 1) | a call | 25,629 | ||
| $A6DD (bank 0) | a call | 24,810 | ||
| $B8D2 (bank 5) | a call | 24,315 | ||
| $A737 (bank 5) | a table | 24,081 | ||
| $A795 (bank 5) | a call | 22,978 | ||
| $B22D (bank 5) | a table | 18,675 | ||
| $B5EA (bank 5) | a call | 16,210 | ||
| $B623 (bank 5) | a call | 16,210 | ||
| $AC07 (bank 5) | a call | 16,091 | ||
| $B5B5 (bank 5) | a call | 15,942 | ||
| $B663 (bank 5) | a call | 15,214 | ||
| $AB6D (bank 5) | a table | 10,979 | ||
| $B3CF (bank 5) | a table | 10,388 | ||
| $9000 (bank 6) | a call | 10,187 | ||
| $920B (bank 6) | a call | 10,187 | ||
| $92F4 (bank 6) | a call | 10,187 | ||
| $9408 (bank 6) | a call | 10,187 | ||
| $95A7 (bank 6) | a call | 10,187 | ||
| $990B (bank 6) | a call | 10,187 | ||
| $9B18 (bank 6) | a call | 10,187 | ||
| $E1B8 (bank 7) | a call | 9,986 | ||
| $E1BE (bank 7) | a call | 9,986 | ||
| $C2CA (bank 7) | a call | 9,784 | ||
| $C2E6 (bank 7) | a table | 9,752 | ||
| $B242 (bank 5) | a table | 8,287 | ||
| $B261 (bank 5) | a table | 8,105 | ||
| $B502 (bank 5) | a call | 8,105 | ||
| $B5D8 (bank 5) | a call | 8,105 | ||
| $B603 (bank 5) | a call | 8,105 | ||
| $B63C (bank 5) | a call | 8,105 | ||
| $B529 (bank 5) | a call | 7,837 | ||
| $815A (bank 6) | a call | 5,379 | ||
| $8167 (bank 6) | a call | 5,379 | ||
| $C1DD (bank 7) | a call | 5,183 | ||
| $9038 (bank 6) | a call | 5,180 | ||
| $CF30 (bank 7) | a call | 5,180 | ||
| $9097 (bank 6) | a call | 5,174 | ||
| $E079 (bank 7) | a call | 4,993 | ||
| $8DC3 (bank 0) | a call | 4,962 | ||
| $903A (bank 0) | a call | 4,962 | ||
| $9235 (bank 0) | a call | 4,962 | ||
| $97FA (bank 0) | a call | 4,962 | ||
| $9847 (bank 0) | a call | 4,962 | ||
| $9925 (bank 0) | a call | 4,962 | ||
| $A6D2 (bank 0) | a call | 4,962 | ||
| $D5A7 (bank 7) | a call | 4,962 | ||
| $E1E6 (bank 7) | a call | 4,962 | ||
| $92BF (bank 0) | a table | 4,932 | ||
| $93BC (bank 0) | a call | 4,932 | ||
| $9483 (bank 0) | a call | 4,932 | ||
| $94C5 (bank 0) | a call | 4,932 | ||
| $959C (bank 0) | a call | 4,932 | ||
| $9031 (bank 6) | a call | 4,926 | ||
| $9089 (bank 6) | a call | 4,926 | ||
| $DEE7 (bank 7) | a call | 4,898 | ||
| $D1CE (bank 7) | a call | 4,866 | ||
| $9610 (bank 0) | a call | 4,622 | ||
| $9A04 (bank 0) | a call | 4,347 | ||
| $DF56 (bank 7) | a call | 3,658 | ||
| $C397 (bank 7) | a table | 3,544 | ||
| $D15C (bank 7) | a call | 3,544 | ||
| $814F (bank 6) | a call | 2,465 | ||
| $C947 (bank 7) | a call | 2,077 | ||
| $8120 (bank 6) | a call | 2,075 | ||
| $9AB8 (bank 0) | a table | 2,053 | ||
| $C82B (bank 7) | a call | 1,984 | ||
| $8147 (bank 6) | a call | 1,873 | ||
| $906F (bank 6) | a call | 1,557 | ||
| $C988 (bank 7) | a call | 1,550 | ||
| $C944 (bank 7) | a call | 1,271 | ||
| $CF3C (bank 7) | a table | 1,090 | ||
| $9A30 (bank 0) | a call | 1,052 | ||
| $9AA8 (bank 0) | a call | 1,047 | ||
| $9A77 (bank 0) | a table | 1,030 | ||
| $D120 (bank 7) | a table | 966 | ||
| $814B (bank 6) | a call | 958 | ||
| $C95C (bank 7) | a call | 806 | ||
| $C95F (bank 7) | a call | 744 | ||
| $9042 (bank 6) | a call | 734 | ||
| $80EE (bank 1) | a table | 713 | ||
| $8247 (bank 1) | a call | 713 | ||
| $C912 (bank 7) | a call | 713 | ||
| $818C (bank 6) | a call | 710 | ||
| $A2D4 (bank 0) | a call | 672 | ||
| $BA6F (bank 5) | a call | 594 | ||
| $D19B (bank 7) | a call | 589 | ||
| $9B13 (bank 0) | a table | 510 | ||
| $FD82 (bank 7) | a call | 510 | ||
| $9067 (bank 6) | a call | 464 | ||
| $821D (bank 1) | a table | 434 | ||
| $906B (bank 6) | a call | 420 | ||
| $F2D3 (bank 7) | a call | 400 | ||
| $D263 (bank 7) | a call | 354 | ||
| $D261 (bank 7) | a call | 323 | ||
| $D266 (bank 7) | a call | 323 | ||
| $A3B3 (bank 0) | a call | 280 | ||
| $A558 (bank 0) | a call | 280 | ||
| $A56B (bank 0) | a call | 280 | ||
| $A589 (bank 0) | a call | 280 | ||
| $8201 (bank 1) | a call | 279 | ||
| $BA40 (bank 5) | a call | 273 | ||
| $AE15 (bank 5) | a table | 255 | ||
| $959D (bank 6) | a call | 233 | ||
| $AEC1 (bank 5) | a call | 231 | ||
| $ACFA (bank 5) | a call | 222 | ||
| $AE55 (bank 5) | a table | 219 | ||
| $AF1F (bank 5) | a table | 219 | ||
| $AC31 (bank 5) | a table | 191 | ||
| $8293 (bank 6) | a call | 170 | ||
| $9B19 (bank 0) | a call | 153 | ||
| $A1DD (bank 0) | a table | 152 | ||
| $B24E (bank 5) | a table | 145 | ||
| $C258 (bank 7) | a call | 140 | ||
| $A5A4 (bank 0) | a call | 122 | ||
| $D29C (bank 7) | a call | 104 | ||
| $BA18 (bank 5) | a call | 102 | ||
| $AC73 (bank 5) | a table | 99 | ||
| $ACA8 (bank 5) | a table | 99 | ||
| $81F3 (bank 1) | a table | 93 | ||
| $DF4C (bank 7) | a call | 93 | ||
| $B40A (bank 5) | a table | 91 | ||
| $A6A0 (bank 5) | a call | 73 | ||
| $A70F (bank 5) | a table | 73 | ||
| $A72E (bank 5) | a table | 73 | ||
| $ADE0 (bank 5) | a call | 73 | ||
| $AF2B (bank 5) | a table | 73 | ||
| $AF34 (bank 5) | a table | 73 | ||
| $B960 (bank 5) | a call | 73 | ||
| $D281 (bank 7) | a call | 73 | ||
| $A49F (bank 0) | a call | 70 | ||
| $A546 (bank 0) | a call | 70 | ||
| $DFE4 (bank 7) | a call | 70 | ||
| $CB18 (bank 7) | a call | 64 | ||
| $A2FE (bank 0) | a table | 60 | ||
| $A35F (bank 0) | a call | 60 | ||
| $A5E3 (bank 0) | a call | 60 | ||
| $B412 (bank 5) | a table | 54 | ||
| $B3DF (bank 5) | a table | 34 | ||
| $B3F4 (bank 5) | a table | 34 | ||
| $AF02 (bank 5) | a table | 33 | ||
| $A057 (bank 0) | a call | 32 | ||
| $A6E5 (bank 5) | a table | 32 | ||
| $AA08 (bank 0) | a call | 32 | ||
| $B911 (bank 5) | a call | 32 | ||
| $BA6C (bank 5) | a call | 32 | ||
| $C34F (bank 7) | a table | 32 | ||
| $C3A5 (bank 7) | a table | 32 | ||
| $C3B5 (bank 7) | a table | 32 | ||
| $C3E6 (bank 7) | a table | 32 | ||
| $CB35 (bank 7) | a table | 32 | ||
| $CC50 (bank 7) | a call | 32 | ||
| $CC97 (bank 7) | a call | 32 | ||
| $CD40 (bank 7) | a table | 32 | ||
| $D293 (bank 7) | a call | 32 | ||
| $812F (bank 1) | a table | 31 | ||
| $81A3 (bank 1) | a table | 31 | ||
| $8340 (bank 1) | a table | 31 | ||
| $C4CB (bank 7) | a call | 31 | ||
| $C63E (bank 7) | a table | 31 | ||
| $C690 (bank 7) | a call | 31 | ||
| $C70C (bank 7) | a table | 31 | ||
| $C755 (bank 7) | a call | 31 | ||
| $C819 (bank 7) | a call | 31 | ||
| $C89D (bank 7) | a call | 31 | ||
| $C927 (bank 7) | a call | 31 | ||
| $D05B (bank 7) | a table | 31 | ||
| $D0FC (bank 7) | a table | 31 | ||
| $D25E (bank 7) | a table | 31 | ||
| $D269 (bank 7) | a table | 31 | ||
| $D27D (bank 7) | a call | 31 | ||
| $9047 (bank 0) | a table | 30 | ||
| $90ED (bank 0) | a call | 30 | ||
| $99D4 (bank 0) | a call | 30 | ||
| $E030 (bank 7) | a call | 30 | ||
| $942B (bank 0) | a call | 19 | ||
| $A3D7 (bank 0) | a table | 11 | ||
| $AD7C (bank 5) | a call | 11 | ||
| $A57E (bank 0) | a call | 10 | ||
| $A26B (bank 0) | a table | 7 | ||
| $AEEE (bank 5) | a call | 7 | ||
| $9064 (bank 6) | a call | 6 | ||
| $A148 (bank 0) | a table | 6 | ||
| $A347 (bank 0) | a table | 6 | ||
| $AF19 (bank 5) | a table | 2 | ||
| $960B (bank 0) | a call | 1 | ||
| $A338 (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 | its name in the listing | what it is, and the evidence |
|---|---|---|
| $ABE5 (bank 5) | b5_wait_ABE5 | The wait for the frame: waits on the byte at $0033, times entered 818, turns 24, calls on each turn 2, writes of it under the frame interrupt 275, frames in all 65,213 The wait for the frame: waits on the byte at $0761, times entered 818, turns 24, calls on each turn 2, writes of it under the frame interrupt 1,088, frames in all 65,213 |
| $C010 (bank 7) | b7_wait_C010 | The wait for the frame: waits on the byte at $0736, times entered 91, turns 79,438,110, writes of it under the frame interrupt 1,067, frames in all 65,213 |
The tables it jumps through
A table of addresses the game picks one from. Some sit right after a call to a jump engine; others are anywhere in the cartridge, and we find them by where the address the game jumped through was loaded from. Some games jump by pushing an address and returning to it, and some keep a table as two, the low bytes of its addresses in one place and the high bytes in another; both are found the same way. 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 | reached | entries | taken | chosen by the byte at |
|---|---|---|---|---|
| $903F (bank 0) | after a call | 2 | 2 | $00B5 |
| $9A1E (bank 0) | after a call | 9 | 4 | $0740 |
| $9DE4 (bank 0) | after a call | 9 | 7 | $0524 |
| $8133 (bank 1) | after a call | 8 | 1 | $0731 |
| $A6DF (bank 5) | after a call | 3 | 3 | $076C |
| $A705 (bank 5) | after a call | 5 | 5 | $0736 |
| $ABEB (bank 5) | after a call | 6 | 6 | $0761 |
| $AE4F (bank 5) | after a call | 3 | 3 | $0035 |
| $B236 (bank 5) | after a call | 2 | 2 | $0736 |
| $B248 (bank 5) | after a call | 3 | 3 | $073B |
| $B3D5 (bank 5) | after a call | 5 | 5 | $073B |
| $C2D8 (bank 7) | after a call | 2 | 2 | $076C |
| $C2EC (bank 7) | after a call | 1 | 8 | $0736 |
| $C39D (bank 7) | after a call | 4 | 4 | $0738 |
| $CF42 (bank 7) | after a call | 5 | 5 | $0769 |
| $D5F1 (bank 7) | through a pointer | 1 | 1 | $00B6, $00B7, $00B8, $00B9 |
The memory its routines share
1,470 bytes of memory were written by one routine and read by another, and 96 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 |
|---|---|---|---|
| $0200 | 256 | 6 | |
| $0300 | 256 | 2 | |
| $0400 | 256 | 2 | |
| $0700 | 256 | 2 | |
| $0500 | 256 | 1 | |
| $0600 | 256 | 1 | |
| $0000 | 224 | 2 | |
| $0302 | 163 | 6 | |
| $0301 | 163 | 1 | |
| $0267 | 108 | 3 | |
| $03A4 | 59 | 2 | |
| $0201 | 57 | 5 |
The 24 busiest shared bytes
| byte | reads and writes | routines writing | routines reading |
|---|---|---|---|
| $0736 | 79,549,384 | 6 | 6 |
| $0000 | 4,342,086 | 6 | 6 |
| $0001 | 2,363,579 | 6 | 6 |
| $00F5 | 1,848,292 | 3 | 6 |
| $0002 | 1,524,216 | 6 | 6 |
| $0003 | 997,021 | 6 | 6 |
| $000E | 931,836 | 6 | 6 |
| $000F | 870,626 | 6 | 6 |
| $000A | 630,487 | 6 | 5 |
| $000C | 578,101 | 6 | 6 |
| $0006 | 560,333 | 6 | 6 |
| $000D | 521,848 | 6 | 6 |
| $00F7 | 515,162 | 2 | 6 |
| $004D | 471,935 | 6 | 6 |
| $00FF | 454,465 | 6 | 6 |
| $0008 | 391,575 | 6 | 6 |
| $003B | 366,125 | 6 | 6 |
| $0004 | 357,177 | 6 | 6 |
| $072C | 345,908 | 4 | 6 |
| $0012 | 336,256 | 4 | 6 |
| $0010 | 290,150 | 6 | 6 |
| $072A | 285,055 | 5 | 6 |
| $00E9 | 218,416 | 6 | 4 |
| $000B | 206,588 | 6 | 5 |
This page shows none of the game's bytes. The listing these figures were read from stays with the cartridge.