![]() |
Routines |
| Prev: B563 | Up: Map | Next: B5A9 |
|
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 | B589 | PUSH BC | Stash BC, DE and HL on the stack. | ||||||||||||||||||||||||||||||||||||
| B58A | PUSH DE | ||||||||||||||||||||||||||||||||||||||
| B58B | PUSH HL | ||||||||||||||||||||||||||||||||||||||
| B58C | LD L,A | Use the character code as the offset into the font. | |||||||||||||||||||||||||||||||||||||
| B58D | LD H,$00 | ||||||||||||||||||||||||||||||||||||||
| B58F | ADD HL,HL | Multiply the offset by eight (the number of bytes in a character). | |||||||||||||||||||||||||||||||||||||
| B590 | ADD HL,HL | ||||||||||||||||||||||||||||||||||||||
| B591 | ADD HL,HL | ||||||||||||||||||||||||||||||||||||||
| B592 | LD DE,($5C36) | Fetch the address of the font from CHARS. | |||||||||||||||||||||||||||||||||||||
| B596 | ADD HL,DE | DE=HL + 3C00. For examples of usage;
|
|||||||||||||||||||||||||||||||||||||
| B597 | EX DE,HL | ||||||||||||||||||||||||||||||||||||||
|
Print the character to the screen.
|
|||||||||||||||||||||||||||||||||||||||
| B598 | POP HL | Restore the screen address. | |||||||||||||||||||||||||||||||||||||
|
This entry point is used by the routine at DisplayPlayerLives.
|
|||||||||||||||||||||||||||||||||||||||
| PrintScreen_Write | B599 | LD B,$08 | Set the number of pixel lines in B to 08. | ||||||||||||||||||||||||||||||||||||
| PrintScreen_Loop | B59B | LD A,(DE) | Draw a pixel line of the character. | ||||||||||||||||||||||||||||||||||||
| B59C | LD (HL),A | ||||||||||||||||||||||||||||||||||||||
| B59D | INC DE | Move onto the next pixel line of the character. | |||||||||||||||||||||||||||||||||||||
| B59E | INC H | Move onto the next pixel line of the screen. | |||||||||||||||||||||||||||||||||||||
| B59F | DJNZ PrintScreen_Loop | Decrease the pixel line counter by one and loop back to PrintScreen_Loop until all eight pixel lines have been drawn. | |||||||||||||||||||||||||||||||||||||
| B5A1 | POP DE | Restore the registers from the stack. | |||||||||||||||||||||||||||||||||||||
| B5A2 | POP BC | ||||||||||||||||||||||||||||||||||||||
|
Reset HL and move to the next column, ready to print the next character.
|
|||||||||||||||||||||||||||||||||||||||
| B5A3 | LD A,H | H=H - 08 (reset the display line). | |||||||||||||||||||||||||||||||||||||
| B5A4 | SUB $08 | ||||||||||||||||||||||||||||||||||||||
| B5A6 | LD H,A | ||||||||||||||||||||||||||||||||||||||
| B5A7 | INC L | Move onto the next column. | |||||||||||||||||||||||||||||||||||||
| B5A8 | RET | Return. | |||||||||||||||||||||||||||||||||||||
|
View the equivalent code in;
|
|||||||||||||||||||||||||||||||||||||||
| Prev: B563 | Up: Map | Next: B5A9 |