1986 · Mastertronic

Storm

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/storm with me to Gold.

The whole game, ported to JavaScript routine by routine and run on its own bytes at the C64's pace, with a map of the lair that fills in as you go and a guide to the nearest brooch.

01 · Play

Play Storm with the keyboard

The characters turn rather than steer: left and right turn a character a quarter at a time, and up walks it the way it faces. On the title, fire starts; then left picks one player and right two, and down skips the instructions.

JoystickAgravain (joystick 1)Storm (joystick 2)
TurnA D← →
Walk forwardW↑
FireSpaceEnter
MagicS a mask, S with Space a scroll↓ with Enter an amulet

The game as the port runs it. A one-player game is always Agravain's, on joystick 1, so the arrow keys and Enter drive joystick 1 too until a two-player game begins. On a touch screen the pad under the game is joystick 1. The Guide button draws, over the room, the way to the nearest brooch each player can reach with what the two of them carry, and once three are carried, the way to Corrine.

02 · The map

The lair as you have seen it

Each room you stand in is drawn into its place on the game's map of 16 by 12 places, as the screen shows it, and stays as you left it. The rooms you have not seen are numbered boxes, joined by their doorways.

the room you are in a brooch still in its room Corrine's room the guide's way for Agravain the guide's way for Storm

The places come from room_map and the doorways from exit_bits, read from the game's memory as it runs. A brooch's mark goes when the game marks its record taken in the room's object list. The guide reads the same memory and searches the rooms as the game would draw them on entering: walls a trap has opened stay open and objects taken stay gone (Maps has every room drawn whole).

03 · The port

Every pass checked against the game's own code

Nothing on this page emulates a 6502, except for the title tune, whose player is the game's own code. The rest of the game is written out in JavaScript, one function for each routine of the listing, and runs on the game's own 64 KB, loaded from the bytes the Source code tab shows. Every variable stays where the game keeps it, so the map and the guide read the same addresses the game does.

test_play.js runs the port beside the game's own code on the kit's model of the C64, with the same joysticks, through 40,000 passes of the main loop at $78D7: whole games of one player and of two, and the title screens between them. At every pass the two memories are compared, and so are colour RAM and every register written to the video chip and the SID. One race of the game's is left out of the port: on the title, the tune's driver shares a pointer with the routine that colours a block, and an interrupt in the middle of a block sends the rest of its colours elsewhere, so a few cells keep their old colours. The port draws every block whole.

The page keeps the C64's pace by keeping its clock. Each routine the port calls moves the clock on by the cycles the game's own routine took on the kit's machine, on average over the same 40,000 passes; for the routines that draw a block, by the block's width and height. The clock runs the raster interrupt on its lines and takes from the processor the 43 cycles of each bad line, as the video chip does. In test_pace.js, over 24,000 frames with both driven by the same autopilot, a pass of play took the page 0.45 % longer than the game with one player and 0.41 % with two.

The screen is drawn by the site's model of the video chip from the port's memory, with each write the interrupt makes to the video chip at the line and cycle where the game makes it. The font the game copies from the character ROM is carried on this page: the first 512 bytes of the C64's character ROM (901225-01, $D000-$D1FF), which copy_rom_font reads.