![]() |
Routines |
| Prev: B097 | Up: Map | Next: B145 |
|
Used by the routine at START.
Runs as a room is entered, before the room is built over the records (START), so it sees the room being left. Every one of the room's 48 records is looked up by its graphic among the 18 quest records at QUEST_RECORDS, and where one matches, the object's first 16 bytes -- where it is now, its sizes, its flags and its room -- are copied back over the quest record. A quest thing that moved or was pushed in a room is found there again.
The match is by graphic, not by the address kept at +10: a quest thing's graphic is unique among them, and CHANGE_GRAPHIC changes the quest record's graphic along with the object's when a quest item is done. An empty record's graphic 0 matches the record of a thing being carried, whose graphic is zeroed while he has it (TAKE_OR_LEAVE), and copies the empty record's leftovers over it; that does no harm, since the graphic stays 0 and putting the thing down writes it back.
|
||||
| QUEST_OUT_OF_ROOM | B115 | LD IY,FLYER_SECOND | IY a record before the room's first; 48 records | |
| B119 | LD C,$30 | |||
| QUEST_OUT_OF_ROOM_0 | B11B | LD DE,$0020 | The next record | |
| B11E | ADD IY,DE | |||
| B120 | LD A,(IY+$00) | Its graphic | ||
| B123 | LD HL,QUEST_RECORDS | Against each of the 18 quest records' graphics | ||
| B126 | LD DE,$0010 | |||
| B129 | LD B,$12 | |||
| QUEST_OUT_OF_ROOM_1 | B12B | CP (HL) | This one? | |
| B12C | JR Z,QUEST_OUT_OF_ROOM_3 | |||
| B12E | ADD HL,DE | |||
| B12F | DJNZ QUEST_OUT_OF_ROOM_1 | |||
| QUEST_OUT_OF_ROOM_2 | B131 | DEC C | The next object | |
| B132 | JR NZ,QUEST_OUT_OF_ROOM_0 | |||
| B134 | RET | |||
| QUEST_OUT_OF_ROOM_3 | B135 | EX DE,HL | Found: the object's first 16 bytes back over the quest record | |
| B136 | PUSH IY | |||
| B138 | POP HL | |||
| B139 | PUSH BC | |||
| B13A | LD BC,$0010 | |||
| B13D | LDIR | |||
| B13F | POP BC | On to the next object | ||
| B140 | LD DE,$0020 | |||
| B143 | JR QUEST_OUT_OF_ROOM_2 | |||
| Prev: B097 | Up: Map | Next: B145 |