Prev: 44094 Up: Map Next: 44133
44103: Print Character
Input
A The character to print
PrintCharacter 44103 PUSH AF Keep the character to print on the stack.
44104 LD A,(23689) Jump to PrintCharacterDirect if the line byte of S_POSN (23689) is not equal to 3.
44107 CP 3
44109 JR NZ,PrintCharacterDirect
44111 POP AF Restore the character to print from the stack, keeping a copy there.
44112 PUSH AF
44113 CP 13 Jump to CheckColumnPosition if this isn't a newline character (13).
44115 JR NZ,CheckColumnPosition
This is a newline, so scroll the screen up to action it.
44117 CALL ScrollScreen Call ScrollScreen.
44120 POP AF Clear the character off the stack (as there's nothing to print for a newline, just the screen scroll).
44121 RET Return.
Check the column position.
CheckColumnPosition 44122 LD A,(23688) Call ScrollScreen if *S_POSN is equal to 1.
44125 CP 1
44127 CALL Z,ScrollScreen
Actions printing A to the screen.
PrintCharacterDirect 44130 POP AF Restore the character to print from the stack.
44131 RST 16 Print to the screen using PRINT_A_1.
44132 RET Return.
Prev: 44094 Up: Map Next: 44133