1987 · Electronic Arts

Skate or Die!

This minisite was contributed by unorig, air. It’s currently claimed by unorig who is editing it to reach a Gold tier standard.

How the half-pipe that High Jump and the Freestyle ramp share is drawn: its picture, its crowd, and its skater, from the bytes the events load. The other events' pictures are on their own pages.

The picture

One bitmap, with a hires strip on top

The half-pipe, the stands, and the sky are a single multicolour bitmap. The bitmap arrives packed in its own file and is unpacked once, when the event starts ($1B6A).

Drawn in the page from the bytes of the listing: the bitmap at $4000, two colours per cell from the screen matrix at $6400, the third from the copy of colour RAM at $6000, on a black background ($089E). The top text row is drawn hires, as the game shows it. The skater, the ruler's black marks, and the shadow are sprites and are not part of the picture. The status line's words are written into the bitmap when the event starts; the listing holds them as they were in the snapshot.

The picture is stored in file $10 with a simple run-length code: a byte from $00 to $7F is followed by that many plus one bytes to copy, and a byte from $80 up repeats the next byte that many minus 127 times ($1B6A). The unpacker writes into the space where the poses will go, and a copy loop then moves 8,000 bytes of pixels to the bitmap, 1,000 colour pairs to the screen matrix and 1,000 colours to a spare kilobyte at $6000 ($08F2). That spare copy is what goes into the C64's colour RAM each time the event starts ($0A50), because colour RAM sits under the input and output chips and cannot be loaded from disk directly.

Two raster interrupts split the screen each frame. The first, at line 249, switches multicolour off, so the top text row is drawn hires ($0B21): that row holds the status line, PRACTICE, PASS, and HEIGHT in a font of 64 characters, drawn inverted into the bitmap ($126D). The second, at line 55, waits three lines and switches multicolour back on for the picture below ($0CA3).

The scenery

A crowd that cheers harder for higher jumps

Sixty-nine squares of the picture, each eight pixels by eight, have a second frame. The first eight are the four flags on the poles, and the other 61 are heads and arms in the stands. To swap one, animate_cell ($192E) copies the other frame's eight bytes of pixels into the bitmap and its colours into the screen matrix and colour RAM, and flips a bit that remembers which frame is showing ($1CA5).

The flags move on their own: about one frame in eight, one flag changes ($199B). The crowd depends on the skater. Each time the skater turns at the top of the right wall, half the height of that pass becomes the crowd's level ($1AD0), and on each frame one random head moves if a random number falls under that level ($19AE). The chance is the level out of 256: after a five-foot pass a head moves on about one frame in thirteen, after a twelve-foot pass on about one frame in five.

The skater

Five sprites, 158 poses

Every pose the skater can strike is a record of 30 bytes: five parts, one for each of the hardware sprites 0 to 4 ($095D). Press a pose to see it larger.

Colour set

All 158 records at $7000, drawn facing right, as on the right half of the ramp. Each part names a shape in the 16 KB of shapes from $8284, its size, and where it sits. Sprites 1 and 2 are multicolour and take white and dark blue as their shared colours; sprites 0, 3, and 4 are single-colour. The colour sets are the two at $2D7F and $2D87; the game picks one at random for each attempt ($19D3).

A sprite is 24 pixels by 21, 63 bytes, but most parts of a skater are smaller. The 477 shapes are stored with only the rows they use, three bytes to a row, and a copy routine fills the rest of the sprite with zeros as it builds it ($13FD). Packed that way, the shapes fill 16,428 bytes ($8284-$C2AF), where 477 full 64-byte sprite blocks would take 30,528.

The poses are stored facing one way. When the skater is on the left half of the ramp, the copy routines mirror each shape as they build the sprite: a single-colour row through a table that reverses the eight bits of a byte, and a multicolour row through a table that reverses the four pairs, so that the colours stay with their pixels ($138D, $13C5, tables at $2E7B and $2F7B, built when the event starts by $1340). The x offsets of the five parts change sign at the same time ($0C6F). The game builds the next frame's five sprites in one buffer while the VIC shows the other, and swaps them each frame ($14DE).

Sprite 4 is the board, and its colour comes from the skater, not the colour set: the event copies a byte the event manager keeps for each skater into both sets ($09EE). Sprite 7 is the board's shape again, in black, kept at the height of the coping while the skater is in the air ($0C29): it reads as the board's shadow. Sprites 5 and 6 are the black marks of the ruler at the top right, stretched to double height and copied into place when the event starts ($0A01). The yellow pole behind them is drawn into the bitmap, ten cells high, by $1AFA.