Prev: BEB3 Up: Map Next: BEE4
BEBF: 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 BEBF EXX Switch to the shadow registers.
BEC0 LD A,(DE) Fetch the attribute of the line.
BEC1 LD ($5BB6),A Set TextAttribute.
BEC4 INC DE Move on to the next attribute.
BEC5 EXX Switch back to the main registers.
BEC6 PUSH BC Stash the number of lines on the stack.
BEC7 LD A,(HL) Fetch the x position.
BEC8 INC HL Move on to the next pair of positions.
BEC9 INC HL
BECA PUSH HL Stash the address of the next pair on the stack.
BECB DEC HL Point HL at the y position.
BECC LD H,(HL) Fetch the y position.
BECD LD L,A Set the x position.
BECE CALL PrintTextSingleColour Call PrintTextSingleColour.
BED1 POP HL Restore the address of the next pair from the stack.
BED2 POP BC Restore the number of lines from the stack.
BED3 DJNZ DisplayTextList Jump to DisplayTextList until all of the lines have been printed.
Draw the border the first time.
BED5 LD A,($5BB8) Return if BorderDrawnFlag is set.
BED8 AND A
BED9 RET NZ
BEDA INC A Write 01 to *BorderDrawnFlag.
BEDB LD ($5BB8),A
BEDE CALL PrintBorder Call PrintBorder.
BEE1 JP UpdateScreen Jump to UpdateScreen.
View the equivalent code in;
Prev: BEB3 Up: Map Next: BEE4