Prev: 34179 Up: Map Next: 34317
34187: Print: One Character
Print_Character 34187 CALL PrintGateOnTheTimeOfDay Call PrintGateOnTheTimeOfDay to gate printing on the time of day.
34190 RET Z Return if PrintGateOnTheTimeOfDay found the day flag does not meet the message gate.
34191 PUSH AF If WaitCountdown is not zero then jump to Print_Character_TestForAReturn.
34192 LD A,(46849)
34195 AND A
34196 JR NZ,Print_Character_TestForAReturn
34198 POP AF Restore the character from the stack and call PrintWriteACharacterToTheScreen_0 to draw it.
34199 CALL PrintWriteACharacterToTheScreen_0
34202 PUSH AF If 46848 is not zero then jump to Print_Character_TestForAnS.
34203 LD A,(46848)
34206 AND A
34207 JR NZ,Print_Character_TestForAnS
34209 POP AF Restore the character from the stack.
34210 RET Return.
Print_Character_TestForAnS 34211 POP AF If this is ASCII "S" then jump to Print_Character_PrintAnH.
34212 CP 83
34214 JR Z,Print_Character_PrintAnH
34216 CP 115 If this is not ASCII "s" then return.
34218 RET NZ
Print_Character_PrintAnH 34219 PUSH AF Use the character 'H'.
34220 LD A,72
34222 CALL PrintWriteACharacterToTheScreen_0 Call PrintWriteACharacterToTheScreen_0 to draw the character on the screen.
34225 POP AF Restore AF from the stack.
34226 RET Return.
34227 NOP Characters left on the current line (32 at the start of a line).
PercentageBuffer 34228 DEFB 0,0,0 Percentage buffer.
Print_Character_TestForAReturn 34231 POP AF Save the character and the text pointer, and jump to
This entry point is used by the routine at TurnReadAndTokeniseTheCommand.
Print_Character_0 34232 PUSH HL Print_Character_TestForBackspace if the character is not a carriage return
34233 PUSH AF (13).
34234 LD HL,(34228)
34237 CP 13
34239 JR NZ,Print_Character_TestForBackspace }
Print a space.
34241 LD A,32 Print a space.
34243 CALL Print_RomFont
34246 JR Print_Character_StartANewLine Jump to Print_Character_StartANewLine to start a new line.
Print_Character_TestForBackspace 34248 CP 8 Jump to Print_Character_RubOut if the character is 8.
34250 JR Z,Print_Character_RubOut
34252 CP 97 Jump to Print_Character_DrawThisCharacterWithTheROMFont if the character is below 97.
34254 JR C,Print_Character_DrawThisCharacterWithTheROMFont
34256 CP 123 Jump to Print_Character_DrawThisCharacterWithTheROMFont if the character is not below 123.
34258 JR NC,Print_Character_DrawThisCharacterWithTheROMFont
34260 AND 95 Keep bits 0, 1, 2, 3, 4, 6.
Draw this character with the ROM font.
Print_Character_DrawThisCharacterWithTheROMFont 34262 CALL Print_RomFont Call Print_RomFont to draw this character with the ROM font.
34265 LD A,(34227) Count down the characters left on the line, and jump to Print_Character_StoreTheCharactersLeft unless the line is now full.
34268 DEC A
34269 JR NZ,Print_Character_StoreTheCharactersLeft
Print_Character_StartANewLine 34271 LD L,224 Move the print position back to the start of the line (224).
34273 CALL Print_ScrollTheLineBuffer Call Print_ScrollTheLineBuffer to scroll the line buffer up.
34276 LD A,32 Reset the count to 32 for the new line.
Print_Character_StoreTheCharactersLeft 34278 LD (34227),A Store the result at 34227.
34281 LD A,(34230) Read the spare grammar byte.
34284 LD (34228),HL Store HL at PercentageBuffer.
Draw this character with the ROM font.
34287 CALL Print_RomFont Call Print_RomFont to draw this character with the ROM font.
34290 POP AF Restore AF and HL from the stack.
34291 POP HL
34292 RET Return.
Print a space.
Print_Character_RubOut 34293 LD A,32 Print a space over the character being rubbed out.
34295 CALL Print_RomFont
34298 DEC L Step the print position back, add one to the characters left, and jump back to Print_Character_StoreTheCharactersLeft unless that goes past the start of the line (33).
34299 DEC L
34300 LD A,(34227)
34303 INC A
34304 CP 33
34306 JR NZ,Print_Character_StoreTheCharactersLeft
34308 LD L,255 The previous pattern byte is at offset 255.
34310 CALL Print_ScrollTheAttributeLine Call Print_ScrollTheAttributeLine to scroll the attribute line up.
34313 LD A,1 Continue with 1 now that the character is drawn.
34315 JR Print_Character_StoreTheCharactersLeft Jump back to Print_Character_StoreTheCharactersLeft to draw this character.
Prev: 34179 Up: Map Next: 34317