Prev: A67F Up: Map Next: A76F
A709: Game variables
All zero on the tape. When the game is first run, START clears everything from here to the end of the object records; after every game it clears again from BUCKET_OUT on. So the first five bytes -- the control method, the menu's two, an unused one and the random number -- carry over from one game to the next: the next game carries on the random sequence rather than replaying the last one, and the menu shows the method chosen before.
CONTROL A709 DEFB $00 Control method: bits 1-2 are 0 keyboard, 1 Kempston, 2 cursor, 3 Interface II (MENU); bit 3 steers a joystick by direction (HANDLE_LEFT_RIGHT), and no menu choice sets it. Kept from game to game
MENU_PASSES A70A DEFB $00 Counted up each time round the menu's loop (MENU); nothing reads it
A70B DEFB $00 Nothing refers to this byte
CONTROL_BEFORE A70C DEFB $00 The control method as it was before the menu read the keys this time round; the menu compares the two and throws the result away
RANDOM A70D DEFB $00 The random number: R is added in at every new game and after every object's update (OBJECT_DONE). Read for the start room (CHOOSE_START), the drops from the sky (SKY_DROP), the collectables' starting spots (NEW_QUEST) and by SPIDER; PUFF_SOUND reads it as a word with the byte after, masked to an address in the ROM, and plays the bytes there as pitches
BUCKET_OUT A70E DEFB $00 1 while the well's bucket is out: the well gives no other (WELL); the bucket clears it when it reaches a quest item (BUCKET). The first byte a new game clears
PENTAGRAM_ON A70F DEFB $00 1 once all four quest items are done (ALL_FOUR_DONE): from then on the pentagram's pieces are put into their room (QUEST_INTO_ROOM)
WIPE_COUNT A710 DEFB $00 How many areas RENDER_DYNAMIC_OBJECTS has wiped this turn and left on the stack to be copied to the screen
NEW_ROOM A711 DEFB $00 Set by ENTER_ROOM when it has built a room. While it is set RENDER_DYNAMIC_OBJECTS wipes nothing; the main loop (OBJECT_DONE) then redraws the whole screen and the panel and clears it
LIST_POINTER A712 DEFB $00,$00 Where RENDER_DYNAMIC_OBJECTS is in the list at DRAW_LIST
DRAW_WORK A714 DEFB $00 The turn's drawing work: SORT_AND_DRAW zeroes it and counts every object it draws, RENDER_DYNAMIC_OBJECTS adds every area it wiped, and the main loop (OBJECT_DONE) waits six units less this
TURNS A715 DEFB $00,$00 The turn counter, counted up at the end of every turn (OBJECT_DONE); also read by CONVEYOR_PUSH and SPIDER
SAVED_SP A717 DEFB $00,$00 The stack pointer, while DRAW_OBJECT has it reading a sprite
SORT_FIRST A719 DEFB $00,$00 Where SORT_AND_DRAW is in the list at DRAW_LIST: the place after the object it has in hand
SORT_SECOND A71B DEFB $00,$00 The place after the object SORT_AND_DRAW is comparing it with
ROOM_EXTENT A71D DEFB $00,$00,$00 The room's size, from ROOM_SIZES (BUILD_ROOM): how far from the middle of the room, 128, an object may reach in U, then in V -- the walls' tests (ADJ_DU_FOR_OUT_OF_BOUNDS, ADJ_DV_FOR_OUT_OF_BOUNDS, CHK_PLYR_OOB) compare the distance plus its half-size with them -- and the floor's height in Z, 128 in all three sizes, below which nothing falls (ADJ_DZ_FOR_OUT_OF_BOUNDS) and on which the builder stands the objects
PANEL_DUE A720 DEFB $00 Set when what he carries changes (TAKE_OR_LEAVE); SHOW_CARRIED redraws the panel's items and clears it
LIVES A721 DEFB $00 Lives, in BCD. START gives five and every start of a life takes one (RESTART_PLAYER), so five is the one in play and four more; the game ends when there is none to take
CARRIED A722 DEFB $00,$00,$00,$00 What he carries: entries of four bytes, the graphic, the flags and the address of the thing's quest record. This one is a slot for the thing being picked up, empty between presses: TAKE_OR_LEAVE writes it here, then moves every entry along one
CARRIED_SHOWN A726 DEFB $00,$00,$00,$00 The things he carries, newest first; these two and the next are the three SHOW_CARRIED shows on the panel
A72A DEFB $00,$00,$00,$00
CARRIED_LAST A72E DEFB $00,$00,$00,$00 The oldest, which the next press puts down
FONT_BASE A732 DEFB $00,$00 The base the print routine (PRINT_CHAR) adds eight times a character's code to: 384 bytes below the font for text, the font itself for digits
FRAME_DRAWN A734 DEFB $00 0 until DISPLAY_MENU has drawn the text screen's frame and copied the whole buffer to the screen, which it then does not do again; the menu and the win clear it to have that done afresh (MENU, WON)
MENU_SPARE A735 DEFB $00 Nothing reads or writes it: its only mention is an LD HL the menu's next instruction overwrites (MENU)
PRINT_ATTR A736 DEFB $00 The attribute PRINT_TEXT_SINGLE_COLOUR gives each cell of text it prints; set by PRINT_SCORE and DISPLAY_MENU
INPUT A737 DEFB $00 This turn's controls (READ_CONTROLS): bits 0 and 1 turn, 2 walk, 3 jump, 4 pick up or put down, 6 fire
ROOM_ATTR A738 DEFB $00 The room's attribute, its ink with BRIGHT on black (BUILD_ROOM); the main loop fills the screen's attributes with it on the first turn in a room (OBJECT_DONE)
Z_STEP A739 DEFB $00 The player's step in Z this turn, kept past the move (MOVE_PLAYER)
TEMPLATES_AT A73A DEFB $00,$00 The object template table the builder reads (OBJECT_TABLE, BUILD_ROOM)
PLACE_NUDGE A73C DEFB $00 Added to the objects' positions by the builder (BUILD_ROOM); zero for every room
DROP_TIMER A73D DEFB $00 Turns until something may fall from the sky (SKY_DROP); set on entering a room (RESET_DROP_TIMER)
MAIN_SP A73E DEFB $00,$00 The stack pointer, saved every turn by the main loop (OBJECT_DONE); nothing reads it back
TAKE_HELD A740 DEFB $00 1 while the pick-up key is held, so one press does one thing (TAKE_OR_LEAVE)
NO_HEADROOM A741 DEFB $00 1 when there is no room above him to stand on what he puts down (TAKE_OR_LEAVE)
DROP_BAN A742 DEFB $00 1 in a room with the well, a quest item or a piece of the pentagram: nothing falls there (BAN_DROPS)
FIRE_HELD A743 DEFB $00 1 while fire is held, so one press is one shot (FIRE)
SCORE A744 DEFB $00,$00,$00 The score, six BCD digits, the highest first (ADD_SCORE)
TUNE_HEARD A747 DEFB $00 Set once the menu's tune has played (PLAY_TUNE_ONCE)
STEP_SOUND A748 DEFB $00 Counted up by FOOTSTEP, which clicks on every fourth count
SOUND_COUNT A749 DEFB $00,$00 A sound effect under way: turns left, then which sound (EFFECT_NOTE). The pause's click (PAUSE_BEEP) counts the first byte up as well
PLACED A74B DEFB $00 How many collectables have reached their places in room 82 (COLLECTABLE)
QUEST_DONE A74C DEFB $00 How many quest items the bucket has reached (QUEST_ITEM)
PERCENT A74D DEFB $00,$00 The percentage of the quest done, BCD, the hundreds first, worked out by PERCENTAGE
ROOMS_SEEN A74F DEFB $00,$00,$00,$00,$00,$00,$00,$00 A bit for each room number, bit 7 of the first byte for room 0, set on entering it (MARK_ROOM_SEEN). PERCENTAGE counts all 31 bytes for the percentage, though rooms go no higher than 149, so only the first 19 can hold a bit
A757 DEFB $00,$00,$00,$00,$00,$00,$00,$00
A75F DEFB $00,$00,$00,$00,$00,$00,$00,$00
A767 DEFB $00,$00,$00,$00,$00,$00,$00
A76E DEFB $00 Nothing refers to this byte
Prev: A67F Up: Map Next: A76F