Prev: B934 Up: Map Next: B9CA
B936: Process Script Display
Used by the routine at DispatchCharacterScript.
Saves the character record and reads the object attribute for this script display.
ProcessScriptDisplay B936 PUSH IX Save the character record, the schedule entry and the pointer.
B938 PUSH IY
B93A PUSH HL
B93B LD ($B935),A Record the result in the display.
ProcessScriptDisplay_Loop B93E CALL $B90E Call B90E to read the object attribute.
B941 LD A,(IX+$07) Jump to ProcessCharacterDisplay if byte 07 of the character record is 02.
B944 CP $02
B946 JP Z,ProcessCharacterDisplay
B949 LD A,(IX+$01) Jump to ProcessScriptDisplay_Next if the moved marker is FF.
B94C CP $FF
B94E JR Z,ProcessScriptDisplay_Next
B950 LD A,($B935) Read the display.
B953 LD ($B934),A Record the result in the display flag at B934.
B956 LD A,(IX+$02) Read the character's room.
B959 LD ($A01C),A Record the result in the display flag at A01C.
B95C LD C,(IX+$03) Read the action flags.
B95F LD B,(IX+$04) Call InitialiseDisplayBuffer to initialise display buffer.
B962 LD ($B17E),BC
B966 CALL InitialiseDisplayBuffer
B969 JR Z,ProcessScriptDisplay_DisplayFlagSaved Go to ProcessScriptDisplay_DisplayFlagSaved if no room record matches.
B96B LD IX,($B866) Read the saved character record and the object-table pointer.
B96F LD BC,($B17E)
B973 LD (IX+$03),C Store it in the action flags and store it in the attribute type.
B976 LD (IX+$04),B
B979 LD A,($A01C) Store the display flag (A01C) and call CopyLinkAhead if that flag is zero.
B97C LD (IX+$02),A
B97F AND A
B980 CALL Z,CopyLinkAhead
ProcessScriptDisplay_Store B983 LD A,$01 Take 01.
ProcessScriptDisplay_BringSavedPointer B985 POP HL Restore the saved pointer, the saved schedule entry and the saved character record from the stack.
B986 POP IY
B988 POP IX
B98A AND A Clear the borrow so an empty entry returns as a failed match.
B98B RET Return.
Read the character's room, then record the result in the saved character, then read the action flags.
ProcessScriptDisplay_Next B98C LD A,(IX+$02) Read the character's room, then call ProcessRoomDisplayParameter to resolve the room display parameter.
B98F CALL ProcessRoomDisplayParameter
B992 LD ($A033),A Record the saved character.
B995 LD A,(IX+$03) Read the action flags, then call ProcessRoomDisplayParameter to resolve the room display parameter.
B998 CALL ProcessRoomDisplayParameter
B99B LD ($A034),A Record the room display parameter.
B99E LD A,(IX+$04) Read the next parameter and call ProcessRoomDisplayParameter to resolve it.
B9A1 CALL ProcessRoomDisplayParameter
B9A4 LD ($A035),A Store the room graphics parameter at RoomGraphicsParameter and call CopyPointerToStack.
B9A7 CALL CopyPointerToStack
B9AA JR ProcessScriptDisplay_Store Jump back to ProcessScriptDisplay_Store to take 01.
Follows the link until it runs out, then clears the result.
ProcessScriptDisplay_FollowsLinkRuns B9AC CALL CopyLinkAhead Call CopyLinkAhead and jump back to ProcessScriptDisplay_FollowsLinkRuns while it returns non-zero.
B9AF JR NZ,ProcessScriptDisplay_FollowsLinkRuns
ProcessScriptDisplay_Zero B9B1 XOR A Jump back to ProcessScriptDisplay_BringSavedPointer to see whether it is zero.
B9B2 JR ProcessScriptDisplay_BringSavedPointer
Read the display flag, then take the saved character record.
ProcessScriptDisplay_DisplayFlagSaved B9B4 LD A,($A01C) Jump to ProcessScriptDisplay_FollowsLinkRuns if the display is zero.
B9B7 AND A
B9B8 JR Z,ProcessScriptDisplay_FollowsLinkRuns
B9BA LD IX,($B866) Read the saved character record and clear its location.
B9BE LD (IX+$02),$00
B9C2 CALL CopyLinkAhead Go to ProcessScriptDisplay_Zero if the link pointer is zero.
B9C5 JR Z,ProcessScriptDisplay_Zero
B9C7 JP ProcessScriptDisplay_Loop Go back to ProcessScriptDisplay_Loop for the next character.
Prev: B934 Up: Map Next: B9CA