Address Length Description
42761 1
Control Method
Selected by the menu at GameMenu. Bits 1 and 2 hold the control method read by ReadControls:
Value Control Method
0 Keyboard
1 Kempston Joystick
2 Cursor Joystick
3 Interface II
Bit 3 is never set by the menu or by anything else, so the game never uses what it would do: it would make the menu flash the line that starts the game, make TestPickupDropKey read the action bit from one place lower, and make HandleTurning move the player by itself.
42762 1
Menu Pass Counter
Incremented on every pass of the menu loop at GameMenu.
42763 1
Unused
Not referenced by the game.
42764 1
Previous Control Method
Copy of ControlMethod taken before the menu keys are read, used to notice a change of selection.
42765 1
Random Seed
The game's random number source. It is stirred by every object handler and by the menu loop with the Z80 refresh register.
42766 1
Helper Active Flag
Set to 1 while the helper creature (object type 90, see RunHelperSource) exists, so that only one is created at a time.
42767 1
Pentagram Revealed Flag
Set to 1 by CheckObjectsCollected once all four of the quest objects have been collected (their entries in the object store then have the types 116 to 119); from then on the eight pentagram arcs (object types 128 to 135) are brought into the room by LoadRoomObjects.
42768 1
Dirty Rectangle Count
Number of screen rectangles queued on the stack by DrawChangedObjects during the current redraw.
42769 1
Room Redraw Flag
Set to 1 when a new room has been built, so that the main loop redraws the whole room.
42770 2
Draw List Pointer
Address of the next entry of the redraw list at DrawList, used by DrawChangedObjects.
42772 1
Drawing Work Count
Number of objects drawn by DrawObjectsInOrder in the current frame, plus the number of rectangles that DrawChangedObjects then copied to the screen. The main loop uses it to pad the frame time.
42773 2
Frame Counter
Counts frames. Bit 0 of it is used by the object handlers to animate and to alternate behaviour every other frame.
42775 2
Saved Stack Pointer
Holds the stack pointer while DrawObject reads sprite data with SP.
42777 2
Sort Outer Pointer
Position in the draw list of the object being compared by DrawObjectsInOrder.
42779 2
Sort Inner Pointer
Position in the draw list of the object it is being compared with.
42781 1
Room Limit X
Distance from the room centre (128) to the wall on the x axis.
42782 1
Room Limit Y
Distance from the room centre (128) to the wall on the y axis.
42783 1
Room Floor Height
The height of the floor, below which objects cannot fall.
42784 1
Inventory Redraw Flag
Set to 1 when the carried objects change, so that CheckInventory redraws the inventory.
42785 1
Lives
Number of lives the player has left. It starts at 5, is lowered by LoseLife each time the player is sent back to the start and is raised by RunCollectableObject.
42786 16
Inventory
The objects the player is carrying: four entries of four bytes. Each holds the object type, the object flags and the address of the object's entry in the persistent object store at ObjectStore. The first entry is only used while an object is being picked up or dropped, and is empty the rest of the time. The other three are the objects that are carried, and are the ones that DisplayObjectsCarried shows. A new object goes into the second entry; the older ones move along when it is picked up, and the one in the last entry is the one that HandlePickupAndDrop drops.
42802 2
Font Pointer
Address of the glyph table used by PrintCharacter.
42804 1
Frame Drawn Flag
Set to 1 once the frame around the menu or end screen has been drawn.
42805 1
Unused
Loaded into HL by 48063 but otherwise not used.
42806 1
Text Colour
The attribute used for text printed by PrintTextSingleColour and PrintTextStandardFont.
42807 1
Controls
The state of the controls, written by ReadControls and read by the player handlers.
Bit Meaning
0 Turn left
1 Turn right
2 Walk forward
3 Jump
4 Pick up or drop
6 Fire
42808 1
Room Colour
The colour of the room: the ink colour from the room data with the bright bit set, set by BuildRoomScenery.
42809 1
Previous Vertical Speed
The vertical speed of the player from the last frame; it tells MovePlayer if the player landed from a fall.
42810 2
Template Table Pointer
Address of the table of template addresses that BuildRoomScenery uses while it builds a room. It starts at TemplateTable and can be moved on to the second half of the table at Template_Block by a group in the room data, though none do.
42812 1
Cell Offset
Offset that BuildRoomScenery adds to the positions of the scenery objects as it builds a room: bit 0 adds 8 to x and bit 1 adds 8 to y, and the whole value is added to z. It is always zero.
42813 1
Spawn Timer
Countdown to the next random creature, see CreateCreature.
42814 2
Saved Stack Pointer Copy
Written by 45021 with the stack pointer but never read.
42816 1
Action Key Held Flag
Set while the pick up or drop key is being held, so that one press only does one thing.
42817 1
No Room To Drop Flag
Set when there is no free space above the player to drop an object.
42818 1
Special Object Flag
Set by CheckSpecialObjects when the room holds an object of one of the types 112 to 120 or 128 to 135; CreateCreature then makes no random creatures.
42819 1
Fire Key Held Flag
Set while the fire key is being held, so that one press fires once.
42820 3
Score
The score as six binary coded decimal digits, most significant byte first.
42823 1
Menu Tune Flag
Set when the tune of the menu has been started, so that it is played only once, see PlayMusicOnce.
42824 1
Footstep Counter
Counts steps of the player to alternate the two footstep sounds.
42825 1
Sound Effect Counter
Number of frames left of the current sound effect, see PlaySoundEffect.
42826 1
Sound Effect Type
Selects the pitch sequence used by PlaySoundEffect.
42827 1
Pentagram Stones Placed
Number of the five pentagram stones that have reached their places on the pentagram. The game is won when it reaches 5.
42828 1
Objects Collected
Number of the four objects that have been collected, see RunCollectableObject.
42829 2
Quest Percentage
The percentage of the quest completed as binary coded decimal, shown on the end screen by PrintQuestPercentage.
42831 32
Visited Rooms
One bit for each of the 256 possible rooms, set by MarkRoomVisited when the player enters the room.
42863 1728
Object Table
The 54 object records of the game, each 32 bytes long. A record whose type byte is 0 is free. The first two records hold the two halves of the player (see ObjectsTable and 42895); the rest hold the scenery, creatures and items of the current room, which BuildRoomScenery fills from the last record downwards. The fields of a record are:
Offset Contents
0 Object type; indexes the sprite table at SpriteTable and the handler table at ObjectHandlerTable
1 Position on the x axis (the centre of the object)
2 Position on the y axis (the centre of the object)
3 Height above the floor (the bottom of the object)
4 Half the size on the x axis
5 Half the size on the y axis
6 Size on the z axis
7 Flags, see below
8 Room the object belongs to (or the room a door leads to)
9 Speed on the x axis
10 Speed on the y axis
11 Speed on the z axis
12 Collision flags: bit 0 is set when the object hit something on the x axis, bit 1 on the y axis and bit 2 on the z axis (it is on the ground); bit 3 is set while it is jumping; the upper four bits count down the frames after entering a room
13 Collision state flags used by the handlers
14 Push from other objects on the x axis
15 Push from other objects on the y axis
16 Low byte of the address of the entry in the object store at ObjectStore, or handler workspace
17 High byte of the address of the entry in the object store
18 Offset on the x axis from the projected position to the sprite
19 Offset on the y axis from the projected position to the sprite
20 to 22 Handler workspace
23 Handler flags
24 Width in bytes of the sprite last drawn
25 Height of the sprite last drawn
26 Screen x position of the sprite last drawn
27 Screen y position of the sprite last drawn, counted from the bottom of the screen
28 to 31 Copy of 24 to 27 from the previous frame
The flags in byte 7 are:
Bit Meaning
0 Ignore the walls of the room
1 The object is being moved, so it is ignored by the collision tests
2 The object can be pushed
3 The object can open doors (the player)
4 The object needs drawing
5 The object has moved and its old area needs restoring
6 Mirror the sprite from left to right
7 Flip the sprite upside down
47818 32
Temporary Object
An object record that is used to draw the icons of the inventory, the frame around the room and the lives, as the drawing routine needs an object. Only the type, the flags and the screen position are set.
52241 32
Creature Template
The object record that CreateCreature copies into a free object, and then changes to the next creature. The type is zero until a creature has been made, and the position is set by the routine. The creature has a z position of 216, which is high above the floor, so it falls into the room.
54322 288
Object Store
The objects of the quest as the game changes them, in 18 entries of 16 bytes. LoadRoomObjects takes the objects of a room from here when the room is built, and SaveRoomObjects puts them back when the player leaves it. The last entry is the one for the helper, at ObjectStore_Helper.