Blades of Steel (USA)
Blades of Steel (USA) is on a UxROM board with 131,072 bytes of program. A crawl of 400 steps from power-on kept 32 paths that found new code. Played back over 27,032 frames, they executed 11,184 bytes of it, 9 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: 11
- The picture writer: 1
- The palette writers: 2
- The sprite writers: 5
- The scroll writer: 1
- The split: 1
- The sound driver: 1
- Where two things are compared: 1
The 221 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 |
|---|---|---|---|
| $C79A (bank 7) | a call | 38,771 | The jump engine: tables 13, jumps through them 38,771 |
| $C2F1 (bank 7) | a call | 36,088 | The bank switch: writes 36,082, in the blank 24,351, while drawing 11,731 |
| $C61C (bank 7) | a call | 26,440 | The poll: port $4016, reads a frame 16, strobes a frame 4 The poll: port $4017, reads a frame 16, strobes a frame 4 |
| $81B2 (bank 0) | a call | 26,217 | The sprite writers: frames it ran in 6,534, writes to the sprite page 733,050 |
| $854C (bank 6) | a call | 16,775 | The sound driver: frames it ran in 6,356, writes 16,843 |
| $C022 (bank 7) | a call | 14,297 | The palette writers: frames it ran in 13,414, writes 20,854 The picture writer: frames it ran in 13,414, writes 131,927, in the blank 88,304, while drawing 54,203 |
| $C175 (bank 7) | a call | 14,297 | The palette writers: frames it ran in 13,414, writes 29,248 |
| $C204 (bank 7) | each frame (NMI) | 13,274 | The game inside the interrupt: frames it ran in 13,274, frames in all 16,532, the spin is at $C1FB |
| $C2A8 (bank 7) | a call | 13,247 | The scroll writer: frames it ran in 13,220, writes in the blank 26,438 |
| $8227 (bank 0) | a call | 13,217 | Where two things are compared: instructions 2, pairs of bytes 84, bytes in all 22, times compared 43,718, Y positions at $0313,$0314,$0315,$0316,$0317,$0318,$0319,$031A,$031B,$031C,$031D,$031E |
| $8001 (bank 0) | a call | 13,215 | The sprite writers: frames it ran in 13,242, writes to the sprite page 641,249 |
| $82AD (bank 0) | a call | 6,671 | The sprite writers: frames it ran in 6,206, writes to the sprite page 97,085 |
| $C512 (bank 7) | a table | 4,722 | The bank switch: writes 4,695, in the blank 27, while drawing 4,668 |
| $C42D (bank 7) | a call | 4,205 | The bank switch: writes 4,204, in the blank 1,243, while drawing 2,961 |
| $8101 (bank 1) | a call | 2,837 | The split: frames it ran in 2,868, scroll writes while drawing 5,672, status reads while drawing 1,474,339 |
| $C2F7 (bank 7) | a call | 2,526 | The bank switch: writes 2,526, in the blank 125, while drawing 2,401 |
| $CD6A (bank 7) | a table | 1,820 | The bank switch: writes 1,820, in the blank 0, while drawing 1,820 |
| $811A (bank 0) | a table | 1,476 | The sprite writers: frames it ran in 1,476, writes to the sprite page 47,232 |
| $C3CB (bank 7) | a call | 389 | The bank switch: writes 389, in the blank 0, while drawing 389 |
| $C39F (bank 7) | a call | 316 | The bank switch: writes 316, in the blank 0, while drawing 316 |
| $C818 (bank 7) | a call | 153 | The bank switch: writes 153, in the blank 0, while drawing 153 |
| $C2DE (bank 7) | a call | 64 | The sprite writers: frames it ran in 64, writes to the sprite page 8,192 |
| $C816 (bank 7) | a call | 59 | The bank switch: writes 59, in the blank 0, while drawing 59 |
| $C373 (bank 7) | a call | 8 | The bank switch: writes 8, in the blank 8, while drawing 0 |
| $C37E (bank 7) | a call | 8 | The bank switch: writes 8, in the blank 0, while drawing 8 |
| $C7AF (bank 7) | a call | 58,415 | |
| $890A (bank 6) | a call | 30,856 | |
| $886A (bank 6) | a call | 29,991 | |
| $82BD (bank 6) | a call | 29,985 | |
| $85A5 (bank 6) | a call | 15,557 | |
| $E095 (bank 7) | a call | 14,808 | |
| $C956 (bank 7) | a call | 14,265 | |
| $81C3 (bank 6) | a call | 13,247 | |
| $8283 (bank 6) | a call | 13,247 | |
| $823C (bank 6) | a call | 13,246 | |
| $C5E2 (bank 7) | a call | 13,220 | |
| $C464 (bank 7) | a call | 13,219 | |
| $D7D2 (bank 7) | a call | 12,340 | |
| $D8F7 (bank 7) | a call | 12,340 | |
| $DE1E (bank 7) | a call | 12,340 | |
| $873E (bank 6) | a call | 11,190 | |
| $865F (bank 6) | a call | 10,987 | |
| $8537 (bank 1) | a call | 8,464 | |
| $EBED (bank 7) | a call | 7,491 | |
| $8071 (bank 0) | a call | 6,977 | |
| $807D (bank 0) | a call | 6,977 | |
| $80A3 (bank 0) | a call | 6,977 | |
| $85FA (bank 6) | a call | 6,306 | |
| $E053 (bank 7) | a call | 6,179 | |
| $E0B5 (bank 7) | a call | 6,179 | |
| $A569 (bank 0) | a call | 6,170 | |
| $86F3 (bank 6) | a call | 5,850 | |
| $8001 (bank 1) | a call | 5,672 | |
| $8123 (bank 1) | a call | 5,672 | |
| $871C (bank 1) | a call | 4,695 | |
| $8EAA (bank 1) | a call | 4,695 | |
| $9E2B (bank 1) | a call | 4,588 | |
| $C48D (bank 7) | a table | 4,237 | |
| $800C (bank 1) | a call | 4,205 | |
| $C107 (bank 7) | a call | 3,630 | |
| $C958 (bank 7) | a call | 3,624 | |
| $8EF6 (bank 1) | a table | 2,820 | |
| $B390 (bank 0) | a call | 2,468 | |
| $B47C (bank 0) | a call | 2,468 | |
| $B453 (bank 0) | a call | 2,464 | |
| $B562 (bank 0) | a call | 2,464 | |
| $857F (bank 1) | a call | 2,382 | |
| $A5B2 (bank 0) | a table | 2,364 | |
| $8535 (bank 1) | a call | 2,335 | |
| $A57F (bank 0) | a table | 2,331 | |
| $8E10 (bank 1) | a call | 2,141 | |
| $8555 (bank 1) | a call | 2,117 | |
| $C95A (bank 7) | a call | 2,102 | |
| $893D (bank 6) | a call | 2,046 | |
| $8803 (bank 1) | a table | 2,000 | |
| $8F2E (bank 1) | a table | 1,828 | |
| $8002 (bank 5) | a call | 1,820 | |
| $A882 (bank 0) | a call | 1,820 | |
| $CD77 (bank 7) | a call | 1,820 | |
| $A8A6 (bank 0) | a table | 1,812 | |
| $AB4F (bank 0) | a call | 1,812 | |
| $C4E4 (bank 7) | a table | 1,802 | |
| $8512 (bank 1) | a call | 1,587 | |
| $8524 (bank 1) | a call | 1,587 | |
| $8532 (bank 1) | a call | 1,514 | |
| $8048 (bank 1) | a table | 1,500 | |
| $80C0 (bank 0) | a call | 1,476 | |
| $A597 (bank 0) | a table | 1,475 | |
| $9FEC (bank 1) | a call | 1,398 | |
| $856F (bank 1) | a call | 1,286 | |
| $A55A (bank 0) | a call | 1,234 | |
| $ADB7 (bank 0) | a call | 1,234 | |
| $CE3A (bank 7) | a call | 1,234 | |
| $9F30 (bank 1) | a call | 1,210 | |
| $C114 (bank 7) | a call | 1,072 | |
| $82A8 (bank 1) | a call | 1,058 | |
| $C8FD (bank 7) | a call | 1,009 | |
| $80EA (bank 1) | a table | 968 | |
| $84F1 (bank 6) | a call | 859 | |
| $88CF (bank 1) | a table | 823 | |
| $8095 (bank 1) | a table | 744 | |
| $86FE (bank 6) | a call | 732 | |
| $85AD (bank 1) | a call | 603 | |
| $8DE5 (bank 1) | a call | 555 | |
| $8D79 (bank 1) | a call | 542 | |
| $83DD (bank 1) | a call | 529 | |
| $8C2D (bank 1) | a table | 498 | |
| $80BF (bank 1) | a table | 496 | |
| $80D0 (bank 1) | a table | 465 | |
| $87A2 (bank 1) | a table | 459 | |
| $CD16 (bank 7) | a table | 400 | |
| $8001 (bank 2) | a call | 389 | |
| $8871 (bank 1) | a table | 371 | |
| $CE43 (bank 7) | a call | 351 | |
| $C15D (bank 7) | a call | 342 | |
| $8813 (bank 1) | a table | 340 | |
| $871D (bank 6) | a call | 325 | |
| $813A (bank 1) | a call | 316 | |
| $817A (bank 1) | a call | 316 | |
| $8681 (bank 1) | a call | 316 | |
| $E1E5 (bank 7) | a call | 316 | |
| $E73C (bank 7) | a call | 316 | |
| $819B (bank 6) | a call | 306 | |
| $88F3 (bank 1) | a table | 290 | |
| $C298 (bank 7) | a call | 279 | |
| $C2C8 (bank 7) | a call | 279 | |
| $8964 (bank 1) | a table | 278 | |
| $8795 (bank 6) | a table | 266 | |
| $C4B5 (bank 7) | a call | 260 | |
| $C641 (bank 7) | a call | 258 | |
| $9E2D (bank 1) | a call | 252 | |
| $8573 (bank 6) | a call | 247 | |
| $87AB (bank 1) | a table | 243 | |
| $89B0 (bank 1) | a table | 239 | |
| $8C7B (bank 1) | a table | 237 | |
| $B7F8 (bank 1) | a call | 236 | |
| $C4A9 (bank 7) | a table | 230 | |
| $C5C8 (bank 7) | a call | 230 | |
| $8578 (bank 1) | a call | 228 | |
| $9EB1 (bank 1) | a call | 228 | |
| $9EE9 (bank 1) | a call | 228 | |
| $C304 (bank 7) | a call | 217 | |
| $87C6 (bank 1) | a table | 216 | |
| $887C (bank 1) | a table | 187 | |
| $881C (bank 1) | a table | 180 | |
| $884B (bank 1) | a table | 177 | |
| $8893 (bank 1) | a table | 168 | |
| $8833 (bank 1) | a table | 160 | |
| $888E (bank 6) | a table | 157 | |
| $87D0 (bank 6) | a table | 150 | |
| $803F (bank 6) | a call | 145 | |
| $C31F (bank 7) | a call | 145 | |
| $8C3A (bank 1) | a table | 130 | |
| $88DB (bank 6) | a call | 126 | |
| $88E5 (bank 6) | a table | 126 | |
| $8C58 (bank 1) | a table | 123 | |
| $9EFB (bank 1) | a call | 114 | |
| $9F36 (bank 1) | a call | 114 | |
| $879B (bank 6) | a table | 107 | |
| $87B4 (bank 6) | a table | 105 | |
| $C16A (bank 7) | a call | 104 | |
| $D744 (bank 7) | a call | 96 | |
| $9F81 (bank 1) | a call | 74 | |
| $8003 (bank 6) | a call | 72 | |
| $88F1 (bank 6) | a call | 72 | |
| $C340 (bank 7) | a call | 72 | |
| $87F8 (bank 6) | a table | 70 | |
| $8208 (bank 6) | a call | 66 | |
| $88DE (bank 6) | a call | 66 | |
| $9E3F (bank 1) | a call | 63 | |
| $C68C (bank 7) | a call | 54 | |
| $8D8A (bank 1) | a call | 51 | |
| $B83C (bank 1) | a call | 43 | |
| $B844 (bank 1) | a call | 43 | |
| $8E02 (bank 1) | a call | 38 | |
| $8D46 (bank 1) | a call | 37 | |
| $C5D9 (bank 7) | a call | 36 | |
| $85C0 (bank 1) | a call | 35 | |
| $85E9 (bank 1) | a call | 35 | |
| $801D (bank 1) | a table | 32 | |
| $C1C5 (bank 7) | power-on | 32 | |
| $C28D (bank 7) | a call | 32 | |
| $C6E3 (bank 7) | a call | 32 | |
| $C7C5 (bank 7) | a call | 32 | |
| $C7D1 (bank 7) | a call | 32 | |
| $C7D5 (bank 7) | a call | 32 | |
| $88CB (bank 6) | a table | 31 | |
| $EC72 (bank 7) | a call | 30 | |
| $8D57 (bank 1) | a call | 29 | |
| $C66C (bank 7) | a call | 29 | |
| $873C (bank 1) | a table | 27 | |
| $8ED0 (bank 1) | a table | 27 | |
| $C2B5 (bank 7) | a call | 27 | |
| $C674 (bank 7) | a call | 27 | |
| $87EF (bank 6) | a table | 24 | |
| $D627 (bank 7) | a call | 24 | |
| $8EFF (bank 1) | a table | 20 | |
| $88AB (bank 1) | a table | 16 | |
| $88DC (bank 1) | a table | 16 | |
| $C225 (bank 7) | a call | 15 | |
| $883C (bank 6) | a table | 10 | |
| $885D (bank 6) | a call | 9 | |
| $8CB1 (bank 1) | a table | 8 | |
| $946F (bank 0) | a call | 8 | |
| $A24A (bank 0) | a call | 8 | |
| $A2BF (bank 0) | a call | 8 | |
| $A88E (bank 0) | a table | 8 | |
| $AC1F (bank 0) | a call | 8 | |
| $AC31 (bank 0) | a call | 8 | |
| $AC41 (bank 0) | a call | 8 | |
| $AC79 (bank 0) | a call | 8 | |
| $C68E (bank 7) | a call | 8 | |
| $CCD3 (bank 7) | a table | 8 | |
| $CCE8 (bank 7) | a call | 8 | |
| $D5FF (bank 7) | a call | 8 | |
| $D60E (bank 7) | a call | 8 | |
| $D6B6 (bank 7) | a call | 8 | |
| $D6C1 (bank 7) | a call | 8 | |
| $D72D (bank 7) | a call | 8 | |
| $E1F1 (bank 7) | a call | 8 | |
| $B593 (bank 0) | a call | 6 |
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 |
|---|---|
| $C1FB (bank 7) | The counting spin: counts in the byte at $0024, turns 20,791,885, turns a frame 1,257, reads of it from outside the loop 32 |
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 |
|---|---|---|---|
| $8112 (bank 0) | 1 | 1 | $0036 |
| $A56F (bank 0) | 3 | 3 | $0367, $0369, $036B, $036D |
| $A888 (bank 0) | 2 | 2 | $0373 |
| $8011 (bank 1) | 6 | 6 | $0080 |
| $8724 (bank 1) | 11 | 8 | $0060 |
| $87A7 (bank 1) | 2 | 2 | $0061 |
| $8818 (bank 1) | 2 | 2 | $0061 |
| $8876 (bank 1) | 3 | 3 | $0061 |
| $88D4 (bank 1) | 4 | 4 | $0061 |
| $8C32 (bank 1) | 4 | 4 | $0061 |
| $8EC8 (bank 1) | 4 | 4 | $0367 |
| $C47A (bank 7) | 5 | 4 | $0018 |
| $CCAB (bank 7) | 3 | 3 | $0030 |
The memory its routines share
602 bytes of memory were written by one routine and read by another, and 93 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 |
|---|---|---|---|
| $0312 | 13 | 5 | 2 down |
| $03CF | 12 | 10 | 10 down |
| $0313 | 10 | 1 | 10 down |
| $0700 | 255 | 57 | |
| $0200 | 253 | 5 | |
| $0000 | 240 | 2 | |
| $0201 | 229 | 3 | |
| $0202 | 229 | 3 | |
| $0203 | 229 | 3 | |
| $0640 | 128 | 5 | |
| $0300 | 91 | 3 | |
| $0701 | 82 | 4 |
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 |
|---|---|---|---|---|---|---|---|
| 13 | 4 | 3 | $0312 | $0300, $0324, $0336 | |||
| 12 | 23 | 9 | $03CF | $0410 | $0367 | $0301, $0337, $035A, $0367, $0381, $038E, $039B, $03A8, $03B5, $03C2, $03E9, $0403, $0410, $042A, $0437, $0444, $0451, $049F, $04D3, $04ED, $0514, $0589 |
The 24 busiest shared bytes
| byte | reads and writes | routines writing | routines reading |
|---|---|---|---|
| $001A | 20,852,214 | 2 | 6 |
| $00E5 | 12,422,229 | 6 | 6 |
| $00E6 | 1,683,621 | 6 | 6 |
| $00E4 | 1,584,213 | 6 | 6 |
| $0000 | 1,307,368 | 6 | 6 |
| $0004 | 999,047 | 6 | 6 |
| $0001 | 991,569 | 6 | 6 |
| $0007 | 870,864 | 6 | 6 |
| $0005 | 844,910 | 6 | 6 |
| $0002 | 698,164 | 6 | 6 |
| $0008 | 623,533 | 6 | 6 |
| $0003 | 586,354 | 6 | 6 |
| $00E2 | 474,633 | 5 | 6 |
| $00C4 | 185,762 | 4 | 4 |
| $0051 | 82,138 | 6 | 6 |
| $0021 | 72,812 | 6 | 6 |
| $0006 | 63,942 | 6 | 6 |
| $004A | 60,077 | 6 | 5 |
| $004B | 60,077 | 6 | 5 |
| $00F5 | 49,739 | 2 | 6 |
| $00D2 | 49,476 | 4 | 4 |
| $00E3 | 46,261 | 5 | 6 |
| $07E0 | 45,707 | 1 | 6 |
| $00C3 | 44,416 | 3 | 2 |
This page shows none of the game's bytes. The listing these figures were read from stays with the cartridge.