|Game status buffer|
There are eight pairs of bytes here that hold the entity specifications for the current room. The first byte in each pair identifies one of the entity definitions at 40960. The meaning of the second byte depends on the entity type: it determines the base sprite index and x-coordinate of a guardian, the y-coordinate of an arrow, or the x-coordinate of the top of a rope.
Initialised by the routine at 35090, and used by the routines at 37056 and 37310. There are eight buffers here, each one eight bytes long, used to hold the state of the entities (rope, arrows and guardians) in the current room.
For a horizontal guardian, the eight bytes are used as follows:
For a vertical guardian, the eight bytes are used as follows:
For an arrow, the eight bytes are used as follows:
The rope uses the second and fourth bytes of the following buffer in addition to its own; these ten bytes are used as follows:
Note that if a rope were the eighth entity specified in a room, its buffer would use the first and third bytes in the otherwise unused area at 33089.
Current room number
Number of items collected
Initialised by the routine at 34762; incremented on each pass through the main loop by the routine at 35245 (which moves the game clock forward by a minute when the counter reaches 0); reset to zero by the routine at 38276 when Willy sticks his head down the toilet; and used by the routines at 37841 (to cycle the colours of the items in the room), 38196 (to determine Maria's animation frame in Master Bedroom) and 38298 (to determine the animation frame for the toilet in The Bathroom).
Screen flash counter
Kempston joystick indicator
Willy's pixel y-coordinate (x2)
Initialised to 208 by the routine at 34762, and used by the routines at 35245, 35591, 36307, 36564, 36796, 37310, 38064, 38098, 38196, 38344 and 38455. Holds the LSB of the address of the entry in the screen buffer address lookup table at 33280 that corresponds to Willy's pixel y-coordinate; in practice, this is twice Willy's actual pixel y-coordinate. Note that when Willy is standing on a ramp, this holds his pixel y-coordinate rounded down to the nearest value of 16 (8x2).
Willy's direction and movement flags
Airborne status indicator
Initialised by the routine at 34762, checked by the routines at 35591, 36796 and 38344, updated by the routines at 37046, 37310 and 38064, and checked and updated by the routines at 36307, 36564 and 38098. Possible values are:
Willy's animation frame
Address of Willy's location in the attribute buffer at 23552
Jumping animation counter
Rope status indicator
Initialised by the routine at 35090, checked by the routines at 36307 and 36796, and checked and updated by the routines at 36564 and 37310. Possible values are:
Willy's state on entry to the room
256 minus the number of items remaining
Game mode indicator
In-game music note index
WRITETYPER key counter
Used by the routines at 34499 and 34620 to hold the entry code, by the routine at 34762 to hold the index into the message scrolled across the screen after the theme tune has finished playing, and by the routine at 35914 to hold the distance of the foot from the top of the screen as it descends onto Willy.