![]() |
Routines |
| Prev: BC7A | Up: Map | Next: BCB4 |
|
Used by the routine at PRINT_TEXT_SINGLE_COLOUR.
The rest of PRINT_TEXT_SINGLE_COLOUR. The position is on the stack. In the alternate registers HL' becomes the attribute address of the first cell, while DE' is kept: the list printer in DISPLAY_MENU walks its list of colours with it. Then each character is drawn into the buffer by PRINT_CHAR, which leaves HL one cell to the right, and its cell in the attribute file is given the colour.
|
||||||||||||
| TEXT_ATTR_ADDR | BC8B | EXX | take the position off the stack into HL' | |||||||||
| BC8C | POP HL | |||||||||||
| BC8D | PUSH DE | HL' = the attribute address of the position (CALC_ATTRIB_ADDR); DE' kept | ||||||||||
| BC8E | CALL CALC_ATTRIB_ADDR | |||||||||||
| BC91 | LD L,E | |||||||||||
| BC92 | LD H,D | |||||||||||
| BC93 | POP DE | |||||||||||
| PRINT_TEXT_CHAR | BC94 | EXX | bit 7 marks the last character | |||||||||
| BC95 | LD A,(DE) | |||||||||||
| BC96 | BIT 7,A | |||||||||||
| BC98 | JR NZ,PRINT_TEXT_LAST | |||||||||||
| BC9A | PUSH DE | draw it, and move on in the string | ||||||||||
| BC9B | CALL PRINT_CHAR | |||||||||||
| BC9E | POP DE | |||||||||||
| BC9F | INC DE | |||||||||||
| BCA0 | EXX | colour its cell, one cell right, and loop | ||||||||||
| BCA1 | EX AF,AF' | |||||||||||
| BCA2 | LD (HL),A | |||||||||||
| BCA3 | INC L | |||||||||||
| BCA4 | EX AF,AF' | |||||||||||
| BCA5 | JR PRINT_TEXT_CHAR | |||||||||||
| PRINT_TEXT_LAST | BCA7 | AND $7F | the last character, without its end marker; DE ends past the string | |||||||||
| BCA9 | PUSH DE | |||||||||||
| BCAA | CALL PRINT_CHAR | |||||||||||
| BCAD | POP DE | |||||||||||
| BCAE | INC DE | |||||||||||
| BCAF | EXX | colour its cell | ||||||||||
| BCB0 | EX AF,AF' | |||||||||||
| BCB1 | LD (HL),A | |||||||||||
| BCB2 | EXX | |||||||||||
| BCB3 | RET | |||||||||||
|
The PUSH DE and POP DE round each call of PRINT_CHAR are not needed: it keeps DE itself.
|
||||||||||||
| Prev: BC7A | Up: Map | Next: BCB4 |