Prev: 718B Up: Map Next: 728C
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, and the object id is planted in the low address byte (5F11) of LD (Continuation),A at 5F10. When the object is absent that byte is cleared again.
ShapeIfPresent 7213 INC IX
7215 LD A,(IX+$00)
7218 LD HL,$5DCA
721B LD C,A
721C LD B,$00
721E ADD HL,BC
721F LD A,($5D87)
7222 CP (HL)
7223 JR NZ,ShapeIfPresent_0
7225 LD A,(IX+$00)
7228 LD ($5F11),A
722B INC IX
722D LD A,(IX+$00)
7230 JP PlotShape
ShapeIfPresent_0 7233 INC IX
7235 INC IX
7237 INC IX
7239 INC IX
723B XOR A
723C LD ($5F11),A
723F JP PictureRecord
This entry point is used by the routine at PatchShift.
ShapeIfPresent_1 7242 PUSH BC
7243 CALL PixelRow
7246 PUSH HL
7247 LD DE,$0000
724A LD B,$08
724C ADD HL,DE
724D DEC HL
724E POP DE
ShapeIfPresent_2 724F PUSH HL
7250 PUSH DE
7251 PUSH BC
7252 LD B,$00
ShapeIfPresent_3 7254 LD A,(DE)
7255 LD C,$80
ShapeIfPresent_4 7257 RL A
7259 RR C
725B JR NC,ShapeIfPresent_4
725D LD (HL),C
725E INC DE
725F DEC HL
7260 DJNZ ShapeIfPresent_3
7262 POP BC
7263 POP DE
7264 POP HL
7265 INC D
7266 INC H
7267 DJNZ ShapeIfPresent_2
7269 POP BC
726A INC B
726B LD A,$00
726D CP B
726E JR NZ,ShapeIfPresent_1
7270 RET
This entry point is used by the routine at PatchShift.
ShapeIfPresent_5 7271 PUSH BC
7272 CALL ResetOrigin_0
7275 LD DE,$0000
7278 PUSH HL
7279 ADD HL,DE
727A DEC HL
727B POP DE
727C LD B,$00
ShapeIfPresent_6 727E LD A,(DE)
727F LD (HL),A
7280 INC DE
7281 DEC HL
7282 DJNZ ShapeIfPresent_6
7284 POP BC
7285 INC B
7286 LD A,$00
7288 CP B
7289 JR NZ,ShapeIfPresent_5
728B RET
Prev: 718B Up: Map Next: 728C