1984 Β· Mastertronic

Squirm

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

Play the whole game in your browser: eat the eggs the worms lay, grab the treasure, keep clear of the worms, and race the bonus clock between levels.

Loading the game's data…
  • Joystick: ← β†’ ↑ ↓ move, Space or Z fires. Fire at the title starts a game.
  • In the maze the player keeps going the way it last went until a wall stops it, and turns as soon as the stick points at an open way. Fire alone stops it.
  • F1 or P pauses, with the stick let go; fire goes on.
  • A high score: left and right pick a letter, fire takes it. Three letters make the name.

The game's own screen, drawn from the port's memory each frame as the video chip would draw it, at the C64's own pace. Squirm reads one joystick, in control port 1: the arrows and Space are that joystick here.

01 Β· Differences

What differs from a C64

Nothing on this page runs the game's 6502 code. Every routine of the game is written again 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: the worms' cells at $2648, the treasure at $268A, the step delay at $2689, and the score, the level and the bonus clock on the screen itself.

Both of the game's interrupt routines end in the KERNAL's, in the C64's ROM, and the page has no ROM. It runs a stand-in that does what the game reads of the KERNAL's routine: it counts the jiffy clock at $A0-$A2, which every wait in the game watches, and scans the keyboard for the key number at $C5, which is how the game sees F1. It takes the time the ROM's routine takes, longer with a key held, so the game keeps the C64's pace.

On a C64 the keyboard's bottom row shares its lines with control port 1, so 1, ←, CTRL and 2 move the player up, down, left and right, and SPACE fires. Here only the arrows, Space, Z and the touch pad do. F1 pauses only while the stick is let go, on the page as on the C64: the KERNAL's scan reads the stick's lines as keys of the bottom row, and keeps the last key it finds, so a held direction hides F1.

The sound is the game's writes to the SID, a twelfth of a frame at a time, played through the site's model of the SID.