Prev: D1F5 Up: Map Next: D234
D1FE: Script Routine: (46) Vat action
Clear the vat's busy bit and reset it onto the post-reset script at CFF4.
Input
IX Address of complex state data for an entity
ScriptRoutine_VatClearBit6AndReset D1FE BIT 6,(IX+$09) Is bit 06 of the current entity's direction / state set? If not, jump to AdvanceScriptInstruction.
D202 JP Z,AdvanceScriptInstruction
D205 RES 6,(IX+$09) Reset bit 06 of the current entity's direction / state.
D209 PUSH IX Stash IX on the stack.
D20B LD IX,($CF35) Load IX from TemporaryEntityPointer_Misc.
D20F LD (IX+$00),$00 Write 00 to the current entity's entity type.
D213 BIT 5,(IX+$01) Is bit 05 of the current entity's flags byte 1 set? If not, jump to ScriptRoutine_VatClearBit6AndReset_RestoreQueueSound.
D217 JR Z,ScriptRoutine_VatClearBit6AndReset_RestoreQueueSound
D219 LD IX,$909B Point IX at the camera-follow entity (StateData_Berk).
D21D SET 0,(IX+$03) Set bit 00 of the current entity's flags byte 3.
D221 LD HL,$BA35 Point HL at Berk script data BerkPutDownScript_CameraFollow.
D224 LD ($72B1),HL Store HL in Berk's script position pointer (Pointer_BerkScriptPosition).
Restore IX, queue the vat sound, and run the post-reset script at CFF4.
ScriptRoutine_VatClearBit6AndReset_RestoreQueueSound D227 POP IX Restore IX from the stack.
D229 LD A,$11 Load A with sound index 11.
D22B CALL Queue_Sound Call Queue_Sound to queue a sound effect.
D22E LD HL,$CFF4 Point HL at Drutt script data CFF4.
D231 JP ScriptInstruction Jump to ScriptInstruction to execute the script instruction at HL.
Prev: D1F5 Up: Map Next: D234