1987 · Electric Dreams Software

Big Trouble in Little China

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

Every fighter is two sprites wide and three tall, built each frame from strips seven lines high. The sewer monster is not a sprite at all: it is painted into the picture.

01 · The figures

Every figure, at the game's speed

Each figure below plays its whole list of frames, one frame a game loop, about ten a second ($117F). The frames come from the game's own lists (figure_types, $0E99) and are drawn in the colours the game gives each figure.

Loading the figures from the listing…

The three heroes are Jack Burton, in blue with his gun, Wang Chi, in grey with his sword and his flying kicks, and Egg Shen, in white, who throws his magic. The enemies come in seven kinds, and the game gives each kind its own colour by writing the enemy's two sprite colour registers ($132A). The lists run on into each other, so a list's last frame can be the next figure's first.

02 · How a frame is built

Strips of seven lines, stacked into a figure

A frame is a record of 12 bytes (frame_records, $506E): three addresses for each of the figure's two sprite columns. Each address points at a run of sprite rows in the parts at $545E-$7FFF, $8C00-$9FFF or $CC00-$DFFF, which build_figure ($08A4) copies into the figure's sprite page every loop.

One frame of Jack, left, and the six runs of rows it is made of: 21, 21 and 14 lines for each column. The first two addresses of a column give three 7-line parts each, the last gives two.

Sharing parts saves memory: the same legs serve a hero's standing and punching frames, and 84 records draw every frame of every figure from about 22 kilobytes of parts. The enemy's parts lie under the I/O chips at $CC00-$DFFF, so update_display switches all RAM in, with interrupts off, while it builds the enemy's frame ($09E2).

Four figures are on the screen at once: the three heroes and one enemy. Each is two sprites side by side, and the raster interrupt reuses the same pair down the screen, three times for each figure, stopping 13 times a frame to move the sprites down and turn their pointers on (irq_sprites_bank2, $0622). The tables of stops are sorted each loop by height (build_mux_bank2, $06BA), because a figure that jumps changes where its sprites have to be reused.

03 · Painted into the picture

The sewer monster, the shots, and the bonuses

Nineteen shapes are not sprites. draw_items ($283B) copies them straight into the hidden bitmap after the street has been drawn, so they need no rubbing out: the next loop draws the street again over them.

The sewer monster's eight frames (shapes 10 to 17), in the sewer's colours. It hurts the active hero in frames 3 and 4, at the top of its rise, so a hero who is walking past has to time it (the sewer monsters).

The other eleven, numbered as the game numbers them: shots 0 to 3 (Jack’s bullet, Egg Shen’s magic and the enemies’ throws), then the bonuses 4 to 9 (gun, strength potion, Egg Shen's potion, food, Wang Chi's sword and the prize), and 18, the panel icon. A shape's colours are the street part's, so they change as the street does.

04 · The screen

Two whole pictures, swapped every loop

The play area is a multicolour bitmap. The game keeps two copies, in video banks 2 and 3, draws the street into the one not shown, and then swaps them by flipping one bit of $DD00 ($0A68).

Nothing of the old picture is kept: every loop draw_street ($0221) copies 19 tile columns from the street map into the hidden bitmap, about 4,600 bytes, with a copy loop whose 32 addresses it rewrites first. That is why the street scrolls in steps of 8 pixels and why the game runs at about ten loops a second rather than fifty. The colours of the whole play area change only when the street enters a new part ($0A23).

05 · The loading screen

The cassette names the game's makers while it loads

About 37 seconds into Electric Dreams' 1987 cassette, the screen turns black with B.T.L.C in its top corner. Ten seconds later the credits come in, a line at a time from the bottom of the screen up: who designed the game and its graphics, who wrote the code, and the copyright lines for the film and the program. They stay for 38 seconds. Then the title picture comes up whole, 93 seconds in, and stays while the rest of the game loads, for nearly three and a half minutes, until the title tune starts.

Two frames of the cassette, drawn as the video chip draws them: B.T.L.C, for two seconds here, then the credits as they came in, at the tape's pace, from the bottom of the screen up. Skip shows them whole. The screen is written in the C64's own characters, so the page carries the ones it shows, 464 bytes of Commodore's character ROM 901225-01, from its two sets at offsets $0000-$07FF and $0800-$0FFF.

The credits give game and graphic design to Focus, and code and effects to M D Software and Edwin Rayner, and call the game a Software Studios production. Once it has loaded, the game names nobody: its title screen has no credits, and none are in its memory. The program's copyright line settles its year, 1987.

Under the last line, in black on the black screen, is a line nobody could see: Electric Dreams S, the start of the line two rows above, in the same place, with the rest left off. Light up the hidden line draws it in grey.

The title picture that follows is the game's own title screen, the same in all 64,000 pixels, so on the cassette it is up for minutes before the game is. The thin grey lines in the border are the loader's: while the tape plays, it switches the border between black and dark grey, over and over.