.GTNME LDA #1 \ Clear the top part of the screen, draw a white border, JSR TT66 \ and set the current view type in QQ11 to 1 LDA #123 \ Print recursive token 123 ("{crlf}COMMANDER'S NAME? ") JSR TT27 JSR DEL8 \ Call DEL8 to wait for 30 delay loops LDA #15 \ Call OSBYTE with A = 15 (flush all buffers) TAX JSR OSBYTE LDX #LO(RLINE) \ Set (Y X) to point to the RLINE parameter block LDY #HI(RLINE) \ configuration block below LDA #0 \ Set A = 0 for the following OSWORD call DEC KEYB \ Decrement KEYB, so it is now &FF, to indicate that we \ are reading from the keyboard using an OS command JSR OSWORD \ Call OSWORD with A = 0 to read a line from the current \ input stream (i.e. the keyboard) INC KEYB \ Increment KEYB back to 0 to indicate we are done \ reading the keyboard BCS TR1 \ The C flag will be set if we pressed ESCAPE when \ entering the name, in which case jump to TR1 to copy \ the last saved commander's name from NA% to INWK \ and return from the subroutine there TYA \ The OSWORD call returns the length of the commander's \ name in Y, so transfer this to A BEQ TR1 \ If A = 0, no name was entered, so jump to TR1 to copy \ the last saved commander's name from NA% to INWK \ and return from the subroutine there JMP TT67 \ We have a name, so jump to TT67 to print a newline \ and return from the subroutine using a tail callName: GTNME [Show more] Type: Subroutine Category: Save and load Summary: Fetch the name of a commander file to save or loadContext: See this subroutine in context in the source code Variations: See code variations for this subroutine in the different versions References: This subroutine is called as follows: * BR1 (Part 1 of 2) calls GTNME * SVE calls GTNME
Get the commander's name for loading or saving a commander file. The name is stored in the INWK workspace and is terminated by a return character (13). If ESCAPE is pressed or a blank name is entered, then the name stored is set to the name from the last saved commander block.
Returns: INWK The commander name entered, terminated by a return character (13)
[X]
Variable KEYB in workspace S% (Part 1 of 2)
This flag indicates whether we are currently reading from the keyboard using OSRDCH or OSWORD, so the keyboard interrupt handler at KEY1 knows whether to pass key presses on to the OS
[X]
Configuration variable OSBYTE = &FFF4
The address for the OSBYTE routine
[X]
Configuration variable OSWORD = &FFF1
The address for the OSWORD routine
[X]
Variable RLINE (category: Text)
The OSWORD configuration block used to fetch a line of text from the keyboard
[X]
Subroutine TR1 (category: Save and load)
Copy the last saved commander's name from NA% to INWK
[X]
Subroutine TT27 (category: Text)
Print a text token
[X]
Subroutine TT66 (category: Drawing the screen)
Clear the screen and set the current view type
[X]
Subroutine TT67 (category: Text)
Print a newline