1987 · Ocean

Wizball

This minisite was contributed by air. It’s agent-generated and needs a human editor. Clone https://github.com/gamesexplained/gamesexplained and follow kit/START.md to curate games/c64/wizball with me to Gold.

Wizball crashes itself when its clock stops, hides a cheat in the word BOREWIZ, and on level 5 draws a tile from the middle of its sound effects.

01 · Protection

Secret: stop the game's clock and it crashes

The initialisation sets CIA 2's timer A to count 19,656 cycles ($4CC7 + 1), exactly one PAL frame, and makes it the NMI. The NMI handler ($7C61) only clears $85. Late in each frame the band $8BBB stores a non-zero value there, and early in the next the band $8A52 ends with a check ($8B04): if $85 is not back to 0, the NMI has not come, and the check pulls a byte off the stack so that the band's return goes astray. Anything that stops the timer or its interrupt sets it off.

AddressBytesInstructionWhat it does
$8B04A7 86LAX $86A and X = $FF, set once by the initialisation
$8B06DF 86 FFDCP $FF86,X$FF86 + $FF wraps round to $0085: decrement it and compare with $FF
$8B09F0 03BEQ $8B0Eit was 0: the NMI came, return normally
$8B0B68PLAotherwise lose a byte of the return address

Both instructions that touch $85 are undocumented opcodes, and the address wraps round the top of memory, so a search of the code for $85 finds only the writes. With CIA 2's interrupts switched off, the check fails on the next frame and the processor runs into screen memory and stops on a JAM opcode at $EA7D, in the landscape screen.

The title screen has its own version, with an INC $FFB0,X that also wraps round to $85, and a failure path ($9292) that increments a random byte of memory first. One more disguised decrement, at $B589, is LXA #$FF followed by DCP $FF97,X. LXA is an undocumented opcode whose result depends on a constant that varies between 6510 chips; only with the constant $EE does X come out as $EE and the address wrap to $0085. The VICE emulator fixes the constant at $EE with the source comment "needs to be 0xee for wizball". The start-up hides as well: the initialisation reaches CIA 2 only through indexed addresses (STA $DC8E,X with X = $7F is $DD0D) and then overwrites itself with random bytes. The menu and "get ready!" screens compare the hardware vectors with their stored copy every frame ($90F8), flickering the screen if they differ.

02 · Cheats

Secret: BOREWIZ, and starting on a later level

On the title or the player menu, the band $AF85 compares each key pressed with the letters B O R E W I Z ($AFCE, in the game's key numbering). After all seven the border turns brown and $BB07 is set: collisions stop ending lives, except during "colour completed" and the bonus stage ($7EF4). The letters only have to come seven in a row, which is why Remember's notes can give it as WIZBOREWIZ; a doubled B breaks it, because a wrong key resets the count without being tried as a new first letter. The same band reads the keys 0 to 5: key n starts the next game on level n + 1, as far as the first level the last game did not finish ($AF7D), with the skipped levels marked done and up to five of thrust, anti-grav, beam, catelite and spray given for free ($B10D). Wiztips calls it the continue game feature.

03 · Level 5

Bug: level 5 draws a tile that does not exist

The tile table has 192 entries, but one byte of the map, at $092B, holds tile number $F8 (248). The drawing code does not check, and reads the tile's 25 characters from $2642 + 25 × 248 = $3E7A, the middle of two sound-effect records. Most of those bytes are small numbers, which draw as sky, but two are $FF, and glyph $FF of the play character set is the last eight bytes of memory: two unused bytes and the NMI, reset and IRQ vectors. The result sits just to the right of level 5's first well.

The stray tile beside level 5's first well, enlarged

Left: the game's screen on level 5, enlarged. Right: the tile's 5 × 5 bytes from $3E7A, drawn with level 5's character set; a 0 is sky, and the star glyphs $01-$5A show whatever stars the game has plotted into them. Remember's 1997 crack lists "matrix in level 5" among the bugs it fixed, and changes exactly this byte to $00.

04 · The shield

Bug: a shield survives quitting the game

The shield timer ($7F06, 40 units, one used every 50 frames) is cleared only when it runs out and in the Wiz-lab. Quitting with Q while paused does not touch it, and nor does starting a new game, so a shield that was running carries into the next game, while that game's icon bar offers the shield as unused. In one game: 38 units at the quit, 36 when the new game begins, and a collision in the new game costs 8 units and no life. Remember's crack names this as its second fix.

05 · Secrets, quirks and bugs

Things the manual never told you

The spray icon Remember's crack "fixed"

Remember's third fix is "the wrong sprite on the spray icon". Every icon in the bar shows what taking it next would give: after thrust is taken the first icon shows anti-grav, after the beam the second shows double. The spray icon follows the same rule, and after the Wiz takes the spray it shows the cat spray, a cat's face with dots very like the catelite's icon. Remember's version of the handler ($7325 here) swaps the two images, so its icon shows who holds the spray instead.

A hang in the Wiz-lab that no player can reach

The lab keeps up to nine permanent weapons ($B116). When a tenth is taken, $B0B0 frees the first two slots holding the spray and tries again; with fewer than two sprays among the nine it jumps to itself for ever ($B0D2). With nine other weapons put in the list by hand, choosing the spray freezes the game there. A player never gets that far: thrust, anti-grav, beam, double, catelite and blazers each turn their icon to the used-up shape once taken, so at most six slots can hold anything but the spray.

An earlier build left in memory

The image carries pieces of an older version of the game. After the initialisation sits a second copy of its last part ($ECB4) with different addresses, never run. $BB0D holds an earlier draft of the third Wiztips page, spelling "permanent" correctly where the real page says "permenant". $6EE4, just after the quit code, would mark the current level's colours done and jump into the level-complete sequence, and the test in front of it for the Q key branches to the next instruction either way: a debugging key, disconnected. Tests for three more keys ($9E5A) branch nowhere too. And the name-entry buffer at $BFF4 still holds "POO BAG", where a team's two sets of initials go; the game fills the buffer with spaces before every entry, so nobody sees it.