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 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.

atits name in the listingentered bytimeswhat it is, and the evidence
$D385 (bank 7)b7_engine_D385a call162,665
The jump engine: tables 19, jumps through them 162,643
$D367 (bank 7)b7_poll_D367a call128,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_FFCCa call64,522
The bank switch: writes 322,610, in the blank 321,205, while drawing 1,405
$C07B (bank 7)b7_nmieach 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_D2ECa call64,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_8000a call54,157
The sound driver: frames it ran in 53,939, writes 108,314
$C032 (bank 7)b7_bank_C032a call54,157
The bank switch: writes 270,785, in the blank 269,150, while drawing 1,635
$A8CF (bank 5)b5_sprites_A8CFa call35,060
The sprite writers: frames it ran in 34,795, writes to the sprite page 210,883
$A918 (bank 5)b5_sprites_A918a call35,060
The sprite writers: frames it ran in 32,596, writes to the sprite page 145,563
$FFC9 (bank 7)b7_bank_FFC9a call22,804
The bank switch: writes 114,020, in the blank 620, while drawing 113,400
$FFC5 (bank 7)b7_bank_FFC5a call19,603
The bank switch: writes 98,007, in the blank 22,477, while drawing 75,530
$D24C (bank 7)b7_sprites_D24Ca call18,901
The sprite writers: frames it ran in 19,058, writes to the sprite page 1,209,664
$B574 (bank 5)b5_sprites_B574a call17,961
The sprite writers: frames it ran in 17,961, writes to the sprite page 71,844
$B596 (bank 5)b5_sprites_B596a call17,961
The sprite writers: frames it ran in 17,961, writes to the sprite page 215,532
$ED7A (bank 7)b7_sprites_ED7Aa call16,820
The sprite writers: frames it ran in 8,410, writes to the sprite page 234,108
$B678 (bank 5)b5_dispatch_B678a table10,212
The sprite writers: frames it ran in 10,212, writes to the sprite page 416,098
$D250 (bank 7)b7_sprites_D250a call10,084
The sprite writers: frames it ran in 10,083, writes to the sprite page 635,292
$C1C1 (bank 7)b7_bank_C1C1a call10,064
The bank switch: writes 50,315, in the blank 44,921, while drawing 5,394
$C1CD (bank 7)b7_bank_C1CDa call5,208
The bank switch: writes 25,900, in the blank 13,320, while drawing 12,580
$968D (bank 0)b0_sprites_968Da call5,205
The sprite writers: frames it ran in 5,204, writes to the sprite page 41,640
$E070 (bank 7)b7_bank_E070a call4,993
The bank switch: writes 24,965, in the blank 0, while drawing 24,965
$80E5 (bank 0)b0_sprites_80E5a call4,962
The sprite writers: frames it ran in 4,962, writes to the sprite page 104,672
$9888 (bank 0)b0_sprites_9888a call4,962
The sprite writers: frames it ran in 4,962, writes to the sprite page 1,352
$D3CC (bank 7)b7_dispatch_D3CCa table4,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_E1DDa call4,962
The bank switch: writes 24,810, in the blank 0, while drawing 24,810
$EBF0 (bank 7)b7_sprites_EBF0a call4,962
The sprite writers: frames it ran in 4,962, writes to the sprite page 9,834
$C3ED (bank 7)b7_dispatch_C3EDa table3,448
The sprite writers: frames it ran in 3,448, writes to the sprite page 6,896
$FED0 (bank 7)b7_bank_FED0a call2,053
The bank switch: writes 10,265, in the blank 0, while drawing 10,265
$D382 (bank 7)b7_engine_D382a call1,090
The jump engine: tables 1, jumps through them 1,090
$9DB0 (bank 0)b0_split_9DB0a call243
The split: frames it ran in 243, scroll writes while drawing 486, status reads while drawing 62,584
$C24F (bank 7)b7_bank_C24Fa call140
The bank switch: writes 700, in the blank 0, while drawing 700
$FFB1 (bank 7)b7_bank_FFB1a call135
The bank switch: writes 675, in the blank 365, while drawing 310
$FF9D (bank 7)b7_bank_FF9Da call104
The bank switch: writes 520, in the blank 365, while drawing 155
$A8C1 (bank 5)b5_sprites_A8C1a call74
The sprite writers: frames it ran in 74, writes to the sprite page 18,944
$BF9D (bank 5)b5_bank_BF9Da call73
The bank switch: writes 365, in the blank 0, while drawing 365
$BFB1 (bank 5)b5_bank_BFB1a call73
The bank switch: writes 365, in the blank 0, while drawing 365
$FF70 (bank 7)b7_resetpower-on73
The bank switch: writes 292, in the blank 292, while drawing 0
$DFDB (bank 7)b7_bank_DFDBa call70
The bank switch: writes 350, in the blank 0, while drawing 350
$96A8 (bank 0)b0_random_96A8a call62
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_C62Fa table30
The sprite writers: frames it ran in 30, writes to the sprite page 120
$98A6 (bank 0)b0_sprites_98A6a call28
The sprite writers: frames it ran in 28, writes to the sprite page 168
$D55E (bank 7)b7_sprites_D55Ea call28
The sprite writers: frames it ran in 28, writes to the sprite page 56
$BAB8 (bank 5)a call91,168
$F27D (bank 7)a call64,811
$D346 (bank 7)a call64,220
$D174 (bank 7)a call63,938
$D168 (bank 7)a call63,852
$821B (bank 6)a call54,157
$826A (bank 6)a call54,157
$A6D9 (bank 5)a call54,154
$810F (bank 6)a call36,062
$8116 (bank 6)a call36,062
$A6F0 (bank 5)a table35,425
$EAE8 (bank 7)a call30,622
$D56D (bank 7)a call29,772
$D5DA (bank 7)a call29,772
$D603 (bank 7)a table29,772
$815E (bank 6)a call27,316
$816B (bank 6)a call27,316
$D625 (bank 7)a call26,082
$850C (bank 1)a call25,629
$A6DD (bank 0)a call24,810
$B8D2 (bank 5)a call24,315
$A737 (bank 5)a table24,081
$A795 (bank 5)a call22,978
$B22D (bank 5)a table18,675
$B5EA (bank 5)a call16,210
$B623 (bank 5)a call16,210
$AC07 (bank 5)a call16,091
$B5B5 (bank 5)a call15,942
$B663 (bank 5)a call15,214
$AB6D (bank 5)a table10,979
$B3CF (bank 5)a table10,388
$9000 (bank 6)a call10,187
$920B (bank 6)a call10,187
$92F4 (bank 6)a call10,187
$9408 (bank 6)a call10,187
$95A7 (bank 6)a call10,187
$990B (bank 6)a call10,187
$9B18 (bank 6)a call10,187
$E1B8 (bank 7)a call9,986
$E1BE (bank 7)a call9,986
$C2CA (bank 7)a call9,784
$C2E6 (bank 7)a table9,752
$B242 (bank 5)a table8,287
$B261 (bank 5)a table8,105
$B502 (bank 5)a call8,105
$B5D8 (bank 5)a call8,105
$B603 (bank 5)a call8,105
$B63C (bank 5)a call8,105
$B529 (bank 5)a call7,837
$815A (bank 6)a call5,379
$8167 (bank 6)a call5,379
$C1DD (bank 7)a call5,183
$9038 (bank 6)a call5,180
$CF30 (bank 7)a call5,180
$9097 (bank 6)a call5,174
$E079 (bank 7)a call4,993
$8DC3 (bank 0)a call4,962
$903A (bank 0)a call4,962
$9235 (bank 0)a call4,962
$97FA (bank 0)a call4,962
$9847 (bank 0)a call4,962
$9925 (bank 0)a call4,962
$A6D2 (bank 0)a call4,962
$D5A7 (bank 7)a call4,962
$E1E6 (bank 7)a call4,962
$92BF (bank 0)a table4,932
$93BC (bank 0)a call4,932
$9483 (bank 0)a call4,932
$94C5 (bank 0)a call4,932
$959C (bank 0)a call4,932
$9031 (bank 6)a call4,926
$9089 (bank 6)a call4,926
$DEE7 (bank 7)a call4,898
$D1CE (bank 7)a call4,866
$9610 (bank 0)a call4,622
$9A04 (bank 0)a call4,347
$DF56 (bank 7)a call3,658
$C397 (bank 7)a table3,544
$D15C (bank 7)a call3,544
$814F (bank 6)a call2,465
$C947 (bank 7)a call2,077
$8120 (bank 6)a call2,075
$9AB8 (bank 0)a table2,053
$C82B (bank 7)a call1,984
$8147 (bank 6)a call1,873
$906F (bank 6)a call1,557
$C988 (bank 7)a call1,550
$C944 (bank 7)a call1,271
$CF3C (bank 7)a table1,090
$9A30 (bank 0)a call1,052
$9AA8 (bank 0)a call1,047
$9A77 (bank 0)a table1,030
$D120 (bank 7)a table966
$814B (bank 6)a call958
$C95C (bank 7)a call806
$C95F (bank 7)a call744
$9042 (bank 6)a call734
$80EE (bank 1)a table713
$8247 (bank 1)a call713
$C912 (bank 7)a call713
$818C (bank 6)a call710
$A2D4 (bank 0)a call672
$BA6F (bank 5)a call594
$D19B (bank 7)a call589
$9B13 (bank 0)a table510
$FD82 (bank 7)a call510
$9067 (bank 6)a call464
$821D (bank 1)a table434
$906B (bank 6)a call420
$F2D3 (bank 7)a call400
$D263 (bank 7)a call354
$D261 (bank 7)a call323
$D266 (bank 7)a call323
$A3B3 (bank 0)a call280
$A558 (bank 0)a call280
$A56B (bank 0)a call280
$A589 (bank 0)a call280
$8201 (bank 1)a call279
$BA40 (bank 5)a call273
$AE15 (bank 5)a table255
$959D (bank 6)a call233
$AEC1 (bank 5)a call231
$ACFA (bank 5)a call222
$AE55 (bank 5)a table219
$AF1F (bank 5)a table219
$AC31 (bank 5)a table191
$8293 (bank 6)a call170
$9B19 (bank 0)a call153
$A1DD (bank 0)a table152
$B24E (bank 5)a table145
$C258 (bank 7)a call140
$A5A4 (bank 0)a call122
$D29C (bank 7)a call104
$BA18 (bank 5)a call102
$AC73 (bank 5)a table99
$ACA8 (bank 5)a table99
$81F3 (bank 1)a table93
$DF4C (bank 7)a call93
$B40A (bank 5)a table91
$A6A0 (bank 5)a call73
$A70F (bank 5)a table73
$A72E (bank 5)a table73
$ADE0 (bank 5)a call73
$AF2B (bank 5)a table73
$AF34 (bank 5)a table73
$B960 (bank 5)a call73
$D281 (bank 7)a call73
$A49F (bank 0)a call70
$A546 (bank 0)a call70
$DFE4 (bank 7)a call70
$CB18 (bank 7)a call64
$A2FE (bank 0)a table60
$A35F (bank 0)a call60
$A5E3 (bank 0)a call60
$B412 (bank 5)a table54
$B3DF (bank 5)a table34
$B3F4 (bank 5)a table34
$AF02 (bank 5)a table33
$A057 (bank 0)a call32
$A6E5 (bank 5)a table32
$AA08 (bank 0)a call32
$B911 (bank 5)a call32
$BA6C (bank 5)a call32
$C34F (bank 7)a table32
$C3A5 (bank 7)a table32
$C3B5 (bank 7)a table32
$C3E6 (bank 7)a table32
$CB35 (bank 7)a table32
$CC50 (bank 7)a call32
$CC97 (bank 7)a call32
$CD40 (bank 7)a table32
$D293 (bank 7)a call32
$812F (bank 1)a table31
$81A3 (bank 1)a table31
$8340 (bank 1)a table31
$C4CB (bank 7)a call31
$C63E (bank 7)a table31
$C690 (bank 7)a call31
$C70C (bank 7)a table31
$C755 (bank 7)a call31
$C819 (bank 7)a call31
$C89D (bank 7)a call31
$C927 (bank 7)a call31
$D05B (bank 7)a table31
$D0FC (bank 7)a table31
$D25E (bank 7)a table31
$D269 (bank 7)a table31
$D27D (bank 7)a call31
$9047 (bank 0)a table30
$90ED (bank 0)a call30
$99D4 (bank 0)a call30
$E030 (bank 7)a call30
$942B (bank 0)a call19
$A3D7 (bank 0)a table11
$AD7C (bank 5)a call11
$A57E (bank 0)a call10
$A26B (bank 0)a table7
$AEEE (bank 5)a call7
$9064 (bank 6)a call6
$A148 (bank 0)a table6
$A347 (bank 0)a table6
$AF19 (bank 5)a table2
$960B (bank 0)a call1
$A338 (bank 0)a table1

