Prev: BC7A Up: Map Next: BCB4
BC8B: Print Text
Used by the routine at PrintTextSingleColour.
Prints each character of a line of text and sets the attribute of its cell. DE' holds the colour, HL' holds the address in the attribute file, and HL holds the address in the screen buffer.
Find the attribute address.
PrintText BC8B EXX Switch to the shadow registers.
BC8C POP HL Fetch the pixel position.
BC8D PUSH DE Stash the address of the text on the stack.
BC8E CALL CalculateAttributeAddress Call CalculateAttributeAddress.
BC91 LD L,E Copy it to HL'.
BC92 LD H,D
BC93 POP DE Restore the address of the text from the stack.
Print each character and set its attribute.
PrintText_Next BC94 EXX Switch back to the main registers.
BC95 LD A,(DE) Fetch a character of the text.
BC96 BIT 7,A Jump to PrintText_Last if it is the last.
BC98 JR NZ,PrintText_Last
BC9A PUSH DE Stash the address of the text on the stack.
BC9B CALL PrintCharacter Call PrintCharacter.
BC9E POP DE Restore the address of the text from the stack.
BC9F INC DE Move on to the next character.
BCA0 EXX Switch to the shadow registers.
BCA1 EX AF,AF' Fetch the attribute.
BCA2 LD (HL),A Set the attribute of the cell.
BCA3 INC L Move on to the next cell.
BCA4 EX AF,AF' Keep the attribute in AF'.
BCA5 JR PrintText_Next Jump to PrintText_Next.
Print the last character.
PrintText_Last BCA7 AND %01111111 Keep only bits 0 to 6.
BCA9 PUSH DE Stash the address of the text on the stack.
BCAA CALL PrintCharacter Call PrintCharacter.
BCAD POP DE Restore the address of the text from the stack.
BCAE INC DE Move on past the text.
BCAF EXX Switch to the shadow registers.
BCB0 EX AF,AF' Fetch the attribute.
BCB1 LD (HL),A Set the attribute of the last cell.
BCB2 EXX Switch back to the main registers.
BCB3 RET Return.
Prev: BC7A Up: Map Next: BCB4