Prev: E2FD Up: Map Next: E346
E31C: Build Entity Spawn Record
Used by the routine at Process_Tracked_Enemy_Entity.
Reads the direction byte from (IX+02), indexes the direction animation offset table at Direction_Animation_Offset_Table by direction × 4, and writes five bytes to the entity spawn buffer at C511: the animation type byte (28 + direction), the direction-adjusted Y coordinate, the direction-adjusted X coordinate, and two further table bytes via two LDI instructions. Called from Process_Tracked_Enemy_Entity.
Build_Entity_Spawn_Record E31C LD HL,$E7AF Index the direction animation table at Direction_Animation_Offset_Table and write the animation type byte (28 + direction) to the spawn buffer at C511.
E31F LD D,$00
E321 LD A,(IX+$02)
E324 AND $07
E326 LD E,A
E327 SLA E
E329 SLA E
E32B ADD HL,DE Write the direction-adjusted Y and X coordinates to the spawn buffer.
E32C LD DE,$C511
E32F ADD A,$28
E331 LD (DE),A
E332 INC DE
E333 LD A,(IX+$03)
E336 ADD A,(HL)
E337 LD (DE),A
E338 INC HL
E339 INC DE Copy two further direction table bytes to the spawn buffer via LDI×2.
E33A LD A,(IX+$05)
E33D ADD A,(HL)
E33E LD (DE),A
E33F INC HL
E340 INC DE
E341 LDI
E343 LDI
E345 RET Return.
Prev: E2FD Up: Map Next: E346