.PrintTextToken LDY tokenOffset,X \ Set Y to the offset for text token X, which we can use \ as a character index to print each character in turn .text1 LDA tokenBase,Y \ Set A to the Y-th character of the text token CMP #&FF \ If A = &FF then we have reached the end of the token, BEQ text2 \ so jump to text2 to return from the subroutine JSR ProcessCharacter \ Process the Y-th character of the text token in A, so \ if A is a token number in the format 200 + token, we \ print the text token, otherwise we print A as a simple \ one-byte character INY \ Increment the character index in Y to point to the \ next character of the text token JMP text1 \ Loop back to print the next character .text2 RTS \ Return from the subroutineName: PrintTextToken [Show more] Type: Subroutine Category: Text Summary: Print a recursive text tokenContext: See this subroutine in context in the source code References: This subroutine is called as follows: * FinishLandscape calls PrintTextToken * MainGameLoop calls PrintTextToken * MainTitleLoop calls PrintTextToken * PreviewLandscape calls PrintTextToken * ProcessCharacter calls PrintTextToken * SecretCodeError calls PrintTextToken
Arguments: X The number of the text token to print (0 to 17)
[X]
Subroutine ProcessCharacter (category: Text)
Process and print a character from a text token, which can encode another text token or be a one-byte character or VDU command
[X]
Label text1 is local to this routine
[X]
Label text2 is local to this routine
[X]
Label tokenBase in variable tokenOffset
[X]
Variable tokenOffset (category: Text)
Address offsets for the text tokens (each offset in the table is the offset of the token from tokenBase)