Prev: F166 Up: Map Next: F1A1
F173: Script Routine: (11) Have entity face right after putting down
After a put-down, face the entity right.
Input
IX Address of complex state data for an entity
ScriptRoutine_FaceRightAfterPutDown F173 BIT 4,(IX+$03) Is bit 04 of flags byte 3 (IX+03) set? If not, jump to AdvanceScriptInstruction.
F177 JP Z,AdvanceScriptInstruction
F17A CALL Script_FaceAfterPutDown_Apply Call Script_FaceAfterPutDown_Apply to script Face After Put Down Apply.
This entry point is used by the routine at ScriptRoutine_FaceLeftAfterPutDown.
Write the held entity's room after facing, then continue the script.
ScriptRoutine_FaceLeftAfterPutDown_ApplyFacing F17D LD (IY+$04),A Set the referenced entity's room index.
F180 JP AdvanceScriptInstruction Jump to AdvanceScriptInstruction to run the next script instruction.
This entry point is used by the routine at ScriptRoutine_FaceLeftAfterPutDown.
Aim the held entity's X at Berk's BerkXCoordinateCopy using the saved width in CameraYCoordinate.
Script_FaceAfterPutDown_Apply F183 LD IY,($72AC) Load IY with the current-entity pointer (Pointer_CurrentEntity).
F187 LD A,($72ED) Load A with the saved held-entity width from CameraYCoordinate.
F18A LD E,$01 Load E with 01.
F18C LD D,A Copy A into D as a saved coordinate / value.
F18D SRL A Shift A right logical.
F18F JR NZ,ScriptRoutine_FaceRightAfterPutDown_WriteHeldX Jump to ScriptRoutine_FaceRightAfterPutDown_WriteHeldX to continue if the comparison did not match.
F191 INC E Advance the low byte of the pointer/offset in DE.
Write the held entity's X and X-extent beside Berk after put-down facing.
ScriptRoutine_FaceRightAfterPutDown_WriteHeldX F192 LD A,($7303) Load A with Berk's X-coordinate copy (BerkXCoordinateCopy).
F195 ADD A,E Add E to A.
F196 LD (IY+$07),A Set the referenced entity's x-coordinate.
F199 ADD A,D Add D into A while building a 16-bit entity/screen address.
F19A LD (IY+$08),A Set the referenced entity's x-extent.
F19D LD A,(IX+$04) Load A with the current entity's room index.
F1A0 RET Return.
Prev: F166 Up: Map Next: F1A1