![]() |
Routines |
| Prev: 6965 | Up: Map | Next: 69BF |
|
Used by the routines at MoveToRoom, MoveToObject, GetObject, DropObject, Saved, RemoveObject, SwapObjects, SetObjectLocation, DropEverything and RedrawLocation.
Sets the room-changed flag and walks the per-room records at RoomRecords so an illustration that depended on an object is redrawn. Verbs 43, 8A, 8B, 85 and 8E skip that walk.
|
||||
| RoomHasChanged | 696C | LD A,$01 | The room has changed. | |
| 696E | LD ($5B95),A | |||
| 6971 | PUSH HL | Keep the line pointer. The last-matched verb may skip the picture walk. | ||
| 6972 | LD A,($5BCF) | |||
| 6975 | CP $43 | Verb 43 skips it. | ||
| 6977 | JR Z,RoomHasChanged_Redraw | |||
| 6979 | CP $8A | Verb 8A skips it. | ||
| 697B | JR Z,RoomHasChanged_Redraw | |||
| 697D | CP $8B | Verb 8B skips it. | ||
| 697F | JR Z,RoomHasChanged_Redraw | |||
| 6981 | CP $85 | Verb 85 skips it. | ||
| 6983 | JR Z,RoomHasChanged_Redraw | |||
| 6985 | CP $8E | Verb 8E skips it. | ||
| 6987 | JR Z,RoomHasChanged_Redraw | |||
| 6989 | POP HL | The records live at RoomRecords, one per room. | ||
| 698A | LD HL,$B798 | |||
| 698D | LD A,($5D87) | |||
| 6990 | LD B,A | |||
| 6991 | LD A,$FF | A record ends at FF. | ||
| RoomHasChanged_Sep | 6993 | CP (HL) | Skip to the next separator. | |
| 6994 | INC HL | |||
| 6995 | JR NZ,RoomHasChanged_Sep | |||
| 6997 | DJNZ RoomHasChanged_Sep | Count one separator per room until this room's record. | ||
| RoomHasChanged_Record | 6999 | LD A,(HL) | FF ends this room's record. | |
| 699A | CP $FF | |||
| 699C | RET Z | |||
| 699D | INC HL | Only an F8 record names an object. | ||
| 699E | CP $F8 | |||
| 69A0 | JR NZ,RoomHasChanged_Record | |||
| 69A2 | PUSH HL | Compare the record with PicturedObject, which nothing writes, so it matches a zero. | ||
| 69A3 | LD A,($5F15) | |||
| 69A6 | CP (HL) | |||
| 69A7 | JR NZ,RoomHasChanged_Redraw | |||
| 69A9 | LD C,A | Point at that object's location. | ||
| 69AA | LD B,$00 | |||
| 69AC | LD HL,$5DCA | |||
| 69AF | ADD HL,BC | |||
| 69B0 | LD A,($5D87) | The picture is left alone when the object is in this room. | ||
| 69B3 | CP (HL) | |||
| 69B4 | JR Z,RoomHasChanged_Keep | |||
| RoomHasChanged_Redraw | 69B6 | XOR A | Forget the drawn picture, restore the picture record pointer from the stack. | |
| 69B7 | LD ($6185),A | |||
| 69BA | POP HL | |||
| 69BB | RET | Return. | ||
| RoomHasChanged_Keep | 69BC | POP HL | Restore the picture record pointer from the stack. | |
| 69BD | JR RoomHasChanged_Record | The next byte of the record. | ||
| Prev: 6965 | Up: Map | Next: 69BF |