Prev: 43831 Up: Map Next: 43870
43850: Action: Start Turn Event
Sets the bit operand in Flags_TurnEvents, which arms that turn-based event.
Input
F The zero flag is set when the conditions hold
IX Pointer to the script entry (opcode, event index)
When the condition failed, skip this action.
Action_StartTurnEvent 43850 JP NZ,RunScript_SkipAction_TwoBytes Jump to RunScript_SkipAction_TwoBytes if the condition failed.
The operand selects which turn-based event to arm in Flags_TurnEvents.
43853 LD B,(IX+1) Fetch the event number from *IX+1 into B.
43856 INC B Start the count at one so event 0 needs a single rotate.
43857 XOR A Clear A and set the carry flag as the seed bit.
43858 SCF
StartTurnEvent_Mask 43859 RLA Rotate the seed bit left into the mask.
43860 DJNZ StartTurnEvent_Mask Decrease the event count by one and loop back to StartTurnEvent_Mask until the bit is in place.
Set that bit so the turn-based event is armed.
43862 LD HL,41160 Set that bit in *Flags_TurnEvents.
43865 OR (HL)
43866 LD (HL),A
43867 JP RunScript_SkipAction_TwoBytes Jump to RunScript_SkipAction_TwoBytes.
Prev: 43831 Up: Map Next: 43870