Prev: C583 Up: Map Next: C5FC
C591: Process Display Record From Script
Used by the routine at ReadCharactersRoom.
HL points at a display record. Copies the low nibbles of its flags and value byte to DisplayMode/A010, clears A00B and checks the record against the current room before drawing it.
ProcessDisplayRecordFromScript C591 PUSH HL Point IX at the record and copy the low nibble of its flags to DisplayMode via CopyRecordFlagNibble.
C592 POP IX
C594 CALL CopyRecordFlagNibble
C597 CALL CopyRecordValueNibble Copy the low nibble of the value byte via CopyRecordValueNibble.
C59A XOR A Clear the parser.
C59B LD ($A00B),A
C59E LD A,($A00F)
C5A1 LD HL,$A010 Take the display mode.
C5A4 OR (HL) Merge the flag at A010, and go to ProcessDisplayRecordFromScript_RunObjectDisplay when both flags are clear.
C5A5 JR Z,ProcessDisplayRecordFromScript_RunObjectDisplay
C5A7 LD A,($A00F) Jump to ProcessDisplayRecordFromScript_CompareRoom if the display mode is 05.
C5AA CP $05
C5AC JR Z,ProcessDisplayRecordFromScript_CompareRoom
C5AE CP $06 Jump ahead to ProcessDisplayRecordFromScript_DisplayMode if the display mode is not 06.
C5B0 JR NZ,ProcessDisplayRecordFromScript_DisplayMode
ProcessDisplayRecordFromScript_CompareRoom C5B2 LD A,($A034) Jump to DispatchLookedUpHandlerThird_0 if the room display parameter is not FE.
C5B5 CP $FE
C5B7 JP NZ,DispatchLookedUpHandlerThird_0
ProcessDisplayRecordFromScript_DisplayMode C5BA LD A,($A010) Jump to ProcessDisplayRecordFromScript_TestGraphics if the display mode is 05.
C5BD CP $05
C5BF JR Z,ProcessDisplayRecordFromScript_TestGraphics
C5C1 CP $06 Jump ahead to ProcessDisplayRecordFromScript_DisplayModeZero if the display mode is not 06.
C5C3 JR NZ,ProcessDisplayRecordFromScript_DisplayModeZero
ProcessDisplayRecordFromScript_TestGraphics C5C5 LD A,($A035) Jump to DispatchLookedUpHandlerThird_0 if the room graphics parameter is not FE.
C5C8 CP $FE
C5CA JP NZ,DispatchLookedUpHandlerThird_0
ProcessDisplayRecordFromScript_DisplayModeZero C5CD LD A,($A00F) Jump to ProcessDisplayRecordFromScript_AcceptGraphics if the display mode is zero.
C5D0 AND A
C5D1 JR Z,ProcessDisplayRecordFromScript_AcceptGraphics
C5D3 LD A,($A034) Jump to ProcessDisplayRecordFromScript_AcceptGraphics if the room display parameter is not FF.
C5D6 CP $FF
C5D8 JR NZ,ProcessDisplayRecordFromScript_AcceptGraphics
C5DA LD B,$00 Start the picture count at zero.
ProcessDisplayRecordFromScript_TestDisplay C5DC CALL ReadDisplayModeForPicture Return if the count has reached the graphics limit.
C5DF RET Z
C5E0 LD ($A034),A Store it in the room display parameter, then call RecordResultRoomGraphics_ClearHighByte to run display action.
C5E3 CALL RecordResultRoomGraphics_ClearHighByte
C5E6 JR NZ,ProcessDisplayRecordFromScript_RunObjectDisplay Go to ProcessDisplayRecordFromScript_RunObjectDisplay if RecordResultRoomGraphics_ClearHighByte found a picture.
C5E8 INC B Try the next display value from ProcessDisplayRecordFromScript_TestDisplay.
C5E9 JR ProcessDisplayRecordFromScript_TestDisplay
Accept a set graphics parameter, and return when it is empty.
ProcessDisplayRecordFromScript_AcceptGraphics C5EB CALL AcceptSetGraphicsParameter Go to ProcessDisplayRecordFromScript_RunObjectDisplay if the set graphics parameter is not accepted.
C5EE JR Z,ProcessDisplayRecordFromScript_RunObjectDisplay
C5F0 CALL RecordResultRoomGraphics_CountGraphicsSteps Return if the graphics count has reached its limit.
C5F3 RET Z
ProcessDisplayRecordFromScript_RunObjectDisplay C5F4 LD A,$01 Set the parser flag at A00B to 01 and continue at ProcessObjectDisplayWithPointer.
C5F6 LD ($A00B),A
C5F9 JP ProcessObjectDisplayWithPointer
Prev: C583 Up: Map Next: C5FC