Prev: 6965 Up: Map Next: 69BF
696C: 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 43, CAVE (8A), LEVE (8B), CURT (85) and PIT (8E) skip that walk.
RoomHasChanged 696C LD A,$01 The room has changed.
696E LD ($5B95),A
6971 PUSH HL Stash the line pointer on the stack.
6972 LD A,($5BCF) Fetch Last_Matched_Verb.
6975 CP $43 Jump to RoomHasChanged_Redraw if the verb is 43, CAVE (8A), LEVE (8B), CURT (85) or PIT (8E).
6977 JR Z,RoomHasChanged_Redraw
6979 CP $8A
697B JR Z,RoomHasChanged_Redraw
697D CP $8B
697F JR Z,RoomHasChanged_Redraw
6981 CP $85
6983 JR Z,RoomHasChanged_Redraw
6985 CP $8E
6987 JR Z,RoomHasChanged_Redraw
6989 POP HL Discard the saved line pointer.
698A LD HL,$B798 Point HL at RoomRecords.
698D LD A,($5D87) Fetch CurrentRoom into B.
6990 LD B,A
6991 LD A,$FF A record terminates with FF.
Skip bytes until the next terminator.
RoomHasChanged_Sep 6993 CP (HL) Advance until this record ends.
6994 INC HL
6995 JR NZ,RoomHasChanged_Sep
6997 DJNZ RoomHasChanged_Sep Jump to RoomHasChanged_Sep until this is the current room's record.
Walk this room's picture record.
RoomHasChanged_Record 6999 LD A,(HL) Fetch the next record byte.
699A CP $FF Return if it is the terminator FF.
699C RET Z
699D INC HL Advance to the opcode.
699E CP $F8 Jump to RoomHasChanged_Record if it is not F8.
69A0 JR NZ,RoomHasChanged_Record
69A2 PUSH HL Stash the record pointer on the stack.
69A3 LD A,($5F15) Jump to RoomHasChanged_Redraw if the object is not *PicturedObject.
69A6 CP (HL)
69A7 JR NZ,RoomHasChanged_Redraw
69A9 LD C,A Copy the object number into BC.
69AA LD B,$00
69AC LD HL,$5DCA Point HL at ObjectLocations.
69AF ADD HL,BC Add the object number.
69B0 LD A,($5D87) Jump to RoomHasChanged_Keep if it is *CurrentRoom.
69B3 CP (HL)
69B4 JR Z,RoomHasChanged_Keep
Force the picture to be drawn again.
RoomHasChanged_Redraw 69B6 XOR A Write 00 to PictureDrawn.
69B7 LD ($6185),A
69BA POP HL Restore the record pointer from the stack.
69BB RET Return.
Keep scanning this record.
RoomHasChanged_Keep 69BC POP HL Restore the picture record pointer from the stack.
69BD JR RoomHasChanged_Record Jump to RoomHasChanged_Record.
Prev: 6965 Up: Map Next: 69BF