Prev: 8092 Up: Map Next: 80FF
80D1: Print a character on screen
Used by the routine at 8092.
Input
A ID of the character to print.
HL Location on screen.
80D1 PUSH HL Remember the screen location.
80D2 LD DE,$813B 813B = character set
80D5 LD L,A Multiply the ID by 8 to get the right offset and store this in DE.
80D6 LD H,$00
80D8 ADD HL,HL
80D9 ADD HL,HL
80DA ADD HL,HL
80DB ADD HL,DE
80DC EX DE,HL
80DD POP HL Restore screen location.
80DE PUSH HL Remember screen location (again).
80DF LD B,$05 Five lines.
80E1 LD A,(DE) Get the current line.
80E2 LD (HL),A Copy it to screen.
80E3 INC DE Next line in data.
80E4 INC H Next line on screen.
80E5 DJNZ $80E1 Repeat for the right number of lines.
80E7 POP HL Restore screen location.
80E8 PUSH HL Remember screen location again.
80E9 LD BC,$FD20 Subtract 02E0 to move up a third.
80EC ADD HL,BC
80ED LD B,$03 Three remaining lines.
80EF LD A,(DE) Get the current line.
80F0 LD (HL),A Copy it to screen.
80F1 INC DE Next line in data.
80F2 INC H Next line on screen.
80F3 DJNZ $80EF Repeat for the right number of lines.
80F5 LD C,$47 Lower attribute is always 47
80F7 LD A,(IX+$03) Get the upper attribute.
80FA CALL $80FF Display the attributes.
80FD POP HL Clean up the stack and return.
80FE RET
Prev: 8092 Up: Map Next: 80FF