Manic Miner: Game status buffer

| Game status buffer

Address | Length | Description
--- | --- | ---
32768 | 32 | Cavern name The cavern name is copied here and then used by the routine at 34436.
32800 | 72 | Cavern tiles The cavern tiles are copied here by the routine at 34436 and then used to draw the cavern by the routine at 35445. The extra tile at 32863 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.
32872 | 1 | Willy's y-coordinate Initialised by the routine at 34436, and used by the routines at 35515, 35805, 37434 and 37503. Holds the LSB of the address of the entry in the screen buffer address lookup table at 33536 that corresponds to Willy's pixel y-coordinate; in practice, this LSB is twice Willy's actual pixel y-coordinate.
32873 | 1 | Willy's animation frame Initialised upon entry to a cavern or after losing a life by the routine at 34436, used by the routine at 37503, and updated by the routine at 35805. Possible values are 0, 1, 2 and 3.
32874 | 1 | Willy's direction and movement flags Initialised by the routine at 34436.
Bit(s) | Meaning | Used by
--- | --- | ---
0 | Direction Willy is facing (reset=right, set=left) | 35805, 37503
1 | Willy's movement flag (set=moving) | 35515, 35805
2-7 | Unused (always reset) |
32875 | 1 | Airborne status indicator Initialised by the routine at 34436, and used by the routines at 34574, 35515, 35805 and 36101. Possible values are:
Value | Meaning
--- | ---
0 | Willy is neither falling nor jumping
1 | Willy is jumping
2-11 | Willy is falling, and can land safely
12+ | Willy is falling, and has fallen too far to land safely (see 35805)
255 | Willy has collided with a nasty or a guardian (see 36101)
32876 | 2 | Address of Willy's location in the attribute buffer at 23552 Initialised by the routine at 34436, used by the routines at 35515, 36805, 37403, 37434 and 37503, and updated by the routine at 35805.
32878 | 1 | Jumping animation counter Initialised by the routine at 34436, and used by the routines at 35515 and 35805.
32879 | 4 | Conveyor definition The conveyor definition is copied here by the routine at 34436.
32883 | 1 | Border colour Initialised and used by the routine at 34436, and also used by the routines at 34574, 35515 and 37173.
32884 | 1 | Attribute of the last item drawn Used by the routines at 36344 and 36707. Holds the attribute byte of the last item drawn, or 0 if all the items have been collected.
32885 | 26 | Item definitions The item definitions are copied here by the routine at 34436, and then used by the routine at 36707. 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 23552
3 | MSB of the address of the item's location in the screen buffer at 24576
4 | Unused (always 255)
32911 | 37 | Portal definition The portal definition is copied here by the routine at 34436.
32948 | 8 | Item graphic The item graphic is copied here by the routine at 34436, and then used by the routine at 36707.
32956 | 1 | Remaining air supply Initialised (always to 63 in practice) and used by the routine at 34436, updated by the routine at 35388, and also used by the routine at 36904. Its value ranges from 36 to 63 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 32957.
32957 | 1 | Game clock Initialised by the routine at 34436, updated on every pass through the main loop by the routine at 35388, and used for timing purposes by the routines at 36111, 36344 and 37173. Its value (which is always a multiple of 4) is also used by the routine at 35388 to compute the amount of air to draw in the cell at the right end of the air bar.
32958 | 29 | Horizontal guardians The horizontal guardian definitions are copied here by the routine at 34436, and then used by the routines at 36111 and 36266. 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 23552
3 | MSB of the address of the guardian's location in the screen buffer at 24576
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
32987 | 1 | Eugene's direction or the Kong Beast's status Initialised by the routine at 34436, and used by the routines at 36344 (to hold Eugene's direction: 0=down, 1=up) and 37173 (to hold the Kong Beast's status: 0=on the ledge, 1=falling, 2=dead).
32988 | 1 | Eugene's or the Kong Beast's pixel y-coordinate Initialised by the routine at 34436, and used by the routines at 34252 (to hold the index into the message scrolled across the screen after the theme tune has finished playing), 35140 (to hold the distance of the boot from the top of the screen as it descends onto Willy), 36344 (to hold Eugene's pixel y-coordinate) and 37173 (to hold the Kong Beast's pixel y-coordinate).
32989 | 35 | Vertical guardians The vertical guardian definitions are copied here by the routine at 34436, and then used by the routines at 36469 and 36593. 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 34436 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 36344.
33024 | 256 | Guardian graphic data The guardian graphic data is copied here by the routine at 34436, and then used by the routines at 36266, 36469, 36593 and 37173.
33799 | 1 | Current cavern number Initialised by the routine at 34252, used by the routines at 34436, 34574, 35445 and 36266, and updated by the routine at 36904.
33823 | 6 | High score Used by the routine at 34574 and updated by the routine at 35140.
33829 | 10 | Score Initialised by the routine at 34436, and used by the routines at 34574, 35140, 36904 and 37098.
33879 | 1 | Lives remaining Initialised to 2 by the routine at 34252, and used and updated by the routines at 34574 and 37098.
33880 | 1 | Screen flash counter Initialised by the routine at 34252, and used by the routines at 34574 and 37098.
33881 | 1 | Kempston joystick indicator Initialised by the routine at 34252, and used by the routines at 34574, 35805 and 37687. Holds 1 if a joystick is present, 0 otherwise.
33882 | 1 | Game mode indicator Initialised by the routine at 34252, and used by the routines at 34436, 34574 and 36904. Holds 0 when a game is in progress, or a value from 1 to 64 when in demo mode.
33883 | 1 | In-game music note index Initialised by the routine at 34252, and used and updated by the routine at 34574.
33884 | 1 | Music flags The keypress flag in bit 0 is initialised by the routine at 34252; bits 0 and 1 are checked and updated by the routine at 34574.
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
33885 | 1 | 6031769 key counter Used by the routines at 34574 and 36904.