![]() |
Game status buffer |
| Prev: FF6A | Up: Map |
|
IY holds OBJECT_COUNT throughout the game, so most of these are reached as IY+n: the author's source text calls this base V, as in (V+3), and the listing writes each such access the same way, as the variable less V: (IY+ROOM-V) is ROOM, and V is an EQU at the top of the source file. Only two places move IY: ZOOMIN (ZOOMIN) points it at a chaser's target for a moment, and ROOMST steps it through the carried things. On the tape the first 61 bytes, up to OBJECTS_PLACED, hold the values a game starts with; the start-up copies them to the master copy (MASTER_OBJECTS) and a new game copies them back. The rest are set before they are read; on the tape many hold the ends of the ROM's user-defined graphics, like UDG_LEFTOVERS.
From POINT up the bytes have several lives, one at a time. While a room is drawn they are the drawing's state, twenty of them (from ORIGIN) reset from ROOM_DEFAULTS for each room. While an object is updated (CHE3D), POINT to WORK_HEADING are a copy of its record's first 19 bytes -- the author's T, as in (T+13) -- so that IY+$64 is the record's +0, IY+$6A its x (+6), IY+$6B its y (+7), IY+$6C its z (+8), IY+$70 its kind (+12) and so on; FOUND_RECORD (T+20), STEP_AXES, ASKED_DIRECTION, WORK_RECORD and RIDE_DIRECTION go with them. While a sprite is drawn (REDRAW_OBJECT) the same bytes hold the rectangle being redrawn, from a copy of +0 to +11, and the drawing's counters; and DRAW_LIST, lower down, takes a list of 30 bytes that runs over the printer's and the room drawing's bytes. Each use sets what it reads first.
The labels are for the use the object code makes of a byte where it reads it by address, and for the drawing's otherwise.
|
||||
| OBJECT_COUNT | FF80 | DEFB $00 | Records in use, counted from FIXED_RECORDS: the six fixed ones, the knight's (7), then the carried things' and the room's | |
| FF81 | DEFB $02 | Not used | ||
| STRIKES_AT | FF82 | DEFB $0B | The low byte of the strike counter of the fighter FIND_OBSTACLE last passed ($98 to $9D) | |
| THIS_RECORD | FF83 | DEFB $00 | The number of the record being updated or drawn, counted from FIXED_RECORDS (the knight is 7) | |
| FF84 | DEFB $80 | Not used | ||
| GRAVITY | FF85 | DEFB $23 | $23, never written: its top six bits are ORed into the direction of a thing not rising -- bit 5, down (ANIMATE_AND_MOVE) | |
| OPTIONS | FF86 | DEFB $10 | Bit 3: the Kempston joystick is in use (9 turns it on and off) | |
| MESSAGE | FF87 | DEFB $00 | The message SHOW_MESSAGE is to show: 1 BLOCKED, 2 LOCKED, 3 TOO HEAVY; 0 none | |
| MESSAGE_TIMER | FF88 | DEFB $00 | MESSAGE_TIMER: passes the message stays up (10). Then two bytes not used; NO_RISE_MASK (IY+NO_RISE_MASK-V), $EF and never written: ANDed with the direction of a thing not rising, it takes out bit 4, up (ANIMATE_AND_MOVE); and two more not used | |
| FF89 | DEFB $00 | |||
| FF8A | DEFB $00 | |||
| NO_RISE_MASK | FF8B | DEFB $EF | ||
| FF8C | DEFB $00 | |||
| FF8D | DEFB $00 | |||
| ROOM_COLOUR | FF8E | DEFB $00 | The room's colour, from its first byte | |
| DECOY | FF8F | DEFB $00,$00 | The record of a decoy (kind 8) in the room, noted by CHE3D for the guards of behaviour 9 | |
| THINGS_NOTED | FF91 | DEFB $00 | Bit 0: a decoy is in the room (DECOY); bit 1: a thing of kind 11 is, which wakes the creature of behaviour 15 and lets the doors of room 61 be used (CHE3D, BUMPED) | |
| CARRIED_WEIGHT | FF92 | DEFB $00 | The weight of what is carried; 8 or more is too heavy | |
| FF93 | DEFB $00 | Not used; then FALL_COUNT (IY+FALL_COUNT-V), the passes the knight has been falling: each over 20 costs 1 LIFE when he lands (CREATURE_UPDATE; measured in the simulator) | ||
| FALL_COUNT | FF94 | DEFB $00 | ||
| LIFE_TENS | FF95 | DEFB $09 | LIFE: the tens | |
| LIFE_UNITS | FF96 | DEFB $09 | LIFE: the units | |
| GAME_FLAGS | FF97 | DEFB $00 | Bit 0: LIFE to be printed; 1: the knight's sword out; 2: the room's first pass; 3: the knight's idle pose; 4: still things being drawn into the room; 6: a message showing; 7: the creatures frozen | |
| STRIKES_LEFT | FF98 | DEFB $00,$3E,$08,$08,$08,$08 | Six fighters' strikes left, 4 each when a room is entered (FIND_OBSTACLE deals them out) | |
| SELECTED | FF9E | DEFB $9F | The low byte of the word in CARRIED for the thing in use ($9F to $A7) | |
| CARRIED | FF9F | DEFB $00,$00 | The records of the five things carried | |
| FFA1 | DEFB $00,$00 | |||
| FFA3 | DEFB $00,$00 | |||
| FFA5 | DEFB $00,$00 | |||
| FFA7 | DEFB $00,$00 | |||
| FFA9 | DEFB $44,$48,$70,$48,$44,$42,$00,$00 | Not used | ||
| FFB1 | DEFB $40,$00,$00 | Not used | ||
| ROOM | FFB4 | DEFB $1D | The room the knight is in | |
| PARTS_TABLE | FFB5 | DEFB $8C,$75 | Where the parts are (PART1) | |
| FFB7 | DEFB $00 | Not used | ||
| FREE_RECORD | FFB8 | DEFB $00,$00 | The next free object record | |
| OBJECT_TABLE_AT | FFBA | DEFB $24,$A9 | Where the object table is (OBJECTS) | |
| OBJECTS_PLACED | FFBC | DEFB $42 | Bit 0: the object table's things have been placed in this room (room code $E4, MORE_ROOM_COMMANDS); the rest not used | |
| FFBD | DEFB $42 | |||
| FFBE | DEFB $42 | |||
| FFBF | DEFB $00 | |||
| FFC0 | DEFB $00 | |||
| FFC1 | DEFB $42 | |||
| FFC2 | DEFB $62 | |||
| FFC3 | DEFB $52 | |||
| FFC4 | DEFB $4A,$46 | Not used | ||
| DRAW_LIST | FFC6 | DEFB $42 | 30 bytes to the end of AWAY_FRAMES: the numbers of the records to draw, in order, copied from BUFFER_DA00 by SORT_AND_DRAW_BEHIND | |
| FFC7 | DEFB $00,$00,$3C,$42 | More of DRAW_LIST | ||
| ARRIVAL_BOX | FFCB | DEFB $42,$42,$42,$3C,$00 | The door code (BUMPED) points IX here, so that a record's +5 to +11 are PRINT_X and the six bytes after it: the box of a door's far side | |
| PRINT_X | FFD0 | DEFB $00 | Where the next character is printed: x | |
| PRINT_Y | FFD1 | DEFB $7C | And y | |
| FFD2 | DEFB $42,$42,$7C,$40,$40,$00,$00,$3C | The rest of ARRIVAL_BOX, and more of DRAW_LIST | ||
| PLACED_TYPE | FFDA | DEFB $42 | The type of the object being placed (PLACE_OBJECT) | |
| PLACED_NUMBER | FFDB | DEFB $42 | Counts the object table's entries as PLACE_ROOM_OBJECTS walks it: the number it gives a record at +$13 (it wraps round after 255) | |
| FFDC | DEFB $52,$4A,$3C | More of DRAW_LIST | ||
| ORIGIN | FFDF | DEFB $00 | Added to x (+6) of each object the room places (IY+$5F-$61; room code $E4 $05) | |
| ORIGIN_Y | FFE0 | DEFB $00 | Added to its y, the height (+7) | |
| ORIGIN_Z | FFE1 | DEFB $7C | Added to its z (+8) | |
| AWAY_FRAMES | FFE2 | DEFB $42,$42 | How far the knight's frames for walking away (+x or +z) lie beyond those for walking towards the viewer, set just before FACING adds it | |
| POINT | FFE4 | DEFB $7C | The room drawing's first point: column. While an object is updated, its +0; in ROOMST, where the next carried record goes | |
| POINT_ROW | FFE5 | DEFB $44 | And row. While an object is updated, its +1 | |
| SECOND_POINT | FFE6 | DEFB $42 | The second point: column. While an object is updated, its +2 | |
| SECOND_POINT_ROW | FFE7 | DEFB $00 | And row. While an object is updated, its +14 as it was when the update began (CHE3D) | |
| WORK_SPRITE | FFE8 | DEFB $00 | While an object is updated or drawn, its sprite (+4, +5, a word); zero, and the byte the screen is cleared with, when a room is drawn (CLEAR_ROOM_SCREEN) | |
| FFE9 | DEFB $3C | The sprite's high byte; then LINE_PAGE (IY+LINE_PAGE-V): 0 to draw a room's lines on the screen, $80 in the clean copy (room code $E4), and while an object is updated, its x (+6) | ||
| LINE_PAGE | FFEA | DEFB $40 | ||
| MODE | FFEB | DEFB $3C | The room drawing's mode bits (room codes $C1-$CE, $E4 $04); while an object is updated, its y (+7) | |
| REPEATS | FFEC | DEFB $02 | How many times the room drawing repeats (room code $D5); while an object is updated, its z (+8) | |
| FFED | DEFB $42 | Kept with REPEATS by room code $E1; while an object is updated, its x length (+9) | ||
| REPEAT_FROM | FFEE | DEFB $3C,$00 | Where the repeat goes back to; while an object is updated, its height and z length (+10, +11) | |
| WORK_KIND | FFF0 | DEFB $00 | While an object is updated, its kind byte (+12) | |
| WORK_DIRECTION | FFF1 | DEFB $FE | Its direction (+13): 0 bounces, 1 rises, 2 -x, 3 +x, 4 up, 5 down, 6 +z, 7 -z; the sprite drawing's flags | |
| WORK_BEHAVIOUR | FFF2 | DEFB $10 | Its behaviour byte (+14) | |
| DRAW_WIDTH | FFF3 | DEFB $10 | A sprite's width in bytes, while it is drawn; while an object is updated, its timer (+15) | |
| WORK_WEIGHT | FFF4 | DEFB $10 | Its +16: 16 more than its weight, 0 if still; the length of the draw list while sprites are drawn | |
| WORK_ANIMATION | FFF5 | DEFB $10 | Its animation byte (+17); rows, while a sprite is drawn | |
| WORK_HEADING | FFF6 | DEFB $10,$00 | Its heading (+18); SP while CLEAR_512_BELOW borrows it; the fill's pointer to the row below | |
| FOUND_RECORD | FFF8 | DEFB $00 | The number of the record FIND_OBSTACLE found (the author's T+20); SP while CLEAR_ROOM_SCREEN borrows it; the fill's texture; a sprite row's bytes (DRAW_SPRITE) | |
| DRAW_INDEX | FFF9 | DEFB $42 | The record REDRAW_OBJECT is looking at | |
| CLEAR_END | FFFA | DEFB $42 | Where CLEAR_ROOM_SCREEN's clearing stopped | |
| STEP_AXES | FFFB | DEFB $42 | A move's axes: bit 0 x, 1 y, 2 z; 5 landed, 6 a climb, 7 into a door; the fill's pointer to this row | |
| ASKED_DIRECTION | FFFC | DEFB $42 | The direction a move asked for, before collisions changed it | |
| WORK_RECORD | FFFD | DEFB $42 | The record being updated; the fill's pointer to the row above | |
| DRAW_COUNT | FFFE | DEFB $3C | Counts down the draw list; the high byte of WORK_RECORD | |
| RIDE_DIRECTION | FFFF | DEFB $00 | The direction of what the mover has landed on; the last entry in the draw list at BUFFER_DA00 ($FF: none) | |
| Prev: FF6A | Up: Map |