Prev: C4B2 Up: Map Next: C542
C4D1: Process Display Action
Used by the routines at DispatchCharacterScript, CE18 and RunSimpleAction.
Jumps ahead when bit 7 of the saved character is set, otherwise finds the object's place in the table and checks the display flag.
ProcessDisplayAction C4D1 LD A,($A033) Jump ahead to LookUpDisplayRecordForMovedMarker if bit 7 of flags: Saved Character (A033) is present.
C4D4 BIT 7,A
C4D6 JP NZ,LookUpDisplayRecordForMovedMarker
Calculate object table offset.
C4D9 CALL CalculateObjectTableOffset Call CalculateObjectTableOffset to find the object's place in the table.
C4DC PUSH HL Call ExtractObjectAttributes to extract object attributes.
C4DD POP IX
C4DF CALL ExtractObjectAttributes
C4E2 CALL CheckDisplayBitsThreeAndSeven Call CheckDisplayBitsThreeAndSeven to test bits 3 and 7 of the object attribute, then call CheckDisplayBitsTwoAndSix to test bits 2 and 6.
C4E5 CALL CheckDisplayBitsTwoAndSix
C4E8 XOR A Clear the parser.
C4E9 LD ($A00B),A
None of the bits 0C are set in the object attribute value?
C4EC LD A,($A01D) Go to ProcessDisplayAction_RunObjectDisplay if bit 2 and bit 3 of the object attribute are clear.
C4EF AND $0C
C4F1 JR Z,ProcessDisplayAction_RunObjectDisplay
C4F3 LD A,($A00F) Jump to ProcessDisplayAction_Next if the display mode is not 05.
C4F6 CP $05
C4F8 JR NZ,ProcessDisplayAction_Next
C4FA LD A,($A034) Jump to DispatchLookedUpHandlerThird_0 if the room display parameter is not FE.
C4FD CP $FE
C4FF JP NZ,DispatchLookedUpHandlerThird_0
ProcessDisplayAction_Next C502 LD A,($A010) Jump to ProcessDisplayAction_DisplayModeZero if the display mode is not 05.
C505 CP $05
C507 JR NZ,ProcessDisplayAction_DisplayModeZero
C509 LD A,($A035) Jump to DispatchLookedUpHandlerThird_0 if the room graphics parameter is not FE.
C50C CP $FE
C50E JP NZ,DispatchLookedUpHandlerThird_0
ProcessDisplayAction_DisplayModeZero C511 LD A,($A00F) Jump to ProcessDisplayAction_AcceptGraphicsParameter if the display mode is zero.
C514 AND A
C515 JR Z,ProcessDisplayAction_AcceptGraphicsParameter
C517 LD A,($A034) Jump to ProcessDisplayAction_AcceptGraphicsParameter if the room display parameter is not FF.
C51A CP $FF
C51C JR NZ,ProcessDisplayAction_AcceptGraphicsParameter
C51E LD B,$FF Start the count at FF so the first step is 00.
ProcessDisplayAction_Loop C520 INC B Count one more and return if ReadDisplayModeForPicture finds the last room for this display mode.
C521 CALL ReadDisplayModeForPicture
C524 RET Z
C525 LD ($A034),A Record the room display parameter.
C528 PUSH BC Call RecordResultRoomGraphics to run display action.
C529 CALL RecordResultRoomGraphics
C52C POP BC
C52D JR NZ,ProcessDisplayAction_RunObjectDisplay Go to ProcessDisplayAction_RunObjectDisplay if RecordResultRoomGraphics found a picture.
C52F JR ProcessDisplayAction_Loop This picture did not match, so try the next one from ProcessDisplayAction_Loop.
Accept the graphics parameter, and return when it is empty.
ProcessDisplayAction_AcceptGraphicsParameter C531 CALL AcceptGraphicsParameter Go to ProcessDisplayAction_RunObjectDisplay if the graphics parameter is not accepted.
C534 JR Z,ProcessDisplayAction_RunObjectDisplay
C536 CALL RecordResultRoomGraphics_CountCountRemaining Return if the graphics count has reached its limit.
C539 RET Z
ProcessDisplayAction_RunObjectDisplay C53A LD A,$01 Set the parser flag to 01 and draw the object from ProcessObjectDisplayLogic.
C53C LD ($A00B),A
C53F JP ProcessObjectDisplayLogic
Prev: C4B2 Up: Map Next: C542