Prev: 71FF Up: Map Next: 7242
7213: Draw Shape When Object Is Here
Used by the routine at DispatchShape.
Opcode F8 names an object. The following shape is drawn only when that object is in the current room. The object id is written over the low address byte (5F11) of LD (*Continuation),A at 5F10, so the next unrecognised line zeros CommandBuffer plus that id. Those addresses are the command buffer and the bytes after it, not object state. When the object is absent the operand is set to 00. RoomHasChanged compares PicturedObject, which this routine never writes.
ShapeIfPresent 7213 INC IX Advance the record pointer.
7215 LD A,(IX+$00) Fetch the object id.
7218 LD HL,$5DCA Point HL at ObjectLocations.
721B LD C,A Index by the object number.
721C LD B,$00
721E ADD HL,BC
721F LD A,($5D87) Jump to ShapeIfPresent_Skip if it is not in *CurrentRoom.
7222 CP (HL)
7223 JR NZ,ShapeIfPresent_Skip
7225 LD A,(IX+$00) Patch 5F11, the low address byte of LD (*Continuation),A, with the object id.
7228 LD ($5F11),A
722B INC IX Advance the record pointer.
722D LD A,(IX+$00) Fetch the shape number.
7230 JP PlotShape Jump to PlotShape.
Skip the shape when the object is elsewhere.
ShapeIfPresent_Skip 7233 INC IX Step past the unused operands.
7235 INC IX
7237 INC IX
7239 INC IX
723B XOR A Clear 5F11, the low address byte of LD (*Continuation),A.
723C LD ($5F11),A
723F JP PictureRecord Jump to PictureRecord.
Prev: 71FF Up: Map Next: 7242