![]() |
Scenery: the backgrounds |
A background is what a room lists first in its record, a byte each up to an $FF: an index into the 14 words of BACKGROUND_TABLE. Each is a list of eight-byte pieces -- graphic, U, V, Z, the half-sizes in U and V, the height and the flags -- ended by a zero, and the builder (BUILD_ROOM) copies every piece into an object record of its own as it is, with the room's number as its +8. So a background carries its own position, and always stands in the same place: each is made for a wall of a room of one size. The three sizes at ROOM_SIZES are 128 by 128 (size 0), 64 by 128 (size 1), 128 by 64 (size 2), U by V, about the middle of the room at 128: a room's walls stand its half-size either side of 128.
There are 4 doorways, one for each wall; 6 walls -- the two back walls whole or with a gap for a doorway, and the long back wall of each narrow room with the stubs of the short one -- and two doorways raised off the floor with the blocks each stands on. Only the two back walls are ever drawn: the front of a room is open, as in Knight Lore. The table's words are not in the order of the bytes: they run 0, 1, 10, 12, 2, 11, 13, 3, 4, 5, 6, 7, 8, 9, so each raised doorway sits next to its blocks.
A doorway is not joined to anything by its data. The rooms are Knight Lore's grid of 16 by 16 numbers, and walking out through a wall moves the room number by 1 along the row or by 16 to the next or last row, whichever doorway it was; the background only puts the pillars in the wall. Every doorway in the game leads to a room that exists and has the doorway back (checked from the room directory).
Each background is drawn here by the game, on its own: a one-off room record naming just that background, in a room of the size most of its rooms have, is written first in the room directory (ROOM02), and the game builds the room (ENTER_ROOM) and draws its first turn (MAIN_NEXT_TURN, in AFTER_GAME), in SkoolKit's simulator. The pictures are white whatever the rooms' own colours. On the screen low U is at the back left, high V at the back right, high U at the front right and low V at the front left (CALC_PIXEL_XY).
Knight Lore builds its rooms the same way from its own backgrounds, one byte each in the room's record (see Knight Lore's scenery); Pentagram gives each background a second byte, the room its doorway leads to (see Pentagram's scenery). Alien 8 is Knight Lore's way round.
0: A doorway in the back right wall -- BACKGROUND0; drawn in a room of size 0 (128 by 128, walls at U 64 and 192, V 64 and 192).
Graphic 2 is the working pillar (FIRST_PILLAR), graphic 3 only draws (SECOND_PILLAR); both are mirrored, as a doorway in a wall of constant V is. The doorway's middle is at 128 along the wall. Walking out through it takes him to the room 16 on, in the next row (EXIT_HIGH_V): where it leads comes from the room's number, not from the background.
| Graphic | U | V | Z | Half U, V; height | Flags |
|---|---|---|---|---|---|
| 2 | 141 | 197 | 64 | 3, 6; 48 | $50 (to be drawn, mirrored) |
| 3 | 115 | 197 | 64 | 3, 6; 48 | $50 (to be drawn, mirrored) |
In 88 rooms (of sizes 0 and 1): $02, $03, $04, $05, $0A, $0B, $0C, $0D, $13, $14, $1B, $1C, $20, $23, $24, $27, $28, $2B, $2C, $2F, $30, $31, $33, $34, $36, $37, $38, $39, $3B, $3C, $3E, $3F, $41, $44, $46, $47, $48, $49, $4B, $4E, $51, $54, $57, $58, $5B, $5E, $62, $64, $65, $67, $68, $6A, $6B, $6D, $72, $77, $78, $7D, $83, $84, $87, $88, $8B, $8C, $94, $95, $96, $97, $98, $99, $9A, $9B, $A5, $A7, $A8, $AA, $B6, $B7, $B8, $B9, $C6, $C7, $C8, $C9, $D7, $D8, $E7, $E8.
1: A doorway in the front right wall -- BACKGROUND1; drawn in a room of size 0 (128 by 128, walls at U 64 and 192, V 64 and 192).
Graphic 2 is the working pillar (FIRST_PILLAR), graphic 3 only draws (SECOND_PILLAR); neither is mirrored, as in a wall of constant U. The doorway's middle is at 128 along the wall. Walking out through it takes him to the room after it in the row (EXIT_HIGH_U): where it leads comes from the room's number, not from the background.
| Graphic | U | V | Z | Half U, V; height | Flags |
|---|---|---|---|---|---|
| 2 | 197 | 115 | 64 | 6, 3; 48 | $10 (to be drawn) |
| 3 | 197 | 141 | 64 | 6, 3; 48 | $10 (to be drawn) |
In 50 rooms (of sizes 0 and 2): $04, $0A, $0B, $0C, $12, $13, $14, $1B, $1C, $27, $30, $36, $38, $3E, $41, $42, $44, $45, $4D, $4E, $61, $64, $6A, $6D, $74, $75, $76, $77, $78, $79, $7A, $83, $84, $85, $86, $87, $88, $89, $8A, $8B, $8C, $95, $99, $9B, $A4, $A5, $A9, $AA, $D6, $D8.
2: A doorway in the front left wall -- BACKGROUND2; drawn in a room of size 0 (128 by 128, walls at U 64 and 192, V 64 and 192).
Graphic 2 is the working pillar (FIRST_PILLAR), graphic 3 only draws (SECOND_PILLAR); both are mirrored, as a doorway in a wall of constant V is. The doorway's middle is at 128 along the wall. Walking out through it takes him to the room 16 back, in the row before (EXIT_LOW_V): where it leads comes from the room's number, not from the background.
| Graphic | U | V | Z | Half U, V; height | Flags |
|---|---|---|---|---|---|
| 2 | 141 | 59 | 64 | 3, 6; 48 | $50 (to be drawn, mirrored) |
| 3 | 115 | 59 | 64 | 3, 6; 48 | $50 (to be drawn, mirrored) |
In 73 rooms (of sizes 0 and 1): $13, $14, $15, $1B, $1C, $1D, $23, $24, $2B, $2C, $30, $33, $34, $37, $38, $3C, $40, $41, $44, $46, $47, $48, $49, $4B, $4E, $4F, $51, $54, $56, $57, $58, $5B, $5E, $64, $67, $68, $6B, $6E, $72, $74, $75, $77, $78, $7A, $7B, $7D, $87, $88, $8D, $94, $97, $98, $9B, $9C, $A5, $A7, $A8, $A9, $AA, $AB, $B5, $B7, $B8, $BA, $C6, $C8, $D6, $D7, $D8, $D9, $E7, $E8, $F8.
3: A doorway in the back left wall -- BACKGROUND3; drawn in a room of size 0 (128 by 128, walls at U 64 and 192, V 64 and 192).
Graphic 2 is the working pillar (FIRST_PILLAR), graphic 3 only draws (SECOND_PILLAR); neither is mirrored, as in a wall of constant U. The doorway's middle is at 128 along the wall. Walking out through it takes him to the room before it in the row (EXIT_LOW_U): where it leads comes from the room's number, not from the background.
| Graphic | U | V | Z | Half U, V; height | Flags |
|---|---|---|---|---|---|
| 2 | 59 | 115 | 64 | 6, 3; 48 | $10 (to be drawn) |
| 3 | 59 | 141 | 64 | 6, 3; 48 | $10 (to be drawn) |
In 62 rooms (of sizes 0 and 2): $03, $04, $05, $0B, $0C, $0D, $13, $14, $15, $1B, $1C, $1D, $28, $31, $37, $39, $3F, $41, $42, $43, $45, $46, $4A, $4B, $4D, $4E, $4F, $62, $65, $6B, $6E, $75, $76, $77, $78, $79, $7A, $7B, $83, $84, $85, $86, $87, $88, $89, $8A, $8B, $8C, $8D, $94, $96, $9A, $9C, $A5, $A6, $AA, $AB, $B6, $BA, $D7, $D9, $F8.
10: A doorway in the front right wall, raised 48 above the floor -- BACKGROUND10; drawn in a room of size 0 (128 by 128, walls at U 64 and 192, V 64 and 192).
Graphic 2 is the working pillar (FIRST_PILLAR), graphic 3 only draws (SECOND_PILLAR); neither is mirrored, as in a wall of constant U. The doorway's middle is at 128 along the wall. Walking out through it takes him to the room after it in the row (EXIT_HIGH_U): where it leads comes from the room's number, not from the background. Coming in through it, he is stood at its height, found from its first pillar (ADJUST_PLYR_Z_FOR_ARCH). Always with background 12, the two blocks under it; the two together, as the game draws them in one room:

| Graphic | U | V | Z | Half U, V; height | Flags |
|---|---|---|---|---|---|
| 2 | 197 | 115 | 112 | 6, 3; 48 | $10 (to be drawn) |
| 3 | 197 | 141 | 112 | 6, 3; 48 | $10 (to be drawn) |
In 12 rooms (of sizes 0 and 2): $02, $03, $1A, $40, $49, $4A, $4C, $82, $93, $B5, $B9, $F7.
11: A doorway in the front left wall, raised 48 above the floor -- BACKGROUND11; drawn in a room of size 0 (128 by 128, walls at U 64 and 192, V 64 and 192).
Graphic 2 is the working pillar (FIRST_PILLAR), graphic 3 only draws (SECOND_PILLAR); both are mirrored, as a doorway in a wall of constant V is. The doorway's middle is at 128 along the wall. Walking out through it takes him to the room 16 back, in the row before (EXIT_LOW_V): where it leads comes from the room's number, not from the background. Coming in through it, he is stood at its height, found from its first pillar (ADJUST_PLYR_Z_FOR_ARCH). Always with background 13, the two blocks under it; the two together, as the game draws them in one room:

| Graphic | U | V | Z | Half U, V; height | Flags |
|---|---|---|---|---|---|
| 2 | 141 | 59 | 112 | 3, 6; 48 | $50 (to be drawn, mirrored) |
| 3 | 115 | 59 | 112 | 3, 6; 48 | $50 (to be drawn, mirrored) |
In 15 rooms (of sizes 0 and 1): $12, $1A, $3B, $3F, $43, $4C, $59, $61, $82, $93, $A4, $A6, $C7, $C9, $F7.
12: Two blocks at a height of 36, against the front right wall -- BACKGROUND12; drawn in a room of size 0 (128 by 128, walls at U 64 and 192, V 64 and 192).
Always in the same rooms as background 10, the raised doorway in the same wall: the blocks' tops, at 48 above the floor, are the step it stands on.
| Graphic | U | V | Z | Half U, V; height | Flags |
|---|---|---|---|---|---|
| 30 | 200 | 120 | 100 | 8, 8; 12 | $10 (to be drawn) |
| 30 | 200 | 136 | 100 | 8, 8; 12 | $10 (to be drawn) |
In 12 rooms (of sizes 0 and 2): $02, $03, $1A, $40, $49, $4A, $4C, $82, $93, $B5, $B9, $F7.
13: Two blocks at a height of 36, against the front left wall -- BACKGROUND13; drawn in a room of size 0 (128 by 128, walls at U 64 and 192, V 64 and 192).
Always in the same rooms as background 11, the raised doorway in the same wall: the blocks' tops, at 48 above the floor, are the step it stands on.
| Graphic | U | V | Z | Half U, V; height | Flags |
|---|---|---|---|---|---|
| 30 | 120 | 56 | 100 | 8, 8; 12 | $10 (to be drawn) |
| 30 | 136 | 56 | 100 | 8, 8; 12 | $10 (to be drawn) |
In 15 rooms (of sizes 0 and 1): $12, $1A, $3B, $3F, $43, $4C, $59, $61, $82, $93, $A4, $A6, $C7, $C9, $F7.
4: The back left wall -- BACKGROUND4; drawn in a room of size 0 (128 by 128, walls at U 64 and 192, V 64 and 192).
| Graphic | U | V | Z | Half U, V; height | Flags |
|---|---|---|---|---|---|
| 14 | 64 | 68 | 64 | 0, 4; 48 | $50 (to be drawn, mirrored) |
| 13 | 64 | 84 | 64 | 0, 12; 48 | $50 (to be drawn, mirrored) |
| 13 | 64 | 108 | 64 | 0, 12; 48 | $50 (to be drawn, mirrored) |
| 13 | 64 | 132 | 64 | 0, 12; 48 | $50 (to be drawn, mirrored) |
| 13 | 64 | 156 | 64 | 0, 12; 48 | $50 (to be drawn, mirrored) |
| 13 | 64 | 180 | 64 | 0, 12; 48 | $50 (to be drawn, mirrored) |
In 40 rooms: $02, $0A, $12, $1A, $20, $27, $2F, $30, $36, $38, $3E, $40, $44, $49, $4C, $56, $59, $61, $64, $6A, $6D, $72, $74, $7D, $82, $93, $95, $99, $9B, $A4, $A9, $B5, $B9, $C6, $C7, $C8, $C9, $D6, $D8, $F7.
5: The back right wall -- BACKGROUND5; drawn in a room of size 0 (128 by 128, walls at U 64 and 192, V 64 and 192).
| Graphic | U | V | Z | Half U, V; height | Flags |
|---|---|---|---|---|---|
| 13 | 76 | 192 | 64 | 12, 0; 48 | $10 (to be drawn) |
| 13 | 100 | 192 | 64 | 12, 0; 48 | $10 (to be drawn) |
| 13 | 124 | 192 | 64 | 12, 0; 48 | $10 (to be drawn) |
| 13 | 148 | 192 | 64 | 12, 0; 48 | $10 (to be drawn) |
| 13 | 172 | 192 | 64 | 12, 0; 48 | $10 (to be drawn) |
| 14 | 188 | 192 | 64 | 4, 0; 48 | $10 (to be drawn) |
In 30 rooms: $12, $15, $1A, $1D, $40, $43, $4C, $4F, $56, $59, $61, $6E, $74, $75, $7A, $7B, $82, $8D, $93, $9C, $A4, $A6, $A9, $AB, $B5, $BA, $D6, $D9, $F7, $F8.
6: The back left wall, with a gap in the middle for a doorway -- BACKGROUND6; drawn in a room of size 0 (128 by 128, walls at U 64 and 192, V 64 and 192).
| Graphic | U | V | Z | Half U, V; height | Flags |
|---|---|---|---|---|---|
| 13 | 64 | 76 | 64 | 0, 12; 48 | $50 (to be drawn, mirrored) |
| 13 | 64 | 100 | 64 | 0, 12; 48 | $50 (to be drawn, mirrored) |
| 13 | 64 | 156 | 64 | 0, 12; 48 | $50 (to be drawn, mirrored) |
| 13 | 64 | 180 | 64 | 0, 12; 48 | $50 (to be drawn, mirrored) |
In 52 rooms: $03, $04, $05, $0B, $0C, $0D, $13, $14, $15, $1B, $1C, $1D, $28, $31, $37, $39, $3F, $41, $43, $46, $4B, $4E, $4F, $62, $65, $6B, $6E, $75, $77, $78, $7A, $7B, $83, $84, $87, $88, $8B, $8C, $8D, $94, $96, $9A, $9C, $A5, $A6, $AA, $AB, $B6, $BA, $D7, $D9, $F8.
7: The back right wall, with a gap in the middle for a doorway -- BACKGROUND7; drawn in a room of size 0 (128 by 128, walls at U 64 and 192, V 64 and 192).
| Graphic | U | V | Z | Half U, V; height | Flags |
|---|---|---|---|---|---|
| 13 | 76 | 192 | 64 | 12, 0; 48 | $10 (to be drawn) |
| 13 | 100 | 192 | 64 | 12, 0; 48 | $10 (to be drawn) |
| 13 | 156 | 192 | 64 | 12, 0; 48 | $10 (to be drawn) |
| 13 | 180 | 192 | 64 | 12, 0; 48 | $10 (to be drawn) |
In 62 rooms: $02, $03, $04, $05, $0A, $0B, $0C, $0D, $13, $14, $1B, $1C, $20, $27, $28, $2F, $30, $31, $36, $37, $38, $39, $3E, $3F, $41, $44, $46, $49, $4B, $4E, $62, $64, $65, $6A, $6B, $6D, $72, $77, $78, $7D, $83, $84, $87, $88, $8B, $8C, $94, $95, $96, $99, $9A, $9B, $A5, $AA, $B6, $B9, $C6, $C7, $C8, $C9, $D7, $D8.
8: The back left wall; and two short pieces of the back right wall, either side of its doorway -- BACKGROUND8; drawn in a room of size 1 (64 by 128, walls at U 96 and 160, V 64 and 192).
| Graphic | U | V | Z | Half U, V; height | Flags |
|---|---|---|---|---|---|
| 14 | 96 | 68 | 64 | 0, 4; 48 | $50 (to be drawn, mirrored) |
| 13 | 96 | 84 | 64 | 0, 12; 48 | $50 (to be drawn, mirrored) |
| 13 | 96 | 108 | 64 | 0, 12; 48 | $50 (to be drawn, mirrored) |
| 13 | 96 | 132 | 64 | 0, 12; 48 | $50 (to be drawn, mirrored) |
| 13 | 96 | 156 | 64 | 0, 12; 48 | $50 (to be drawn, mirrored) |
| 13 | 96 | 180 | 64 | 0, 12; 48 | $50 (to be drawn, mirrored) |
| 15 | 104 | 192 | 64 | 4, 0; 48 | $10 (to be drawn) |
| 15 | 152 | 192 | 64 | 4, 0; 48 | $10 (to be drawn) |
In 26 rooms: $23, $24, $2B, $2C, $33, $34, $3B, $3C, $47, $48, $51, $54, $57, $58, $5B, $5E, $67, $68, $97, $98, $A7, $A8, $B7, $B8, $E7, $E8.
9: The back right wall; and two short pieces of the back left wall, either side of its doorway -- BACKGROUND9; drawn in a room of size 2 (128 by 64, walls at U 64 and 192, V 96 and 160).
| Graphic | U | V | Z | Half U, V; height | Flags |
|---|---|---|---|---|---|
| 13 | 76 | 160 | 64 | 12, 0; 48 | $10 (to be drawn) |
| 13 | 100 | 160 | 64 | 12, 0; 48 | $10 (to be drawn) |
| 13 | 124 | 160 | 64 | 12, 0; 48 | $10 (to be drawn) |
| 13 | 148 | 160 | 64 | 12, 0; 48 | $10 (to be drawn) |
| 13 | 172 | 160 | 64 | 12, 0; 48 | $10 (to be drawn) |
| 14 | 188 | 160 | 64 | 4, 0; 48 | $10 (to be drawn) |
| 15 | 64 | 104 | 64 | 0, 4; 48 | $50 (to be drawn, mirrored) |
| 15 | 64 | 152 | 64 | 0, 4; 48 | $50 (to be drawn, mirrored) |
In 10 rooms: $42, $45, $4A, $4D, $76, $79, $85, $86, $89, $8A.