Prev: 47412 Up: Map Next: 47562
47414: Process Script Display
Used by the routine at DispatchCharacterScript.
Saves the character record and reads the object attribute for this script display.
ProcessScriptDisplay 47414 PUSH IX Save the character record, the schedule entry and the pointer.
47416 PUSH IY
47418 PUSH HL
47419 LD (47413),A Record the result in the display.
ProcessScriptDisplay_Loop 47422 CALL 47374 Call 47374 to read the object attribute.
47425 LD A,(IX+7) Jump to ProcessCharacterDisplay if byte 7 of the character record is 2.
47428 CP 2
47430 JP Z,ProcessCharacterDisplay
47433 LD A,(IX+1) Jump to ProcessScriptDisplay_Next if the moved marker is 255.
47436 CP 255
47438 JR Z,ProcessScriptDisplay_Next
47440 LD A,(47413) Read the display.
47443 LD (47412),A Record the result in the display flag at 47412.
47446 LD A,(IX+2) Read the character's room.
47449 LD (40988),A Record the result in the display flag at 40988.
47452 LD C,(IX+3) Read the action flags.
47455 LD B,(IX+4) Call InitialiseDisplayBuffer to initialise display buffer.
47458 LD (45438),BC
47462 CALL InitialiseDisplayBuffer
47465 JR Z,ProcessScriptDisplay_DisplayFlagSaved Go to ProcessScriptDisplay_DisplayFlagSaved if no room record matches.
47467 LD IX,(47206) Read the saved character record and the object-table pointer.
47471 LD BC,(45438)
47475 LD (IX+3),C Store it in the action flags and store it in the attribute type.
47478 LD (IX+4),B
47481 LD A,(40988) Store the display flag (40988) and call CopyLinkAhead if that flag is zero.
47484 LD (IX+2),A
47487 AND A
47488 CALL Z,CopyLinkAhead
ProcessScriptDisplay_Store 47491 LD A,1 Take 1.
ProcessScriptDisplay_BringSavedPointer 47493 POP HL Restore the saved pointer, the saved schedule entry and the saved character record from the stack.
47494 POP IY
47496 POP IX
47498 AND A Clear the borrow so an empty entry returns as a failed match.
47499 RET Return.
Read the character's room, then record the result in the saved character, then read the action flags.
ProcessScriptDisplay_Next 47500 LD A,(IX+2) Read the character's room, then call ProcessRoomDisplayParameter to resolve the room display parameter.
47503 CALL ProcessRoomDisplayParameter
47506 LD (41011),A Record the saved character.
47509 LD A,(IX+3) Read the action flags, then call ProcessRoomDisplayParameter to resolve the room display parameter.
47512 CALL ProcessRoomDisplayParameter
47515 LD (41012),A Record the room display parameter.
47518 LD A,(IX+4) Read the next parameter and call ProcessRoomDisplayParameter to resolve it.
47521 CALL ProcessRoomDisplayParameter
47524 LD (41013),A Store the room graphics parameter at RoomGraphicsParameter and call CopyPointerToStack.
47527 CALL CopyPointerToStack
47530 JR ProcessScriptDisplay_Store Jump back to ProcessScriptDisplay_Store to take 1.
Follows the link until it runs out, then clears the result.
ProcessScriptDisplay_FollowsLinkRuns 47532 CALL CopyLinkAhead Call CopyLinkAhead and jump back to ProcessScriptDisplay_FollowsLinkRuns while it returns non-zero.
47535 JR NZ,ProcessScriptDisplay_FollowsLinkRuns
ProcessScriptDisplay_Zero 47537 XOR A Jump back to ProcessScriptDisplay_BringSavedPointer to see whether it is zero.
47538 JR ProcessScriptDisplay_BringSavedPointer
Read the display flag, then take the saved character record.
ProcessScriptDisplay_DisplayFlagSaved 47540 LD A,(40988) Jump to ProcessScriptDisplay_FollowsLinkRuns if the display is zero.
47543 AND A
47544 JR Z,ProcessScriptDisplay_FollowsLinkRuns
47546 LD IX,(47206) Read the saved character record and clear its location.
47550 LD (IX+2),0
47554 CALL CopyLinkAhead Go to ProcessScriptDisplay_Zero if the link pointer is zero.
47557 JR Z,ProcessScriptDisplay_Zero
47559 JP ProcessScriptDisplay_Loop Go back to ProcessScriptDisplay_Loop for the next character.
Prev: 47412 Up: Map Next: 47562