1987 · Imagine

Arkanoid

This minisite was contributed by chunkypixel, 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/arkanoid with me to Gold.

How the play screen is built, how the 32 walls are stored and drawn, how the bat sends the ball off, and what round 33 does differently. How the capsules are chosen is on the Discoveries tab, and Martin Galway's music plays on the Music tab.

01 · The screen

One frame of round 1, rebuilt from memory

One frame of play: the video chip's registers, every change made to them during the frame, and the memory they read, drawn line by line.

Play uses video bank 3: the screen at $C000 and one character set at $C800, in multicolour mode. Characters $00-$3F are the font and the logo, $40-$7F the background tiles, copied in each round, and $80-$FF the bricks, walls and panel. The bricks are character pairs, not sprites: $80 $81 for a coloured brick, $85 $89 for silver and $8D $91 for gold (draw_wall, $F40E).

The Vaus, the balls, the capsule, the laser shots and the enemies are twelve sprite objects on eight hardware sprites. A chain of three raster interrupts ($F720, $F75E, $FBEE) sorts the objects by height once a frame and places them down the screen. The right-hand panel is drawn once from a template of 25 rows of 13 screen codes at $7800 ($F2B5).

02 · The rounds

Thirty-two walls in 5 KB

Drawn from the round's 160 bytes at $8000 + 160 × (round − 1), with the game's own wall routine ported: tile pattern, colours, brick characters and the shading each brick casts. For round 1 the port's screen codes match the game's screen in the play snapshot in every cell but the three bricks already broken there. The Levels tab shows all 32.

Each round is 16 rows of 10 bytes: a 16-bit mask saying which of the 14 columns hold a brick, then 16 four-bit brick types ($F40E). A type below 8 is a coloured brick in colour type + 8. From 8 up, type AND 3 = 1 makes a silver brick and anything else a gold one, which is never counted and never breaks. Round 33 has no map: it is Doh.

RoundsHits to break silver
1-82
9-163
17-244
25-325

From the table at $F52A, plus one ($F4DF).

A coloured brick's value depends on its colour, from 70 to 130 points (brick_points, $B2C4): white 100, red 80, cyan 120, purple 90, green 110, blue 70, yellow 130; the Levels tab has every kind of brick, and how a silver brick counts its hits. The background alternates between two sets of 64 tile characters ($EC00 for rounds 1, 2, 5, 6…, $EE00 for 3, 4, 7, 8…) in blue or red ($F552).

03 · The bat

The two sides of the Vaus are not mirror images

Where the ball meets the Vaus, measured from a point 6 pixels right of its centre, and the angle it leaves at (bat_collision, $ABB3). Steep, diagonal and shallow are the step ratios the code sets: $FF/$40, $FF/$F0 and $80/$FF, vertical against horizontal.

The left half sends the ball left and the right half sends it right, each in three zones: two of 4 pixels, then the rest. Near the middle the left side gives a diagonal and the next zone out a steep bounce; on the right side the order is the other way round ($AC12-$AC3A against $AD0F-$AD38). Both outer zones give the shallow angle. On the enlarged Vaus the distance is halved first, so the zones are twice as wide.

The ball's speed is a number of steps per frame, from 1 to 11 (move_balls, $ADB3). Every brick hit adds 4 to a fraction that carries into it ($AF5F), and the time since the life began sets a floor that rises by one every 1,024 frames ($ADE7). A new life starts at 2. With the joystick the Vaus moves faster as the ball does: each frame it steps 2 × (speed + 1) pixels ($FDBF).

04 · Round 33

Doh takes 23 hits

Round 33: Doh

Round 33, reached by setting the round number and the bricks-left count so that the next brick broken in round 1 ended the round.

Doh is not a sprite. The round copies a 26 × 24 screen of characters from $7B90 into the playfield and swaps in its own character set (doh_setup, $9C59). The bricks-left counter becomes a hit counter, set to 22 ($95F4); every ball hit on one of Doh's characters takes one off ($B11E), and the ending starts when it goes below zero ($9637): the 23rd hit. Doh fires one shot per cycle of its mouth, aimed at the Vaus ($9819-$987B).

After the last hit Doh dissolves, the ending tune and the title picture play, and the story's last page is printed ($B8B0): "DIMENSION CONTROLLING FORT DOH HAS NOW BEEN DEMOLISHED AND TIME STARTED FLOWING BACKWARDS". Then the game sets the player's lives to none and goes to game over ($96B7).

05 · Quirks

Bug: a ball moving left cannot hit an enemy from the side

The ball-against-enemy test has a horizontal check for each direction. The one for a ball moving left subtracts 24 where it should add ($9E9B-$9EAB), so it never matches; only the vertical test catches such a ball. This was read in the code and not tried in play.

The Break exit pays nothing

In the arcade game, leaving through the Break exit is worth 10,000 points. Here the exit ends the round ($A41F to round_cleared, $95CF) and that path never adds to the score.

An extra life every 20,000 points, all at once

The threshold starts at 20,000 and rises by 20,000 with each life awarded (check_extra_life, $FAA5). A score set to 199,900 pays out ten lives in a row, taking the lives from 3 to 13 and the threshold to 220,000. The published cheat POKE 39801,189 turns the store at $9B79 that takes a life away into a load, so a lost ball costs nothing.

Two programs in one file

The 63 KB file carries an older build of much of the game beside the one that runs: an earlier assembly of $A971-$B5FF from $096B, of the interrupt and input code at $BA6B-$BFFF (with a 30-sprite multiplexer and a joystick reader for port 2 only), and of the sound driver at $3B8B, assembled $1000 higher. The game never reads or runs any of it. The enemies' second gate is unused in the same way: its path needs $0246, which the game never writes, so every enemy comes in through the gate at X $47.