Prev: 48029 Up: Map Next: 48107
48049: 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 24968. 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 48049 PUSH HL Stash the pixel position on the stack.
48050 LD HL,24968 Point HL at 24968.
48053 LD (23335),HL Set FontPointer.
48056 POP BC Copy the pixel position to BC (using the stack).
48057 PUSH BC
48058 CALL CalculateBufferAddress Call CalculateBufferAddress.
48061 LD L,C Copy it to HL.
48062 LD H,B
48063 LD A,(DE) Fetch the attribute of the text.
48064 EX AF,AF' Keep the attribute in AF'.
48065 INC DE Move on to the first character.
This entry point is used by the routine at PrintTextSingleColour.
Find the attribute address.
PrintTextStandardFont_PrintLine 48066 EXX Switch to the shadow registers.
48067 POP HL Fetch the pixel position.
48068 PUSH DE Stash the address of the text on the stack.
48069 CALL CalculateAttributeAddress Call CalculateAttributeAddress.
48072 LD L,E Copy it to HL.
48073 LD H,D
48074 POP DE Restore the address of the text from the stack.
Print each character and set its attribute.
PrintTextStandardFont_NextCharacter 48075 EXX Switch back to the main registers.
48076 LD A,(DE) Fetch a character of the text.
48077 BIT 7,A Jump to PrintTextStandardFont_LastCharacter if it is the last.
48079 JR NZ,PrintTextStandardFont_LastCharacter
48081 PUSH DE Stash the address of the text on the stack.
48082 CALL PrintCharacter Call PrintCharacter.
48085 POP DE Restore the address of the text from the stack.
48086 INC DE Move on to the next character.
48087 EXX Switch to the shadow registers.
48088 EX AF,AF' Fetch the attribute.
48089 LD (HL),A Set the attribute of the cell.
48090 INC L Move on to the next cell.
48091 EX AF,AF' Keep the attribute in AF'.
48092 JR PrintTextStandardFont_NextCharacter Jump to PrintTextStandardFont_NextCharacter.
Print the last character.
PrintTextStandardFont_LastCharacter 48094 AND %01111111 Keep only bits 0 to 6.
48096 PUSH DE Stash the address of the text on the stack.
48097 CALL PrintCharacter Call PrintCharacter.
48100 POP DE Restore the address of the text from the stack.
48101 INC DE Move on past the text.
48102 EXX Switch to the shadow registers.
48103 EX AF,AF' Fetch the attribute.
48104 LD (HL),A Set the attribute of the last cell.
48105 EXX Switch back to the main registers.
48106 RET Return.
View the equivalent code in;
Prev: 48029 Up: Map Next: 48107