Prev: AB91 Up: Map Next: AC24
ABF3: Match Character Pair
Used by the routines at CopyDisplayIfNeeded and CheckDisplayMode.
Scans the character-id pairs at 994D for the two characters being compared, and stops at the zero word that ends the table.
MatchCharacterPair ABF3 CALL SaveTextPointer Call SaveTextPointer, and call it again if it returns 80.
ABF6 CP $80
ABF8 CALL Z,SaveTextPointer
ABFB LD A,B Use the character pairs (994D).
ABFC AND $0F
ABFE LD B,A
ABFF LD HL,$994D
MatchCharacterPair_Loop AC02 LD A,(HL) Go to MatchCharacterPair_Next if this word is zero.
AC03 INC HL
AC04 OR (HL)
AC05 JR Z,MatchCharacterPair_Next
AC07 LD A,B Jump ahead to MatchCharacterPair_0 if this pair's first id differs.
AC08 CP (HL)
AC09 JR NZ,MatchCharacterPair_0
AC0B DEC HL Jump ahead to MatchCharacterPair_CharacterScriptPosition if this pair's second id matches.
AC0C LD A,C
AC0D CP (HL)
AC0E JR Z,MatchCharacterPair_CharacterScriptPosition
AC10 INC HL Step to the next character.
MatchCharacterPair_0 AC11 INC HL Step to the next character pair and go back to MatchCharacterPair_Loop.
AC12 JR MatchCharacterPair_Loop
MatchCharacterPair_Next AC14 OR %00000001 Reset the zero flag.
AC16 RET Return.
Store this character's id and script position, then clear the link bit.
MatchCharacterPair_CharacterScriptPosition AC17 LD (IY+$00),C Store BC at IY+00-01 and clear bit 1 of E.
AC1A LD (IY+$01),B
AC1D RES 1,E
AC1F CALL SaveTextPointer Call SaveTextPointer to save the text pointer.
AC22 XOR A Clear A.
AC23 RET Return.
Prev: AB91 Up: Map Next: AC24