Prev: 41824 Up: Map Next: 42004
41853: Process Object Display
Used by the routines at ProcessObjectDisplay and CheckAndResetCharacterState.
Clears the object-processing flag, reads this object's attributes, and prints the tokens the display bits select.
ProcessObject_Display 41853 XOR A Clear the object processing source flag.
41854 LD (41000),A
41857 LD A,(41821) Call CalculateObjectTableOffset to calculate object table offset.
41860 CALL CalculateObjectTableOffset
41863 PUSH HL Call ExtractObjectAttributes to extract object attributes.
41864 POP IX
41866 PUSH HL
41867 CALL ExtractObjectAttributes
41870 CALL CheckDisplayBitsThreeAndSeven Call CheckDisplayBitsThreeAndSeven to test bits 3 and 7 of the object attribute.
41873 CALL CheckDisplayBitsTwoAndSix Call CheckDisplayBitsTwoAndSix to test bits 2 and 6 of the object attribute.
41876 POP HL Restore HL from the stack.
41877 LD A,(40989) Read the byte at ObjectAttributeValue into C, save HL and take an offset of 0006.
41880 LD C,A
41881 PUSH HL
41882 LD DE,6
41885 ADD HL,DE Call ExtractTokenFromText to print the token.
41886 CALL ExtractTokenFromText
41889 POP HL
41890 CALL ExtractTokenFromText Call ExtractTokenFromText, then jump ahead to ProcessObject_Display_0 if bit 3 of C is clear.
41893 BIT 3,C
41895 JR Z,ProcessObject_Display_0
41897 BIT 5,C If bit 5 of the token is set, call ExtractTokenFromText to extract the token.
41899 CALL NZ,ExtractTokenFromText
41902 LD A,(40990) If bit 7 of the saved token is set, call ExtractTokenFromText to extract the token.
41905 BIT 7,A
41907 CALL NZ,ExtractTokenFromText
41910 LD A,(41822) Jump to ProcessObject_Display_Next if the saved object field at 41822 is not 254.
41913 CP 254
41915 JR NZ,ProcessObject_Display_Next
41917 PUSH HL Point HL at DisplayPointer and call ShiftTextPointer, keeping the saved pointer.
41918 LD HL,(41007)
41921 CALL ShiftTextPointer
41924 POP HL
41925 JR ProcessObject_Display_0 The picture marker has been handled and the saved pointer is already back in HL, so carry on at ProcessObject_Display_0.
Compare this object with the character being processed, and take the token at 1371 when they match.
ProcessObject_Display_Next 41927 PUSH HL Jump ahead to ProcessObject_Display_DisplayModePicture if this object is not the character being processed.
41928 LD HL,41014
41931 CP (HL)
41932 JR NZ,ProcessObject_Display_DisplayModePicture
41934 LD DE,1371 Take 1371 for the object, then call PrintTextToken to print token 1371.
41937 CALL PrintTextToken
41940 JR ProcessObject_Display_WorkspaceBringingSaved The token for the character being processed has been printed, so skip the location data and carry on at ProcessObject_Display_WorkspaceBringingSaved.
When the display mode is the picture marker, run the location data in the saved object fields.
ProcessObject_Display_DisplayModePicture 41942 LD A,(40975) Read the display mode.
41945 CP 5 See whether the display mode is 5 and read the saved object field at 41822, then call ProcessLocationDataIfValid to run location data if valid.
41947 LD A,(41822)
41950 CALL ProcessLocationDataIfValid
ProcessObject_Display_WorkspaceBringingSaved 41953 POP HL Restore the saved pointer from the stack.
ProcessObject_Display_0 41954 LD A,(41823) Jump ahead to PrintFullStop if the saved object field at 41823 is 255.
41957 CP 255
41959 JR Z,PrintFullStop
41961 BIT 2,C Jump ahead to PrintFullStop if bit 2 is clear.
41963 JR Z,PrintFullStop
41965 BIT 5,C If bit 5 of the token is clear, call ExtractTokenFromText to extract the token.
41967 CALL Z,ExtractTokenFromText
41970 LD A,(40990) If bit 7 of the display flag at 40990 is clear, call ExtractTokenFromText to extract the token.
41973 BIT 7,A
41975 CALL Z,ExtractTokenFromText
41978 LD A,(41823) Jump to ProcessObject_Display_OtherDisplayMode if the saved object field at 41823 is not 254.
41981 CP 254
41983 JR NZ,ProcessObject_Display_OtherDisplayMode
41985 LD HL,(41009) Read the display pointer, then call ShiftTextPointer to handle the picture for this message.
41988 CALL ShiftTextPointer
41991 JR PrintFullStop Jump ahead to PrintFullStop to take 46 and jump to Print_Character.
When the other display mode is the picture marker, run the location data in the saved object fields.
ProcessObject_Display_OtherDisplayMode 41993 LD A,(40976) Read the display mode.
41996 CP 5 See whether the display mode is 5 and read the saved object field at 41823, then call ProcessLocationDataIfValid to run location data if valid.
41998 LD A,(41823)
42001 CALL ProcessLocationDataIfValid
Prev: 41824 Up: Map Next: 42004