Prev: B68F Up: Map Next: B6BD
B69F: Get word from dictionary using index
Used by the routines at String_WriteSpecial and Word_PrintFromIndex.
Input
A Index of word to search for.
Dictionary_GetWord B69F LD HL,Word_Table Start of words and size of data struct.
B6A2 LD DE,$0003
B6A5 LD C,D Keep a copy of structure size.
B6A6 LD B,D
Dictionary_GetWord_0 B6A7 CP (HL) See if the index of word we want is within range of group.
B6A8 JR C,Dictionary_GetWord_1 If it is less, then we have passed the group we want...
B6AA ADD HL,DE Move into next word group.
B6AB INC C Increase word length by one.
B6AC JR Dictionary_GetWord_0 Try next group.
Dictionary_GetWord_1 B6AE AND A Move back to previous word group.
B6AF SBC HL,DE
B6B1 SUB (HL) Get offset index for the word we actually want.
B6B2 INC HL
B6B3 LD E,(HL) Get start of word group.
B6B4 INC HL
B6B5 LD D,(HL)
B6B6 EX DE,HL
B6B7 RET Z
Dictionary_GetWord_2 B6B8 ADD HL,BC Search to the word we want.
B6B9 DEC A
B6BA JR NZ,Dictionary_GetWord_2
B6BC RET Return address of word in HL.
Prev: B68F Up: Map Next: B6BD