Prev: D794 Up: Map Next: D9E0
D9C4: Initialise Entity State
Activates an entity state effect by copying a 16-byte configuration record from Entity_State_Table into the active state slot at Entity_State_Pointer. The entity type code in E selects the record (multiplied by 10). If Entity_State_Flag is zero, no effect is pending and the routine returns immediately without change.
Input
E Entity type code
Initialise_Entity_State D9C4 LD A,($C52F) Return if no entity state effect is pending.
D9C7 AND A
D9C8 RET Z
D9C9 SLA E Multiply the entity type code by 10 to form the record offset.
D9CB SLA E
D9CD SLA E
D9CF SLA E
D9D1 LD D,$00
D9D3 LD HL,$D9EA Index into Entity_State_Table by offset and set DE to Entity_State_Pointer.
D9D6 ADD HL,DE
D9D7 LD DE,$C521
D9DA LD BC,$0010 Copy the 10-byte effect record to Entity_State_Pointer.
D9DD LDIR
D9DF RET Return.
Prev: D794 Up: Map Next: D9E0