Address Length Description
68A0 1
Room index
This holds the index of the room that the hero is presently in, or 0 when he's outside.
The possible room numbers are as follows:
Room Description Movable Object Items
0 Outdoors / exterior / main map - Green key
1 Lowest hut, right hand side - Poison
2 Middle hut, left hand side (Hero's start room) - Stove
3 Middle hut, right hand side - -
4 Highest hut, left hand side - -
5 Highest hut, right hand side - -
6 (unused index) - -
7 Corridor - -
8 Corridor - -
9 "Crate" Crate Shovel
10 "Lockpick" - Lockpick
11 Commandant's office - Papers
12 Corridor - -
13 Corridor - -
14 Guard’s quarters 1 - Torch
15 Guard’s quarters 2 - Uniform, Yellow key
16 Corridor - -
17 Corridor - -
18 “Radio” - Radio
19 “Food” - Food
20 "Red Cross parcel" - From parcel: Purse, Wire snips, Bribe, Compass
21 Corridor - -
22 Corridor to solitary - Red key
23 Mess hall, right room - -
24 Solitary confinement - -
25 Mess hall, left room - -
26 (unused index) - -
27 (unused index) - -
28 Lowest hut, left hand side Stove -
29 Tunnel 2, start of - -
30 Tunnel 2 - -
31 Tunnel 2 - -
32 Tunnel 2 - -
33 Tunnel 2 - -
34 Tunnel 2, end of - -
35 Tunnel 2 - -
36 Tunnel 2 - -
37 Tunnel 1, start of - -
38 Tunnel 1 - -
39 Tunnel 1 - -
40 Tunnel 1 - -
41 Tunnel 1 - -
42 Tunnel 1 - -
43 Tunnel 1 - -
44 Tunnel 1 - -
45 Tunnel 1 - -
46 Tunnel 1 - -
47 Tunnel 1 - -
48 Tunnel 1, end of - -
49 Tunnel 1 - -
50 Tunnel 1 (initially blocked) - -
51 Tunnel 2 - -
52 Tunnel 2 - -
68A1 1
Current door
This is the current door id. Bit 7 is the door_REVERSE flag.
7CFC 19
Message queue
This is a queue of pending message indexes. Each is a two-byte value. Terminated by a single message_QUEUE_END byte ($FF).
7D0F 1
Message display delay
This is a decrementing counter. When it reaches zero it shows the next message.
7D10 1
Message display index
This is an index into the message that we're displaying or wiping.
message_display uses this. If it's 128 then we call next_message. If it exceeds 128 then we call wipe_message. Otherwise we proceed with displaying the next character.
7D11 2
Message queue pointer
This is a pointer to the next available slot in the message queue.
7D13 2
Current message character
This is a pointer to the next message character to be displayed.
81A4 6
Saved position
This holds a position (type: pos_t OR tinypos_t, depending on the code). It is used all over the code either for scratch space or for argument passing.
81AA 1
Touch's stash for register A
The only user of this is touch which stashes a copy of A here.
81AC 6
Bitmap and mask pointers
These are used by the vischar and item plotting code.
81B2 3
Saved (tiny) position
This holds a position (type: tinypos_t). This is populated when a vischar or item is readied for plotting. It's then used to control the rendering of masks into the mask buffer.
guards_follow_suspicious_character also uses it as a scratch space.
81B5 2
Isometric position
This holds the current vischar's isometric projected map position.
81B7 1
Flip sprite
This is set by setup_vischar_plotting. When set, the top bit causes the character to be drawn flipped horizontally.
81B8 3
Hero's map position
This holds the hero's map position (type: tinypos_t). event_roll_call, for example, uses this to test that the hero is within the roll call area.
81BB 2
Map position
This is used when drawing tiles and is also used to decide whether to permit the map to scroll.
81BD 1
Searchlight state
This is set to searchlight_STATE_SEARCHING ($FF) when the hero is being searched for. It's set to searchlight_STATE_CAUGHT ($1F) when the hero is caught in the searchlight. Otherwise it's set to ($00..$1E) when the hero has evaded the searchlight.
Used by the routines at nighttime, plot_sprites.
Value Meaning
255 Searching
31 Caught the hero
0..30 Tracking the hero
81BE 1
Room definition bounds index
This is a copy of the first byte of the current room definition. It indexes roomdef_dimensions allowing interior_bounds_check to perform a bounds check.
81BF 1
Room definition object bounds count
This is the count of object bounds (places where the hero cannot move to) held in roomdef_object_bounds.
81C0 16
Room definition object bounds
This holds up to four object bounds (places where the hero cannot move to) copied from the current room definition.
81D0 6
Unreferenced bytes
81D6 4
Interior doors
This holds up to four interior doors indices.
81DA 57
Interior mask data
This holds a count byte followed by up to seven mask structures for the current room definition.
Used by the routines at setup_room and render_mask_buffer.
The first byte is a count, followed by <count> mask_t's, with the following format:
Type Bytes Name Meaning
Byte 1 index An index into mask_pointers (the RLE mask data pointer)
bounds_t 5 bounds Isometric projected bounds of the mask. Used for culling.
tinypos_t 3 pos If a character is behind this point then the mask is enabled. ("Behind" here means when the character's x-coord is greater and y-coord is greater-or-equal).
8213 1
Saved item
Written to by setup_item_plotting but never read.
8214 1
Item height
This is a copy of item_definition height.
Used by the routines at setup_item_plotting, item_visible.
8215 2
Items held
The two items which the hero is holding. Each byte holds one item. Initialised to ($FF,$FF) meaning no item in either slot.
8217 1
Character index
The current character index.
A12F 1
Game counter
This counts $00..$FF then wraps around.
Write/read-write by wave_morale_flag.
A130 1
Bell
This is the state of the bell.
Value Meaning
0 Ring indefinitely
255 Don't ring
N Ring for N calls
Read-only by automatics.
Write/read-write by in_permitted_area, ring_bell, event_wake_up, event_go_to_roll_call, event_go_to_breakfast_time, event_breakfast_time, event_go_to_exercise_time, event_exercise_time, event_go_to_time_for_bed, searchlight_caught, solitary, guards_follow_suspicious_character, event_roll_call.
A132 5
Score digits
Read-only by plot_score.
Write/read-write by increase_score, reset_game.
A137 1
Hero in breakfast
This is the 'hero is at breakfast' flag.
Write/read-write by process_player_input, end_of_breakfast, hero_sit_sleep_common.
A138 1
Red flag
This is the 'red morale flag' flag.
Value Meaning
0 The hero is in a permitted area
255 The hero is not in a permitted area
Read-only by automatics, guards_follow_suspicious_character.
Write/read-write by in_permitted_area.
A139 1
Automatic player counter
This counts down while there are no input events. An input event will reset it to 31. When it reaches zero the CPU will assume control of the hero.
Read-only by touch, automatics, character_behaviour.
Write/read-write by check_morale, process_player_input, charevnt_hero_release, solitary.
A13A 1
In solitary
This is the 'in solitary' flag. When set ($FF) it stops set_hero_route working, stops automatics from running, stops process_player_input from running and in_permitted_area too.
Read-only by process_player_input, in_permitted_area, set_hero_route, automatics.
Write/read-write by charevnt_solitary_ends, solitary.
A13B 1
Morale exhausted
This is the 'morale exhausted' flag. It inhibits user input when non-zero.
Set by check_morale.
Reset by reset_game.
Read-only by process_player_input.
Write/read-write by check_morale.
A13C 1
Remaining morale
This is the hero's current morale level. It ranges from morale_MIN (0) to morale_MAX (112).
Read-only by check_morale, wave_morale_flag.
Write/read-write by increase_morale, decrease_morale, reset_game.
A13D 1
Clock
This is the game clock. It ranges from 0 to 139.
Read-only by in_permitted_area.
Write/read-write by dispatch_timed_event, reset_map_and_characters.
A13E 1
Entered move_a_character
This flag is set when character_index is valid. In character_bed_state etc.: when non-zero, character_index is valid, otherwise IY points to a character_struct.
Read-only by charevnt_bed, charevnt_breakfast.
Write/read-write by set_route, spawn_character, move_character, automatics, set_route.
A13F 1
Hero in bed
This is the 'hero in bed' flag.
Read-only by event_night_time,
Write/read-write by process_player_input, wake_up, hero_sit_sleep_common.
A140 1
Displayed morale
This is the currently-displayed morale. It lags behind the actual morale at morale while the flag drifts to its target level.
Write/read-write by wave_morale_flag.
A141 2
Morale flag screen address
This is a pointer to the screen address where the morale flag was most recently plotted.
Write/read-write by wave_morale_flag.
A143 2
Pointer to door being lockpicked
This is the address of a door (in locked_doors) in which bit 7 is cleared when successfully picked.
Read-only by picking_lock.
Write/read-write by action_lockpick.
A145 1
Player locked out until
This is the game time at which player control will be restored, e.g. when picking a lock or cutting though a wire fence.
Read-only by picking_lock, cutting_wire.
Write/read-write by action_wiresnips, action_lockpick.
A146 1
This is the 'night-time' flag
Value Meaning
0 Daytime
255 Night-time
Read-only by main_loop, choose_game_window_attributes.
Write/read-write by set_day_or_night, reset_map_and_characters.
A263 1
Red cross parcel current contents
This holds the current contents of the red cross parcel.
A7C6 1
move_map Y
This is an index used only by move_map.
A7C7 2
Game window offset
This is the game window's scroll offset. It's (0,0) when displaying interior rooms, but varies when the exterior is shown.
AB66 4
Zoombox parameters
AB6A 1
Game window attribute
This is a copy of the game window's current attribute byte. Assigned by set_attribute_from_A and used by zoombox_draw_tile_1 to set the attribute of a zoombox border tile.
AE75 3
Searchlight state variables
AF8E 1
Bribed character
This is the current bribed character.
Set by bribe_found. Read by B05B, C97E and tr_pursue.
B837 4
render_mask_buffer variables
C41A 2
PRNG pointer
This is a pointer to some bytes to output as pseudo-random data.
Initially set to $9000. Wraps around after $90FF.
C891 1
Food discovered counter
This is a countdown until any food item is discovered.
Used by automatics and target_reached.
EDD1 2
Saved stack pointer
F06B 10
Key definitions
These are the user-defined keys. It's pairs of (port, key mask).
F075 1
Static tiles plot direction
This is a stash location used by plot_static_tiles.
Value Meaning
0 Horizontal
255 Vertical
F445 1
Chosen input device
This records which input device was chosen.
Value Meaning
0 Keyboard
1 Kempston
2 Sinclair
3 Protek
F541 4
Music channel indices