Ninja Gaiden (USA)

Ninja Gaiden (USA) is on a MMC1 board with 131,072 bytes of program. A crawl of 400 steps from power-on kept 36 paths that found new code. Played back over 24,896 frames, they executed 8,601 bytes of it, 7 percent.

What the rules named

The 123 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
$80F4 (bank 3)a call36,011
The sound driver: frames it ran in 9,074, writes 102,492
$E819 (bank 7)a call28,174
The poll: port $4016, reads a frame 15, strobes a frame 3
$C028 (bank 7)a call21,686
The bank switch: writes 108,349, in the blank 0, while drawing 108,349
$C02A (bank 7)a call17,612
The bank switch: writes 88,029, in the blank 0, while drawing 88,029
$80A8 (bank 5)a call17,372
The jump engine: tables 1, jumps through them 17,372
$F91A (bank 7)each frame (NMI)14,087
The bank switch: writes 308,539, in the blank 260,271, while drawing 48,268
The palette writers: frames it ran in 14,148, writes 118,694
The scroll writer: frames it ran in 14,148, writes in the blank 28,174
The picture writer: frames it ran in 14,148, writes 151,036, in the blank 151,036, while drawing 0
$823B (bank 4)a call8,693
The wait for the frame: waits on the byte at $001F, times entered 8,692, turns 12,877,382, writes of it under the frame interrupt 14,057, frames in all 14,396
$8181 (bank 4)a call8,686
The sprite writers: frames it ran in 8,686, writes to the sprite page 527,376
$F104 (bank 7)a call5,096
The wait for the frame: waits on the byte at $001F, times entered 5,116, turns 16,857,610, writes of it under the frame interrupt 14,057, frames in all 14,396
$F5A2 (bank 7)a call4,954
The bank switch: writes 49,467, in the blank 0, while drawing 49,467
The split: frames it ran in 4,953, scroll writes while drawing 9,897, status reads while drawing 3,417,661
$8013 (bank 5)a call2,454
The sprite writers: frames it ran in 2,454, writes to the sprite page 78,408
$F768 (bank 7)a call1,154
The sprite writers: frames it ran in 1,154, writes to the sprite page 72,654
$F0A7 (bank 7)a call1,125
The sprite writers: frames it ran in 1,125, writes to the sprite page 19,813
$D8D5 (bank 7)a call1,107
The bank switch: writes 5,529, in the blank 0, while drawing 5,529
$F47E (bank 7)a call504
The bank switch: writes 5,040, in the blank 0, while drawing 5,040
$8301 (bank 4)a call269
The wait for the frame: waits on the byte at $001F, times entered 269, turns 756,096, writes of it under the frame interrupt 14,057, frames in all 14,396
$F5EA (bank 7)a call251
The bank switch: writes 1,255, in the blank 0, while drawing 1,255
$818E (bank 6)a call240
The jump engine: tables 1, jumps through them 240
$81E9 (bank 4)a call199
The bank switch: writes 995, in the blank 0, while drawing 995
$86D2 (bank 4)a call133
The sprite writers: frames it ran in 133, writes to the sprite page 133
$817D (bank 4)a call131
The sprite writers: frames it ran in 131, writes to the sprite page 8,253
$8328 (bank 4)a call102
The sprite writers: frames it ran in 102, writes to the sprite page 408
$FFDA (bank 7)power-on36
The bank switch: writes 252, in the blank 252, while drawing 0
The sprite writers: frames it ran in 108, writes to the sprite page 9,216
$E902 (bank 7)a call29
The bank switch: writes 270, in the blank 0, while drawing 270
$EAC1 (bank 7)a call29
The bank switch: writes 290, in the blank 0, while drawing 290
The split: frames it ran in 116, scroll writes while drawing 58, status reads while drawing 21,286
The sprite writers: frames it ran in 116, writes to the sprite page 116
$F8F0 (bank 7)a call29
The bank switch: writes 290, in the blank 0, while drawing 290
The split: frames it ran in 58, scroll writes while drawing 58, status reads while drawing 19,923
$8161 (bank 3)a call37,495
$BF98 (bank 4)a call17,612
$BFB3 (bank 5)a call17,372
$8000 (bank 3)a call14,085
$8003 (bank 5)a table8,686
$8006 (bank 5)a table8,686
$83A9 (bank 4)a call8,686
$83B5 (bank 4)a call8,686
$81D7 (bank 6)a call6,940
$81C8 (bank 6)a call6,700
$82B9 (bank 3)a call6,139
$81A4 (bank 6)a call5,704
$81B5 (bank 6)a call5,704
$81E5 (bank 6)a call5,704
$E792 (bank 7)a call5,445
$82E0 (bank 4)a call4,234
$867F (bank 4)a call3,205
$F53E (bank 7)a call3,024
$F568 (bank 7)a call3,024
$837A (bank 3)a call3,020
$8193 (bank 5)a call2,454
$80D6 (bank 5)a call2,422
$87A0 (bank 4)a call1,383
$84D7 (bank 3)a table1,245
$D85D (bank 7)a call1,125
$DC88 (bank 7)a call1,125
$EB64 (bank 7)a call1,125
$F10D (bank 7)a call1,125
$D710 (bank 7)a call1,107
$D9E4 (bank 7)a call1,107
$DD32 (bank 7)a call1,107
$E560 (bank 7)a call1,107
$E625 (bank 7)a call1,107
$E677 (bank 7)a call1,107
$EB7B (bank 7)a call1,107
$EFF1 (bank 7)a call1,107
$F1AC (bank 7)a call1,107
$F7E4 (bank 7)a call1,107
$8225 (bank 3)a table884
$820A (bank 3)a table883
$81F0 (bank 3)a table852
$EC7B (bank 7)a table741
$8535 (bank 3)a table638
$822F (bank 4)a call577
$F2DD (bank 7)a call504
$81AA (bank 4)a call466
$823A (bank 3)a table427
$8205 (bank 3)a table426
$83CB (bank 3)a table300
$8340 (bank 4)a call256
$8398 (bank 4)a call256
$8000 (bank 6)a table240
$8157 (bank 6)a call240
$8166 (bank 6)a call240
$BFB3 (bank 6)a call240
$8192 (bank 4)a call233
$81CF (bank 4)a call233
$81DE (bank 4)a call233
$8243 (bank 3)a call216
$E2C3 (bank 7)a call216
$F745 (bank 7)a call216
$8471 (bank 3)a table213
$83E6 (bank 3)a table208
$F85D (bank 7)a table200
$81FD (bank 4)a call197
$F850 (bank 7)a table187
$F86F (bank 7)a table187
$F83E (bank 7)a table179
$F86A (bank 7)a table179
$F831 (bank 7)a table175
$EDB1 (bank 7)a table136
$ED0D (bank 7)a table135
$85EB (bank 4)a call132
$84C3 (bank 3)a table123
$EEE7 (bank 7)a call121
$8448 (bank 3)a table117
$80BE (bank 4)a call102
$860A (bank 4)a call66
$868D (bank 4)a call66
$F62D (bank 7)a call58
$EE55 (bank 7)a table57
$8407 (bank 3)a table56
$EE99 (bank 7)a table38
$8000 (bank 4)a call36
$E526 (bank 7)a call36
$8500 (bank 3)a table32
$850D (bank 3)a table30
$E7DC (bank 7)a call29
$E7E7 (bank 7)a call29
$F0F3 (bank 7)a call29
$83FA (bank 3)a table28
$84F2 (bank 3)a table28
$D97C (bank 7)a call27
$E30A (bank 7)a call27
$F653 (bank 7)a call27
$F6B5 (bank 7)a call27
$8431 (bank 3)a table2

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
$BFB6 (bank 5)32
$BFB6 (bank 6)11

The memory its routines share

364 bytes of memory were written by one routine and read by another, and 45 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
$03002562
$02002534
$02032533
$02012532
$02022532
$06271131
$06281131
$062C1131
$06301131
$0340492
$0700354
$03A3326

The 24 busiest shared bytes

bytereads and writesroutines writingroutines reading
$0028737,49336
$00F0691,79336
$00F3669,67726
$00F2608,41225
$00F1468,86736
$0000272,18966
$0001239,63266
$000298,80666
$033F56,77655
$005C53,46133
$00F451,82766
$00F545,59266
$001C42,47766
$038041,83233
$00E432,06035
$00E532,06035
$066D27,67723
$067D27,67623
$064D27,15423
$00A727,11854
$069D26,95423
$062625,36723
$067C23,74856
$069C23,61046

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

All the games