Prev: A2BD Up: Map Next: A35D
A2E4: Process Object Display
Used by the routine at ReadSavedCharacter.
Sets the object display flag and prints the object when the player can see it.
ProcessObjectDisplay A2E4 LD A,$01 Write 01 to the object display flag.
A2E6 LD ($A2AA),A
A2E9 PUSH IY
A2EB PUSH BC
A2EC PUSH IX Save the character record, the pointer and the source.
A2EE PUSH HL
A2EF PUSH DE
A2F0 LD A,($A033) Write *A033 to *A35D.
A2F3 LD ($A35D),A
A2F6 LD HL,($A034) Write *RoomDisplayParameter to *A35E.
A2F9 LD ($A35E),HL
Are the parser flags clear?
A2FC LD A,($A00C) Jump to ProcessObjectDisplay_0 if the parser flags are clear.
A2FF LD B,A
A300 AND A
A301 LD A,$01
A303 JR Z,ProcessObjectDisplay_0
A305 XOR A Start the object from zero.
ProcessObjectDisplay_0 A306 LD ($A027),A Store it in the print mode, then call CheckObjectVisibility to test object visibility.
A309 CALL CheckObjectVisibility
A30C JR NC,ProcessObjectDisplay_Next Jump ahead to ProcessObjectDisplay_Next if CheckObjectVisibility finds the object is not visible.
A30E LD A,B Jump ahead to ProcessObjectDisplay_Next if the count is not zero.
A30F AND A
A310 JR NZ,ProcessObjectDisplay_Next
A312 LD HL,$68D1 Take the cannot see message, then call PrintTextAndHandleControlCharacters to print the cannot see message.
A315 CALL PrintTextAndHandleControlCharacters
A318 JR ProcessObjectDisplay_WriteList Jump ahead to ProcessObjectDisplay_WriteList to finish this object.
Read the saved object fields at A35D, then use the saved pointer as the character record, then read the object attribute value at ObjectAttributeValue.
ProcessObjectDisplay_Next A31A LD A,($A35D) Call CalculateObjectTableOffset to calculate object table offset.
A31D CALL CalculateObjectTableOffset
A320 PUSH HL Call ExtractObjectAttributes to extract object attributes.
A321 POP IX
A323 CALL ExtractObjectAttributes
A326 LD A,($A01D) Read the object attribute value.
A329 AND %00010000 Go to ProcessObjectDisplay_WriteList to finish this object if bit 4 of its attribute value is set.
A32B JR NZ,ProcessObjectDisplay_WriteList
A32D CP B Go to ProcessObjectDisplay_CharacterBeingProcessed if B is zero.
A32E JR Z,ProcessObjectDisplay_CharacterBeingProcessed
A330 CALL CheckCharacterID Print a newline at PrintNewline if the character is 00 01 or Sherlock at CheckCharacterID.
A333 CALL Z,PrintNewline
ProcessObjectDisplay_CharacterBeingProcessed A336 CALL ReadCharacter Call ReadCharacter to read which character is being processed.
A339 LD DE,$017F Go to ProcessObjectDisplay_PrintsNewLine if B is not zero.
A33C XOR A
A33D CP B
A33E JR NZ,ProcessObjectDisplay_PrintsNewLine
A340 CALL PrintTextToken Print the token at PrintTextToken, call CheckAndResetCharacterState, then go to ProcessObjectDisplay_1.
A343 CALL CheckAndResetCharacterState
A346 JR ProcessObjectDisplay_1
Prints a new line, then clears the object-display flag and the print mode.
ProcessObjectDisplay_PrintsNewLine A348 CALL ProcessObject_Display Call ProcessObject_Display to process the object display.
ProcessObjectDisplay_1 A34B CALL PrintNewline Call PrintNewline to print a new line.
ProcessObjectDisplay_WriteList A34E XOR A Write 00 to .
A34F LD ($A2AA),A
A352 LD ($A027),A
A355 POP DE Restore the saved source, the saved pointer, the saved character record, the saved count and the saved schedule entry from the stack.
A356 POP HL
A357 POP IX
A359 POP BC
A35A POP IY
A35C RET Return.
Prev: A2BD Up: Map Next: A35D