Prev: 48165 Up: Map Next: 48214
48177: Display Text List
Used by the routines at GameOver and GameCompleted.
Prints a list of lines of text in the screen buffer, each in its own colour. DE' points at the attributes, HL at pairs of pixel x and y positions, and DE at the text. After the lines have been printed the border is drawn and the buffer is copied to the screen, unless BorderDrawnFlag is already set.
Input
B Number of lines
DE Address of the text
HL Address of the list of positions
DE' Address of the list of attributes
Print one line from the three lists.
DisplayTextList 48177 EXX Switch to the shadow registers.
48178 LD A,(DE) Fetch the attribute of the line.
48179 LD (23318),A Set TextAttribute.
48182 INC DE Move on to the next attribute.
48183 EXX Switch back to the main registers.
48184 PUSH BC Stash the number of lines on the stack.
48185 LD A,(HL) Fetch the x position.
48186 INC HL Move on to the next pair of positions.
48187 INC HL
48188 PUSH HL Stash the address of the next pair on the stack.
48189 DEC HL Point HL at the y position.
48190 LD H,(HL) Fetch the y position.
48191 LD L,A Set the x position.
48192 CALL PrintTextSingleColour Call PrintTextSingleColour.
48195 POP HL Restore the address of the next pair from the stack.
48196 POP BC Restore the number of lines from the stack.
48197 DJNZ DisplayTextList Jump to DisplayTextList until all of the lines have been printed.
Draw the border the first time.
48199 LD A,(23320) Return if BorderDrawnFlag is set.
48202 AND A
48203 RET NZ
48204 INC A Write 1 to *BorderDrawnFlag.
48205 LD (23320),A
48208 CALL PrintBorder Call PrintBorder.
48211 JP UpdateScreen Jump to UpdateScreen.
View the equivalent code in;
Prev: 48165 Up: Map Next: 48214