![]() |
Routines |
| Prev: 46435 | Up: Map | Next: 46505 |
|
Used by the routines at HallOfFame, PrintStringColour, Score_1UP, EnterInitials and DisplayPlayerLives.
Prints a character from the font pointed to by the system variable CHARS onto the screen, at an address on the screen, and moves to the next column.
|
|||||||||||||||||||||||||||||||||||||||
| PrintScreen | 46473 | PUSH BC | Stash BC, DE and HL on the stack. | ||||||||||||||||||||||||||||||||||||
| 46474 | PUSH DE | ||||||||||||||||||||||||||||||||||||||
| 46475 | PUSH HL | ||||||||||||||||||||||||||||||||||||||
| 46476 | LD L,A | Use the character code as the offset into the font. | |||||||||||||||||||||||||||||||||||||
| 46477 | LD H,0 | ||||||||||||||||||||||||||||||||||||||
| 46479 | ADD HL,HL | Multiply the offset by eight (the number of bytes in a character). | |||||||||||||||||||||||||||||||||||||
| 46480 | ADD HL,HL | ||||||||||||||||||||||||||||||||||||||
| 46481 | ADD HL,HL | ||||||||||||||||||||||||||||||||||||||
| 46482 | LD DE,(23606) | Fetch the address of the font from CHARS. | |||||||||||||||||||||||||||||||||||||
| 46486 | ADD HL,DE | DE=HL + 15360. For examples of usage;
|
|||||||||||||||||||||||||||||||||||||
| 46487 | EX DE,HL | ||||||||||||||||||||||||||||||||||||||
|
Print the character to the screen.
|
|||||||||||||||||||||||||||||||||||||||
| 46488 | POP HL | Restore the screen address. | |||||||||||||||||||||||||||||||||||||
|
This entry point is used by the routine at DisplayPlayerLives.
|
|||||||||||||||||||||||||||||||||||||||
| PrintScreen_Write | 46489 | LD B,8 | Set the number of pixel lines in B to 8. | ||||||||||||||||||||||||||||||||||||
| PrintScreen_Loop | 46491 | LD A,(DE) | Draw a pixel line of the character. | ||||||||||||||||||||||||||||||||||||
| 46492 | LD (HL),A | ||||||||||||||||||||||||||||||||||||||
| 46493 | INC DE | Move onto the next pixel line of the character. | |||||||||||||||||||||||||||||||||||||
| 46494 | INC H | Move onto the next pixel line of the screen. | |||||||||||||||||||||||||||||||||||||
| 46495 | DJNZ PrintScreen_Loop | Decrease the pixel line counter by one and loop back to PrintScreen_Loop until all eight pixel lines have been drawn. | |||||||||||||||||||||||||||||||||||||
| 46497 | POP DE | Restore the registers 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 | Move onto the next column. | |||||||||||||||||||||||||||||||||||||
| 46504 | RET | Return. | |||||||||||||||||||||||||||||||||||||
|
View the equivalent code in;
|
|||||||||||||||||||||||||||||||||||||||
| Prev: 46435 | Up: Map | Next: 46505 |