![]() |
Routines |
| Prev: 25833 | Up: Map | Next: 25872 |
|
Used by the routines at PrintString, PrintStringAndANewline, Handler_UserInput, Parser_MatchInputWord, Handler_DisplayRoom and PrintInputPrompt.
Print a character, scrolling when the cursor reaches the bottom of the text area.
|
||||||||
| PrintCharacter | 25842 | PUSH AF | Preserve the character to print. | |||||
| 25843 | LD A,(23689) | Jump to PrintCharacter_Step2 when the cursor row in S_POSN is not 3. | ||||||
| 25846 | CP 3 | |||||||
| 25848 | JR NZ,PrintCharacter_Step2 | |||||||
| 25850 | POP AF | Restore the character from the stack, keeping a copy there. | ||||||
| 25851 | PUSH AF | |||||||
| 25852 | CP 13 | Jump to PrintCharacter_Step1 when this is not a newline (13). | ||||||
| 25854 | JR NZ,PrintCharacter_Step1 | |||||||
|
A newline scrolls the text area.
|
||||||||
| 25856 | CALL ScrollScreen | Call ScrollScreen to scroll the screen. | ||||||
| 25859 | POP AF | Discard the character. A newline only scrolls. | ||||||
| 25860 | RET | Return. | ||||||
|
Check the column position.
|
||||||||
| PrintCharacter_Step1 | 25861 | LD A,(23688) | Call ScrollScreen to scroll when the column in S_POSN is 1. | |||||
| 25864 | CP 1 | |||||||
| 25866 | CALL Z,ScrollScreen | |||||||
| PrintCharacter_Step2 | 25869 | POP AF | Restore the character to print from the stack. | |||||
|
Print the character.
|
||||||||
| 25870 | RST 16 | Print the character with PRINT_A_1. | ||||||
| 25871 | RET | Return. | ||||||
| Prev: 25833 | Up: Map | Next: 25872 |