Prev: C119 Up: Map Next: C15E
C13B: Draw Chosen Object
Handles an object for DrawObject when only one object is to be drawn, which is the object whose address is the operand of the first instruction. Every other object is skipped. The block of the object is drawn with the code that is patched to draw a block section instead of a block row.
DrawChosenObject C13B LD HL,$0000 Set HL to the address of the chosen object, which is patched in.
C13E PUSH IX Copy the address of the current object into DE.
C140 POP DE
C141 AND A Subtract the address of the current object.
C142 SBC HL,DE
C144 RET NZ Return if it is not the chosen object.
C145 LD A,(IX+$01) Fetch the kind of the object.
C148 AND %10001111 Use bits 0-3 and bit 7.
C14A CP $82 Compare it with 82.
C14C RET NZ Return if it is not an object of that kind.
C14D LD A,$C3 Set A to the opcode of a JP instruction, C3.
C14F LD ($C75D),A Patch it into the drawing code at C75D.
C152 LD HL,$C7AC Point HL at DrawBlockSection.
C155 LD ($C75E),HL Patch it in as the destination of the jump.
C158 LD HL,$00F6 HL is F6.
C15B LD ($C1A0),HL Patch it in as the amount that is used by DrawBlock at C1A0.
Continue on to DrawBlock.
Prev: C119 Up: Map Next: C15E