Prev: 48686 Up: Map Next: 48725
48695: Print Character
Print one character, scrolling the text window when the cursor reaches its edge.
Input
A Character to print
PrintCharacter 48695 PUSH AF Keep the character safe on the stack.
48696 LD A,(23689) Jump to PrintCharacterDirect if the line byte of S_POSN (23689) is not row 3.
48699 CP 3
48701 JR NZ,PrintCharacterDirect
48703 POP AF Restore the character from the stack, leaving a copy.
48704 PUSH AF
48705 CP 13 Jump to CheckColumnPosition if this is not a newline (13).
48707 JR NZ,CheckColumnPosition
A newline scrolls the text window and prints nothing.
48709 CALL ScrollScreen Call ScrollScreen.
48712 POP AF Discard the character from the stack.
48713 RET Return.
Check the column.
CheckColumnPosition 48714 LD A,(23688) Call ScrollScreen if *S_POSN is column 1.
48717 CP 1
48719 CALL Z,ScrollScreen
Print the character.
PrintCharacterDirect 48722 POP AF Restore the character from the stack.
48723 RST 16 Print it with PRINT_A_1.
48724 RET Return.
Prev: 48686 Up: Map Next: 48725