Super Mario Bros. + Duck Hunt (USA)

Super Mario Bros. + Duck Hunt (USA) is on a GxROM board with 65,536 bytes of program. A crawl of 400 steps from power-on kept 39 paths that found new code. Played back over 20,979 frames, they executed 11,910 bytes of it, 18 percent.

What the rules named

The 247 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
$C588 (bank 1)a call1,957,668
The random byte: frames it ran in 7,842, bytes $05EC,$05ED,$05EE,$05EF, rotates 4, exclusive-ors 1
$D10E (bank 1)a call152,286
Where two things are compared: instructions 1, pairs of bytes 1, bytes in all 2, times compared 57, X positions at $0032,$0033, Y positions at $0032,$0033
$C35E (bank 1)a call16,167
The jump engine: tables 5, jumps through them 16,167
$C086 (bank 1)each frame (NMI)9,359
The game inside the interrupt: frames it ran in 9,359, frames in all 10,479, the spin is at $8057
$C3C1 (bank 1)a call7,994
The scroll writer: frames it ran in 7,974, writes in the blank 15,948
$C2BF (bank 1)a call7,974
The picture writer: frames it ran in 7,974, writes 6,923, in the blank 6,923, while drawing 0
$C291 (bank 1)a call7,776
The poll: port $4016, reads a frame 8, strobes a frame 0
$F56C (bank 1)a call7,776
The sound driver: frames it ran in 7,776, writes 7,776
$CE4D (bank 1)a call5,482
The sprite writers: frames it ran in 5,482, writes to the sprite page 1,015,547
$8E04 (bank 0)a call3,435
The jump engine: tables 8, jumps through them 3,435
$EBB2 (bank 0)a call1,944
The sprite writers: frames it ran in 486, writes to the sprite page 15,552
$8158 (bank 1)a call1,219
The poll: port $4016, reads a frame 8, strobes a frame 3
$8082 (bank 0)each frame (NMI)807
The split: frames it ran in 816, scroll writes while drawing 1,218, status reads while drawing 103,445
$8EDD (bank 0)a call807
The palette writers: frames it ran in 807, writes 568
$8E5C (bank 0)a call806
The poll: port $4017, reads a frame 8, strobes a frame 2
$8E6A (bank 0)a call806
The poll: port $4016, reads a frame 8, strobes a frame 0
$CA19 (bank 1)a table526
The sprite writers: frames it ran in 526, writes to the sprite page 30,725
$CD5C (bank 1)a table526
The sprite writers: frames it ran in 526, writes to the sprite page 96,583
$8222 (bank 0) (inside another instruction)a call489
The sprite writers: frames it ran in 494, writes to the sprite page 30,807
$F0E9 (bank 0)a call483
The sprite writers: frames it ran in 483, writes to the sprite page 966
$CEF9 (bank 1)a table164
The sprite writers: frames it ran in 164, writes to the sprite page 26,460
$C23B (bank 1)a call86
The sprite writers: frames it ran in 86, writes to the sprite page 5,504
$82BC (bank 1)a call78
The sprite writers: frames it ran in 78, writes to the sprite page 3,744
$C3B8 (bank 1)a call73
The palette writers: frames it ran in 73, writes 2,176
$CD16 (bank 1)a table47
The sprite writers: frames it ran in 47, writes to the sprite page 8,977
$C617 (bank 1)a call43
The split: frames it ran in 86, scroll writes while drawing 86, status reads while drawing 2,366
$8000 (bank 0)power-on39
The bank switch: writes 39, in the blank 39, while drawing 0
The sprite writers: frames it ran in 10,189, writes to the sprite page 5,888
$80EF (bank 1)a call39
The sprite writers: frames it ran in 78, writes to the sprite page 9,984
$822C (bank 1)a call39
The palette writers: frames it ran in 39, writes 1,248
$8268 (bank 1)a call39
The sprite writers: frames it ran in 39, writes to the sprite page 156
$82B7 (bank 1)a call38
The sprite writers: frames it ran in 38, writes to the sprite page 1,824
$CD3C (bank 1)a table31
The sprite writers: frames it ran in 31, writes to the sprite page 5,921
$90CC (bank 0)a call21
The sprite writers: frames it ran in 42, writes to the sprite page 5,376
$8220 (bank 0)a call16
The sprite writers: frames it ran in 16, writes to the sprite page 1,024
$CD4C (bank 1)a table13
The sprite writers: frames it ran in 13, writes to the sprite page 2,483
$CD52 (bank 1)a table12
The sprite writers: frames it ran in 12, writes to the sprite page 2,292
$CE40 (bank 1)a table10
The sprite writers: frames it ran in 10, writes to the sprite page 1,910
$CF00 (bank 1)a table10
The sprite writers: frames it ran in 10, writes to the sprite page 1,910
$9061 (bank 0)a table5
The sprite writers: frames it ran in 5, writes to the sprite page 20
$82B2 (bank 1)a call4
The sprite writers: frames it ran in 4, writes to the sprite page 192
$EFA4 (bank 0)a call3
The sprite writers: frames it ran in 3, writes to the sprite page 3
$D12B (bank 1)a call152,934
$D114 (bank 1)a call152,286
$C426 (bank 1)a call15,530
$C5F7 (bank 1)a call8,211
$C607 (bank 1)a call8,194
$C249 (bank 1)a call7,974
$C263 (bank 1)a call7,974
$C61E (bank 1)a call7,954
$C284 (bank 1)a call7,776
$C348 (bank 1)a call7,776
$F591 (bank 1)a call7,776
$F621 (bank 1)a call7,776
$F6CF (bank 1)a call7,776
$F7CC (bank 1)a call7,776
$C0B3 (bank 1)a call7,775
$D131 (bank 1)a call7,633
$D160 (bank 1)a call7,633
$C86E (bank 1)a table7,195
$CC94 (bank 1)a call7,195
$C6C4 (bank 1)a call7,178
$C6F5 (bank 1)a call7,178
$C7FB (bank 1)a call7,178
$C890 (bank 1)a call7,178
$CCA9 (bank 1)a call7,178
$CFBA (bank 1)a call7,178
$CFC5 (bank 1)a call7,178
$D3D2 (bank 1)a call7,178
$D428 (bank 1)a call7,178
$D3DF (bank 1)a call7,168
$CD1D (bank 1)a table3,784
$9BE1 (bank 0)a call3,445
$84C3 (bank 0)a call2,898
$C047 (bank 0)a call2,898
$F26D (bank 0)a call2,385
$E3EB (bank 0) (inside another instruction)a call1,892
$C5E0 (bank 1)a table1,468
$F1F6 (bank 0)a call1,429
$8129 (bank 1)a call1,385
$84F4 (bank 1)a call1,229
$827C (bank 1)a call1,132
$8EED (bank 0)a call1,072
$C902 (bank 1)a call1,016
$BE70 (bank 0)a call966
$F12A (bank 0)a call956
$F171 (bank 0)a call956
$F180 (bank 0)a call956
$F1D7 (bank 0)a call956
$E3E8 (bank 0)a call946
$F564 (bank 1)a call852
$C71D (bank 1)a call833
$8EE6 (bank 0)a call807
$8182 (bank 0)a call806
$8F97 (bank 0)a call806
$8F9E (bank 0)a call806
$F2D0 (bank 0)a call806
$8212 (bank 0)a call801
$F544 (bank 1)a call780
$F42E (bank 1)a table745
$F550 (bank 1)a call745
$F4EE (bank 1)a table708
$F502 (bank 1)a call708
$F49B (bank 1)a table647
$F568 (bank 1)a call647
$8231 (bank 0)a table630
$92B0 (bank 0)a call536
$92C8 (bank 0)a call536
$D81B (bank 1)a call526
$81C6 (bank 0)a call489
$8245 (bank 0)a table486
$89E1 (bank 0)a call483
$AEEA (bank 0)a call483
$B04A (bank 0)a call483
$B29A (bank 0)a call483
$B624 (bank 0)a call483
$B74F (bank 0)a call483
$B7B8 (bank 0)a call483
$B855 (bank 0)a call483
$B9BC (bank 0)a call483
$BB96 (bank 0)a call483
$BED4 (bank 0)a call483
$EEE9 (bank 0)a call483
$EFBE (bank 0)a call483
$EFEC (bank 0)a call483
$F091 (bank 0)a call483
$C932 (bank 1)a table480
$AF93 (bank 0)a call473
$B0E9 (bank 0)a table473
$B329 (bank 0)a call473
$B35A (bank 0)a table473
$B450 (bank 0)a call473
$B58F (bank 0)a call473
$B5CC (bank 0)a call473
$BF09 (bank 0)a call473
$DC64 (bank 0)a call473
$DEBD (bank 0)a call473
$DEC4 (bank 0)a call473
$DEDD (bank 0)a call473
$DEE8 (bank 0)a call473
$DF9A (bank 0)a call473
$DFA1 (bank 0)a call473
$DFB0 (bank 0)a call473
$E29C (bank 0)a call473
$E3E9 (bank 0)a call473
$9595 (bank 0)a call402
$8567 (bank 0)a table301
$88AE (bank 0)a table268
$C5D9 (bank 1)a call198
$F41B (bank 0)a call174
$F57C (bank 0)a call174
$F667 (bank 0)a call174
$F694 (bank 0)a call174
$AEDC (bank 0)a table171
$889D (bank 0)a table150
$92DB (bank 0)a table134
$93FC (bank 0)a table134
$9508 (bank 0)a call134
$CF0B (bank 1)a call123
$F4E5 (bank 1)a table119
$811C (bank 1)a call117
$81C5 (bank 1)a call78
$8218 (bank 1)a call78
$86E6 (bank 0)a table67
$896A (bank 0)a call67
$D4EE (bank 1)a call65
$F366 (bank 1)a call65
$810F (bank 1)a call59
$8407 (bank 1)a call55
$CEED (bank 1)a table49
$F383 (bank 1)a call46
$F3D0 (bank 1)a call46
$C22B (bank 1)a call43
$C232 (bank 1)a call43
$C5E1 (bank 1)a call43
$9BBB (bank 0)a call40
$C64B (bank 1)a call40
$D4D9 (bank 1)a call40
$80A9 (bank 1)a call39
$80EE (bank 1)a table39
$8478 (bank 1)a call39
$84A1 (bank 1)a call39
$84F3 (bank 1)a table39
$8511 (bank 1)a call39
$D528 (bank 1)a call32
$9589 (bank 0)a call25
$C230 (bank 1)a call23
$C303 (bank 1)a call23
$C5AA (bank 1)a table23
$D4E2 (bank 1)a call23
$D509 (bank 1)a call23
$F581 (bank 1)a call23
$9A2E (bank 0)a table20
$9B0E (bank 0)a table20
$9B36 (bank 0)a call20
$9BAC (bank 0)a call20
$C4BF (bank 1)a call20
$C502 (bank 1)a call20
$C5EE (bank 1)a call20
$C641 (bank 1)a call20
$C793 (bank 1)a call20
$C7B3 (bank 1)a call20
$C81D (bank 1)a table20
$C839 (bank 1)a table20
$C854 (bank 1)a table20
$CCD4 (bank 1)a table20
$CF44 (bank 1)a call20
$D2A4 (bank 1)a call20
$8E19 (bank 0)a call15
$8E2D (bank 0)a call15
$85F1 (bank 0)a call14
$8F06 (bank 0)a call14
$8F11 (bank 0)a call14
$8808 (bank 0)a call12
$D52C (bank 1)a call12
$C919 (bank 1)a table10
$CD9A (bank 1)a table10
$858B (bank 0)a table9
$859B (bank 0)a table9
$8652 (bank 0)a table9
$865A (bank 0)a table9
$8693 (bank 0)a table9
$86A8 (bank 0)a table9
$9C03 (bank 0)a call9
$9C09 (bank 0)a call9
$9C13 (bank 0)a call9
$9C22 (bank 0)a call9
$B038 (bank 0)a call9
$BC30 (bank 0)a call9
$F423 (bank 1)a table8
$8325 (bank 0)a call7
$8FCF (bank 0)a table6
$85BF (bank 0)a table5
$85E3 (bank 0)a table5
$8643 (bank 0)a table5
$86FF (bank 0)a table5
$8732 (bank 0)a table5
$8749 (bank 0)a table5
$90ED (bank 0)a call5
$9131 (bank 0)a table5
$92AA (bank 0)a call5
$92AF (bank 0)a call5
$B069 (bank 0)a table5
$BC36 (bank 0)a call5
$88A5 (bank 0)a call3
$8FE4 (bank 0)a table3
$D464 (bank 1)a call3
$EFDC (bank 0)a call3

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
$8057 (bank 0)
The idle spin: turns 5,174,858, turns a frame 493
$813D (bank 1)
The wait for the frame: waits on the byte at $0020, times entered 1,385, turns 3,486,089, writes of it under the frame interrupt 9,380, frames in all 10,479
$C07C (bank 1)
The wait for the frame: waits on the byte at $0020, times entered 7,779, turns 1,957,629, calls on each turn 1, writes of it under the frame interrupt 9,380, frames in all 10,479
$C5DC (bank 1)
The wait for the frame: waits on the byte at $0020, times entered 198, turns 735,103, writes of it under the frame interrupt 9,380, frames in all 10,479

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
$8218 (bank 0)22$0770
$8237 (bank 0)44$0772
$856D (bank 0)1514$073C
$92CB (bank 0)83$071F
$9667 (bank 0)252
$AEE2 (bank 0)22$0772
$B04F (bank 0)93$000E
$B351 (bank 0)11$001D
$C128 (bank 1)175$0025
$C227 (bank 1)22$0026
$C907 (bank 1)43$0031, $0301
$CCAE (bank 1)1911$0031, $03A1
$CE66 (bank 1)63

The memory its routines share

719 bytes of memory were written by one routine and read by another, and 75 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
$00308041 across, 1 down
$002A921 across, 1 down
$020025611
$03002569
$05002563
$00002562
$04002562
$06002561
$07002561
$03411454
$03421412
$03431412

The 24 busiest shared bytes

bytereads and writesroutines writingroutines reading
$00204,748,57253
$00073,999,87266
$00301,329,51566
$0037606,85966
$0000480,57866
$0034340,91366
$0033196,88966
$0032192,74766
$000198,03266
$000389,70966
$000672,65066
$000442,97566
$004239,76066
$003837,60266
$003C37,60266
$000534,18166
$002832,40336
$002932,40336
$006D30,78466
$03A029,22066
$003528,31266
$003127,10766
$004026,42466
$03AD24,86866

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

All the games