Prev: 46435 Up: Map Next: 46505
46473: Print Character
Input
A ASCII value to print
HL Screen address
PrintScreen 46473 PUSH BC Stash BC, DE and HL on the stack.
46474 PUSH DE
46475 PUSH HL
46476 LD L,A Create an offset in HL.
46477 LD H,0
46479 ADD HL,HL Calculate offset for ASCII character (HL=HL * 8).
46480 ADD HL,HL
46481 ADD HL,HL
46482 LD DE,(23606) DE=CHARS.
46486 ADD HL,DE DE=HL + 15360. For examples of usage;
Letter ASCII Value * 8 (offset) CHARS + offset
"U" 85 680 16040
"L" 76 608 15968
"T" 84 672 16032
"I" 73 584 15944
"M" 77 616 15976
"A" 65 520 15880
"T" 84 672 16032
"E" 69 552 15912
46487 EX DE,HL
Print the character to the screen.
46488 POP HL Restore HL, containing the screen buffer location, from the stack.
This entry point is used by the routine at DisplayPlayerLives.
PrintScreen_0 46489 LD B,8 B=8 (8 rows of pixels).
PrintScreen_Loop 46491 LD A,(DE) Copy a byte from the font data to the screen buffer.
46492 LD (HL),A
46493 INC DE Increment the font data by one.
46494 INC H Move onto the next pixel line.
46495 DJNZ PrintScreen_Loop Decrease counter by one and loop back to PrintScreen_Loop until counter is zero.
46497 POP DE Restore DE and BC from the stack.
46498 POP BC
Reset HL and move to the next column, ready to print the next character.
46499 LD A,H H=H - 8 (reset the display line).
46500 SUB 8
46502 LD H,A
46503 INC L Increment screen column by one.
46504 RET Return.
View the equivalent code in;
Prev: 46435 Up: Map Next: 46505