1987 · Imagine

Arkanoid: graphics

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.

Every sprite shape the game keeps, its animations played at the rates the game steps them, the sprites of the intro, and the picture the cassette builds on the screen while the game loads.

01 · What moves

Every animation, at the game's speed

The Vaus, the enemies, Doh's shots and the falling capsule, each drawn from the listing's bytes and stepped by the game's own rules, fifty frames a second as on a PAL machine.

Sprites in play are multicolour ($D01C = $FC), with white and light blue as the two shared colours (play_screen_colours, $F719). Each card uses the colour the game gives that sprite: red for the Vaus ($F242), blue for the enemies (enemy_colour, $A3EC), yellow for an explosion ($9EFB), white for a laser shot ($A770) and the capsule's colour by type (capsule_colours, $B2BC). The game sets no colour when Doh fires a shot ($9853-$9872), so the shot keeps its slot's last one; it is drawn here in the enemies' blue.

Enemies take their frames from one table of lists, anim_lists ($A376). animate_object ($A344) shows the next frame of a list once every speed + 1 calls, and a 0 in the list is followed by the place to start again, or by a second 0, which removes the object. The speed depends on the enemy (enemy_anim_speed, $A3F0): every 4th call for the cone and the cube, every 3rd for the pyramid, every 5th for the three balls. The enemies are not updated on every frame: update_enemies ($9F5E) adds $A1 to a counter each frame and runs only when it carries, on 161 frames in 256, and their animation slows with them. Which enemy a round has follows the round number: the cone in rounds 1, 5, 9 and so on, the pyramid in rounds 2, 6, 10, the three balls in rounds 3, 7, 11 and the cube in rounds 4, 8, 12 (enemy_anim_start, $A3E8).

The Vaus is two sprites side by side, a left half and a right half, and its animations are pairs of pointers. It fades in over four steps when a round or a life begins (vaus_appear, $A3F4), runs through the same dithered frames when the laser is fitted or taken away ($A5C7, $AD85), and breaks up over eight pairs when it is lost (vaus_explode_frames, $9C50). The capsule's letter rolls round: every 4th frame the game rebuilds the middle of the capsule sprite from the blank capsule and the letter, one row further on each time (capsule_letter, $A7DC).

02 · Every shape in play

All 104 sprite shapes of the play screen

Sprite shapes $40-$A7 of video bank 3, at $D000-$E9FF, 64 bytes each and numbered as the sprite pointers number them (shape n is at $C000 + 64n). They lie under the I/O area, where only the video chip reads them. Each is drawn in the colours of the sprite that shows it; shapes that no code points a sprite at are drawn in grey.

Two pairs are not what they first look like. Shapes $43 and $44 are the laser Vaus, the last frame of the laser's change (laser_on_frames, $A5EA). Shape $95 is the capsule with its letter, which the game rewrites every 4th frame from the blank capsule, $94, so as stored it holds whatever letter was last built. Shapes $46 to $49, four frames of scattering pixels, are put in a sprite pointer by no code the analysis found.

Shapes $96 to $99 belong to sprites 0 and 1, the two the multiplexer leaves alone. They are hi-res and black, sit at Y $EC ($F221) and take the X positions of the Vaus's two halves every frame ($F74C). The Vaus sits at Y $E0 ($F219) and its shapes fill rows 12 to 20 of the sprite, so the black sprites lie exactly over it. Sprites 0 and 1 are drawn in front of the others, so their black lines outline the multicolour Vaus. The game clears them while the Vaus fades in ($F0AA) and copies them back from $98-$99 when it has ($F09E). When the Vaus leaves through the Break exit, past X $E0, the game fills them with black one pixel column a frame, the right half first ($A4C4), and the Vaus disappears into the wall a column at a time.

The bricks are characters, not sprites (below).

03 · The bricks

Eighteen characters for the bricks, and a shadow for the background

A brick is two characters side by side, 16 pixels wide and 8 high with a black line below and to the right. Coloured bricks share one pair; silver and gold each have four pairs, which the game steps through to make them shine when they are hit.

Characters $80-$91 of the play screen's set, at $CC00-$CC8F, drawn four times their size in the play screen's colours: black behind, grey and light blue as the two shared colours (play_screen_colours, $F719), and the colour RAM the wall gives them: red here for the coloured pair, which takes each brick's own colour, and white (9) for silver and gold. The two bricks under them shine as the game shines them, one step every fourth frame (silver_shine, $AB55), over and over here; in the game a shine runs once per hit.

A coloured brick's face is entirely the brick's colour, so one pair, $80 $81, serves all seven colours, and the colour comes from colour RAM. Silver is grey with a white edge, and its shine is a white band that moves across it through $85-$82 on the left and $89-$86 on the right. Gold uses the same pattern with light blue in place of grey, $8D-$8A and $91-$8E, so on the Commodore 64 the gold bricks are light blue. What each brick is worth and how many hits it takes is on the Levels tab.

The playfield's 4 × 4 background tile (characters $40-$4F, copied in from $EC00), its shaded copy ($50-$5F), and two bricks on the background with the shadow draw_wall gives them.

The shadow is a second copy of the background. The 64 background characters copied in each round hold two tiles of 16 characters, one for odd rounds and one for even, and after each its shaded copy, 16 codes higher. draw_wall ($F40E) adds $10 to the two cells one row below a brick and one column to the right, the second only if it is not itself a brick, so every brick casts a shadow down and to the right. When a brick breaks, brick_hit ($B108) puts the background back in its two cells, each shaded when a brick still sits above it or above and to its left, and takes the shadow off the cells below and to its right unless another brick is there.

04 · The intro

A second set of sprites, for the title picture

Before round 1 a short scene plays over the title picture: a craft flies in and fires, and the Vaus escapes, turning end over end into the distance. Its sprites live in video bank 1, beside the picture.

Shapes $A0-$D5 of video bank 1, at $6800-$757F, drawn in the intro's colours: white for the craft and the Vaus, cyan and light red as the shared colours (intro_sprite_setup, $08CC). The escaping Vaus advances a frame every 4th frame (intro_vaus_frames, $08A1); the glint over the title, after the intro, every other frame (title_sprite_animate, $B983).

To draw in bank 1 the game points its sprite multiplexer at the title's screen: intro_sprite_setup rewrites the high bytes of the two stores that write the sprite pointers ($F976, $FC17) from $C3 to $63, and main_entry puts them back before play.

05 · The loading picture

The title picture, drawn on the screen as the tape reads it

The cassette loads the title picture first and lets you watch it arrive. On a white screen it fills in a cell at a time, left to right along each row of cells and down the screen, over 38 seconds, while Martin Galway's Ocean loading tune plays (Music).

The game's own bytes, from the listing: the bitmap at $4000-$5F3F, its screen colours at $6000-$63E7 and the colour RAM that the title copies from $6400, as the 1987 cassette loads them. The bitmap appears at the tape's own pace, where it has got to every half second.

About a minute into the tape, with the screen switched off, the loader reads the picture's screen colours and its colour RAM. Then it turns the screen on, white, and reads the bitmap in the order it lies in memory, at about 210 bytes a second. The bitmap keeps the eight rows of each 8 by 8 cell together, eight bytes in a row, so the picture arrives in whole cells: forty across, then the next row of cells down, twenty-five rows in all.

The game keeps these bytes as they loaded: they are its title picture. show_title_picture ($B480) points the video chip at them again for the title screen, and once more after Doh falls at the end.