Prev: 26981 Up: Map Next: 27071
26988: Action: Room Changed
Sets the room-changed flag and walks the per-room records at RoomRecords so an illustration that depended on an object is redrawn. Verb 67, CAVE (138), LEVE (139), CURT (133) and PIT (142) skip that walk.
RoomHasChanged 26988 LD A,1 The room has changed.
26990 LD (23445),A
26993 PUSH HL Stash the line pointer on the stack.
26994 LD A,(23503) Fetch Last_Matched_Verb.
26997 CP 67 Jump to RoomHasChanged_Redraw if the verb is 67, CAVE (138), LEVE (139), CURT (133) or PIT (142).
26999 JR Z,RoomHasChanged_Redraw
27001 CP 138
27003 JR Z,RoomHasChanged_Redraw
27005 CP 139
27007 JR Z,RoomHasChanged_Redraw
27009 CP 133
27011 JR Z,RoomHasChanged_Redraw
27013 CP 142
27015 JR Z,RoomHasChanged_Redraw
27017 POP HL Discard the saved line pointer.
27018 LD HL,47000 Point HL at RoomRecords.
27021 LD A,(23943) Fetch CurrentRoom into B.
27024 LD B,A
27025 LD A,255 A record terminates with 255.
Skip bytes until the next terminator.
RoomHasChanged_Sep 27027 CP (HL) Advance until this record ends.
27028 INC HL
27029 JR NZ,RoomHasChanged_Sep
27031 DJNZ RoomHasChanged_Sep Jump to RoomHasChanged_Sep until this is the current room's record.
Walk this room's picture record.
RoomHasChanged_Record 27033 LD A,(HL) Fetch the next record byte.
27034 CP 255 Return if it is the terminator 255.
27036 RET Z
27037 INC HL Advance to the opcode.
27038 CP 248 Jump to RoomHasChanged_Record if it is not 248.
27040 JR NZ,RoomHasChanged_Record
27042 PUSH HL Stash the record pointer on the stack.
27043 LD A,(24341) Jump to RoomHasChanged_Redraw if the object is not *PicturedObject.
27046 CP (HL)
27047 JR NZ,RoomHasChanged_Redraw
27049 LD C,A Copy the object number into BC.
27050 LD B,0
27052 LD HL,24010 Point HL at ObjectLocations.
27055 ADD HL,BC Add the object number.
27056 LD A,(23943) Jump to RoomHasChanged_Keep if it is *CurrentRoom.
27059 CP (HL)
27060 JR Z,RoomHasChanged_Keep
Force the picture to be drawn again.
RoomHasChanged_Redraw 27062 XOR A Write 0 to PictureDrawn.
27063 LD (24965),A
27066 POP HL Restore the record pointer from the stack.
27067 RET Return.
Keep scanning this record.
RoomHasChanged_Keep 27068 POP HL Restore the picture record pointer from the stack.
27069 JR RoomHasChanged_Record Jump to RoomHasChanged_Record.
Prev: 26981 Up: Map Next: 27071