Prev: BC25 Up: Map Next: BC56
BC31: 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 BC31 EXX Switch to the shadow registers.
BC32 LD A,(DE) Fetch the attribute of the line.
BC33 LD ($5B16),A Set TextAttribute.
BC36 INC DE Move on to the next attribute.
BC37 EXX Switch back to the main registers.
BC38 PUSH BC Stash the number of lines on the stack.
BC39 LD A,(HL) Fetch the x position.
BC3A INC HL Move on to the next pair of positions.
BC3B INC HL
BC3C PUSH HL Stash the address of the next pair on the stack.
BC3D DEC HL Point HL at the y position.
BC3E LD H,(HL) Fetch the y position.
BC3F LD L,A Set the x position.
BC40 CALL PrintTextSingleColour Call PrintTextSingleColour.
BC43 POP HL Restore the address of the next pair from the stack.
BC44 POP BC Restore the number of lines from the stack.
BC45 DJNZ DisplayTextList Jump to DisplayTextList until all of the lines have been printed.
Draw the border the first time.
BC47 LD A,($5B18) Return if BorderDrawnFlag is set.
BC4A AND A
BC4B RET NZ
BC4C INC A Write 01 to *BorderDrawnFlag.
BC4D LD ($5B18),A
BC50 CALL PrintBorder Call PrintBorder.
BC53 JP UpdateScreen Jump to UpdateScreen.
View the equivalent code in;
Prev: BC25 Up: Map Next: BC56