Prev: CB79 Up: Map Next: CBA7
CB7B: Get Display Address Based On Flag
Picks a token number from the graphics flag. Pointed at by C7A1.
GetDisplayAddressBasedOnFlag CB7B LD A,($CB79) Read the token select flag at CB79 and take the token table at C471.
CB7E BIT 7,A
CB80 LD HL,$C471
CB83 JR Z,GetDisplayAddressBasedOnFlag_Next Jump ahead to GetDisplayAddressBasedOnFlag_Next if bit 7 of the token select flag is clear.
CB85 LD HL,$C481 Take the token table at C481.
GetDisplayAddressBasedOnFlag_Next CB88 OR $80 Force a non-zero result so the caller continues.
GetDisplayAddressBasedOnFlag_Loop CB8A LD E,(HL) Read the next token number and repeat from GetDisplayAddressBasedOnFlag_Loop while this bit of the flag is clear.
CB8B INC HL
CB8C LD D,(HL)
CB8D INC HL
CB8E RRCA
CB8F JR NC,GetDisplayAddressBasedOnFlag_Loop
CB91 LD A,D Jump back to SelectSherlock if this token word is zero.
CB92 OR E
CB93 JR Z,SelectSherlock
CB95 LD A,($CB7A) Record the room display parameter.
CB98 LD ($A034),A
CB9B LD HL,$6817 Use the introduction (680B+0C).
CB9E CALL PrintTextAndHandleControlCharacters Call PrintTextAndHandleControlCharacters to print this message, then call PrintTextToken to extract token from text.
CBA1 CALL PrintTextToken
CBA4 JP PrintNewline Jump back to PrintNewline to print newline.
Prev: CB79 Up: Map Next: CBA7