Commodore 64 · 1985 · Activision

Little Computer People: the source

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/little-computer-people with me to Gold.

Every routine, table and variable the game uses, with the names and descriptions given to them. Click an operand to follow it; the counter beside a label lists what refers to it. The reference below the fold is rendered from the game's facts file.

Technical reference: memory map, timing, tables, cheats

Current truth for this game. The workflow lives in kit/skills/; how this understanding developed lives in agent-history.md. Every fact names the routine or table it comes from. Unless marked live, a fact comes from reading the code in the snapshot named in orientation.md.

Build

A single-file crack by Mr Z of the 1985 Activision game; see orientation.md for the image, the loader and the crack screen. The crack hands over at $0340, the game's own jump table, after putting three blocks back where the game expects them: $0340–$03FF from $4B40, $0400–$07FF from $4C00, and colour RAM from $CC00. Nothing in the program touches the disk (orientation.md, "Steady state").

Memory layout

ThingWhere
Zero page: parser, switch, counters, keyboard, both music players, text$0000–$00FF
Text output queue; typed-line ring (128 bytes, write index $0222)$0200–$0221; $0224–$02A3
Jump table: cold start, random number, mood score$0340–$0349
Settings and state: mood, illness, needs, house clock, figure arrays$034A–$03F4
The name "Billy Bob Binkle", referenced by nothing$03FC–$040B
Random number state; activity script pointer; real-time clock$0414–$0417; $0423; $0426–$0429
Cold start, time prompt, keyboard$0434–$0690
Keyboard tables, VIC start values$0691–$070F
Raster interrupt$0713–$08D2
Main loop, house clock, illness, daily schedule, wall clock$0931–$0CF1
Figure sprites: unpacking, sharing out, outlines, clipping$0E41–$13EE
Walking, stairs, the dog, 55 places, random numbers$16AE–$1E59
Activities and their handlers$1E5A–$3F0B, $52D8–$5BF7, $8D99–$96C4, $A80B–$AFFB, $BEFF–$BFFC, $E000–$E452
House events: CTRL keys, TV, stereo, fire, phone, alarm, stove$2B45–$2E92
Sound request scheduler; typed input$3476–$3730; $3731
Record player music: tunes; driver; note table$39C7–$3E43; $3F3B–$46BC, $7F40–$801F; $46C9
The switch$3F0C–$3F3A
Sprite shape buffers (VIC bank 1)$4800–$4BFF
Font, 91 glyphs$5000–$52D7
Letter pieces$5600–$56DC
Colour matrix, sprite pointers$5C00–$5FFF
The house picture, a multicolour bitmap$6000–$7F3F
Letter buffer (inside the record player's work area)$7F40–$7FDE
Four piano pieces$8020–$8D98
House objects: states, drawing, frames$96C5–$A807
Head turning; pose view classes$ACF3–$AEE9
Piano and effects sound driver$B000–$B9BD, interpreter $D000–$D586, data $D587–$DD8E
Clothes colours; text output$B9BE–$BA35; $BA36–$BECF
Parser: code, word lists, rules$C000–$C233, $C234–$C969, $C96A–$CB8A
Colour RAM image of the house$CC00–$CFE7
Activity chooser; piano activity$E13F; $E3CA
Packed figure graphics: offsets, 183 images$E453–$E5C0, $E5C1–$FFB9
Hardware vectors$FFFA–$FFFF

Banking

Timing

Controls

| Key | Code | What it does | |---|---|---| | CTRL F | $06 | food delivery, activity 44; ignored while the cupboard is full ($30B4 = $0F) | | CTRL W | $17 | one more line of water in the tank $2B51, up to 11 | | CTRL A | $01 | rings the alarm clock ($2B4E); ignored while a record plays ($801E) | | CTRL D | $04 | dog food delivery, activity 33 | | CTRL C | $03 | the phone rings: activity 25 | | CTRL P | $10 | pats him if he is in the easy chair (place $2B), setting the mood to happy; otherwise activity 6 walks him there | | CTRL R | $12 | a record delivered, activity 50 (only while $0711 is 0, which it always is) | | CTRL B | $02 | a book delivered, activity 51 |

Live: each of D, C, P, R and B started its activity (after the brief activity 16) within a third of a second; W raised the tank from 5 to 11 and no further; F did nothing with the cupboard full and started activity 44 at once after $30B4 was set to $07.

The person, the dog and what they carry

Activities

| Activity | What he does | |---|---| | 0 | chooses the next activity | | 1 | a cooked meal (a script chosen at random, $AAC8) | | 2 | takes a typed request | | 5 | sits in the attic armchair (the TV) | | 6 | walks to the easy chair to be patted | | 7 | lights a fire: fetches a log from outside, puts it in the fireplace | | 9 | puts on a record (script 121, 119, 118, 120) | | 12, 13, 23, 60–69, 105, 106 | looks inside: upstairs closet, bedroom closet, filing cabinet, kitchen cupboard, fridge, freezer, dresser, nightstand | | 15 | takes up an interrupted activity | | 16 | switches the TV on or off at random | | 19 | tidies up | | 20 | uses the computer | | 21 | the piano: turns the stereo off first | | 22 | writes a letter | | 24 | the easy chair, with a white object (possibly the newspaper) | | 25 | answers the phone | | 27 | exercises | | 28 | brushes his teeth (a script) | | 29 | drinks a glass of water | | 30, 31 | goes to bed; gets up | | 32 | eats | | 33, 50, 51 | fetches a delivery: dog food, a record, a book | | 34 | feeds the dog | | 43, 44 | takes food from the cupboard; puts delivered food in it | | 46 | turns towards the player and makes a face, before a request that scored 12 or more | | 48, 49 | cooks: a pot on the stove, then to the sink | | 52 | answers a greeting | | 53 | dances (3, 7, 11 or 15 moves) | | 78, 79 | picks a piano piece; plays it | | 84, 102 | takes a bath | | 107–110 | changes clothes | | 113 | unknown | | 118, 119, 120, 121 | rummages at the stereo; picks one of the four tunes; starts the music; stops it | | 122 | comes in through the front door |

The rest are phases of these or small helpers; each is named in its state machine's comment.

The parser

Needs, mood and illness

The house

Letters

Sound

Hardware register census

From the code (work/census.py: every absolute-mode operand in $D000–$DFFF, plus the indexed start-up copy). Registers reached through an index are listed under the base the instruction names.

RegisterWhat the game does with itWhere
$D000–$D02E, all of the VICset from the 47-byte table vic_init_values ($06E1) at the cold start: border and background black, screen off$0487
$D000–$D010 sprite positionswritten once a pass by the sprite update$11B6 (after $1275)
$D015, $D01B, $D01C, $D027+likewise; the text cursor borrows one sprite$11B6; $0836, $0865
$D025, $D026 sprite multicoloursclothes colour; $D026 = $0A normally and 5 (green) while ill$B9BE; $04F5; $0B51–$0BA7
$D011screen on after start; blanked when no key has been pressed for about 3.6 hours; raster high bit cleared in the interrupt$04E6, $0589, $07F4
$D012the raster line $28, set once; $07DB and $1277 only wait on it$049A
$D016multicolour off for the text band (AND #$EF), put back at a timed raster position$0759, $07E9
$D018, $DD00VIC bank 1, bitmap $6000, matrix $5C00, set once$04EB; $046F
$D019, $D01Araster interrupt enabled at start, acknowledged in the handler$0492, $0495; $07F1
$D020–$D024set to black by the start-up copy and never changed$0487
colour RAM $D800+the TV screen, the objects' colours, the text band$2D6B, $96ED, $BAF3
SID $D400–$D414cleared at start; both music drivers and the effects$3726; $42DF–$43F2; $B34D
SID $D415–$D418filter and volume, from the presets at $B6A1$B474–$B486; $046C
CIA1 $DC00–$DC03keyboard and joysticks$059E–$060C
CIA1 timers, $DC0D–$DC0Fthe record player's clocks; interrupts off at start$4487–$44A5, $3FFD–$401D; $045B
CIA2 $DD0D–$DD0Finterrupts and timers off, once at start$0450–$0469

Text

Live tests

All from work/play-02.vsf with the machine running at normal speed unless warp is named. The game is deterministic from a snapshot: with no input the same activities come at the same times, so a difference after an input is the input's doing. The activity number is $8D9B, sampled every quarter second, so an activity shorter than that can be missed. After an interruption, the next activity he chooses for himself is the same in every run (the same random state).

InputActivities, in order (seconds after the input)
none5; 40 at 18.8; 79 at 23.2
"please type a letter to me"5; 46 at 0.5; 22 at 2.9; the letter is typed into the top band
"please light a fire"5; 46 at 0.5; 7 at 6.4; the fire burns by 80 s
"please play the piano"5; 121 at 0.3; 79 at 0.5; the piano plays
"hello"5; 46 at 0.5; 52 at 2.9; 5 at 6.7
"please dance"5; 118 at 0.5; 120 at 4.9; 53 at 5.4
"please put on a record"5; 121; 118 at 0.7; 120 at 4.9; the record plays
"please play poker"5; 46 at 0.5; 25 at 2.9 (his own choice); no game
CTRL F (cupboard full)nothing but a moment of activity 0
CTRL W, CTRL Athe same as no input
CTRL D, C, P, R, B16 at once, then 33, 25, 6, 50 and 51 respectively

Other tests are described above, beside their facts: the house tick (timing), the first activity, CTRL W's limit and CTRL F with the cupboard not full (controls), manners (parser), illness and bed, the three faces (needs), the TV and the turntable (house), the complaint letter (letters), the piano pieces and the talking sound (sound). Unprompted, over nine minutes from play-02, he spent 166 s at the piano (79), 116 s on the phone (25), 107 s in the attic armchair (5), 49 s exercising (27), 46 s switching the TV (16) and 29 s in 8; activity 0 lasted a moment each time. He did not knock on the glass to ask for a game.

Open questions and oddities

Cheats

Pokes that change the game within its own parameters. Each one names the variable it changes and whether it has been tested live. Untested pokes are labelled as candidates.

EffectPokeStatus
His mood: 0 happy, 1 content, 2 sad ($035F); picks his face and adds 3, 1 or 0 to every request's scorePOKE 863,0tested: the face changes at once (reference/moods.png), and a request without "please" scored 7 instead of 4
Make him ill: illness level 1–4 ($0365); at 3 or more he goes to bed, and he turns greenPOKE 869,3tested: green at the next tick; recovers at once unless food and water are gone too
Empty the kitchen cupboard ($30B4, one bit per packet), so CTRL F works and letters complainPOKE 12468,0tested: CTRL F then starts the delivery; the letter becomes the complaint
Fill the kitchen cupboardPOKE 12468,15tested: this is how the game starts, and CTRL F is ignored
Water in the tank, 0–11 lines ($2B51)POKE 11089,11tested: CTRL W stops at 11; 0 with an empty cupboard makes the complaint letter
Hunger and thirst, 0–3 ($0371, $036E); at 3 an illness starts on the next risePOKE 881,3 / POKE 878,3tested, together with the illness poke: he goes for food and water first
The house hour, 0–23 ($0379); 3 rings the alarm, 23 starts the evening listPOKE 889,2candidate: from the code ($09EB, $0BB2), not tried
Choose the next piano piece: stop at $AB1F and set A to 0–3 (Mozart, unidentified, Für Elise, Bach)a breakpoint at $AB1F in the emulator's monitor, then set the A registertested: this is how each piece was recorded
Choose the next record tune: stop at $AB14 and set A to 0–3a breakpoint at $AB14, then set the A registertested: tune 2 is tune 0 upside down

The addresses are in RAM that the game reads with I/O in ($01 = $35), so a poke from the machine-language monitor of an emulator works while the game runs; there is no BASIC to type POKE into while the game is going.

routines tables variables strings branch labels

Loading listing…