Prev: 763D Up: Map Next: 768E
766D: Print a character using the ROM font
Draws character A at screen address HL using the Spectrum ROM's character set at $3D00 (8 x 8 pixels), then moves HL on to the next character cell. Used only for the lower (input) window.
Input
A Character
HL Screen address
Output
HL Next character position
766D PUSH AF Save the registers this uses
766E PUSH BC
766F PUSH DE
7670 PUSH HL
7671 SUB $20 A = the character code, counted from the space character
7673 LD L,A
7674 LD H,$00
7676 ADD HL,HL ...times 8, since each character's bitmap is 8 bytes...
7677 ADD HL,HL
7678 ADD HL,HL
7679 LD DE,$3D00 ...added to the start of the ROM's own character set
767C ADD HL,DE
767D EX DE,HL DE = the character's own bitmap
767E POP HL HL = where to draw it (put back for a moment)
767F PUSH HL
7680 LD B,$08 Eight pixel rows to copy
7682 LD A,(DE) Copy one row of the bitmap...
7683 LD (HL),A
7684 INC DE Move on to the next row of the bitmap...
7685 INC H ...and the next pixel line on screen (the odd layout means +$100)
7686 DJNZ $7682
7688 POP HL Restore HL and the other saved registers
7689 POP DE
768A POP BC
768B POP AF
768C INC L Move on to the next character cell
768D RET
Prev: 763D Up: Map Next: 768E