Prev: 41661 Up: Map Next: 41821
41700: 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 41700 LD A,1 Write 1 to the object display flag.
41702 LD (41642),A
41705 PUSH IY
41707 PUSH BC
41708 PUSH IX Save the character record, the pointer and the source.
41710 PUSH HL
41711 PUSH DE
41712 LD A,(41011) Write *41011 to *41821.
41715 LD (41821),A
41718 LD HL,(41012) Write *RoomDisplayParameter to *41822.
41721 LD (41822),HL
Are the parser flags clear?
41724 LD A,(40972) Jump to ProcessObjectDisplay_0 if the parser flags are clear.
41727 LD B,A
41728 AND A
41729 LD A,1
41731 JR Z,ProcessObjectDisplay_0
41733 XOR A Start the object from zero.
ProcessObjectDisplay_0 41734 LD (40999),A Store it in the print mode, then call CheckObjectVisibility to test object visibility.
41737 CALL CheckObjectVisibility
41740 JR NC,ProcessObjectDisplay_Next Jump ahead to ProcessObjectDisplay_Next if CheckObjectVisibility finds the object is not visible.
41742 LD A,B Jump ahead to ProcessObjectDisplay_Next if the count is not zero.
41743 AND A
41744 JR NZ,ProcessObjectDisplay_Next
41746 LD HL,26833 Take the cannot see message, then call PrintTextAndHandleControlCharacters to print the cannot see message.
41749 CALL PrintTextAndHandleControlCharacters
41752 JR ProcessObjectDisplay_WriteList Jump ahead to ProcessObjectDisplay_WriteList to finish this object.
Read the saved object fields at 41821, then use the saved pointer as the character record, then read the object attribute value at ObjectAttributeValue.
ProcessObjectDisplay_Next 41754 LD A,(41821) Call CalculateObjectTableOffset to calculate object table offset.
41757 CALL CalculateObjectTableOffset
41760 PUSH HL Call ExtractObjectAttributes to extract object attributes.
41761 POP IX
41763 CALL ExtractObjectAttributes
41766 LD A,(40989) Read the object attribute value.
41769 AND %00010000 Go to ProcessObjectDisplay_WriteList to finish this object if bit 4 of its attribute value is set.
41771 JR NZ,ProcessObjectDisplay_WriteList
41773 CP B Go to ProcessObjectDisplay_CharacterBeingProcessed if B is zero.
41774 JR Z,ProcessObjectDisplay_CharacterBeingProcessed
41776 CALL CheckCharacterID Print a newline at PrintNewline if the character is 0 1 or Sherlock at CheckCharacterID.
41779 CALL Z,PrintNewline
ProcessObjectDisplay_CharacterBeingProcessed 41782 CALL ReadCharacter Call ReadCharacter to read which character is being processed.
41785 LD DE,383 Go to ProcessObjectDisplay_PrintsNewLine if B is not zero.
41788 XOR A
41789 CP B
41790 JR NZ,ProcessObjectDisplay_PrintsNewLine
41792 CALL PrintTextToken Print the token at PrintTextToken, call CheckAndResetCharacterState, then go to ProcessObjectDisplay_1.
41795 CALL CheckAndResetCharacterState
41798 JR ProcessObjectDisplay_1
Prints a new line, then clears the object-display flag and the print mode.
ProcessObjectDisplay_PrintsNewLine 41800 CALL ProcessObject_Display Call ProcessObject_Display to process the object display.
ProcessObjectDisplay_1 41803 CALL PrintNewline Call PrintNewline to print a new line.
ProcessObjectDisplay_WriteList 41806 XOR A Write 0 to .
41807 LD (41642),A
41810 LD (40999),A
41813 POP DE Restore the saved source, the saved pointer, the saved character record, the saved count and the saved schedule entry from the stack.
41814 POP HL
41815 POP IX
41817 POP BC
41818 POP IY
41820 RET Return.
Prev: 41661 Up: Map Next: 41821