Prev: CBA7 Up: Map Next: CC0B
CBC2: Process Character Display
Used by the routine at CheckCharacterDisguise.
See whether the display flag is the end marker before returning.
ProcessCharacterDisplay_TestDisplayFlagEnd CBC2 CP $FF Return if the character is the end marker.
CBC4 RET Z
CBC5 AND A Return if the character is zero.
CBC6 RET Z
CBC7 LD B,A Call GetObjectFirstLocation to read the object's first location.
CBC8 CALL GetObjectFirstLocation
CBCB LD C,A Store the result in the low byte of the count.
CBCC LD A,($A009) Read Sherlock's disguise.
CBCF CP C See whether the two values match.
CBD0 RET NZ Return if they differ.
CBD1 LD A,$01 Write 01 to the system Variables.
CBD3 LD ($5C3C),A
CBD6 PUSH DE
ProcessCharacterDisplay_LookObject CBD7 LD A,B Call FetchObjectDataPointer to look up that object.
CBD8 CALL FetchObjectDataPointer
CBDB LD A,(IX+$01) Jump to ProcessCharacterDisplay_CountExchangeAddress if the moved marker is FF.
CBDE CP $FF
CBE0 JR Z,ProcessCharacterDisplay_CountExchangeAddress
CBE2 LD B,A Jump back to ProcessCharacterDisplay_LookObject to take the count, call FetchObjectDataPointer to fetch object data pointer and read the moved marker.
CBE3 JR ProcessCharacterDisplay_LookObject
Point at the object attribute, remember the character, and switch to the one at Table_Timetable.
ProcessCharacterDisplay_CountExchangeAddress CBE5 LD A,B Take the count, then call PointToObjectAttributeByte to point to object attribute byte.
CBE6 CALL PointToObjectAttributeByte
CBE9 EX (SP),HL Read the current character.
CBEA LD A,($A036)
CBED PUSH AF
CBEE LD A,($9860) Call SetCharacterPointerAndID to set character pointer and id.
CBF1 LD ($A036),A
CBF4 CALL SetCharacterPointerAndID
CBF7 LD A,B Call CheckObjectLocationMatch to check object location match.
CBF8 CALL CheckObjectLocationMatch
CBFB JR NZ,ProcessCharacterDisplay_ResultCharacterBeing Jump ahead to ProcessCharacterDisplay_ResultCharacterBeing to set character pointer and id if CheckObjectLocationMatch does not return 00.
CBFD POP AF
CBFE POP HL
CBFF RET Return.
Put the saved character back and print the message.
ProcessCharacterDisplay_ResultCharacterBeing CC00 POP AF Call SetCharacterPointerAndID to set character pointer and id.
CC01 LD ($A036),A
CC04 CALL SetCharacterPointerAndID
CC07 CALL PrintTextAndHandleControlCharacters Call PrintTextAndHandleControlCharacters to print the message.
CC0A RET Return.
Prev: CBA7 Up: Map Next: CC0B