Where it waits

Loops a rule named that sit inside a routine and are not themselves a place the code is entered.

atits name in the listingwhat 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.

atreachedentriestakenchosen by the byte at
$903F (bank 0)after a call22$00B5
$9A1E (bank 0)after a call94$0740
$9DE4 (bank 0)after a call97$0524
$8133 (bank 1)after a call81$0731
$A6DF (bank 5)after a call33$076C
$A705 (bank 5)after a call55$0736
$ABEB (bank 5)after a call66$0761
$AE4F (bank 5)after a call33$0035
$B236 (bank 5)after a call22$0736
$B248 (bank 5)after a call33$073B
$B3D5 (bank 5)after a call55$073B
$C2D8 (bank 7)after a call22$076C
$C2EC (bank 7)after a call18$0736
$C39D (bank 7)after a call44$0738
$CF42 (bank 7)after a call55$0769
$D5F1 (bank 7)through a pointer11$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.

004080C0$0000$0100$0200$0300$0400$0500$0600$0700
The console's 2,048 bytes of memory, one row for each 256. A tick under a row is one of the 24 busiest shared bytes. The second row is the page the processor keeps its stack in. Reaches through an index that belong to no table are not drawn: the loops that clear memory reach nearly every byte.

Reaches through an index: those that hold positions, then the longest

frombytes reachedinstructionspositions it holds
$02002566
$03002562
$04002562
$07002562
$05002561
$06002561
$00002242
$03021636
$03011631
$02671083
$03A4592
$0201575

The 24 busiest shared bytes

bytereads and writesroutines writingroutines reading
$073679,549,38466
$00004,342,08666
$00012,363,57966
$00F51,848,29236
$00021,524,21666
$0003997,02166
$000E931,83666
$000F870,62666
$000A630,48765
$000C578,10166
$0006560,33366
$000D521,84866
$00F7515,16226
$004D471,93566
$00FF454,46566
$0008391,57566
$003B366,12566
$0004357,17766
$072C345,90846
$0012336,25646
$0010290,15066
$072A285,05556
$00E9218,41664
$000B206,58865

This page shows none of the game's bytes. The listing these figures were read from stays with the cartridge.

All the games