| Character buffers

The character buffers occupy bytes 0-24 in pages 215-221 and bytes 0-31 in pages 222-230.

The buffers in pages 215-221 are each shared by a group of five minor characters. Which one of the five characters 'owns' the buffer at any one time depends on the portion of the play area that is currently on screen. When the screen scrolls left or right, ownership of one of the buffers switches to the next or previous character in the group. See the routines at 61838 and 61882.

The buffers in pages 222-230 are used mostly by the principal characters, depending on the current game mode (0-4).

Page | Address | Character |  | Page | Address | Character |  | Page | Address | Character
215 | 55040 | Various |  | 221 | 56576 | Various |  | 227 | 58112 | Sniper (modes 1-4)
216 | 55296 | Various |  | 222 | 56832 | Policeman (modes 0-3) |  | 228 | 58368 | Banknote
217 | 55552 | Various |  | 223 | 57088 | Policeman (modes 1-3) |  | 229 | 58624 | Banknote; hook
218 | 55808 | Various |  | 224 | 57344 | Gangster |  | 230 | 58880 | Sam
219 | 56064 | Various |  | 225 | 57600 | Fat Man (mode 2); Lana (mode 3)
220 | 56320 | Various |  | 226 | 57856 | Daisy (modes 0-3)

The bytes in each character buffer are used as follows:

Byte(s) | Contents
--- | ---
0 | Animatory state
1,2 | Location (x, y)
3 | Various flags:
Bit(s) | Meaning if set
--- | ---
0-3 | Unused
4 | Unused (always reset, but checked by 61948)
5 | Unused
6 | Character should be moved (see 61948)
7 | Character is running (see 61948)
4 | z-coordinate: 1=indoors; 2=outside, behind people on the sidewalk; 4=on the sidewalk or road; 8=invisible
5 | Post-midstride animatory state (see 60347, 60506)
6 | Post-midstride x-coordinate (see 60347, 60506)
7 | Post-midstride y-coordinate (see 60347, 60506, 60641, 64338)
8 | LSB of the primary command routine address (see 61948)
Sam's main action timer (see 24832, 25789, 29149, 29912, 30675, 60641, 61483, 64338)
9 | MSB of the primary command routine address (see 61948)
Sam's midstride/mid-action timer (see 29149, 60641, 61483)
10 | Destination x-coordinate (see 28803, 29072, 29361, 31126, 31808, 31944, 60812, 62976)
Walkabout origin x-coordinate (see 63304, 63530)
Counter used by the sniper to decide when to appear (see 25307)
1 if the banknote has just been landed on by Sam, 0 otherwise (see 25420, 25539)
11 | Destination y-coordinate (see 29072, 29361, 31126, 31944, 60812, 62976)
Walkabout destination x-coordinate for a cat (see 63530)
LSB of the address of the door knock status flags for the door (if any) that the character is on duty for (see 31338, 63304, 63520)
12 | Roll/somersault animation phase table entry address LSB (see 25789)
Destination location identifier (see 28803, 29072, 29361, 31126, 31808, 31944, 60812, 62976)
Walkabout duration indicator (0=indefinite, 255=finite) (see 31338, 63304, 63520)
13 | Roll/somersault animation phase table entry address MSB (see 25789)
0 if Sam has only just met Lana, 1 otherwise (see 24832)
Pre-knockout animatory state (see 64005, 64131)
Number of mini-walkabouts remaining (see 31338, 63304)
Location/destination indicator: 2 if the character is not on the sidewalk or the road, and is not in the same region as his destination; 1 if the character is not on the sidewalk or the road, and is in the same region as his destination; 0 if the character is on the sidewalk or the road, or on the front steps of the hotel but heading somewhere other than the hotel (see 31808, 60812, 62976)
1 if Sam has stepped off or been dropped off the the roof of a building to the ground from a great enough height that he could be knocked out when he lands; 0 otherwise (see 64227, 64338)
14,15 | Interruptible subcommand routine address (see 61948)
16 | Walkabout destination x-coordinate (see 63209, 63304)
Intermediate destination x-coordinate (see 62926, 62976)
Intermediate destination y-coordinate (see 62892, 62976)
Counter used by the sniper to decide when to duck and when to shoot (see 25118, 25307)
LSB of the address of the door knock status flags (see 32682) for the door the character has knocked on (see 62278, 62297)
Counter that determines how much longer a policeman will keep knocking on a door before busting it open (see 62325, 62339)
17 | Delay counter used by the sniper after firing a bullet (see 25118, 25307)
Counter that determines how much longer the character will wait for a door to be opened before giving up (see 62278, 62297)
Counter that determines the delay until the character will consider flipping a light switch or raising or lowering a window blind (see 63209)
18,19 | Uninterruptible subcommand routine address (see 61948)
20 | Telephone dialling sound effect counter (see 30675)
Distance remaining for the hook to fly (see 31713)
Knockout and recovery delay counter (see 64005)
Animation phase counter used when a character has just stepped off the roof of a building (see 64227, 64338)
21 | Pre-knockout x-coordinate (see 64005, 64131)
Landing y-coordinate (see 64338)
22 | Offset of the point reached in the current command list (relative to the start) (see 61791)
23,24 | Start address of the command list (see 61791, 61948)
25,26 | Unused (but see 61948)
27,28 | Unused (but checked by 61948 for a continual subcommand routine address)
29 | ID of Sam's disguise (bits 5-7) when he was last spotted (but not recognised) by the policeman, and the corresponding disguise timeout counter (bits 0-4) (see 29100, 29218, 29361, 29559)
30 | Sam's x-coordinate when he was last spotted by the policeman while wearing a disguise unknown to the police (see 29100, 29218)
31 | Sam's y-coordinate (bits 0-5) and z-coordinate (bits 6-7) when he was last spotted by the policeman while wearing a disguise unknown to the police (see 29100, 29218)