Double Dribble (USA) (Rev 1)
Double Dribble (USA) (Rev 1) is on a UxROM board with 131,072 bytes of program. A crawl of 400 steps from power-on kept 26 paths that found new code. Played back over 18,226 frames, they executed 15,960 bytes of it, 12 percent.
What the rules named
- The poll: 2
- The counting spin: 1
- The game inside the interrupt: 1
- The jump engine: 1
- The bank switch: 3
- The picture writer: 1
- The palette writers: 1
- The sprite writers: 4
- The scroll writer: 1
- The sound driver: 1
- Where two things are compared: 3
The 154 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.
| at | entered by | times | what it is, and the evidence |
|---|---|---|---|
| $80E8 (bank 2) | a call | 35,346 | The sprite writers: frames it ran in 7,194, writes to the sprite page 801,499 |
| $C159 (bank 7) | a call | 32,337 | The bank switch: writes 32,337, in the blank 7,304, while drawing 25,033 |
| $C314 (bank 7) | a call | 14,556 | The poll: port $4016, reads a frame 16, strobes a frame 4 The poll: port $4017, reads a frame 16, strobes a frame 4 |
| $80ED (bank 1) | a call | 11,915 | The sound driver: frames it ran in 3,912, writes 7,083 |
| $C41C (bank 7) | a call | 10,745 | The jump engine: tables 7, jumps through them 10,745 |
| $C15E (bank 7) | a call | 7,462 | The bank switch: writes 7,462, in the blank 7,304, while drawing 158 |
| $C036 (bank 7) | each frame (NMI) | 7,307 | The game inside the interrupt: frames it ran in 7,369, frames in all 7,726, the spin is at $C02B |
| $C100 (bank 7) | a call | 7,307 | The sprite writers: frames it ran in 7,307, writes to the sprite page 29,228 |
| $D350 (bank 7) | a call | 7,307 | The scroll writer: frames it ran in 7,307, writes in the blank 13,946 |
| $CB63 (bank 7) | a call | 7,278 | The palette writers: frames it ran in 7,278, writes 1,936 The picture writer: frames it ran in 7,278, writes 5,565, in the blank 5,565, while drawing 0 |
| $824B (bank 2) | a call | 7,276 | Where two things are compared: instructions 1, pairs of bytes 32, bytes in all 10, times compared 31,550, Y positions at $03C2,$03C3,$03C4,$03C5,$03C6,$03C7,$03CA,$03CB,$03CE,$03E0 |
| $8209 (bank 2) | a call | 7,254 | Where two things are compared: instructions 1, pairs of bytes 23, bytes in all 9, times compared 14,824, Y positions at $03C2,$03C3,$03C4,$03C6,$03C8,$03C9,$03CA,$03CB,$03CE |
| $8154 (bank 2) | a call | 7,252 | The sprite writers: frames it ran in 7,252, writes to the sprite page 256,366 |
| $C165 (bank 7) | a call | 183 | The bank switch: writes 183, in the blank 26, while drawing 157 |
| $C10C (bank 7) | a call | 42 | The sprite writers: frames it ran in 68, writes to the sprite page 10,752 |
| $ACB6 (bank 0) | a call | 3 | Where two things are compared: instructions 1, pairs of bytes 1, bytes in all 2, times compared 19, Y positions at $03E0,$041E |
| $C43A (bank 7) | a call | 65,297 | |
| $847D (bank 1) | a call | 11,934 | |
| $8493 (bank 1) | a call | 9,020 | |
| $C0F3 (bank 7) | a call | 7,503 | |
| $D371 (bank 7) | a call | 7,307 | |
| $8029 (bank 1) | a call | 7,281 | |
| $807A (bank 1) | a call | 7,281 | |
| $81C9 (bank 2) | a call | 7,278 | |
| $C2E6 (bank 7) | a call | 7,278 | |
| $C339 (bank 7) | a call | 7,278 | |
| $C355 (bank 7) | a call | 7,278 | |
| $C187 (bank 7) | a call | 7,252 | |
| $C77F (bank 7) | a call | 7,252 | |
| $CDA4 (bank 7) | a table | 3,356 | |
| $C35A (bank 7) | a call | 2,428 | |
| $C1BF (bank 7) | a table | 2,407 | |
| $CE05 (bank 7) | a table | 2,174 | |
| $C783 (bank 7) | a call | 1,579 | |
| $C220 (bank 7) | a table | 1,447 | |
| $C27D (bank 7) | a call | 1,201 | |
| $83B2 (bank 1) | a call | 1,117 | |
| $CDFD (bank 7) | a table | 916 | |
| $8436 (bank 1) | a call | 760 | |
| $CD9B (bank 7) | a call | 625 | |
| $8128 (bank 1) | a call | 507 | |
| $83E9 (bank 1) | a table | 489 | |
| $810D (bank 1) | a call | 443 | |
| $A73C (bank 1) | a call | 336 | |
| $A7BF (bank 1) | a call | 260 | |
| $C785 (bank 7) | a call | 260 | |
| $83C0 (bank 1) | a table | 233 | |
| $D31F (bank 7) | a table | 204 | |
| $C724 (bank 7) | a call | 185 | |
| $C549 (bank 7) | a call | 180 | |
| $9CF6 (bank 0) | a call | 179 | |
| $AA20 (bank 0) | a call | 152 | |
| $9B42 (bank 0) | a call | 141 | |
| $A896 (bank 0) | a call | 130 | |
| $9CA0 (bank 0) | a call | 99 | |
| $CBE0 (bank 7) | a call | 92 | |
| $8491 (bank 0) | a call | 90 | |
| $8BC5 (bank 0) | a table | 80 | |
| $A84C (bank 0) | a call | 80 | |
| $C16A (bank 7) | a call | 63 | |
| $C17B (bank 7) | a call | 63 | |
| $CC99 (bank 7) | a call | 63 | |
| $8340 (bank 1) | a table | 57 | |
| $C450 (bank 7) | a call | 56 | |
| $C3C5 (bank 7) | a call | 53 | |
| $8397 (bank 1) | a table | 52 | |
| $843A (bank 1) | a call | 52 | |
| $89B2 (bank 0) | a call | 50 | |
| $91A6 (bank 0) | a call | 50 | |
| $9EBD (bank 0) | a call | 50 | |
| $AB53 (bank 0) | a call | 45 | |
| $AB72 (bank 0) | a call | 45 | |
| $9FA3 (bank 0) | a call | 41 | |
| $C141 (bank 7) | a call | 41 | |
| $9D2D (bank 0) | a call | 34 | |
| $AAEE (bank 0) | a call | 34 | |
| $A85A (bank 0) | a call | 30 | |
| $C0E0 (bank 7) | a call | 29 | |
| $CD6F (bank 7) | a call | 29 | |
| $D33F (bank 7) | a call | 29 | |
| $C001 (bank 7) | power-on | 26 | |
| $C0B9 (bank 7) | a call | 26 | |
| $C128 (bank 7) | a call | 26 | |
| $C135 (bank 7) | a call | 26 | |
| $C1AD (bank 7) | a table | 26 | |
| $C38A (bank 7) | a call | 26 | |
| $C4FA (bank 7) | a call | 26 | |
| $CEB6 (bank 7) | a call | 26 | |
| $9A87 (bank 0) | a call | 23 | |
| $9EA5 (bank 0) | a call | 23 | |
| $AA4A (bank 0) | a call | 22 | |
| $B11F (bank 0) | a call | 22 | |
| $B3E9 (bank 0) | a call | 22 | |
| $852F (bank 0) | a call | 20 | |
| $93AE (bank 0) | a call | 20 | |
| $949F (bank 0) | a call | 20 | |
| $94A5 (bank 0) | a call | 20 | |
| $955E (bank 0) | a call | 20 | |
| $9583 (bank 0) | a call | 20 | |
| $95E0 (bank 0) | a call | 20 | |
| $993A (bank 0) | a call | 20 | |
| $9E70 (bank 0) | a call | 20 | |
| $AAA8 (bank 0) | a call | 20 | |
| $AAC4 (bank 0) | a call | 20 | |
| $AADB (bank 0) | a call | 20 | |
| $AC7F (bank 0) | a call | 20 | |
| $B51D (bank 0) | a call | 20 | |
| $CDC7 (bank 7) | a table | 20 | |
| $CE90 (bank 7) | a call | 20 | |
| $8488 (bank 1) | a call | 19 | |
| $914E (bank 0) | a call | 19 | |
| $9B84 (bank 0) | a call | 19 | |
| $9BB0 (bank 0) | a call | 19 | |
| $AE25 (bank 0) | a table | 19 | |
| $B377 (bank 0) | a call | 19 | |
| $B473 (bank 0) | a call | 19 | |
| $C251 (bank 7) | a table | 16 | |
| $C392 (bank 7) | a call | 16 | |
| $C3BC (bank 7) | a call | 16 | |
| $CE0D (bank 7) | a table | 16 | |
| $CE25 (bank 7) | a table | 14 | |
| $8DD2 (bank 0) | a table | 10 | |
| $9977 (bank 0) | a call | 10 | |
| $9E90 (bank 0) | a call | 10 | |
| $9F26 (bank 0) | a table | 10 | |
| $9F70 (bank 0) | a call | 10 | |
| $A5D0 (bank 0) | a table | 10 | |
| $AA07 (bank 0) | a call | 10 | |
| $B503 (bank 0) | a call | 10 | |
| $9C06 (bank 0) | a call | 8 | |
| $C694 (bank 7) | a call | 8 | |
| $8131 (bank 1) | a call | 6 | |
| $84C1 (bank 1) | a call | 6 | |
| $9C0B (bank 0) | a call | 6 | |
| $A539 (bank 1) | a call | 6 | |
| $C6A5 (bank 7) | a call | 6 | |
| $C6AD (bank 7) | a call | 6 | |
| $D311 (bank 7) | a call | 6 | |
| $A631 (bank 1) | a table | 4 | |
| $9381 (bank 0) | a call | 3 | |
| $945A (bank 0) | a call | 3 | |
| $A4EB (bank 1) | a table | 3 | |
| $B035 (bank 0) | a call | 3 | |
| $C110 (bank 7) | a call | 3 | |
| $C547 (bank 7) | a call | 3 | |
| $CEB8 (bank 7) | a table | 3 | |
| $CEEA (bank 7) | a table | 3 | |
| $CF1C (bank 7) | a table | 3 | |
| $CF47 (bank 7) | a table | 3 | |
| $D2C3 (bank 7) | a call | 3 | |
| $9490 (bank 0) | a call | 2 | |
| $9395 (bank 0) | a call | 1 | |
| $B017 (bank 0) | a table | 1 | |
| $B501 (bank 0) | a call | 1 |
Where it waits
Loops a rule named that sit inside a routine and are not themselves a place the code is entered.
| at | what it is, and the evidence |
|---|---|
| $C02B (bank 7) | The counting spin: counts in the byte at $0063, turns 8,544,182, turns a frame 1,105, reads of it from outside the loop 2 |
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.
| at | entries | taken | chosen by the byte at |
|---|---|---|---|
| $89C0 (bank 0) | 13 | 2 | $0347, $0348, $0349, $034A |
| $9F00 (bank 0) | 19 | 1 | $0342 |
| $A01C (bank 0) | 54 | 2 | $0342, $0343, $0344, $0345 |
| $AC91 (bank 0) | 11 | 2 | $0340 |
| $A4D5 (bank 1) | 4 | 2 | $0480 |
| $C199 (bank 7) | 6 | 5 | $0018 |
| $CDA9 (bank 7) | 9 | 10 | $002A |
The memory its routines share
460 bytes of memory were written by one routine and read by another, and 66 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
| from | bytes reached | instructions | positions it holds |
|---|---|---|---|
| $03C0 | 16 | 17 | 11 down |
| $0410 | 15 | 7 | 1 down |
| $03E0 | 12 | 2 | 1 down |
| $0200 | 253 | 4 | |
| $0000 | 240 | 2 | |
| $0201 | 201 | 2 | |
| $0202 | 201 | 1 | |
| $0203 | 201 | 1 | |
| $0700 | 73 | 34 | |
| $0300 | 16 | 10 | |
| $0310 | 16 | 10 | |
| $0320 | 16 | 10 |
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, and which pick the way through a jump table, which is what a state or a kind does. What the rest hold is not named yet.
| slots | arrays | routines | positions across | positions down | added into them | choosing a jump | travelling with them |
|---|---|---|---|---|---|---|---|
| 16 | 11 | 13 | $03C0, $0410 | $0300, $0320, $0330, $0350, $0360, $0370, $03B0, $03D0, $0460 | |||
| 12 | 6 | 3 | $03E0 | $0390, $03A0, $03F0, $0430, $0440 |
The 24 busiest shared bytes
| byte | reads and writes | routines writing | routines reading |
|---|---|---|---|
| $001A | 8,576,750 | 2 | 6 |
| $0063 | 3,374,454 | 3 | 3 |
| $0000 | 906,790 | 6 | 6 |
| $0005 | 864,326 | 4 | 6 |
| $0001 | 715,576 | 6 | 6 |
| $0008 | 712,532 | 6 | 6 |
| $0009 | 712,323 | 6 | 6 |
| $0003 | 669,013 | 6 | 6 |
| $0002 | 614,834 | 6 | 6 |
| $0004 | 500,152 | 6 | 6 |
| $0013 | 247,169 | 5 | 4 |
| $0011 | 79,608 | 6 | 6 |
| $0320 | 67,499 | 6 | 6 |
| $0018 | 64,711 | 6 | 6 |
| $0321 | 63,685 | 6 | 6 |
| $0010 | 61,406 | 6 | 6 |
| $0326 | 60,957 | 6 | 6 |
| $0325 | 60,278 | 6 | 6 |
| $0322 | 59,794 | 6 | 6 |
| $0323 | 59,794 | 6 | 6 |
| $0324 | 59,794 | 6 | 6 |
| $0327 | 59,794 | 6 | 6 |
| $032A | 59,794 | 6 | 6 |
| $0328 | 59,793 | 6 | 6 |
This page shows none of the game's bytes. The listing these figures were read from stays with the cartridge.