Page Byte Address Length Description
128 0 8000 32
Cavern name
The cavern name is copied here and then used by the routine at 8684.
128 32 8020 72
Cavern tiles
The cavern tiles are copied here by the routine at 8684 and then used to draw the cavern by the routine at 8A75.
The extra tile at 805F behaves like a floor tile, and is used as such in The Endorian Forest, Attack of the Mutant Telephones, Ore Refinery, Skylab Landing Bay and The Bank. It is also used in The Menagerie as spider silk, and in Miner Willy meets the Kong Beast and Return of the Alien Kong Beast as a switch.
128 104 8068 1
Willy's pixel y-coordinate (x2)
Initialised by the routine at 8684, and used by the routines at 8ABB, 8BDD, 923A and 927F. Holds the LSB of the address of the entry in the screen buffer address lookup table at 8300 that corresponds to Willy's pixel y-coordinate; in practice, this is twice Willy's actual pixel y-coordinate.
128 105 8069 1
Willy's animation frame
Initialised upon entry to a cavern or after losing a life by the routine at 8684, used by the routine at 927F, and updated by the routine at 8BDD. Possible values are 0, 1, 2 and 3.
128 106 806A 1
Willy's direction and movement flags
Initialised by the routine at 8684.
Bit(s) Meaning Used by
0 Direction Willy is facing (reset=right, set=left) 8BDD, 927F
1 Willy's movement flag (set=moving) 8ABB, 8BDD
2-7 Unused (always reset)
128 107 806B 1
Airborne status indicator
Initialised by the routine at 8684, and used by the routines at 870E, 8ABB, 8BDD and 8D05. Possible values are:
Value Meaning
0x00 Willy is neither falling nor jumping
0x01 Willy is jumping
0x02-0x0B Willy is falling, and can land safely
0x0C+ Willy is falling, and has fallen too far to land safely (see 8BDD)
0xFF Willy has collided with a nasty or a guardian (see 8D05)
128 108 806C 2
Address of Willy's location in the attribute buffer at 5C00
Initialised by the routine at 8684, used by the routines at 8ABB, 8FC5, 921B, 923A and 927F, and updated by the routine at 8BDD.
128 110 806E 1
Jumping animation counter
Initialised by the routine at 8684, and used by the routines at 8ABB and 8BDD.
128 111 806F 4
Conveyor definition
The conveyor definition is copied here by the routine at 8684.
128 115 8073 1
Border colour
Initialised and used by the routine at 8684, and also used by the routines at 870E, 8ABB and 9135.
128 116 8074 1
Attribute of the last item drawn
Used by the routines at 8DF8 and 8F63. Holds the attribute byte of the last item drawn, or 0x00 if all the items have been collected.
128 117 8075 26
Item definitions
The item definitions are copied here by the routine at 8684, and then used by the routine at 8F63. An item definition contains the following information:
Byte(s) Contents
0 Current attribute
1,2 Address of the item's location in the attribute buffer at 5C00
3 MSB of the address of the item's location in the screen buffer at 6000
4 Unused (always 0xFF)
128 143 808F 37
Portal definition
The portal definition is copied here by the routine at 8684.
128 180 80B4 8
Item graphic
The item graphic is copied here by the routine at 8684, and then used by the routine at 8F63.
128 188 80BC 1
Remaining air supply
Initialised (always to 0x3F in practice) and used by the routine at 8684, updated by the routine at 8A3C, and also used by the routine at 9028. Its value ranges from 0x24 to 0x3F and is actually the LSB of the display file address for the cell at the right end of the air bar. The amount of air to draw in this cell is determined by the value of the game clock at 80BD.
128 189 80BD 1
Game clock
Initialised by the routine at 8684, updated on every pass through the main loop by the routine at 8A3C, and used for timing purposes by the routines at 8D0F, 8DF8 and 9135. Its value (which is always a multiple of 4) is also used by the routine at 8A3C to compute the amount of air to draw in the cell at the right end of the air bar.
128 190 80BE 29
Horizontal guardians
The horizontal guardian definitions are copied here by the routine at 8684, and then used by the routines at 8D0F and 8DAA. There are four slots, each one seven bytes long, used to hold the state of the horizontal guardians in the current cavern.
For each horizontal guardian, the seven bytes are used as follows:
Byte Contents
0 Bit 7: animation speed (0=normal, 1=slow)
Bits 0-6: attribute (BRIGHT, PAPER and INK)
1,2 Address of the guardian's location in the attribute buffer at 5C00
3 MSB of the address of the guardian's location in the screen buffer at 6000
4 Animation frame
5 LSB of the address of the leftmost point of the guardian's path in the attribute buffer
6 LSB of the address of the rightmost point of the guardian's path in the attribute buffer
128 219 80DB 1
Eugene's direction or the Kong Beast's status
Initialised by the routine at 8684, and used by the routines at 8DF8 (to hold Eugene's direction: 0=down, 1=up) and 9135 (to hold the Kong Beast's status: 0=on the ledge, 1=falling, 2=dead).
128 220 80DC 1
Eugene's or the Kong Beast's pixel y-coordinate
Initialised by the routine at 8684, and used by the routines at 85CC (to hold the index into the message scrolled across the screen after the theme tune has finished playing), 8944 (to hold the distance of the boot from the top of the screen as it descends onto Willy), 8DF8 (to hold Eugene's pixel y-coordinate) and 9135 (to hold the Kong Beast's pixel y-coordinate).
128 221 80DD 35
Vertical guardians
The vertical guardian definitions are copied here by the routine at 8684, and then used by the routines at 8E75 and 8EF1. There are four slots, each one seven bytes long, used to hold the state of the vertical guardians in the current cavern.
For each vertical guardian, the seven bytes are used as follows:
Byte Contents
0 Attribute
1 Animation frame
2 Pixel y-coordinate
3 x-coordinate
4 Pixel y-coordinate increment
5 Minimum pixel y-coordinate
6 Maximum pixel y-coordinate
In most of the caverns that do not have vertical guardians, this area is overwritten by unused bytes from the cavern definition. The exception is Eugene's Lair: the routine at 8684 copies the graphic data for the Eugene sprite into the last 32 bytes of this area, where it is then used by the routine at 8DF8.
129 0 8100 256
Guardian graphic data
The guardian graphic data is copied here by the routine at 8684, and then used by the routines at 8DAA, 8E75, 8EF1 and 9135.
132 7 8407 1
Current cavern number
Initialised by the routine at 85CC, used by the routines at 8684, 870E, 8A75 and 8DAA, and updated by the routine at 9028.
132 31 841F 6
High score
Used by the routine at 870E and updated by the routine at 8944.
132 37 8425 10
Score
Initialised by the routine at 8684, and used by the routines at 870E, 8944, 9028 and 90EA.
132 87 8457 1
Lives remaining
Initialised to 2 by the routine at 85CC, and used and updated by the routines at 870E and 90EA.
132 88 8458 1
Screen flash counter
Initialised by the routine at 85CC, and used by the routines at 870E and 90EA.
132 89 8459 1
Kempston joystick indicator
Initialised by the routine at 85CC, and used by the routines at 870E, 8BDD and 9337. Holds 1 if a joystick is present, 0 otherwise.
132 90 845A 1
Game mode indicator
Initialised by the routine at 85CC, and used by the routines at 8684, 870E and 9028. Holds 0x00 when a game is in progress, or a value from 0x01 to 0x40 when in demo mode.
132 91 845B 1
In-game music note index
Initialised by the routine at 85CC, and used and updated by the routine at 870E.
132 92 845C 1
Music flags
The keypress flag in bit 0 is initialised by the routine at 85CC; bits 0 and 1 are checked and updated by the routine at 870E.
Bit(s) Meaning
0 Keypress flag (set=H-ENTER being pressed, reset=no key pressed)
1 In-game music flag (set=music off, reset=music on)
2-7 Unused
132 93 845D 1
6031769 key counter
Used by the routines at 870E and 9028.