Q-bert (USA)

Q-bert (USA) is on a CNROM board with 32,768 bytes of program. A crawl of 400 steps from power-on kept 17 paths that found new code. Played back over 20,757 frames, they executed 4,409 bytes of it, 13 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
$911Ea call161,477
The sprite writers: frames it ran in 10,092, writes to the sprite page 243,315
$91ECa call81,105
The sprite writers: frames it ran in 5,932, writes to the sprite page 81,103
$8207a call22,502
The jump engine: tables 9, jumps through them 22,502
$CC12a call20,194
The poll: port $4016, reads a frame 16, strobes a frame 4
The poll: port $4017, reads a frame 16, strobes a frame 4
$CE58a call13,960
The sound driver: frames it ran in 3,528, writes 1,067
$CAF5each frame (NMI)10,138
The game inside the interrupt: frames it ran in 10,138, frames in all 10,257, the spin is at $CAF2
$90A5a call10,109
The palette writers: frames it ran in 10,109, writes 1,440
The picture writer: frames it ran in 10,109, writes 19,680, in the blank 19,680, while drawing 0
$CB69a call10,109
The scroll writer: frames it ran in 10,109, writes in the blank 20,218
$8000a call10,097
The random byte: frames it ran in 9,935, bytes $003C,$003D, rotates 2, exclusive-ors 1
$9292a call10,095
The sprite writers: frames it ran in 10,092, writes to the sprite page 564,785
$E88Da call116
The sprite writers: frames it ran in 116, writes to the sprite page 116
$CC3Ba call40
The bank switch: writes 80, in the blank 0, while drawing 80
$CA85power-on17
The bank switch: writes 34, in the blank 34, while drawing 0
The sprite writers: frames it ran in 10,172, writes to the sprite page 4,352
$CC37a call17
The bank switch: writes 34, in the blank 0, while drawing 34
$8452a call128,000
$9329a call91,197
$D3CDa call13,960
$CB9Fa call10,109
$CBB5a call10,098
$CD6Ca call10,098
$CDDAa call10,098
$CE3Ca call10,098
$CBDBa call10,097
$CBF7a call10,097
$84FDa call10,092
$D430a call7,147
$CE35a call6,719
$D4C9a call6,355
$8132a call5,698
$811Ca table4,111
$8220a call3,871
$D20Ea call3,316
$D237a call3,316
$802Da table3,180
$9C73a table2,748
$9CDCa table2,736
$E510a call2,736
$E8B9a call2,572
$E5D4a table2,513
$D1A7a call2,483
$D1C6a call2,483
$E611a table2,396
$E85Fa call2,396
$E8E0a call2,396
$D252a call1,970
$84F4a call1,914
$84A1a call1,870
$81B5a call1,570
$C272a call934
$D0B7a call924
$D1D3a call833
$C28Ea table705
$C29Da call705
$C4FFa call705
$C54Aa call667
$C286a table594
$C55Fa call358
$CC8Ea call352
$C56Aa call347
$D3E7a table302
$C243a call294
$D2BAa table292
$C268a call229
$84EEa call185
$84F6a call185
$E59Aa table176
$E5AFa table176
$C145a call147
$C190a call147
$C196a call147
$E81Aa call147
$CB89a call102
$D370a table102
$D1FDa call92
$D39Ca call90
$D38Fa call86
$C4E3a call82
$D2C1a table67
$E575a call60
$E5DFa table60
$E5FAa table57
$C1F1a call49
$C216a table49
$C21Fa table49
$C4C4a call49
$CEBEa call49
$E51Da table47
$83E4a call45
$CD57a call45
$E94Da call42
$814Ca call40
$83E0a call40
$D2D4a table40
$C555a call38
$CBC3a call37
$8143a call34
$C23Ca call33
$C2AFa table33
$C2F7a call33
$C33Ea call33
$CC56a call33
$E940a call31
$81D4a call28
$9E2Ba table23
$9E1Fa table22
$E918a call20
$8157a table17
$8174a table17
$817Fa table17
$CA8Aan interrupt (IRQ)17
$CB53a call17
$83BAa call16
$D340a table15
$80F2a table12
$8107a table12
$81CFa call12
$81D8a call12
$9CA8a table12
$9CE7a table12
$E645a call9
$9E27a table4
$D3DAa call4
$E908a call2

Where it waits

Loops a rule named that sit inside a routine and are not themselves a place the code is entered.

atwhat it is, and the evidence
$CAF2
The idle spin: turns 74,970,040, turns a frame 7,309

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
$801B97$0018
$817911$0090
$9C8A22$0034
$9CE122$0090
$C1F8115$0053
$E51533$008E
$E59F11$008F
$E5D933$008F
$E88533$002E

The memory its routines share

262 bytes of memory were written by one routine and read by another, and 60 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
$030025614
$07002567
$04002561
$05002561
$02002532
$02012531
$02022531
$02032531
$00001524
$06001281
$040F171
$0460163

The 24 busiest shared bytes

bytereads and writesroutines writingroutines reading
$0000984,21066
$0001824,55666
$0008778,44745
$0009753,79923
$0003600,52066
$0002559,51266
$000E263,49723
$000C214,03423
$000B172,31622
$00AB88,05826
$002282,09523
$00F760,61623
$009A41,81366
$000D37,42923
$003235,35866
$003035,14534
$00F533,46524
$00A532,45866
$001E31,59266
$009827,53036
$009927,53036
$00AC24,09213
$00FF22,56744
$001D21,26753

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

All the games