Legend of Zelda, The (USA) (Rev 1)

Legend of Zelda, The (USA) (Rev 1) is on a MMC1 board with 131,072 bytes of program. A crawl of 400 steps from power-on kept 18 paths that found new code. Played back over 13,878 frames, they executed 4,548 bytes of it, 3 percent.

What the rules named

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

atentered bytimeswhat it is, and the evidence
$FFAC (bank 7)a call8,128
The bank switch: writes 40,640, in the blank 13,619, while drawing 27,021
$E5E2 (bank 7)a call5,934
The jump engine: tables 7, jumps through them 5,934
$98F5 (bank 2)a call4,230
The sprite writers: frames it ran in 1,410, writes to the sprite page 67,680
$A0F6 (bank 6)a call2,616
The palette writers: frames it ran in 2,616, writes 2,800
The picture writer: frames it ran in 2,616, writes 27,706, in the blank 8,169, while drawing 19,537
$E484 (bank 7)each frame (NMI)2,616
The game inside the interrupt: frames it ran in 2,729, frames in all 3,378, the spin is at $E45B
The random byte: frames it ran in 2,729, bytes $0018,$0019,$001A, rotates 3, exclusive-ors 1
The scroll writer: frames it ran in 2,729, writes in the blank 8,082
$E62D (bank 7)a call2,615
The poll: port $4017, reads a frame 17, strobes a frame 6
The random byte: frames it ran in 2,695, bytes $0000,$00F8,$00F9, rotates 3, exclusive-ors 1
$E640 (bank 7)a call2,615
The poll: port $4016, reads a frame 18, strobes a frame 4
The random byte: frames it ran in 2,615, bytes $0000,$00F8,$00F9, rotates 3, exclusive-ors 1
$9C67 (bank 0)a call2,598
The sound driver: frames it ran in 2,598, writes 11,544
$986B (bank 2)a call1,410
The sprite writers: frames it ran in 1,410, writes to the sprite page 157,920
$9943 (bank 2)a call1,410
The sprite writers: frames it ran in 1,410, writes to the sprite page 22,560
$9EF0 (bank 2)a table528
The sprite writers: frames it ran in 528, writes to the sprite page 528
$A1C3 (bank 2)a call528
The sprite writers: frames it ran in 528, writes to the sprite page 1,056
$A1DD (bank 2)a call528
The sprite writers: frames it ran in 528, writes to the sprite page 1,056
$A204 (bank 2)a call528
The sprite writers: frames it ran in 528, writes to the sprite page 3
$A59A (bank 2)a table326
The sprite writers: frames it ran in 326, writes to the sprite page 1,252
$E5F7 (bank 7)a call80
The sprite writers: frames it ran in 80, writes to the sprite page 5,120
$FF50 (bank 7)power-on18
The bank switch: writes 162, in the blank 162, while drawing 0
$FF98 (bank 7)a call18
The bank switch: writes 90, in the blank 90, while drawing 0
$A18E (bank 2)a call13
The sprite writers: frames it ran in 13, writes to the sprite page 180
$A351 (bank 2)a call83,520
$A42B (bank 2)a call16,965
$9C50 (bank 0)a call4,278
$9F7C (bank 0)a call2,852
$A080 (bank 6)a call2,616
$9825 (bank 0)a call2,598
$98CC (bank 0)a call2,598
$99A0 (bank 0)a call2,598
$9AD3 (bank 0)a call2,598
$9B83 (bank 0)a call2,598
$EB30 (bank 7)a call2,318
$9020 (bank 2)a table1,442
$903B (bank 2)a table1,410
$90CF (bank 2)a call1,410
$95AC (bank 2)a table1,410
$98C3 (bank 2)a call1,410
$A1F7 (bank 2)a call1,056
$A011 (bank 2)a call528
$E625 (bank 7)a call403
$A591 (bank 2)a table339
$E8F8 (bank 7)a call280
$A307 (bank 2)a call192
$E96F (bank 7)a table112
$9EE2 (bank 0)a call102
$A35D (bank 2)a call96
$E94B (bank 7)a table85
$9D2A (bank 2)a call78
$9C27 (bank 0)a call77
$9FDE (bank 2)a call65
$E9C3 (bank 7)a table65
$E47D (bank 7)a call64
$E580 (bank 7)a call64
$9C09 (bank 0)a call54
$804F (bank 2)a call51
$9C3B (bank 0)a call51
$A4C4 (bank 2)a table48
$E46D (bank 7)a call46
$A3E1 (bank 2)a call39
$A437 (bank 2)a call39
$8D84 (bank 1)a call34
$9BFF (bank 0)a call34
$9C1D (bank 0)a call34
$9EDC (bank 0)a call34
$9F72 (bank 0)a call34
$A2A0 (bank 2)a table32
$808C (bank 6)a call18
$80C6 (bank 6)a call18
$80D7 (bank 6)a call18
$8D00 (bank 1)a call18
$B4AC (bank 5)a call18
$B4E8 (bank 5)a call18
$E45E (bank 7)a call18
$E608 (bank 7)a call18
$94E7 (bank 2)a table17
$9512 (bank 2)a table17
$9545 (bank 2)a table17
$905D (bank 2)a table16
$A47F (bank 2)a table16
$A4BD (bank 2)a table16
$A51E (bank 2)a table16
$A0F0 (bank 2)a call13
$A5DF (bank 2)a table13
$9FC5 (bank 2)a table9
$A017 (bank 2)a call2

Where it waits

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

atwhat it is, and the evidence
$E45B (bank 7)
The idle spin: turns 19,870,380, turns a frame 5,882

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.

atentriestakenchosen by the byte at
$900E (bank 2)33$042D
$9035 (bank 2)33$0013
$90DA (bank 2)11$042D
$A292 (bank 2)75$0013
$A596 (bank 2)22$0013
$E923 (bank 7)23$0012, $0016

The memory its routines share

564 bytes of memory were written by one routine and read by another, and 28 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

frombytes reachedinstructionspositions it holds
$02012534
$02002533
$02022532
$02032532
$00002406
$01FF1131
$0302529
$0305442
$0001251
$0638243
$0309181
$0303161

The 24 busiest shared bytes

bytereads and writesroutines writingroutines reading
$00001,642,77866
$00011,484,13766
$00021,115,85066
$0003683,63966
$00F8291,35216
$000E169,02456
$000F168,20855
$000435,28366
$000528,51666
$00FA16,44313
$001515,93125
$00147,97563
$00E37,88212
$00077,58255
$00116,82666
$03026,04966
$005C5,26822
$06005,26542
$06025,25952
$06045,25242
$00E05,24913
$06015,23222
$00125,07536
$6E074,84823

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

All the games