Up: Map Next: 5B88
5B00: Game variables
Below the game block, where the BASIC loader's CLEAR left the printer buffer, the system variables and the loader itself: the bytes the snapshot holds here are those, not the game's. The first thing the game does (START) is read the ROM's frame counter into SEED and clear everything from here to the end of the object records; after every game it clears again from WIPE_COUNT on (AFTER_GAME), so the first eight bytes -- the seed, the turn counter, the control method and the random number -- carry over from one game to the next.
Up to NO_HEADROOM this is Knight Lore's layout, 160 bytes lower, and where Alien 8 does the same job it keeps the same byte. The bytes nothing refers to are Knight Lore's variables for things Alien 8 does not have: the three after FLOOR the portcullises and the werewolf's change, the one after DRAW_WORK one spiked ball falling (Alien 8 keeps its own at DROPPING), the one after PLAYER_DZ the bouncing ball's step, the one after LIFT_TOP the rooms visited, the two after FONT_BASE the percentage. From CLOCK on the variables are Alien 8's own, and the rooms seen and the carried things sit at other places than Knight Lore's.
SEED 5B00 DEFB $00 The seed. The ROM's frame counter when the game is first run (START), plus the turn counter's low byte at every new game (AFTER_GAME), plus one each time round the menu (MENU). Bits 0-1 pick the start room (NEW_GAME_START); with the refresh register it picks the first kind of valve dealt (INIT_SPECIAL_OBJECTS)
5B01 DEFB $00 Nothing refers to this byte (searched): as in Knight Lore, the byte after the seed is spare
TURNS 5B02 DEFB $00 The turn counter, a word, counted up at the end of every turn (OBJECT_DONE) and never cleared after the first game. Its low bits time things: the sparks of the scene after a game (SCENE_SPARKS), the clockwork mice's speed (CLOCKWORK_MOUSE), the sounds (WARBLE_SOUND, CRASH_SOUND)
TURNS_HIGH 5B03 DEFB $00 Its high byte; the clockwork mice mix it with the random number for how far to walk (CLOCKWORK_MOUSE)
CONTROL 5B04 DEFB $00 Control method, set on the menu (MENU): bits 1-2 are 0 keyboard, 1 Kempston, 2 cursor, 3 Interface II; bit 3 directional control, toggled by key 5
RANDOM 5B05 DEFB $00 The random number: R is added in after every object's update, and the turn counter and a byte of memory it points at at the end of every turn (OBJECT_DONE). Read wherever the game wants chance: a thing dropping (CEILING_DROP), a leaper starting (LEAPER), a mouse's turn (CLOCKWORK_MOUSE), a tool's swing (SCENE_TOOL), the dealing of the valves (INIT_SPECIAL_OBJECTS)
CONTROL_BEFORE 5B06 DEFB $00 The control method as it was before the menu read the keys this time round (MENU)
5B07 DEFB $00 Nothing refers to this byte (searched); spare in Knight Lore too
WIPE_COUNT 5B08 DEFB $00 How many areas the drawing of a turn (RENDER_DYNAMIC_OBJECTS) has wiped and left on the stack to be copied to the screen; added to DRAW_WORK. The first byte cleared after a game (AFTER_GAME)
SAVED_SP 5B09 DEFB $00,$00 The stack pointer, while the sprite drawing borrows it (CALC_PIXEL_XY_AND_RENDER, SPRITE_SHIFTED_RUN)
ROOM_HALF_U 5B0B DEFB $00 The room's half-size in U, from ROOM_SIZES (BUILD_ROOM)
ROOM_HALF_V 5B0C DEFB $00 The room's half-size in V
ROOM_INK 5B0D DEFB $00 The room's ink, bits 0-2 of its record's third byte (BUILD_ROOM); white once its chamber is activated (LOOSE_VALVE). COLOUR_PANEL fills the screen's attributes with it, and colours the panel's label and chamber icon from it
FLOOR 5B0E DEFB $00 The floor's height, from ROOM_SIZES (BUILD_ROOM)
5B0F DEFB $00,$00,$00 Nothing refers to these bytes (searched): Knight Lore's portcullis and werewolf variables
PLAYED 5B12 DEFB $00 Bit 0 set at the end of every turn (OBJECT_DONE), cleared at a new game (AFTER_GAME); while it is set, entering a room first writes what lies in the one being left back to its places (ENTER_ROOM, UPDATE_SPECIAL_OBJS)
TAKE_HELD 5B13 DEFB $00 1 while the pick-up key is held, so one press does one thing (TAKE_OR_LEAVE)
PANEL_DUE 5B14 DEFB $00 Set on every press of the pick-up key that gets past TAKE_OR_LEAVE's first checks, whether or not anything changes hands; SHOW_CARRIED then redraws the carried things on the panel and clears it
INPUT 5B15 DEFB $00 This turn's controls (READ_CONTROLS): bits 0 and 1 turn, 2 walk, 3 jump, 4 pick up or put down; bit 5 any letter key, ENTER or SYMBOL SHIFT, which is the pick-up when a joystick is used with directional control (CHK_PICKUP_DROP). None are read while the game is won or over
PRINT_ATTR 5B16 DEFB $00 The colour byte a text list gives each line (DISPLAY_MENU), read by the printer (PRINT_TEXT_SINGLE_COLOUR)
NEW_ROOM 5B17 DEFB $00 Set when a room has been built (ENTER_ROOM) and when the scene after a game is set up (GAME_ENDED). The turn's drawing (RENDER_DYNAMIC_OBJECTS) then wipes nothing, and the main loop (OBJECT_DONE) draws the panel, colours the screen, copies the whole buffer out and clears it
TEXT_SHOWN 5B18 DEFB $00 0 until a text list has been printed and the screen copied once (DISPLAY_MENU); the menu and the arrival screen clear it
PLACE_NUDGE 5B19 DEFB $00 Added to the objects' positions by the builder (BUILD_ROOM); set by a template-0 header in a room's record
LIVES 5B1A DEFB $00 Lives, counted in binary but printed on the panel as though BCD (PRINT_LIVES): five at a new game (AFTER_GAME), one taken at the start of every life (NEW_LIFE), so the one in play and four more; the game is over when there is none to take. An extra life adds one (EXTRA_LIFE)
SAVED_UVZ 5B1B DEFB $00,$00,$00 An object's U, V and Z before its move, saved by SAVE_UVZ and compared after it by SAME_UVZ, so PUSHABLE can tell whether it was moved
DRAW_WORK 5B1E DEFB $00 The turn's drawing work: SORT_AND_DRAW zeroes it and counts every object it draws, RENDER_DYNAMIC_OBJECTS adds the areas it wiped, and the main loop (OBJECT_DONE) waits six units less this
5B1F DEFB $00 Nothing refers to this byte (searched): Knight Lore's "a spiked ball is falling"
TEMPLATES_AT 5B20 DEFB $00 The object template table the builder reads, a word with the next byte (OBJECT_TABLE, BUILD_ROOM): a template-31 header moves it on to the second page
PLAYER_DZ 5B21 DEFB $00 The player's step in Z this turn (MOVE_PLAYER) -- and the high byte of TEMPLATES_AT while a room is being built
5B22 DEFB $00 Nothing refers to this byte (searched): Knight Lore's bouncing ball's step
WON 5B23 DEFB $00 Set when the twenty-fourth chamber is activated (LOOSE_VALVE). The game then ends with the arrival screen (GAME_ENDED, ARRIVAL_SCREEN) and the robot's oiling (OILED_ROBOT) instead of the re-programming; while it is set the panel's carried things are not redrawn (SHOW_CARRIED)
GAME_OVER 5B24 DEFB $00 1 while the scene after a game runs in the main loop (GAME_ENDED): objects are then placed in pixels rather than projected (CALC_PIXEL_XY), the main loop neither waits nor runs the clock (OBJECT_DONE), and no controls are read (READ_CONTROLS). Cleared with the rest when the scene ends (AFTER_GAME)
LIFT_TOP 5B25 DEFB $00 The height the room's lifts rise to, one for them all: zero when a room is built (BUILD_ROOM), then set by the first lift or bobbing block to run (LIFT) -- a lift (graphic 47) its own Z plus 48, a bobbing block (graphic 31) its own Z. Measured: 112 in room $23, 100 in room $1D. Knight Lore keeps its bouncing balls' turning height the same way
5B26 DEFB $00 Nothing refers to this byte (searched): Knight Lore's count of rooms visited
FONT_BASE 5B27 DEFB $00,$00 The base the printer adds eight times a character's code to (PRINT_LIVES, PRINT_TEXT_SINGLE_COLOUR): FONT less 384 for text, FONT itself for numbers (RUN_CLOCK)
5B29 DEFB $00,$00 Nothing refers to these bytes (searched): Knight Lore's percentage
SEQUENCE_AT 5B2B DEFB $00,$00 Where the turn's drawing (RENDER_DYNAMIC_OBJECTS) is in the list of records to draw at DRAW_LIST, which LIST_DRAWN makes and ends with $FF
SORT_FIRST 5B2D DEFB $00,$00 A place in the depth sort's list (SORT_AND_DRAW)
SORT_SECOND 5B2F DEFB $00,$00 Another (SORT_AND_DRAW)
TUNE_HEARD 5B31 DEFB $00 Bit 0 set once the menu's tune has played (PLAY_TUNE_ONCE), so it plays once each time the menu is shown, not at every pass of the menu's loop; the clear after a game (AFTER_GAME) lets it play again
KEY5_HELD 5B32 DEFB $00 1 while key 5 is held on the menu, so one press toggles directional control once (MENU)
NO_HEADROOM 5B33 DEFB $00 1 when there is no room above him to stand on what he puts down (TAKE_OR_LEAVE)
ROOM_COLOUR_AT 5B34 DEFB $00,$00 The address of the room record's third byte, its size and colours (BUILD_ROOM); an activated chamber's white ink is written there (LOOSE_VALVE), so the room stays white until the next game
CLOCK 5B36 DEFB $00,$00 The light years left, four bytes, the highest digit first: each a digit in bits 4-7 and, in bits 0-2, how far it still has to roll into place. 6000 at a new game (AFTER_GAME); counted down by RUN_CLOCK every turn, a light year every seven turns; the game is over when all four are zero
CLOCK_LOW 5B38 DEFB $00 The third digit
CLOCK_LAST 5B39 DEFB $00 The last digit: CLOCK_BORROW takes a light year off when it has finished rolling
DROPPING 5B3A DEFB $00 1 while one of the things that drop from the ceiling is falling, so only one falls at a time (CEILING_DROP); cleared on entering a room (ENTER_ROOM)
DROP_LATCH 5B3B DEFB $00 While it is set nothing drops from the ceiling (CEILING_DROP): set on entering an even-numbered room (ENTER_ROOM), cleared by a pick-up (TAKE_OR_LEAVE) or an extra life (EXTRA_LIFE). As Knight Lore's spiked balls
SUMMARY_LOST 5B3C DEFB $00 The summary after a game (SUMMARISE_CHAMBERS), worked out from the room directory and the places. The cryonauts lost -- the frozen crew, object templates 21 and 22 (graphic 74), in the chambers not activated -- a BCD word, high byte first; 132 when none is activated. PRINT_SUMMARY_COUNTS prints three digits
SUMMARY_LOST_LOW 5B3D DEFB $00 Its low byte
SUMMARY_ACTIVE 5B3E DEFB $00 Chambers activated, BCD: the crew rooms where a seated valve (graphics 100-103) lies (SUMMARISE_CHAMBERS)
SUMMARY_IDLE 5B3F DEFB $00 Chambers not activated, BCD (SUMMARISE_CHAMBERS)
CHAMBERS 5B40 DEFB $00 Chambers activated in this game, BCD (LOOSE_VALVE), printed on the panel (PRINT_CHAMBERS); the twenty-fourth wins
SCENE_STATE 5B41 DEFB $00 The re-programming after a lost game. 0 while the sparks over the robot flash; 1 when they stop (SCENE_SPARKS); then bit 7 is set while one of the three tools swings (SCENE_TOOL) and bits 0-6 count the swings, the scene ending at 16
REMOTE_ORDERS 5B42 DEFB $00 The remote-controlled robots' orders. Bit 7: one robot has taken control (REMOTE_ROBOT). Bits 0-6: what he stands on this turn -- 1 the pad (REMOTE_PAD), 2-5 a button (REMOTE_BUTTON), each a step in U or V (REMOTE_STEPS) -- taken by the robot in control as it moves; cleared on entering a room (ENTER_ROOM)
LEAPING 5B43 DEFB $00 1 while one of the room's leapers (graphic 130) is in the air, so they leap one at a time (LEAPER): set when one starts, cleared when it lands and on entering a room (ENTER_ROOM)
5B44 DEFB $00,$00,$00,$00,$00,$00,$00,$00 Nothing refers to these bytes (searched)
5B4C DEFB $00,$00,$00,$00,$00,$00,$00,$00
5B54 DEFB $00,$00,$00,$00
ROOMS_SEEN 5B58 DEFB $00,$00,$00,$00,$00,$00,$00,$00 A bit per room number, set on entering the room (MARK_ROOM_SEEN): 256 bits, byte room/8, bit room AND 7. Counted for the rating after a game (COUNT_ROOMS_SEEN)
5B60 DEFB $00,$00,$00,$00,$00,$00,$00,$00
5B68 DEFB $00,$00,$00,$00,$00,$00,$00,$00
5B70 DEFB $00,$00,$00,$00,$00,$00,$00,$00
CARRIED_NEW 5B78 DEFB $00,$00,$00,$00 What he carries -- only valves can be picked up -- in entries of four bytes: the graphic, the flags and the address of its place. This one is where a thing being picked up is put (TAKE_OR_LEAVE) before the list moves on one; empty between presses
CARRIED 5B7C DEFB $00,$00,$00,$00 The things he carries, newest first (drawn on the panel by SHOW_CARRIED)
5B80 DEFB $00,$00,$00,$00
CARRIED_LAST 5B84 DEFB $00,$00,$00,$00 The oldest, which the next press puts down (TAKE_OR_LEAVE)
Up: Map Next: 5B88