Prev: 99B4 Up: Map Next: 99FB
99E0: Find a character's table entry
Searches the character table C9BA for character A and returns IY pointing at its entry (or at the $FF end marker, with A=$FF, if it is not there).
Input
A Character
Output
IY Table entry
99E0 PUSH DE Save DE and BC
99E1 PUSH BC
99E2 LD B,A B = the character being searched for
99E3 LD HL,$C9BA HL = the start of the character table
99E6 LD DE,$0007
99E9 LD A,(HL) A = this entry's own character number
99EA CP B Is it the one we want?
99EB JR Z,$99F5
99ED CP $FF Is this the end of the table?
99EF JR Z,$99F5
99F1 ADD HL,DE Neither: move on to the next entry
99F2 JP $99E9
99F5 POP BC Found it (or reached the end): restore BC and DE
99F6 POP DE
99F7 PUSH HL IY = the entry (or the end marker)
99F8 POP IY
99FA RET
Prev: 99B4 Up: Map Next: 99FB