Prev: 35263 Up: Map Next: 35345
35311: Print Character
Input
A ASCII value to print
HL Screen address
PrintScreen 35311 PUSH BC Stash BC, DE and HL on the stack.
35312 PUSH DE
35313 PUSH HL
35314 SUB 32 Create an offset in HL.
35316 LD L,A
35317 LD H,0
35319 ADD HL,HL HL=HL * 8.
35320 ADD HL,HL
35321 ADD HL,HL
35322 LD DE,(24068) DE=FontPointer (main font is MainFont).
35326 ADD HL,DE DE=HL + DE. For examples of usage;
Letter ASCII Value - 32 * 8 (offset) CHARS + offset
"U" 85 424 54511
"L" 76 352 54439
"T" 84 416 54503
"I" 73 328 54415
"M" 77 360 54447
"A" 65 264 54351
"T" 84 416 54503
"E" 69 296 54383
35327 EX DE,HL
Print the character to the screen.
35328 POP HL Restore HL, containing the screen buffer location, from the stack.
This entry point is used by the routine at DisplayPlayerLives.
PrintScreen_0 35329 LD B,8 B=8 (8 rows of pixels).
PrintScreen_Loop 35331 LD A,(DE) Copy a byte from the font data to the screen buffer.
35332 LD (HL),A
35333 INC DE Increment the font data by one.
35334 INC H Move onto the next pixel line.
35335 DJNZ PrintScreen_Loop Decrease counter by one and loop back to PrintScreen_Loop until counter is zero.
35337 POP DE Restore DE and BC from the stack.
35338 POP BC
Reset HL and move to the next column, ready to print the next character.
35339 LD A,H H=H - 8 (reset the display line).
35340 SUB 8
35342 LD H,A
35343 INC L Increment screen column by one.
35344 RET Return.
View the equivalent code in;
Prev: 35263 Up: Map Next: 35345