Prev: 89EF Up: Map Next: 8A37
8A11: Print Colour String
Print a bit-7-terminated string using the attribute byte stored in front of the text.
Input
DE Pointer to string data
HL Pixel address co-ordinates
PrintStringColour 8A11 PUSH HL Stash HL on the stack.
8A12 CALL ScreenAddress Call ScreenAddress.
8A15 LD A,(DE) Fetch the attribute byte.
8A16 EX AF,AF' Switch to the shadow AF register.
8A17 INC DE Increment DE by one to point to the text of the string.
8A18 EXX Switch to the shadow registers.
8A19 POP HL Restore HL from the stack.
8A1A CALL AttributeAddress Call AttributeAddress.
This entry point is used by the routine at MenuWriteText.
Print each character with its attribute until the string terminator is reached.
PrintString_Loop 8A1D EXX Switch back to the normal registers.
8A1E LD A,(DE) Fetch the character to print.
8A1F BIT 7,A Jump to PrintString_LastCharacter if bit 7 is set (end of the string).
8A21 JR NZ,PrintString_LastCharacter
8A23 CALL PrintScreen Call PrintScreen.
Move to the next character and write this cell's attribute.
8A26 INC DE Increment DE by one.
8A27 EXX Switch to the shadow registers.
8A28 EX AF,AF' Switch to the shadow AF register.
8A29 LD (HL),A Copy the attribute byte to the screen.
8A2A INC L Increment L by one.
8A2B EX AF,AF' Switch to the shadow AF register.
8A2C JR PrintString_Loop Jump to PrintString_Loop.
Because the last character contains the terminator, it needs to be handled separately.
PrintString_LastCharacter 8A2E AND %01111111 Keep only bits 0-6 (i.e. strip the bit 7 terminator).
8A30 CALL PrintScreen Call PrintScreen.
8A33 EXX Switch to the shadow registers.
8A34 EX AF,AF' Switch to the shadow AF register.
8A35 LD (HL),A Copy the attribute byte to the screen.
8A36 RET Return.
Prev: 89EF Up: Map Next: 8A37