Prev: CC0B Up: Map Next: CC29
CC0E: Find Character
Used by the routines at CC37 and DC6C.
Input
A Character ID
Output
A The character ID or FF if it wasn't found
IY Pointer to character data
F The zero flag will be set if the character wasn't found
Stash some registers so they don't get corrrupted.
FindCharacter CC0E PUSH DE Stash DE and BC on the stack.
CC0F PUSH BC
CC10 LD C,A Store the character ID in C.
CC11 LD DE,$0008 Load the length of the character data 0008 bytes into DE.
CC14 LD IY,$9860 IY=Table_Timetable.
FindCharacter_Loop CC18 LD A,(IY+$00) Fetch the current characters ID from the timetable pointer.
CC1B CP C Jump to FindCharacter_Return if this character ID and the requested character ID match.
CC1C JR Z,FindCharacter_Return
CC1E CP $FF Jump to FindCharacter_Return if the termination character has been reached (FF).
CC20 JR Z,FindCharacter_Return
CC22 ADD IY,DE Add 0008 bytes to the timetable pointer to move to the next set of character data.
CC24 JR FindCharacter_Loop Jump to FindCharacter_Loop.
Return with some housekeeping.
FindCharacter_Return CC26 POP BC Restore BC and DE from the stack.
CC27 POP DE
CC28 RET Return.
Prev: CC0B Up: Map Next: CC29