Goonies II, The (USA)

Goonies II, The (USA) is on a UxROM board with 131,072 bytes of program. A crawl of 6,400 steps from power-on kept 119 paths that found new code. Played back over 265,939 frames, they executed 17,460 bytes of it, 13 percent.

What the rules named

The 345 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
$A453 (bank 2)b2_sprites_A453a call1,650,795
The sprite writers: frames it ran in 94,809, writes to the sprite page 1,712,500
$D4D7 (bank 7)b7_engine_D4D7a call373,113
The jump engine: tables 18, jumps through them 373,113
$C1BC (bank 7)b7_bank_C1BCa call312,759
The bank switch: writes 312,758, in the blank 34,091, while drawing 278,667
$82E8 (bank 2)b2_sound_82E8a call199,187
The sound driver: frames it ran in 59,218, writes 82,197
$C1C0 (bank 7)b7_bank_C1C0a call96,113
The bank switch: writes 96,113, in the blank 41,284, while drawing 54,829
$C1BE (bank 7)b7_bank_C1BEa call96,112
The bank switch: writes 96,112, in the blank 40,402, while drawing 55,710
$C07C (bank 7)b7_nmieach frame (NMI)94,634
The game inside the interrupt: frames it ran in 95,068, frames in all 97,519, the spin is at $C072
$C10E (bank 7)b7_split_C10Ea call94,632
The split: frames it ran in 94,409, scroll writes while drawing 106,536, status reads while drawing 18,790,653
$D18F (bank 7)b7_poll_D18Fa call94,631
The poll: port $4016, reads a frame 16, strobes a frame 4
The poll: port $4017, reads a frame 16, strobes a frame 4
$DF97 (bank 7)b7_drain_DF97a call94,595
The palette writers: frames it ran in 94,610, writes 9,488
The picture writer: frames it ran in 94,610, writes 378,563, in the blank 318,332, while drawing 60,231
$A3CC (bank 2)b2_sprites_A3CCa call94,492
The sprite writers: frames it ran in 94,810, writes to the sprite page 5,240,675
$C0EC (bank 7)b7_scroll_C0ECa call52,175
The scroll writer: frames it ran in 52,074, writes in the blank 104,148
$C1AD (bank 7)b7_sprites_C1ADa call52,175
The sprite writers: frames it ran in 52,074, writes to the sprite page 208,700
$83BA (bank 0)b0_compare_83BAa call51,548
Where two things are compared: instructions 2, pairs of bytes 7, bytes in all 9, times compared 73, X positions at $0058,$03A7,$03AA,$03AD, Y positions at $0059,$0336,$033E,$0340,$0341
$8482 (bank 6)b6_compare_8482a call51,133
Where two things are compared: instructions 3, pairs of bytes 3, bytes in all 5, times compared 478, X positions at $003F,$006C,$03A7, Y positions at $0059,$033B
$C1A9 (bank 7)b7_sprites_C1A9a call37,666
The sprite writers: frames it ran in 37,545, writes to the sprite page 150,664
$B092 (bank 0)b0_compare_B092a call17,608
Where two things are compared: instructions 4, pairs of bytes 31, bytes in all 23, times compared 13,739, X positions at $003F,$0058,$03A7,$03AA,$03AB,$03AC,$03AD,$03AE,$03AF,$03B1, Y positions at $0059,$0336,$033B,$033E,$033F,$0340,$0341,$0342,$0343,$0344,$0345,$037E
$CE6C (bank 7)b7_sprites_CE6Ca call13,622
The sprite writers: frames it ran in 13,622, writes to the sprite page 27,244
$83A9 (bank 6)b6_compare_83A9a call9,518
Where two things are compared: instructions 1, pairs of bytes 1, bytes in all 2, times compared 34, Y positions at $0336,$037E
$8CF0 (bank 6)b6_sprites_8CF0a call1,846
The sprite writers: frames it ran in 1,846, writes to the sprite page 3,692
$D79E (bank 7)b7_dispatch_D79Ea table813
The sprite writers: frames it ran in 813, writes to the sprite page 16
$C219 (bank 7)b7_bank_C219a call575
The bank switch: writes 4,936, in the blank 238, while drawing 4,698
$981D (bank 0)b0_compare_981Da call347
Where two things are compared: instructions 1, pairs of bytes 7, bytes in all 6, times compared 297, X positions at $003F,$0058,$03AA,$03AB,$03AD,$03AF
$EF49 (bank 7)b7_random_EF49a call252
The random byte: frames it ran in 252, bytes $006C,$0511, rotates 4, exclusive-ors 2
$D11B (bank 7)b7_sprites_D11Ba call216
The sprite writers: frames it ran in 216, writes to the sprite page 3,456
$C008 (bank 7)b7_resetpower-on119
The sprite writers: frames it ran in 95,089, writes to the sprite page 29,696
$CE38 (bank 7)b7_dispatch_CE38a table107
The sprite writers: frames it ran in 321, writes to the sprite page 107
$CE53 (bank 7)b7_dispatch_CE53a table107
The sprite writers: frames it ran in 107, writes to the sprite page 214
$EEA6 (bank 7)b7_random_EEA6a call98
The random byte: frames it ran in 98, bytes $006C,$0511, rotates 4, exclusive-ors 1
$9581 (bank 0)b0_dispatch_9581a table56
Where two things are compared: instructions 1, pairs of bytes 2, bytes in all 3, times compared 36, X positions at $03A7,$03AE,$03B1
$9853 (bank 0)b0_compare_9853a call56
Where two things are compared: instructions 1, pairs of bytes 3, bytes in all 5, times compared 56, Y positions at $0059,$0336,$0342,$0344,$0345
$987D (bank 0)b0_compare_987Da call21
Where two things are compared: instructions 1, pairs of bytes 4, bytes in all 5, times compared 24, X positions at $003F,$0058,$0366,$03AE,$03AF
$D81A (bank 7)b7_sprites_D81Aa call18
The sprite writers: frames it ran in 18, writes to the sprite page 72
$CEE8 (bank 7)b7_dispatch_CEE8a table9
The sprite writers: frames it ran in 27, writes to the sprite page 27
$D7FD (bank 7)b7_sprites_D7FDa call4
The sprite writers: frames it ran in 4, writes to the sprite page 16
$D96B (bank 7)b7_sprites_D96Ba call4
The sprite writers: frames it ran in 4, writes to the sprite page 4
$CC81 (bank 7)b7_palette_CC81a call3
The palette writers: frames it ran in 1, writes 32
$9868 (bank 0)b0_compare_9868a call2
Where two things are compared: instructions 1, pairs of bytes 1, bytes in all 2, times compared 2, Y positions at $0059,$0343
$D807 (bank 7)b7_sprites_D807a call2
The sprite writers: frames it ran in 2, writes to the sprite page 8
$EA66 (bank 7)a call307,485
$EAEC (bank 7)a call285,408
$CC77 (bank 7)a call165,395
$EE10 (bank 7)a call158,791
$F014 (bank 7)a call122,614
$817F (bank 2)a call121,414
$861F (bank 2)a call109,943
$B69C (bank 0)a call103,292
$C19A (bank 7)a call95,963
$C1F7 (bank 7)a call94,671
$8179 (bank 2)a call94,552
$CCFC (bank 7)a call94,480
$C47D (bank 7)a call94,479
$C479 (bank 7)a call91,608
$EA95 (bank 7)a call71,352
$80D8 (bank 0)a call70,365
$80CC (bank 0)a table69,981
$80E9 (bank 0)a call69,981
$99F6 (bank 0)a call66,268
$EE01 (bank 7)a call59,939
$E3B8 (bank 7)a call56,694
$E03C (bank 7)a call56,574
$E05B (bank 7)a call56,574
$E257 (bank 7)a table52,560
$E298 (bank 7)a call52,560
$8026 (bank 0)a call51,548
$80B2 (bank 6)a call51,548
$852E (bank 0)a call51,548
$9339 (bank 6)a call51,548
$B49F (bank 0)a call51,548
$B711 (bank 0)a call51,548
$E487 (bank 7)a call51,548
$E73E (bank 7)a call51,548
$F6FC (bank 7)a call51,548
$8141 (bank 6)a call51,135
$813B (bank 6)a table51,133
$8651 (bank 6)a call51,133
$8786 (bank 6)a call51,133
$E013 (bank 7)a table50,581
$9378 (bank 0)a table49,261
$863D (bank 6)a call46,251
$F548 (bank 7)a call45,558
$B2D4 (bank 0)a call43,326
$98E8 (bank 0)a call41,268
$9A0A (bank 0)a call40,425
$99CA (bank 0)a call40,383
$9922 (bank 0)a call40,366
$8978 (bank 6)a call34,515
$EE69 (bank 7)a call34,004
$8824 (bank 6)a table33,592
$990E (bank 0)a call26,745
$91AB (bank 0)a call25,843
$93AF (bank 0)a table25,843
$9942 (bank 0)a call25,843
$998D (bank 0)a call25,843
$9A1C (bank 0)a call25,843
$E4A2 (bank 7)a call25,772
$E599 (bank 7)a call25,772
$E8D1 (bank 7)a call23,591
$CE21 (bank 7)a table23,254
$8641 (bank 0)a call20,156
$85D0 (bank 0)a call20,058
$E8A0 (bank 7)a call19,460
$EB22 (bank 7)a call19,460
$93BC (bank 0)a table16,267
$910A (bank 0)a table15,941
$915A (bank 0)a table14,467
$8592 (bank 2)a call14,304
$CE81 (bank 7)a table13,515
$D1FF (bank 7)a call13,180
$E775 (bank 7)a call13,080
$E7A4 (bank 7)a call13,080
$85F7 (bank 2)a call12,979
$8AF2 (bank 6)a table9,323
$C481 (bank 7)a call9,111
$9131 (bank 0)a table8,435
$CEB4 (bank 7)a table7,576
$CF10 (bank 7)a table7,568
$8656 (bank 0)a call7,415
$8AED (bank 6)a table6,376
$CDED (bank 7)a table6,115
$B5B5 (bank 5)a call6,113
$E00B (bank 7)a call6,113
$8809 (bank 6)a call5,332
$817C (bank 2)a call5,223
$CD1E (bank 7)a table4,670
$B689 (bank 0)a call3,878
$DE81 (bank 7)a call2,312
$CDC8 (bank 7)a table2,288
$F752 (bank 7)a call2,098
$CD9B (bank 7)a table1,992
$FA29 (bank 7)a call1,992
$E7DE (bank 7)a call1,972
$CEFD (bank 7)a table1,846
$800F (bank 1)a call1,808
$8D8F (bank 1)a call1,808
$E313 (bank 7)a table1,808
$C0E4 (bank 7)a call1,754
$81E8 (bank 0)a table1,656
$822A (bank 0)a table1,654
$CD4F (bank 7)a table1,577
$81BA (bank 0)a call1,545
$84E2 (bank 0)a call1,540
$E868 (bank 7)a call1,531
$EE75 (bank 7)a call1,530
$C483 (bank 7)a call1,528
$E16F (bank 7)a table1,471
$867A (bank 0)a call1,443
$8EEB (bank 1)a table1,432
$9366 (bank 6)a table1,302
$93E3 (bank 6)a table1,263
$949B (bank 6)a call1,263
$9488 (bank 0)a table1,246
$8814 (bank 6)a call1,223
$8BE1 (bank 6)a table1,220
$C1CC (bank 7)a call1,219
$9932 (bank 0)a call1,157
$C424 (bank 7)a call1,106
$8467 (bank 0)a call1,046
$941A (bank 0)a call902
$9463 (bank 6)a call783
$8692 (bank 0)a call758
$94A0 (bank 0)a table746
$9DF7 (bank 1)a call604
$CD6D (bank 7)a table603
$9DEF (bank 1)a call600
$D626 (bank 7)a call592
$D653 (bank 7)a call592
$9393 (bank 0)a table585
$97EC (bank 0)a call530
$8161 (bank 0)a table511
$CD58 (bank 7)a table485
$F7A2 (bank 7)a call460
$F7EF (bank 7)a call460
$F9D2 (bank 7)a call460
$F9F5 (bank 7)a call460
$9563 (bank 0)a table452
$8233 (bank 0)a table448
$8609 (bank 2)a call435
$8269 (bank 0)a table412
$8325 (bank 0)a call412
$8C19 (bank 6)a table372
$C1CA (bank 7)a call356
$989C (bank 0)a call347
$C212 (bank 7)a call340
$C0DD (bank 7)a call339
$DE40 (bank 7)a call334
$81AF (bank 2)a call332
$D227 (bank 7)a call331
$E7B4 (bank 7)a call308
$8029 (bank 6)a call272
$89B0 (bank 6)a call262
$D50B (bank 7)a call253
$DE42 (bank 7)a call244
$DDFE (bank 7)a call231
$E344 (bank 7)a call206
$E132 (bank 7)a call205
$8F3F (bank 1)a table204
$9106 (bank 1)a call204
$928E (bank 1)a table196
$A17B (bank 1)a call196
$98E1 (bank 0)a call195
$98DA (bank 0)a call182
$E187 (bank 7)a table180
$E658 (bank 7)a call168
$8BAE (bank 6)a table158
$952F (bank 0)a table156
$911E (bank 0)a table138
$865F (bank 0)a call132
$E2C0 (bank 7)a table132
$8680 (bank 0)a call131
$8F5E (bank 1)a table126
$CBA3 (bank 7)a call119
$D1FA (bank 7)a call119
$C0D3 (bank 7)a call116
$ED9F (bank 7)a call111
$8000 (bank 6)a call110
$E32E (bank 7)a call104
$E0F5 (bank 7)a call103
$E124 (bank 7)a call103
$EB69 (bank 7)a call103
$EBAB (bank 7)a call103
$EC40 (bank 7)a call103
$ECBF (bank 7)a call103
$ECE6 (bank 7)a call103
$ED0D (bank 7)a call103
$ED34 (bank 7)a call103
$ED8D (bank 7)a call103
$E1DA (bank 7)a call102
$81AF (bank 0)a call100
$E07D (bank 7)a table100
$E099 (bank 7)a call100
$E0ED (bank 7)a table99
$84E9 (bank 0)a call98
$B628 (bank 0)a call98
$B6A5 (bank 0)a call98
$E1B3 (bank 7)a table98
$E202 (bank 7)a call98
$EE84 (bank 7)a call98
$F4B4 (bank 7)a call98
$938A (bank 0)a table97
$D467 (bank 7)a call96
$E952 (bank 7)a call96
$EB4C (bank 7)a call96
$CECC (bank 7)a table94
$D413 (bank 7)a call94
$89FF (bank 6)a table92
$B305 (bank 0)a call85
$A8A7 (bank 0)a table82
$94DB (bank 0)a table80
$B1FC (bank 0)a call79
$EC2A (bank 7)a call79
$A956 (bank 0)a table78
$9217 (bank 0)a call75
$E323 (bank 7)a table62
$E151 (bank 7)a table60
$916B (bank 0)a call56
$985D (bank 0)a call56
$DA0C (bank 7)a call54
$81E0 (bank 0)a table45
$8D20 (bank 6)a call43
$8E33 (bank 6)a call43
$99A8 (bank 0)a call42
$D971 (bank 7)a call36
$DB1C (bank 7)a call36
$DB6C (bank 7)a call36
$82B5 (bank 0)a table32
$B306 (bank 0)a call28
$B48E (bank 0)a call28
$DB69 (bank 7)a call28
$D531 (bank 7)a call26
$D559 (bank 7)a call26
$8DE8 (bank 1)a table24
$E816 (bank 7)a call24
$9887 (bank 0)a call21
$823A (bank 2)a call20
$913C (bank 0)a table20
$D591 (bank 7)a table18
$D5C3 (bank 7)a table18
$D5F7 (bank 7)a table18
$D69C (bank 7)a table18
$D6CB (bank 7)a table18
$D6FA (bank 7)a table18
$D729 (bank 7)a table18
$D734 (bank 7)a table18
$D73A (bank 7)a table18
$D74C (bank 7)a call18
$D760 (bank 7)a table18
$D895 (bank 7)a call18
$D982 (bank 7)a call18
$D99F (bank 7)a call18
$DA73 (bank 7)a call18
$E625 (bank 7)a call16
$8002 (bank 2)a call10
$8481 (bank 0)a call10
$A14C (bank 1)a call10
$DDE5 (bank 7)a call9
$9DB1 (bank 1)a call8
$CD37 (bank 7)a table8
$8000 (bank 1)a call6
$8257 (bank 0)a call6
$8DDF (bank 1)a table6
$8E0F (bank 1)a table6
$8E34 (bank 1)a table6
$92B4 (bank 1)a table6
$9579 (bank 0)a table6
$9B9E (bank 1)a call6
$A152 (bank 1)a call6
$A348 (bank 1)a call6
$E7F6 (bank 7)a call6
$8247 (bank 0)a table4
$93F7 (bank 0)a call4
$949A (bank 0)a table4
$A158 (bank 1)a call4
$A8B3 (bank 0)a table4
$B67F (bank 0)a call4
$B6FA (bank 0)a call4
$CF1C (bank 7)a table4
$D879 (bank 7)a table4
$D885 (bank 7)a call4
$E139 (bank 7)a table4
$CC70 (bank 7)a call3
$CF8C (bank 7)a call3
$D22F (bank 7)a call3
$81FA (bank 0)a table2
$82DC (bank 0)a call2
$8DBD (bank 1)a table2
$9009 (bank 1)a table2
$912D (bank 0)a call2
$92BC (bank 1)a table2
$92CB (bank 1)a table2
$9DE3 (bank 1)a call2
$9E0F (bank 1)a call2
$A15E (bank 1)a call2
$A356 (bank 1)a call2
$B575 (bank 5)a call2
$CD72 (bank 7)a table2
$CD79 (bank 7)a table2
$CD86 (bank 7)a call2
$DE1C (bank 7)a call2
$E308 (bank 7)a call2
$EC1A (bank 7)a call2
$FA7C (bank 7)a call2
$81ED (bank 2)a call1
$CC61 (bank 7)a call1
$D167 (bank 7)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
$8696 (bank 6)b6_wait_8696
The wait for the frame: waits on the byte at $03A2, times entered 2,727, turns 102, writes of it under the frame interrupt 49, frames in all 97,519
$C072 (bank 7)b7_spin_C072
The counting spin: counts in the byte at $000F, turns 112,106,245, turns a frame 1,149, reads of it from outside the loop 2,066

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
$8046 (bank 0)after a call589$03CF, $03CE, $03D1, $03D0
$80CA (bank 0)by a return11
$81F6 (bank 0)after a call22$03EF
$8241 (bank 0)after a call33$03EF
$9110 (bank 0)after a call44$03F4, $03F2, $03F3
$937E (bank 0)after a call66$03F3, $03F2, $03F5, $03F4
$948E (bank 0)after a call66$03F7, $03F6
$9569 (bank 0)after a call44$03F8, $03F6, $03F9
$A8AD (bank 0)after a call22$03F2, $03F3
$8DA3 (bank 1)after a call99$0052
$910B (bank 1)after a call43$0054
$92C1 (bank 1)after a call11$0029
$810B (bank 6)after a call87$03EA, $03A2
$8139 (bank 6)by a return11
$9356 (bank 6)after a call21$03C7
$9364 (bank 6)by a return11
$CD0C (bank 7)after a call77$0000
$CD27 (bank 7)after a call88$0001
$CE26 (bank 7)after a call77$0001
$D579 (bank 7)after a call1212$049E
$E026 (bank 7)after a call1111$001C

