Prev: 52089 Up: Map Next: 52135
52091: Get Display Address Based On Flag
Picks a token number from the graphics flag. Pointed at by 51105.
GetDisplayAddressBasedOnFlag 52091 LD A,(52089) Read the token select flag at 52089 and take the token table at 50289.
52094 BIT 7,A
52096 LD HL,50289
52099 JR Z,GetDisplayAddressBasedOnFlag_Next Jump ahead to GetDisplayAddressBasedOnFlag_Next if bit 7 of the token select flag is clear.
52101 LD HL,50305 Take the token table at 50305.
GetDisplayAddressBasedOnFlag_Next 52104 OR 128 Force a non-zero result so the caller continues.
GetDisplayAddressBasedOnFlag_Loop 52106 LD E,(HL) Read the next token number and repeat from GetDisplayAddressBasedOnFlag_Loop while this bit of the flag is clear.
52107 INC HL
52108 LD D,(HL)
52109 INC HL
52110 RRCA
52111 JR NC,GetDisplayAddressBasedOnFlag_Loop
52113 LD A,D Jump back to SelectSherlock if this token word is zero.
52114 OR E
52115 JR Z,SelectSherlock
52117 LD A,(52090) Record the room display parameter.
52120 LD (41012),A
52123 LD HL,26647 Use the introduction (26635+12).
52126 CALL PrintTextAndHandleControlCharacters Call PrintTextAndHandleControlCharacters to print this message, then call PrintTextToken to extract token from text.
52129 CALL PrintTextToken
52132 JP PrintNewline Jump back to PrintNewline to print newline.
Prev: 52089 Up: Map Next: 52135