Prev: 43447 Up: Map Next: 43633
43540: Print One Character And Remember The Line
Used by the routine at Print_Character.
Turns an upper-case letter into lower case, remembers that a character has been printed on this line, and starts a new line when the character is a carriage return.
Convert uppercase letters to lowercase if needed.
Print_Character_ProcessCharacter 43540 CP 65 Jump ahead to Print_Character_CheckSpace if the character is below A.
43542 JR C,Print_Character_CheckSpace
43544 CP 91 Jump ahead to Print_Character_CheckSpace if the character is past Z.
43546 JR NC,Print_Character_CheckSpace
43548 OR 32 Set bit 5 to make the letter lower case.
Print_Character_CheckSpace 43550 PUSH AF Keep the character and jump to Print_Character_MarkPrintStarted when this line has already started.
43551 LD A,(40997)
43554 AND A
43555 JR NZ,Print_Character_MarkPrintStarted
43557 POP AF
43558 CP 32 Return if the character is a space.
43560 RET Z
43561 PUSH AF Keep the character and set the print position flag at PrintPositionFlag.
Mark that we've started printing on this line.
Print_Character_MarkPrintStarted 43562 LD A,1
43564 LD (40997),A
43567 POP AF Jump ahead to Print_Character_CheckQuote if the character is not a new line.
43568 PUSH AF
43569 CP 13
43571 JR NZ,Print_Character_CheckQuote
Reset the print position flag for a carriage return.
43573 XOR A Clear *PrintPositionFlag.
43574 LD (40997),A
43577 JR Print_Character_Print Jump ahead to Print_Character_Print to print the character.
A quotation mark is printed as a blank, and the picture flag is consulted.
Print_Character_CheckQuote 43579 CP 34 Jump ahead to Print_Character_CheckPeriod if the character is not a quotation mark.
43581 JR NZ,Print_Character_CheckPeriod
43583 LD A,32 Take a space.
43585 CALL CheckTVFlagAndProcess Call CheckTVFlagAndProcess to honour the television flag.
43588 JR Print_Character_SetTokenFormatFlag As after a full stop, go to Print_Character_SetTokenFormatFlag to set the flag at TokenFormatFlag so the next letter is a capital.
A sentence stop marks the token so the next letter can be printed in capitals.
Print_Character_CheckPeriod 43590 CP 46 Jump ahead to Print_Character_CheckLowercase if the character is not a full stop.
43592 JR NZ,Print_Character_CheckLowercase
Print_Character_SetTokenFormatFlag 43594 LD A,1 Set *TokenFormatFlag.
43596 LD (40998),A
43599 JR Print_Character_Print Jump ahead to Print_Character_Print to print the character.
See whether the character byte is a lower-case letter, then see whether the character byte is past the lower-case letters, then read the lowercase Handling Flag.
Handle lowercase letters (dictionary word characters).
Print_Character_CheckLowercase 43601 CP 97 Jump ahead to Print_Character_Print if the character is below the letter a.
43603 JR C,Print_Character_Print
43605 CP 123 Jump ahead to Print_Character_Print if the character is at least 123.
43607 JR NC,Print_Character_Print
43609 LD A,(43089) Jump to Print_Character_ResetTokenFormatFlag if the lowercase handling flag is set.
43612 AND A
43613 JR NZ,Print_Character_ResetTokenFormatFlag
43615 LD A,(40998) Jump to Print_Character_Print if the token format flag is zero.
43618 AND A
43619 JR Z,Print_Character_Print
Reset the token format flag before converting to uppercase.
Print_Character_ResetTokenFormatFlag 43621 XOR A Reset *TokenFormatFlag.
43622 LD (40998),A
43625 POP AF Restore the character from the stack.
Clear bit 5 from the character code (convert to uppercase).
43626 AND %01011111 Clear bit 5 so a lowercase letter becomes uppercase.
43628 PUSH AF Keep the character while it is printed.
Print_Character_Print 43629 POP AF Jump to CheckTVFlagAndProcess to check the television flag.
43630 JP CheckTVFlagAndProcess
Prev: 43447 Up: Map Next: 43633