Prev: 48250 Up: Map Next: 48308
48267: 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 48267 EXX Switch to the shadow registers.
48268 POP HL Fetch the pixel position.
48269 PUSH DE Stash the address of the text on the stack.
48270 CALL CalculateAttributeAddress Call CalculateAttributeAddress.
48273 LD L,E Copy it to HL'.
48274 LD H,D
48275 POP DE Restore the address of the text from the stack.
Print each character and set its attribute.
PrintText_Next 48276 EXX Switch back to the main registers.
48277 LD A,(DE) Fetch a character of the text.
48278 BIT 7,A Jump to PrintText_Last if it is the last.
48280 JR NZ,PrintText_Last
48282 PUSH DE Stash the address of the text on the stack.
48283 CALL PrintCharacter Call PrintCharacter.
48286 POP DE Restore the address of the text from the stack.
48287 INC DE Move on to the next character.
48288 EXX Switch to the shadow registers.
48289 EX AF,AF' Fetch the attribute.
48290 LD (HL),A Set the attribute of the cell.
48291 INC L Move on to the next cell.
48292 EX AF,AF' Keep the attribute in AF'.
48293 JR PrintText_Next Jump to PrintText_Next.
Print the last character.
PrintText_Last 48295 AND %01111111 Keep only bits 0 to 6.
48297 PUSH DE Stash the address of the text on the stack.
48298 CALL PrintCharacter Call PrintCharacter.
48301 POP DE Restore the address of the text from the stack.
48302 INC DE Move on past the text.
48303 EXX Switch to the shadow registers.
48304 EX AF,AF' Fetch the attribute.
48305 LD (HL),A Set the attribute of the last cell.
48306 EXX Switch back to the main registers.
48307 RET Return.
Prev: 48250 Up: Map Next: 48308