Prev: 6A11 Up: Map Next: 6A2F
6A16: Action: Set Object Location
Writes a new location for the object. A value of 1 for an object numbered 46 or higher is stored as zero. If the new location is the current room, the room is marked changed.
Input
A New location
B Object number
SetObjectLocation 6A16 CALL ObjectAddress Call ObjectAddress.
6A19 LD C,A C is the new location.
6A1A LD A,B An index below 46 is stored as given.
6A1B CP $46
6A1D JR C,SetObject_Write
6A1F LD A,C Jump to SetObject_Write if the location is 01.
6A20 CP $01
6A22 JR Z,SetObject_Write
6A24 LD C,$00 Store 00 instead.
Write the new location.
SetObject_Write 6A26 LD (HL),C Write the location.
This entry point is used by the routine at CopyObjectLocation.
Redraw if the object is here.
SetObject_Here 6A27 LD HL,$5D87 Point HL at CurrentRoom.
6A2A CP (HL) Jump to RoomHasChanged if it is *CurrentRoom.
6A2B JP Z,RoomHasChanged
6A2E RET Return.
Prev: 6A11 Up: Map Next: 6A2F