![]() |
Routines |
| Prev: 48819 | Up: Map | Next: 48868 |
|
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.
|
||||||||||||||
|
Print one line from the three lists.
|
||||||||||||||
| DisplayTextList | 48831 | EXX | Switch to the shadow registers. | |||||||||||
| 48832 | LD A,(DE) | Fetch the attribute of the line. | ||||||||||||
| 48833 | LD (23478),A | Set TextAttribute. | ||||||||||||
| 48836 | INC DE | Move on to the next attribute. | ||||||||||||
| 48837 | EXX | Switch back to the main registers. | ||||||||||||
| 48838 | PUSH BC | Stash the number of lines on the stack. | ||||||||||||
| 48839 | LD A,(HL) | Fetch the x position. | ||||||||||||
| 48840 | INC HL | Move on to the next pair of positions. | ||||||||||||
| 48841 | INC HL | |||||||||||||
| 48842 | PUSH HL | Stash the address of the next pair on the stack. | ||||||||||||
| 48843 | DEC HL | Point HL at the y position. | ||||||||||||
| 48844 | LD H,(HL) | Fetch the y position. | ||||||||||||
| 48845 | LD L,A | Set the x position. | ||||||||||||
| 48846 | CALL PrintTextSingleColour | Call PrintTextSingleColour. | ||||||||||||
| 48849 | POP HL | Restore the address of the next pair from the stack. | ||||||||||||
| 48850 | POP BC | Restore the number of lines from the stack. | ||||||||||||
| 48851 | DJNZ DisplayTextList | Jump to DisplayTextList until all of the lines have been printed. | ||||||||||||
|
Draw the border the first time.
|
||||||||||||||
| 48853 | LD A,(23480) | Return if BorderDrawnFlag is set. | ||||||||||||
| 48856 | AND A | |||||||||||||
| 48857 | RET NZ | |||||||||||||
| 48858 | INC A | Write 1 to *BorderDrawnFlag. | ||||||||||||
| 48859 | LD (23480),A | |||||||||||||
| 48862 | CALL PrintBorder | Call PrintBorder. | ||||||||||||
| 48865 | JP UpdateScreen | Jump to UpdateScreen. | ||||||||||||
|
View the equivalent code in;
|
||||||||||||||
| Prev: 48819 | Up: Map | Next: 48868 |