Prev: AC3E Up: Map Next: AC65
AC47: Print Character
Input
A The character to print
PrintCharacter AC47 PUSH AF Keep the character to print on the stack.
AC48 LD A,($5C89) Jump to PrintCharacterDirect if the line byte of S_POSN (5C89) is not equal to 03.
AC4B CP $03
AC4D JR NZ,PrintCharacterDirect
AC4F POP AF Restore the character to print from the stack, keeping a copy there.
AC50 PUSH AF
AC51 CP $0D Jump to CheckColumnPosition if this isn't a newline character (0D).
AC53 JR NZ,CheckColumnPosition
This is a newline, so scroll the screen up to action it.
AC55 CALL ScrollScreen Call ScrollScreen.
AC58 POP AF Clear the character off the stack (as there's nothing to print for a newline, just the screen scroll).
AC59 RET Return.
Check the column position.
CheckColumnPosition AC5A LD A,($5C88) Call ScrollScreen if *S_POSN is equal to 01.
AC5D CP $01
AC5F CALL Z,ScrollScreen
Actions printing A to the screen.
PrintCharacterDirect AC62 POP AF Restore the character to print from the stack.
AC63 RST $10 Print to the screen using PRINT_A_1.
AC64 RET Return.
Prev: AC3E Up: Map Next: AC65