Prev: CAAE Up: Map Next: CB28
CAAF: Process Object Display Entry
Used by the routine at ProcessDisplayRecord.
Checks this character against Sherlock's disguise and returns when the disguise already matches.
CheckCharacterDisguise CAAF CALL CheckCharacterID Call CheckCharacterID to check the character id.
CAB2 RET Z Return if the character is 00 01 or Sherlock.
CAB3 LD A,($C491) Read the character id saved for the disguise check.
CAB6 LD HL,$A009 Use Sherlock's disguise as the pointer.
CAB9 CP (HL) See whether it matches Sherlock's disguise.
CABA RET Z Return if they match.
CABB LD A,($A036) Call GetObjectFirstLocation to read the object's first location.
CABE CALL GetObjectFirstLocation
CAC1 LD HL,$A009 Jump ahead to CheckCharacterDisguise_DisplayModeBelow if this is not Sherlock's disguise.
CAC4 CP (HL)
CAC5 JR NZ,CheckCharacterDisguise_DisplayModeBelow
CAC7 LD A,($A036) Read the character being processed and take the exits message, then call ProcessCharacterDisplay_TestDisplayFlagEnd to run character display.
CACA LD DE,$68ED
CACD CALL ProcessCharacterDisplay_TestDisplayFlagEnd
CheckCharacterDisguise_DisplayModeBelow CAD0 LD A,($A00F) Return if the display mode is below 07.
CAD3 CP $07
CAD5 RET C
CAD6 LD A,($A034) Call GetObjectFirstLocation to read the object's first location.
CAD9 CALL GetObjectFirstLocation
CADC CP $FF Go to CheckCharacterDisguise_OtherCharacterCompare when this is not the FF end marker.
CADE JR NZ,CheckCharacterDisguise_OtherCharacterCompare
CAE0 LD B,(IX+$00) Read the record's first byte into B and read Sherlock's disguise.
CAE3 LD A,($A009)
CheckCharacterDisguise_TestAttributeMatch CAE6 CP (IX+$0F) Jump ahead to CheckCharacterDisguise_CharacterBeingProcessed if this id matches the character attribute.
CAE9 JR Z,CheckCharacterDisguise_CharacterBeingProcessed
CAEB INC IX Count the next object and repeat from CheckCharacterDisguise_TestAttributeMatch.
CAED DJNZ CheckCharacterDisguise_TestAttributeMatch
CAEF RET Return.
Read the character being processed, then store the result in the count, then mark the entry as finished.
CheckCharacterDisguise_CharacterBeingProcessed CAF0 LD A,($A036) Read the current character.
CAF3 LD B,A
CAF4 LD A,$FF
CAF6 LD ($A036),A Record the current character.
CAF9 LD A,$01 Set the television flag to 01.
CAFB LD ($5C3C),A
CAFE LD A,($A009) Read Sherlock's disguise and call FindObjectByFieldTwo to find an object by field two.
CB01 CALL FindObjectByFieldTwo
CB04 CP $FF Call ReadSavedCharacter if the entry is not the end marker.
CB06 CALL NZ,ReadSavedCharacter
CB09 SUB A Store it in the system variables and store it in the character being processed.
CB0A LD ($5C3C),A
CB0D LD A,B
CB0E LD ($A036),A
CB11 RET Return.
Read the other character id, compare it with Sherlock's disguise, and return when they match.
CheckCharacterDisguise_OtherCharacterCompare CB12 LD A,($C492) Read the other character id saved for the disguise check.
CB15 LD HL,$A009 Use Sherlock's disguise as the pointer.
CB18 CP (HL) See whether it matches Sherlock's disguise.
CB19 RET Z Return if they match.
CB1A LD A,($A034) Read the room display parameter.
CB1D LD HL,$A036 Use the character being processed as the pointer.
CB20 CP (HL) See whether it matches the character being processed.
CB21 RET Z Return if they match.
CB22 LD DE,$68ED Point DE at the message at 68E9+04 and jump to ProcessCharacterDisplay_TestDisplayFlagEnd.
CB25 JP ProcessCharacterDisplay_TestDisplayFlagEnd
Prev: CAAE Up: Map Next: CB28