1994 · Psygnosis

Lemmings

This minisite was contributed by air, Nico-van-der-Zijden. It’s agent-generated and needs a human editor. Clone https://github.com/gamesexplained/gamesexplained and follow kit/START.md to curate games/c64/lemmings with me to Gold.

Every lemming the game draws, frame by frame, the intro's larger lemmings, and the character sets of the play screen, with the frames no animation ever shows.

01 · Lemmings in play

Twenty-one animations from 300 frames

A lemming in play is eight multicolour pixels wide and at most sixteen lines high, drawn into characters with the screen's three colours.

ten steps a second, the fastest the play screen swaps

Decoded by this page from the game part's listing. Each action's frames are the ones the game shows, worked out by a port of the frame step at $1FB1-$1FF2: the action's first frame (frame_base_lo, $12C9), a counter that moves on by one or two frames a pass (action_frame_step, $1308) and starts again at action_frame_restart ($131D) when it reaches action_frame_wrap ($12F3), starting from the 0 that restart_animation ($2160) leaves. test_graphics.js runs the game's own step for every action and compares. A frame is two bytes a line, from the addresses in frame_lo/frame_hi ($3C00/$3D2C) and frame2_lo/frame_ptr_hi ($3E58/$2EA0) plus 16, as or_frame_rows ($1D48) reads them. Colours: light blue, green and white, the play screen's $D022, $D023 and colour RAM.

The names are the labels of the action handlers in the Source tab. Pairs like 8 and 9, the walker, are one action in its two directions, each with frames of its own. The splat, the exit and the two deaths play once: their handlers end the lemming when the counter reaches a set value. The floater's counter starts its loop again at 32, its fifth frame, so the frames before it, the umbrella opening, play once.

02 · Never shown

Frames no animation reaches

The frame table has 300 entries. Stepped as the game steps them, the animations show some of them and never the rest.

Every frame of the table that none of the 21 animations shows, by the same port, with its number. Frames whose graphics another frame also points at, and which are shown that way, are left out.

…

Most of them are the in-between frames of the basher and the miner, which step two frames a pass. The counter starts at 0 and moves by 16 (two frames), and it starts again at 0, so the odd frames are skipped every time, although their graphics differ from their neighbours'. The builder and the digger step the same way, but their odd entries point at the same graphics as the even ones. Frames 189 to 195 lie between the shrugging builder (180-187) and the floater, and no action's frames include them. The floater's own first frame, 196, is never drawn either: its counter has already moved on to 8 when the first frame is chosen, and when it starts again it starts at 32.

03 · The intro's lemmings

148 larger lemmings in pairs of sprites

The intro draws its lemmings with sprites: a black hires outline over a multicolour body, 24 pixels wide and 21 lines high.

Unpacked by this page from the intro part's listing: 148 packed streams from $5B40, with their offsets (image_offset_lo, $4F6A) and starting literal counts (image_literals, $5094), by a port of the intro's unpacker (intro_unpack, $4E13). test_graphics.js unpacks all 148 with the game's own code on the kit's 6502 and compares them byte for byte. The body's colour is the image's 128th byte; the two shared colours are the intro's light red and blue (sprites_init, $497F).

All 148 images are named in the intro's frame list (frame_list, $4B0E), so none of them is spare.

04 · Character sets

Three character sets, two of them rewritten every pass

The play screen's two buffers each have a character set for the lemmings, and the panel has a third.

Drawn by this page from the game's memory 30 seconds into level 1 (reference/lem-gfx.js, made by work/mkgfx.py from a snapshot of play), in multicolour with the play screen's colours. Outlined: the codes the screen showed at that moment. The listing's snapshot is the briefing, when $5000-$5FFF hold the briefing's code, so these come from play.

The screen at $4000 uses the set at $5000, and the screen at $4400 the set at $5800 (screen_d018, $1349). Character 0 is empty and character 1 fills the screen around the play area. From character 2 up the set is rewritten every pass, one character at a time as the lemmings need them (next_char, resident $0422), and the rest of the 2 KB keeps whatever was there: the briefing's code, which the loader puts back at $5000-$64AF before every level. The cursor takes $FC-$FF and water $F4-$FB.

The panel's set at $7000 holds the skill icons, the digits and the letters of the line above them. Its last 256 bytes, $73C0-$74BF, are not characters the panel shows: they are the panel's four sprite shapes, $CF-$D2 (panel_sprite_ptr, $3F90), one of them the highlight on the chosen skill.