Prev: 80F0 Up: Map Next: 8141
8100: Entity buffers
Initialised by the routine at 8912, and used by the routines at 90C0 and 91BE. There are eight buffers here, each one eight bytes long, used to hold the state of the entities (rope, arrows and guardians) in the current room.
For a horizontal guardian, the eight bytes are used as follows:
Byte Contents
0 Bit 7: direction (0=left, 1=right)
Bits 5-6: animation frame index
Bits 3-4: unused
Bits 0-2: entity type (001)
1 Bits 5-7: animation frame index mask
Bit 4: unused
Bit 3: BRIGHT value
Bits 0-2: INK colour
2 Bits 5-7: base sprite index
Bits 0-4: x-coordinate
3 Pixel y-coordinate x2 (index into the table at 8200)
4 Unused
5 Page containing the sprite graphic data (see AB00)
6 Minimum x-coordinate
7 Maximum x-coordinate
For a vertical guardian, the eight bytes are used as follows:
Byte Contents
0 Bits 5-7: animation frame index
Bits 3-4: animation frame update flags (see 917F)
Bits 0-2: entity type (010)
1 Bits 5-7: animation frame index mask
Bit 4: unused
Bit 3: BRIGHT value
Bits 0-2: INK colour
2 Bits 5-7: base sprite index
Bits 0-4: x-coordinate
3 Pixel y-coordinate x2 (index into the table at 8200)
4 Pixel y-coordinate increment
5 Page containing the sprite graphic data (see AB00)
6 Minimum y-coordinate
7 Maximum y-coordinate
For an arrow, the eight bytes are used as follows:
Byte Contents
0 Bit 7: direction (0=left, 1=right)
Bits 3-6: unused
Bits 0-2: entity type (100)
1 Unused
2 Pixel y-coordinate x2 (index into the table at 8200)
3 Unused
4 x-coordinate
5 Collision detection byte (0x00=off, 0xFF=on)
6 Top/bottom pixel row (drawn either side of the shaft)
7 Unused
The rope uses the second and fourth bytes of the following buffer in addition to its own; these ten bytes are used as follows:
Byte Contents
0 Bit 7: direction (0=left, 1=right)
Bits 3-6: unused
Bits 0-2: entity type (011)
1 Animation frame index
2 x-coordinate of the top of the rope
3 x-coordinate of the segment of rope being drawn
4 Length (0x20)
5 Segment drawing byte
6 Unused
7 Animation frame at which the rope changes direction (0x36)
9 Index of the segment of rope being drawn (0x00-0x20)
11 Bits 1-7: unused
Bit 0: Willy is on the rope (set), or not (reset)
Note that if a rope were the eighth entity specified in a room, its buffer would use the first and third bytes in the otherwise unused area at 8141.
Input
Output
8100 DEFS $08 Entity 1
8108 DEFS $08 Entity 2
8110 DEFS $08 Entity 3
8118 DEFS $08 Entity 4
8120 DEFS $08 Entity 5
8128 DEFS $08 Entity 6
8130 DEFS $08 Entity 7
8138 DEFS $08 Entity 8
8140 DEFB $FF Terminator
Prev: 80F0 Up: Map Next: 8141