Prev: BB9D Up: Map Next: BBEB
BBB1: Print Text Standard Font
Used by the routines at UpdatePanel and GameOver.
Prints a line of text, which starts with its attribute, using the ASCII font at 6188. The last character of the text has bit 7 set. Each character cell has its attribute set as well.
Input
DE Address of the text
HL Pixel position
Point at the ASCII font and fetch the attribute from the text.
PrintTextStandardFont BBB1 PUSH HL Stash the pixel position on the stack.
BBB2 LD HL,$6188 Point HL at 6188.
BBB5 LD ($5B27),HL Set FontPointer.
BBB8 POP BC Copy the pixel position to BC (using the stack).
BBB9 PUSH BC
BBBA CALL CalculateBufferAddress Call CalculateBufferAddress.
BBBD LD L,C Copy it to HL.
BBBE LD H,B
BBBF LD A,(DE) Fetch the attribute of the text.
BBC0 EX AF,AF' Keep the attribute in AF'.
BBC1 INC DE Move on to the first character.
This entry point is used by the routine at PrintTextSingleColour.
Find the attribute address.
PrintTextStandardFont_PrintLine BBC2 EXX Switch to the shadow registers.
BBC3 POP HL Fetch the pixel position.
BBC4 PUSH DE Stash the address of the text on the stack.
BBC5 CALL CalculateAttributeAddress Call CalculateAttributeAddress.
BBC8 LD L,E Copy it to HL.
BBC9 LD H,D
BBCA POP DE Restore the address of the text from the stack.
Print each character and set its attribute.
PrintTextStandardFont_NextCharacter BBCB EXX Switch back to the main registers.
BBCC LD A,(DE) Fetch a character of the text.
BBCD BIT 7,A Jump to PrintTextStandardFont_LastCharacter if it is the last.
BBCF JR NZ,PrintTextStandardFont_LastCharacter
BBD1 PUSH DE Stash the address of the text on the stack.
BBD2 CALL PrintCharacter Call PrintCharacter.
BBD5 POP DE Restore the address of the text from the stack.
BBD6 INC DE Move on to the next character.
BBD7 EXX Switch to the shadow registers.
BBD8 EX AF,AF' Fetch the attribute.
BBD9 LD (HL),A Set the attribute of the cell.
BBDA INC L Move on to the next cell.
BBDB EX AF,AF' Keep the attribute in AF'.
BBDC JR PrintTextStandardFont_NextCharacter Jump to PrintTextStandardFont_NextCharacter.
Print the last character.
PrintTextStandardFont_LastCharacter BBDE AND %01111111 Keep only bits 0 to 6.
BBE0 PUSH DE Stash the address of the text on the stack.
BBE1 CALL PrintCharacter Call PrintCharacter.
BBE4 POP DE Restore the address of the text from the stack.
BBE5 INC DE Move on past the text.
BBE6 EXX Switch to the shadow registers.
BBE7 EX AF,AF' Fetch the attribute.
BBE8 LD (HL),A Set the attribute of the last cell.
BBE9 EXX Switch back to the main registers.
BBEA RET Return.
View the equivalent code in;
Prev: BB9D Up: Map Next: BBEB