Address Length Description
A709 1
Control Method
Selected by the menu at GameMenu. Bits 01 and 02 hold the control method read by ReadControls:
Value Control Method
00 Keyboard
01 Kempston Joystick
02 Cursor Joystick
03 Interface II
Bit 03 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.
A70A 1
Menu Pass Counter
Incremented on every pass of the menu loop at GameMenu.
A70B 1
Unused
Not referenced by the game.
A70C 1
Previous Control Method
Copy of ControlMethod taken before the menu keys are read, used to notice a change of selection.
A70D 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.
A70E 1
Helper Active Flag
Set to 01 while the helper creature (object type 5A, see RunHelperSource) exists, so that only one is created at a time.
A70F 1
Pentagram Revealed Flag
Set to 01 by CheckObjectsCollected once all four of the quest objects have been collected (their entries in the object store then have the types 74 to 77); from then on the eight pentagram arcs (object types 80 to 87) are brought into the room by LoadRoomObjects.
A710 1
Dirty Rectangle Count
Number of screen rectangles queued on the stack by DrawChangedObjects during the current redraw.
A711 1
Room Redraw Flag
Set to 01 when a new room has been built, so that the main loop redraws the whole room.
A712 2
Draw List Pointer
Address of the next entry of the redraw list at DrawList, used by DrawChangedObjects.
A714 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.
A715 2
Frame Counter
Counts frames. Bit 00 of it is used by the object handlers to animate and to alternate behaviour every other frame.
A717 2
Saved Stack Pointer
Holds the stack pointer while DrawObject reads sprite data with SP.
A719 2
Sort Outer Pointer
Position in the draw list of the object being compared by DrawObjectsInOrder.
A71B 2
Sort Inner Pointer
Position in the draw list of the object it is being compared with.
A71D 1
Room Limit X
Distance from the room centre (80) to the wall on the x axis.
A71E 1
Room Limit Y
Distance from the room centre (80) to the wall on the y axis.
A71F 1
Room Floor Height
The height of the floor, below which objects cannot fall.
A720 1
Inventory Redraw Flag
Set to 01 when the carried objects change, so that CheckInventory redraws the inventory.
A721 1
Lives
Number of lives the player has left. It starts at 05, is lowered by LoseLife each time the player is sent back to the start and is raised by RunCollectableObject.
A722 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.
A732 2
Font Pointer
Address of the glyph table used by PrintCharacter.
A734 1
Frame Drawn Flag
Set to 01 once the frame around the menu or end screen has been drawn.
A735 1
Unused
Loaded into HL by BBBF but otherwise not used.
A736 1
Text Colour
The attribute used for text printed by PrintTextSingleColour and PrintTextStandardFont.
A737 1
Controls
The state of the controls, written by ReadControls and read by the player handlers.
Bit Meaning
00 Turn left
01 Turn right
02 Walk forward
03 Jump
04 Pick up or drop
06 Fire
A738 1
Room Colour
The colour of the room: the ink colour from the room data with the bright bit set, set by BuildRoomScenery.
A739 1
Previous Vertical Speed
The vertical speed of the player from the last frame; it tells MovePlayer if the player landed from a fall.
A73A 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.
A73C 1
Cell Offset
Offset that BuildRoomScenery adds to the positions of the scenery objects as it builds a room: bit 0 adds 08 to x and bit 1 adds 08 to y, and the whole value is added to z. It is always zero.
A73D 1
Spawn Timer
Countdown to the next random creature, see CreateCreature.
A73E 2
Saved Stack Pointer Copy
Written by AFDD with the stack pointer but never read.
A740 1
Action Key Held Flag
Set while the pick up or drop key is being held, so that one press only does one thing.
A741 1
No Room To Drop Flag
Set when there is no free space above the player to drop an object.
A742 1
Special Object Flag
Set by CheckSpecialObjects when the room holds an object of one of the types 70 to 78 or 80 to 87; CreateCreature then makes no random creatures.
A743 1
Fire Key Held Flag
Set while the fire key is being held, so that one press fires once.
A744 3
Score
The score as six binary coded decimal digits, most significant byte first.
A747 1
Menu Tune Flag
Set when the tune of the menu has been started, so that it is played only once, see PlayMusicOnce.
A748 1
Footstep Counter
Counts steps of the player to alternate the two footstep sounds.
A749 1
Sound Effect Counter
Number of frames left of the current sound effect, see PlaySoundEffect.
A74A 1
Sound Effect Type
Selects the pitch sequence used by PlaySoundEffect.
A74B 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 05.
A74C 1
Objects Collected
Number of the four objects that have been collected, see RunCollectableObject.
A74D 2
Quest Percentage
The percentage of the quest completed as binary coded decimal, shown on the end screen by PrintQuestPercentage.
A74F 32
Visited Rooms
One bit for each of the 0100 possible rooms, set by MarkRoomVisited when the player enters the room.
A76F 1728
Object Table
The 36 object records of the game, each 20 bytes long. A record whose type byte is 00 is free. The first two records hold the two halves of the player (see ObjectsTable and A78F); 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
00 Object type; indexes the sprite table at SpriteTable and the handler table at ObjectHandlerTable
01 Position on the x axis (the centre of the object)
02 Position on the y axis (the centre of the object)
03 Height above the floor (the bottom of the object)
04 Half the size on the x axis
05 Half the size on the y axis
06 Size on the z axis
07 Flags, see below
08 Room the object belongs to (or the room a door leads to)
09 Speed on the x axis
0A Speed on the y axis
0B Speed on the z axis
0C Collision flags: bit 00 is set when the object hit something on the x axis, bit 01 on the y axis and bit 02 on the z axis (it is on the ground); bit 03 is set while it is jumping; the upper four bits count down the frames after entering a room
0D Collision state flags used by the handlers
0E Push from other objects on the x axis
0F Push from other objects on the y axis
10 Low byte of the address of the entry in the object store at ObjectStore, or handler workspace
11 High byte of the address of the entry in the object store
12 Offset on the x axis from the projected position to the sprite
13 Offset on the y axis from the projected position to the sprite
14 to 16 Handler workspace
17 Handler flags
18 Width in bytes of the sprite last drawn
19 Height of the sprite last drawn
1A Screen x position of the sprite last drawn
1B Screen y position of the sprite last drawn, counted from the bottom of the screen
1C to 1F Copy of 18 to 1B from the previous frame
The flags in byte 07 are:
Bit Meaning
00 Ignore the walls of the room
01 The object is being moved, so it is ignored by the collision tests
02 The object can be pushed
03 The object can open doors (the player)
04 The object needs drawing
05 The object has moved and its old area needs restoring
06 Mirror the sprite from left to right
07 Flip the sprite upside down
BACA 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.
CC11 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 D8, which is high above the floor, so it falls into the room.
D432 288
Object Store
The objects of the quest as the game changes them, in 12 entries of 10 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.