Battle Chess (USA)
Battle Chess (USA) is on a MMC1 board with 262,144 bytes of program. A crawl of 6,400 steps from power-on kept 49 paths that found new code. Played back over 183,069 frames, they executed 9,181 bytes of it, 4 percent.
What the rules named
- The poll: 2
- The wait for the frame: 9
- The handler kept in memory: 1
- The bank switch: 3
- The picture writer: 1
- The palette writers: 2
- The sprite writers: 7
- The scroll writer: 1
- The sound driver: 1
- The random byte: 1
The 186 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.
| at | its name in the listing | entered by | times | what it is, and the evidence |
|---|---|---|---|---|
| $C160 (bank 15) | b15_bank_C160 | a call | 147,239 | The bank switch: writes 736,195, in the blank 1,740, while drawing 734,455 |
| $C4EF (bank 15) | b15_nmi | each frame (NMI) | 36,863 | The scroll writer: frames it ran in 37,100, writes in the blank 66,538 |
| $D42F (bank 15) | b15_sprites_D42F | a call | 36,706 | The sprite writers: frames it ran in 36,944, writes to the sprite page 9,243,994 |
| $C764 (bank 15) | b15_poll_C764 | a call | 36,665 | The poll: port $4016, reads a frame 8, strobes a frame 2 The poll: port $4017, reads a frame 8, strobes a frame 2 |
| $C6D0 (bank 15) | b15_drain_C6D0 | a call | 33,105 | The palette writers: frames it ran in 33,105, writes 1,059,360 The picture writer: frames it ran in 33,105, writes 1,059,360, in the blank 1,059,360, while drawing 0 |
| $D4A0 (bank 15) | b15_sprites_D4A0 | a call | 17,363 | The sprite writers: frames it ran in 14,724, writes to the sprite page 373,400 |
| $8000 (bank 14) | b14_sound_8000 | a call | 16,986 | The random byte: frames it ran in 16,985, bytes $0690, rotates 1, exclusive-ors 1 The sound driver: frames it ran in 16,985, writes 58 |
| $D05E (bank 15) | b15_sprites_D05E | a call | 14,799 | The sprite writers: frames it ran in 14,796, writes to the sprite page 29,592 |
| $C35F (bank 15) | b15_wait_C35F | a call | 14,300 | The wait for the frame: waits on the byte at $0030, times entered 14,297, turns 52,330,296, writes of it under the frame interrupt 48,944, frames in all 39,849 |
| $C9FD (bank 15) | b15_palette_C9FD | a call | 537 | The palette writers: frames it ran in 489, writes 5,024 |
| $CD8F (bank 15) | b15_sprites_CD8F | a call | 162 | The sprite writers: frames it ran in 963, writes to the sprite page 41,185 |
| $C099 (bank 15) | b15_sprites_C099 | a call | 157 | The sprite writers: frames it ran in 609, writes to the sprite page 40,192 |
| $C000 (bank 15) | b15_reset | power-on | 49 | The bank switch: writes 392, in the blank 392, while drawing 0 The sprite writers: frames it ran in 19,560, writes to the sprite page 12,544 |
| $C174 (bank 15) | b15_bank_C174 | a call | 49 | The bank switch: writes 245, in the blank 245, while drawing 0 |
| $E67B (bank 15) | b15_handlers_E67B | a call | 11 | The handler kept in memory: jumps 11, places it landed 2, address copied from $04B3 |
| $C7CD (bank 15) | b15_sprites_C7CD | a call | 5 | The sprite writers: frames it ran in 5,495, writes to the sprite page 20 |
| $C156 (bank 15) | a call | 41,153 | ||
| $D3BE (bank 15) | a call | 36,709 | ||
| $C63C (bank 15) | a call | 36,706 | ||
| $D3E2 (bank 15) | a call | 36,662 | ||
| $DD3C (bank 15) | a call | 24,108 | ||
| $DD55 (bank 15) | a call | 17,712 | ||
| $D36F (bank 15) | a call | 17,330 | ||
| $CCC8 (bank 15) | a call | 16,986 | ||
| $807A (bank 14) | a call | 16,979 | ||
| $8091 (bank 14) | a call | 16,935 | ||
| $CC8D (bank 15) | a call | 14,799 | ||
| $E2A1 (bank 15) | a call | 14,799 | ||
| $E2BE (bank 15) | a call | 14,799 | ||
| $C79D (bank 15) | a call | 14,271 | ||
| $C343 (bank 15) | a call | 12,212 | ||
| $9819 (bank 0) | a call | 12,192 | ||
| $97E5 (bank 0) | a call | 12,020 | ||
| $97A7 (bank 0) | a call | 12,009 | ||
| $9CC1 (bank 0) | a call | 12,009 | ||
| $80CA (bank 14) | a call | 7,577 | ||
| $80E9 (bank 14) | a call | 7,396 | ||
| $81EB (bank 14) | a call | 7,396 | ||
| $CA93 (bank 15) | a call | 6,132 | ||
| $D8EA (bank 15) | a call | 5,832 | ||
| $EA8A (bank 15) | a call | 5,316 | ||
| $EAA3 (bank 15) | a call | 5,312 | ||
| $E2EB (bank 15) | a call | 5,292 | ||
| $C567 (bank 15) | a call | 4,432 | ||
| $DC7C (bank 15) | a call | 4,018 | ||
| $E357 (bank 15) | a call | 4,000 | ||
| $C149 (bank 15) | a call | 3,911 | ||
| $D93C (bank 15) | a call | 3,888 | ||
| $E727 (bank 15) | a table | 3,807 | ||
| $DBE8 (bank 15) | a call | 2,132 | ||
| $8D99 (bank 0) | a call | 2,094 | ||
| $8A98 (bank 0) | a call | 2,079 | ||
| $DC39 (bank 15) | a call | 1,886 | ||
| $D9C9 (bank 15) | a call | 1,711 | ||
| $DA3C (bank 15) | a call | 1,353 | ||
| $DAED (bank 15) | a call | 1,353 | ||
| $8283 (bank 14) | a call | 1,310 | ||
| $EB70 (bank 15) | a call | 1,211 | ||
| $CAD3 (bank 15) | a call | 1,120 | ||
| $DB52 (bank 15) | a call | 1,066 | ||
| $DD73 (bank 15) | a call | 1,066 | ||
| $DD7F (bank 15) | a call | 1,066 | ||
| $82A9 (bank 14) | a call | 943 | ||
| $DB9D (bank 15) | a call | 943 | ||
| $DD6D (bank 15) | a call | 943 | ||
| $DD79 (bank 15) | a call | 943 | ||
| $8355 (bank 14) | a call | 686 | ||
| $D980 (bank 15) | a call | 648 | ||
| $C103 (bank 15) | a call | 608 | ||
| $C367 (bank 15) | a call | 525 | ||
| $C0EF (bank 15) | a call | 404 | ||
| $C0F8 (bank 15) | a call | 404 | ||
| $C931 (bank 15) | a call | 295 | ||
| $C9C7 (bank 15) | a call | 295 | ||
| $CDE1 (bank 15) | a call | 270 | ||
| $CDD6 (bank 15) | a call | 269 | ||
| $99ED (bank 0) | a call | 266 | ||
| $C0E0 (bank 15) | a call | 264 | ||
| $8372 (bank 14) | a call | 257 | ||
| $CEE1 (bank 15) | a call | 200 | ||
| $8C9A (bank 0) | a call | 196 | ||
| $8C6E (bank 0) | a call | 190 | ||
| $C04C (bank 15) | a call | 158 | ||
| $C13E (bank 15) | a call | 158 | ||
| $C074 (bank 15) | a call | 157 | ||
| $C143 (bank 15) | a call | 157 | ||
| $8115 (bank 14) | a call | 153 | ||
| $8CCC (bank 0) | a call | 146 | ||
| $CAC5 (bank 15) | a call | 125 | ||
| $814E (bank 13) | a call | 123 | ||
| $CACA (bank 15) | a call | 123 | ||
| $E6B2 (bank 15) | a table | 120 | ||
| $818E (bank 13) | a call | 117 | ||
| $C0D3 (bank 15) | a call | 113 | ||
| $CA5A (bank 15) | a call | 110 | ||
| $E1DF (bank 15) | a call | 110 | ||
| $CA85 (bank 15) | a call | 104 | ||
| $817F (bank 13) | a call | 94 | ||
| $EA66 (bank 15) | a call | 88 | ||
| $880C (bank 0) | a call | 87 | ||
| $CE13 (bank 15) | a call | 87 | ||
| $CE67 (bank 15) | a call | 87 | ||
| $CEF1 (bank 15) | a call | 87 | ||
| $CFC8 (bank 15) | a call | 87 | ||
| $D00C (bank 15) | a call | 87 | ||
| $E1FC (bank 15) | a call | 87 | ||
| $E23B (bank 15) | a call | 87 | ||
| $E373 (bank 15) | a call | 87 | ||
| $E3DF (bank 15) | a call | 87 | ||
| $8231 (bank 13) | a table | 84 | ||
| $EA78 (bank 15) | a call | 83 | ||
| $E6D6 (bank 15) | a table | 60 | ||
| $E6DF (bank 15) | a table | 60 | ||
| $C8C0 (bank 15) | a call | 59 | ||
| $80B9 (bank 14) | a call | 51 | ||
| $CCC0 (bank 15) | a call | 51 | ||
| $E4E4 (bank 15) | a table | 51 | ||
| $8A16 (bank 0) | a call | 49 | ||
| $C01F (bank 15) | an interrupt (IRQ) | 49 | ||
| $C3B7 (bank 15) | a call | 49 | ||
| $EB1F (bank 15) | a call | 49 | ||
| $822B (bank 13) | a table | 48 | ||
| $EB43 (bank 15) | a call | 48 | ||
| $821A (bank 13) | a table | 47 | ||
| $C3BE (bank 15) | a call | 47 | ||
| $EA02 (bank 15) | a call | 44 | ||
| $EA32 (bank 15) | a call | 44 | ||
| $8CFB (bank 13) | a call | 42 | ||
| $8D2B (bank 13) | a call | 42 | ||
| $8FAE (bank 13) | a call | 42 | ||
| $9698 (bank 0) | a call | 42 | ||
| $96B7 (bank 0) | a call | 42 | ||
| $E87F (bank 15) | a call | 42 | ||
| $EAFD (bank 15) | a call | 42 | ||
| $96F0 (bank 0) | a call | 41 | ||
| $D7FA (bank 15) | a call | 41 | ||
| $D826 (bank 15) | a call | 41 | ||
| $8A4F (bank 0) | a call | 40 | ||
| $8076 (bank 13) | a call | 39 | ||
| $8086 (bank 13) | a table | 39 | ||
| $9C63 (bank 0) | a call | 39 | ||
| $8108 (bank 14) | a call | 28 | ||
| $8D41 (bank 0) | a call | 24 | ||
| $CC9F (bank 15) | a call | 24 | ||
| $8A54 (bank 0) | a call | 19 | ||
| $8081 (bank 13) | a call | 14 | ||
| $995D (bank 0) | a call | 13 | ||
| $8B65 (bank 0) | a call | 11 | ||
| $8D7C (bank 0) | a call | 11 | ||
| $9EB1 (bank 0) | a call | 11 | ||
| $E558 (bank 15) | a table | 11 | ||
| $E669 (bank 15) | a table | 11 | ||
| $8C53 (bank 0) | a call | 10 | ||
| $9DA1 (bank 0) | a table | 8 | ||
| $9DE4 (bank 0) | a call | 8 | ||
| $80AA (bank 14) | a call | 7 | ||
| $CCBA (bank 15) | a call | 7 | ||
| $8AF9 (bank 0) | a call | 4 | ||
| $8B36 (bank 0) | a call | 4 | ||
| $82F6 (bank 13) | a call | 3 | ||
| $8BCC (bank 0) | a call | 3 | ||
| $9DB3 (bank 0) | a table | 3 | ||
| $9E48 (bank 0) | a call | 3 | ||
| $CE87 (bank 15) | a call | 3 | ||
| $E1ED (bank 15) | a call | 3 | ||
| $8071 (bank 13) | a table | 2 | ||
| $808F (bank 13) | a table | 2 | ||
| $8098 (bank 13) | a table | 2 | ||
| $809C (bank 13) | a table | 2 | ||
| $80C7 (bank 13) | a table | 2 | ||
| $80D6 (bank 13) | a table | 2 | ||
| $813F (bank 13) | a call | 2 | ||
| $8254 (bank 13) | a call | 2 | ||
| $8296 (bank 13) | a call | 2 | ||
| $8309 (bank 13) | a call | 2 | ||
| $8323 (bank 13) | a call | 2 | ||
| $8383 (bank 13) | a call | 2 | ||
| $8396 (bank 13) | a call | 2 | ||
| $839E (bank 13) | a call | 2 | ||
| $844D (bank 13) | a call | 2 | ||
| $8D10 (bank 13) | a call | 2 | ||
| $914E (bank 0) | a table | 2 | ||
| $E8DD (bank 15) | a call | 2 | ||
| $91E4 (bank 0) | a table | 1 | ||
| $921D (bank 0) | a table | 1 | ||
| $9286 (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 | its name in the listing | what it is, and the evidence |
|---|---|---|
| $C150 (bank 15) | b15_wait_C150 | The wait for the frame: waits on the byte at $03E9, times entered 2,915, turns 10,771,895, writes of it under the frame interrupt 66,466, frames in all 39,849 |
| $C3B9 (bank 15) | b15_wait_C3B9 | The wait for the frame: waits on the byte at $0030, times entered 48, turns 18,393,403, writes of it under the frame interrupt 48,944, frames in all 39,849 |
| $C3C0 (bank 15) | b15_wait_C3C0 | The wait for the frame: waits on the byte at $0663, times entered 46, turns 11,162,932, writes of it under the frame interrupt 586,640, frames in all 39,849 |
| $C3CA (bank 15) | b15_wait_C3CA | The wait for the frame: waits on the byte at $0663, times entered 41, turns 2,904,578, writes of it under the frame interrupt 586,640, frames in all 39,849 |
| $C568 (bank 15) | b15_wait_C568 | The wait for the frame: waits on the byte at $002B, times entered 5,642, turns 4,163,468, writes of it under the frame interrupt 3,437, frames in all 39,849 |
| $C8B2 (bank 15) | b15_wait_C8B2 | The wait for the frame: waits on the byte at $03E9, times entered 5,463, turns 7,798,908, writes of it under the frame interrupt 66,466, frames in all 39,849 |
| $D82A (bank 15) | b15_wait_D82A | The wait for the frame: waits on the byte at $002B, times entered 648, turns 1,981,370, writes of it under the frame interrupt 3,437, frames in all 39,849 |
| $DA9B (bank 15) | b15_wait_DA9B | The wait for the frame: waits on the byte at $002B, times entered 1,353, turns 2,074,721, writes of it under the frame interrupt 3,437, frames in all 39,849 |
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.
| at | reached | entries | taken | chosen by the byte at |
|---|---|---|---|---|
| $E6C4 (bank 15) | through a pointer | 2 | 2 | $04B3 |
The memory its routines share
714 bytes of memory were written by one routine and read by another, and 99 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 |
|---|---|---|---|
| $0700 | 256 | 6 | |
| $0200 | 256 | 3 | |
| $0000 | 256 | 1 | |
| $0300 | 256 | 1 | |
| $0400 | 256 | 1 | |
| $0500 | 256 | 1 | |
| $0600 | 256 | 1 | |
| $0004 | 231 | 16 | |
| $0560 | 120 | 1 | |
| $0005 | 113 | 1 | |
| $000A | 113 | 1 | |
| $000B | 113 | 1 |
The 24 busiest shared bytes
| byte | reads and writes | routines writing | routines reading |
|---|---|---|---|
| $03E9 | 18,692,195 | 2 | 4 |
| $0663 | 14,965,645 | 3 | 6 |
| $002B | 8,278,315 | 6 | 6 |
| $000B | 5,920,519 | 6 | 6 |
| $005D | 1,590,574 | 5 | 4 |
| $0032 | 1,397,302 | 6 | 6 |
| $0664 | 802,416 | 3 | 4 |
| $0033 | 549,842 | 6 | 6 |
| $0007 | 492,302 | 6 | 6 |
| $006F | 433,916 | 6 | 6 |
| $000E | 410,526 | 6 | 6 |
| $00A4 | 279,299 | 5 | 5 |
| $00A2 | 267,922 | 5 | 6 |
| $00A3 | 267,468 | 5 | 6 |
| $007B | 203,666 | 6 | 6 |
| $00A6 | 196,179 | 5 | 6 |
| $0004 | 168,393 | 6 | 6 |
| $005F | 132,958 | 4 | 4 |
| $0026 | 129,173 | 6 | 6 |
| $0390 | 123,326 | 6 | 6 |
| $0393 | 123,326 | 6 | 6 |
| $0391 | 122,752 | 6 | 6 |
| $0394 | 122,752 | 6 | 6 |
| $000D | 120,008 | 6 | 6 |
This page shows none of the game's bytes. The listing these figures were read from stays with the cartridge.