Prev: C027 Up: Map Next: C095
C06E: Spawn Task Entity
Used by the routine at Update_Entity_Slot.
Spawn Task Entity for the current Thing Upstairs task.
Spawns a pan into a free complex-entity slot.
Spawn_Task_Entity C06E PUSH HL Stash HL on the stack.
C06F LD IY,$9055 Point IY at the pan entity (StateData_Complex_26).
C073 SET 7,(IY+$02) Set bit 07 of the referenced entity's flags byte 2.
C077 LD HL,$72B5 Point HL at the task-two flags (TaskTwoFlags).
C07A RES 4,(HL) Clear bit 04 of TaskTwoFlags (also set at C0D2. no BIT reader found).
C07C RES 5,(HL) Clear bit 05 of TaskTwoFlags (also set at C0D4 / cleared at C0F1. no BIT reader found).
C07E SET 7,(HL) Set bit 07 of TaskTwoFlags.
C080 LD A,($72BF) Load A with the room-transition flag (RoomTransitionFlag).
C083 INC A Advance room-transition flag by one.
C084 LD ($72BF),A Set the room-transition flag (RoomTransitionFlag).
C087 CP $04 Is room-transition flag equal to 04? If not, jump to Spawn_Task_Entity_PanLayout.
C089 JR NZ,Spawn_Task_Entity_PanLayout
C08B SET 6,(HL) Set bit 06 of TaskTwoFlags (written here when RoomTransitionFlag reaches 04 no BIT reader found).
Point the helper entity at layout GraphicLayout_Pan after arming spawn flags.
Spawn_Task_Entity_PanLayout C08D LD HL,$9E07 Point HL at the pan layout GraphicLayout_Pan.
C090 LD ($905F),HL Write the layout pointer into the helper entity's layout field (905F).
C093 POP HL Restore HL from the stack.
C094 RET Return.
Prev: C027 Up: Map Next: C095