Prev: 46511 Up: Map Next: 46571
46539: Print Character
Prints a single character to the display file, at a character position.
Before After
print-character-before print-character-after
Input
A Character code
HL Screen address
Output
HL Screen address of the next column
PrintScreen 46539 PUSH BC Save the registers.
46540 PUSH DE
46541 PUSH HL
46542 LD L,A Multiply the character code by 8, using doubling.
46543 LD H,0
46545 ADD HL,HL
46546 ADD HL,HL
46547 ADD HL,HL
46548 LD DE,(38424) Add the address of the current character set.
46552 ADD HL,DE
46553 EX DE,HL Point DE at the graphics of the character.
46554 POP HL Restore the screen address.
46555 LD B,8 There are 8 pixel rows in a character.
PrintScreen_Row 46557 LD A,(DE) Fetch a pixel row of the character.
46558 LD (HL),A Write it to the screen.
46559 INC DE Move on to the next pixel row of the character.
46560 INC H Move down to the next pixel row on the screen.
46561 DJNZ PrintScreen_Row Loop back until the whole character has been printed.
46563 POP DE Restore the registers.
46564 POP BC
46565 LD A,H Move back up to the top of the character.
46566 SUB 8
46568 LD H,A
46569 INC L Move on to the next column.
46570 RET Return.
Prev: 46511 Up: Map Next: 46571