Prev: 9C46 Up: Map Next: 9DC0
9D73: Redraws an object, on stage. If the object is already there then it is Xor'd out.
Used by the routines at Hero_PickUp and Hero_Drop.
Input
A Object index
Output
Obj_DrawOrClearByIndex 9D73 CALL Obj_GetBmpIndex Get the bitmap index for object[A]
9D76 LD L,(HL)
9D77 CALL Bitmap_CopyFrame Copy details of bitmap into cache.
9D7A LD HL,$5E55
9D7D LD C,$0F
Obj_DrawOrClearByIndex_0 9D7F LD A,(HL) Find an empty slot
9D80 AND $0F
9D82 JR Z,Obj_DrawOrClearByIndex_1
9D84 DEC C
9D85 DEC HL
9D86 JR Obj_DrawOrClearByIndex_0
Obj_DrawOrClearByIndex_1 9D88 LD A,(Bitmap_InfoCache_Width)
9D8B AND $7F
9D8D RRA
9D8E NEG
9D90 ADD A,$02
9D92 ADD A,C
9D93 RLA
9D94 RLA
9D95 RLA
9D96 AND $F8
9D98 LD C,A
9D99 LD HL,Coords_NS
9D9C LD A,(Camera_Compass)
9D9F BIT 0,A
9DA1 JR NZ,Obj_DrawOrClearByIndex_2
9DA3 INC HL
9DA4 INC HL
Obj_DrawOrClearByIndex_2 9DA5 BIT 0,(HL)
9DA7 JR Z,Obj_DrawOrClearByIndex_3
9DA9 LD A,C
9DAA SUB $04
9DAC LD C,A
Obj_DrawOrClearByIndex_3 9DAD LD A,(Bitmap_InfoCache_Height)
9DB0 AND $7F
9DB2 RLA
9DB3 RLA
9DB4 RLA
9DB5 NEG
9DB7 ADD A,$28
9DB9 LD B,A
9DBA CALL Obj_DrawOrClear
9DBD JP Inv_Update
Prev: 9C46 Up: Map Next: 9DC0