Prev: DEDA Up: Map Next: DF15
DEE8: Handle Dust
Handler for the object types 48 to 4B (a puff of dust). The counter in byte 08 goes down on every call and the puff is removed, and erased, when it reaches zero. Bit 0 of the type follows bit 0 of the counter, which makes the puff flicker between two frames. The puff is removed if Sabreman is not in its room.
Input
IX Object record
Handle_Dust DEE8 CALL StoreEntity Save the state of the puff.
DEEB LD A,($8F1C) Fetch the room x of Sabreman.
DEEE CP (IX+$02) Jump to Remove_Unseen_Weapon to remove the puff if it is in a different room x.
DEF1 JP NZ,Remove_Unseen_Weapon
DEF4 LD A,($8F1E) Fetch the room y of Sabreman.
DEF7 CP (IX+$04) Jump to Remove_Unseen_Weapon to remove the puff if it is in a different room y.
DEFA JP NZ,Remove_Unseen_Weapon
DEFD DEC (IX+$08) Decrease the counter and jump to Remove_Thrown_Weapon to remove the puff when it reaches zero.
DF00 JP Z,Remove_Thrown_Weapon
DF03 LD A,(IX+$08) Fetch the counter.
DF06 AND %00000001 Keep only bit 0.
DF08 LD B,A Store it in B.
DF09 LD A,(IX+$00) Fetch the type.
DF0C AND %11111110 Reset bit 0.
DF0E ADD A,B Add bit 0 of the counter.
DF0F LD (IX+$00),A Store the type.
DF12 JP Update_Object_Sprite Jump to Update_Object_Sprite.
Prev: DEDA Up: Map Next: DF15