Prev: CD46 Up: Map Next: CDB2
CD78: Print Double Height
Prints C ROM-font characters from HL to screen address DE at double height.
Input
HL Pointer to the ASCII characters
DE Destination screen address
C Number of characters to print
Print_Double_Height CD78 PUSH HL Stash the character pointer and screen address on the stack.
CD79 PUSH DE
CD7A PUSH DE Stash the screen address on the stack.
CD7B LD A,(HL) Fetch the next character.
CD7C LD D,$00 Convert the character to a font offset.
CD7E RLA
CD7F RL D
CD81 RLA
CD82 RL D
CD84 RLA
CD85 RL D
CD87 AND %11111000 Keep only bits 3-7.
CD89 LD E,A Store the font offset in E.
CD8A LD HL,($5C36) Point HL at the ROM font.
CD8D ADD HL,DE Point HL at the glyph.
CD8E POP DE Restore the screen address from the stack.
CD8F LD B,$04 Set the row counter to 04 in B.
Copy the top half of the glyph at double height.
Print_Double_Height_Top CD91 LD A,(HL) Write 04 glyph bytes to the screen, doubling each row.
CD92 LD (DE),A
CD93 INC D
CD94 LD (DE),A
CD95 INC D
CD96 INC HL
CD97 DJNZ Print_Double_Height_Top
Move the screen address down one character row.
CD99 PUSH HL Point DE at the next character row (using the stack).
CD9A LD HL,$F820
CD9D ADD HL,DE
CD9E EX DE,HL
CD9F POP HL
CDA0 LD B,$04 Set the row counter to 04 in B.
Copy the bottom half of the glyph at double height.
Print_Double_Height_Bottom CDA2 LD A,(HL) Write 04 glyph bytes to the screen, doubling each row.
CDA3 LD (DE),A
CDA4 INC D
CDA5 LD (DE),A
CDA6 INC D
CDA7 INC HL
CDA8 DJNZ Print_Double_Height_Bottom
CDAA POP DE Restore the screen address from the stack.
CDAB INC E Advance the screen address by one.
CDAC POP HL Restore the character pointer from the stack.
CDAD INC HL Advance the character pointer.
CDAE DEC C Decrease the character counter by one, and jump to Print_Double_Height until all characters are printed.
CDAF JR NZ,Print_Double_Height
CDB1 RET Return.
Prev: CD46 Up: Map Next: CDB2