The memory its routines share

854 bytes of memory were written by one routine and read by another, and 62 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$070011X2222Y2↓2X22Y2+2X22→22→2↓22↓2↓22↓2+2+2→↓
The console's 2,048 bytes of memory, one row for each 256. A numbered span is a column of one of the object tables drawn below, counted in the same order, as long as the table and filled as it is there. Where a table's columns overlap, its things lie one after another, each with all its properties, so the table is one outline with a mark where each property starts. A dark square is a position a rule saw compared. 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. 1 label is left out where columns sit too close to name each one; the drawings below name them all.

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

frombytes reachedinstructionspositions it holds
$000E14522 across, 1 down
$035A18341 across
$0336183110 down
$03A216128 across
$037E14262 down
$006C221 across
$070025682
$02002535
$02012532
$02022531
$02032531
$000024011

What travels with a position

Arrays that at least two routines step through together with an array of positions, across the same range. That is what a table of the things on the screen looks like in memory: one array for each property, one slot for each thing. We can say which arrays hold positions, which of the others get added into them, which is what a speed does, which pick the way through a jump table, which is what a state or a kind does, and which are only ever counted down, which is what a timer does. What the rest hold is not named yet.

01$0004+191$0006+191$006CX
Table 1: 3 arrays of up to 2 slots that 2 routines step through together. Each column is an array at its address and each row a slot, so one thing on the screen is one row across all of them. A number under a column is how many more bytes that array was reached across than the table is long. X and Y are positions, and the darker squares are the slots a rule saw compared. + is added into a position, which is what a speed does. → chose a jump, which is what a state or a kind does. ↓ is only ever counted down, which is what a timer does. A plain outline travels with them and is not named yet.
0481216$0300$0312$0324$0336Y$0348↓$035AX$036C$037EY$0390+$03A2X$03B4$03C6→$03D8$03EA→$03FC↓$040E$0432↓$0444↓$0456$0468↓$047A+$048C++14$049E→↓
Table 2: 23 arrays of up to 18 slots that 51 routines step through together. Each column is an array at its address and each row a slot, so one thing on the screen is one row across all of them. A number under a column is how many more bytes that array was reached across than the table is long. X and Y are positions, and the darker squares are the slots a rule saw compared. + is added into a position, which is what a speed does. → chose a jump, which is what a state or a kind does. ↓ is only ever counted down, which is what a timer does. A plain outline travels with them and is not named yet.
slotsarraysroutinespositions acrosspositions downadded into themchoosing a jumpcounted downtravelling with them
232$006C$0004, $0006
182351$035A, $03A2$0336, $037E$0390, $047A, $048C$03C6, $03EA, $049E$0348, $03FC, $0432, $0444, $0468, $049E$0300, $0312, $0324, $0348, $036C, $0390, $03B4, $03C6, $03D8, $03EA, $03FC, $040E, $0432, $0444, $0456, $0468, $047A, $048C, $049E

The 24 busiest shared bytes

bytereads and writesroutines writingroutines reading
$000F217,535,05736
$0002113,197,04036
$006D8,576,45966
$006F8,246,90666
$00686,277,52466
$00716,077,22566
$006A6,014,91766
$00705,962,76466
$00695,635,73166
$006B5,054,34666
$00383,362,80366
$00AB1,491,71836
$006C1,197,23866
$006E1,154,29566
$00AC1,145,15734
$00BA977,46435
$0075947,11666
$000D930,67966
$007B818,72864
$007D801,71766
$0078793,89466
$0017721,93433
$0003711,99226
$007C686,35666

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

All the games