Prev: 64E9 Up: Map Next: 6510
64F2: Print Character
Print a character, scrolling when the cursor reaches the bottom of the text area.
Input
A Character to print
PrintCharacter 64F2 PUSH AF Preserve the character to print.
64F3 LD A,($5C89) Jump to PrintCharacter_Step2 when the cursor row in S_POSN is not 03.
64F6 CP $03
64F8 JR NZ,PrintCharacter_Step2
64FA POP AF Restore the character from the stack, keeping a copy there.
64FB PUSH AF
64FC CP $0D Jump to PrintCharacter_Step1 when this is not a newline (0D).
64FE JR NZ,PrintCharacter_Step1
A newline scrolls the text area.
6500 CALL ScrollScreen Call ScrollScreen to scroll the screen.
6503 POP AF Discard the character. A newline only scrolls.
6504 RET Return.
Check the column position.
PrintCharacter_Step1 6505 LD A,($5C88) Call ScrollScreen to scroll when the column in S_POSN is 01.
6508 CP $01
650A CALL Z,ScrollScreen
PrintCharacter_Step2 650D POP AF Restore the character to print from the stack.
Print the character.
650E RST $10 Print the character with PRINT_A_1.
650F RET Return.
Prev: 64E9 Up: Map Next: 6510