Prev: A360 Up: Map Next: A414
A37D: 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 A37D XOR A Clear the object processing source flag.
A37E LD ($A028),A
A381 LD A,($A35D) Call CalculateObjectTableOffset to calculate object table offset.
A384 CALL CalculateObjectTableOffset
A387 PUSH HL Call ExtractObjectAttributes to extract object attributes.
A388 POP IX
A38A PUSH HL
A38B CALL ExtractObjectAttributes
A38E CALL CheckDisplayBitsThreeAndSeven Call CheckDisplayBitsThreeAndSeven to test bits 3 and 7 of the object attribute.
A391 CALL CheckDisplayBitsTwoAndSix Call CheckDisplayBitsTwoAndSix to test bits 2 and 6 of the object attribute.
A394 POP HL Restore HL from the stack.
A395 LD A,($A01D) Read the byte at ObjectAttributeValue into C, save HL and take an offset of 0006.
A398 LD C,A
A399 PUSH HL
A39A LD DE,$0006
A39D ADD HL,DE Call ExtractTokenFromText to print the token.
A39E CALL ExtractTokenFromText
A3A1 POP HL
A3A2 CALL ExtractTokenFromText Call ExtractTokenFromText, then jump ahead to ProcessObject_Display_0 if bit 3 of C is clear.
A3A5 BIT 3,C
A3A7 JR Z,ProcessObject_Display_0
A3A9 BIT 5,C If bit 5 of the token is set, call ExtractTokenFromText to extract the token.
A3AB CALL NZ,ExtractTokenFromText
A3AE LD A,($A01E) If bit 7 of the saved token is set, call ExtractTokenFromText to extract the token.
A3B1 BIT 7,A
A3B3 CALL NZ,ExtractTokenFromText
A3B6 LD A,($A35E) Jump to ProcessObject_Display_Next if the saved object field at A35E is not FE.
A3B9 CP $FE
A3BB JR NZ,ProcessObject_Display_Next
A3BD PUSH HL Point HL at DisplayPointer and call ShiftTextPointer, keeping the saved pointer.
A3BE LD HL,($A02F)
A3C1 CALL ShiftTextPointer
A3C4 POP HL
A3C5 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 055B when they match.
ProcessObject_Display_Next A3C7 PUSH HL Jump ahead to ProcessObject_Display_DisplayModePicture if this object is not the character being processed.
A3C8 LD HL,$A036
A3CB CP (HL)
A3CC JR NZ,ProcessObject_Display_DisplayModePicture
A3CE LD DE,$055B Take 055B for the object, then call PrintTextToken to print token 055B.
A3D1 CALL PrintTextToken
A3D4 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 A3D6 LD A,($A00F) Read the display mode.
A3D9 CP $05 See whether the display mode is 05 and read the saved object field at A35E, then call ProcessLocationDataIfValid to run location data if valid.
A3DB LD A,($A35E)
A3DE CALL ProcessLocationDataIfValid
ProcessObject_Display_WorkspaceBringingSaved A3E1 POP HL Restore the saved pointer from the stack.
ProcessObject_Display_0 A3E2 LD A,($A35F) Jump ahead to PrintFullStop if the saved object field at A35F is FF.
A3E5 CP $FF
A3E7 JR Z,PrintFullStop
A3E9 BIT 2,C Jump ahead to PrintFullStop if bit 2 is clear.
A3EB JR Z,PrintFullStop
A3ED BIT 5,C If bit 5 of the token is clear, call ExtractTokenFromText to extract the token.
A3EF CALL Z,ExtractTokenFromText
A3F2 LD A,($A01E) If bit 7 of the display flag at A01E is clear, call ExtractTokenFromText to extract the token.
A3F5 BIT 7,A
A3F7 CALL Z,ExtractTokenFromText
A3FA LD A,($A35F) Jump to ProcessObject_Display_OtherDisplayMode if the saved object field at A35F is not FE.
A3FD CP $FE
A3FF JR NZ,ProcessObject_Display_OtherDisplayMode
A401 LD HL,($A031) Read the display pointer, then call ShiftTextPointer to handle the picture for this message.
A404 CALL ShiftTextPointer
A407 JR PrintFullStop Jump ahead to PrintFullStop to take 2E 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 A409 LD A,($A010) Read the display mode.
A40C CP $05 See whether the display mode is 05 and read the saved object field at A35F, then call ProcessLocationDataIfValid to run location data if valid.
A40E LD A,($A35F)
A411 CALL ProcessLocationDataIfValid
Prev: A360 Up: Map Next: A414