.TT102 \ --- Mod: Code removed for Elite-A: ------------------> \CMP #f8 \ If red key f8 was pressed, jump to STATUS to show the \BNE P%+5 \ Status Mode screen, returning from the subroutine \JMP STATUS \ using a tail call \ \CMP #f4 \ If red key f4 was pressed, jump to TT22 to show the \BNE P%+5 \ Long-range Chart, returning from the subroutine using \JMP TT22 \ a tail call \ \CMP #f5 \ If red key f5 was pressed, jump to TT23 to show the \BNE P%+5 \ Short-range Chart, returning from the subroutine using \JMP TT23 \ a tail call \ \CMP #f6 \ If red key f6 was pressed, call TT111 to select the \BNE TT92 \ system nearest to galactic coordinates (QQ9, QQ10) \JSR TT111 \ (the location of the chart crosshairs) and set ZZ to \JMP TT25 \ the system number, and then jump to TT25 to show the \ \ Data on System screen (along with an extended system \ \ description for the system in ZZ if we're docked), \ \ returning from the subroutine using a tail call \ --- And replaced by: --------------------------------> CMP #f8 \ If red key f8 was pressed, jump to info_menu to show BNE P%+5 \ the Encyclopedia screen, returning from the subroutine JMP info_menu \ using a tail call CMP #f4 \ If red key f4 was pressed, jump to TT22 to show the BNE P%+5 \ Long-range Chart, returning from the subroutine using JMP TT22 \ a tail call CMP #f5 \ If red key f5 was pressed, jump to TT23 to show the BNE P%+5 \ Short-range Chart, returning from the subroutine using JMP TT23 \ a tail call CMP #f6 \ If red key f6 was not pressed, jump to TT92 to check BNE TT92 \ for the next key JSR CTRL \ Red key f6 was pressed, so check whether CTRL was BPL jump_data \ also pressed, and if it wasn't pressed, jump to \ jump_data to skip the following instruction JMP launch \ CTRL-f6 was pressed, so jump to launch to load and run \ the main docked code (i.e. to exit the encyclopedia) .jump_data JSR TT111 \ Red key f6 was pressed on its own, so call TT111 to \ select the system nearest to galactic coordinates \ (QQ9, QQ10) (the location of the chart crosshairs) and \ set ZZ to the system number JMP TT25 \ Jump to TT25 to show the Data on System screen, along \ with an extended system description for the system in \ ZZ, returning from the subroutine using a tail call \ --- End of replacement ------------------------------> .TT92 \ --- Mod: Code removed for Elite-A: ------------------> \CMP #f9 \ If red key f9 was pressed, jump to TT213 to show the \BNE P%+5 \ Inventory screen, returning from the subroutine \JMP TT213 \ using a tail call \ \CMP #f7 \ If red key f7 was pressed, jump to TT167 to show the \BNE P%+5 \ Market Price screen, returning from the subroutine \JMP TT167 \ using a tail call \ \CMP #f0 \ If red key f0 was pressed, jump to TT110 to launch our \BNE fvw \ ship (if docked), returning from the subroutine using \JMP TT110 \ a tail call \ --- And replaced by: --------------------------------> CMP #f9 \ If red key f9 was pressed, jump to info_menu to show BNE not_invnt \ the Encyclopedia screen, returning from the subroutine JMP info_menu \ using a tail call .not_invnt CMP #f7 \ If red key f7 was pressed, jump to info_menu to show BNE not_price \ the Encyclopedia screen, returning from the subroutine JMP info_menu \ using a tail call .not_price \ --- End of replacement ------------------------------> .fvw \ --- Mod: Code removed for Elite-A: ------------------> \CMP #f3 \ If red key f3 was pressed, jump to EQSHP to show the \BNE P%+5 \ Equip Ship screen, returning from the subroutine using \JMP EQSHP \ a tail call \ \CMP #f1 \ If red key f1 was pressed, jump to TT219 to show the \BNE P%+5 \ Buy Cargo screen, returning from the subroutine using \JMP TT219 \ a tail call \ \CMP #&47 \ If "@" was not pressed, skip to nosave \BNE nosave \ \JSR SVE \ "@" was pressed, so call SVE to show the disc access \ \ menu \ \BCC P%+5 \ If the C flag was set by SVE, then we loaded a new \JMP QU5 \ commander file, so jump to QU5 to restart the game \ \ with the newly loaded commander \ \JMP BAY \ Otherwise the C flag was clear, so jump to BAY to go \ \ to the docking bay (i.e. show the Status Mode screen) \ \.nosave \ \CMP #f2 \ If red key f2 was pressed, jump to TT208 to show the \BNE LABEL_3 \ Sell Cargo screen, returning from the subroutine using \JMP TT208 \ a tail call \ \.INSP \ --- And replaced by: --------------------------------> CMP #f0 \ If red key f0 was pressed, jump to jump_menu to show BEQ jump_menu \ the Encyclopedia screen CMP #f1 \ If red key f1 was pressed, jump to jump_menu to show BEQ jump_menu \ the Encyclopedia screen CMP #f2 \ If red key f2 was pressed, jump to jump_menu to show BEQ jump_menu \ the Encyclopedia screen CMP #f3 \ If red key f3 was not pressed, jump to LABEL_3 to BNE LABEL_3 \ skip the following and keep checking for other keys .jump_menu JMP info_menu \ Jump to info_menu to show the Encyclopedia screen \ --- End of replacement ------------------------------> .LABEL_3 CMP #&54 \ If "H" was not pressed, jump to NWDAV5 to skip the BNE NWDAV5 \ following JSR CLYNS \ "H" was pressed, so clear the bottom three text rows \ of the upper screen, and move the text cursor to \ column 1 on row 21, i.e. the start of the top row of \ the three bottom rows LDA #15 \ Move the text cursor to column 15 (the middle of the STA XC \ screen) LDA #205 \ Print extended token 205 ("DOCKED") and return from JMP DETOK \ the subroutine using a tail call .NWDAV5 CMP #&32 \ If "D" was pressed, jump to T95 to print the distance BEQ T95 \ to a system (if we are in one of the chart screens) CMP #&43 \ If "F" was not pressed, jump down to HME1, otherwise BNE HME1 \ keep going to process searching for systems LDA QQ11 \ If the current view is a chart (QQ11 = 64 or 128), AND #%11000000 \ keep going, otherwise return from the subroutine (as BEQ t95 \ t95 contains an RTS) JMP HME2 \ Jump to HME2 to let us search for a system, returning \ from the subroutine using a tail call .HME1 STA T1 \ Store A (the key that's been pressed) in T1 LDA QQ11 \ If the current view is a chart (QQ11 = 64 or 128), AND #%11000000 \ keep going, otherwise jump down to t95 to return from BEQ t95 \ the subroutine LDA QQ22+1 \ If the on-screen hyperspace counter is non-zero, BNE t95 \ then we are already counting down, so jump down to t95 \ to return from the subroutine LDA T1 \ Restore the original value of A (the key that's been \ pressed) from T1 \ --- Mod: Code removed for Elite-A: ------------------> \CMP #&36 \ If "O" was pressed, do the following three jumps, \BNE ee2 \ otherwise skip to ee2 to continue \ --- And replaced by: --------------------------------> CMP #&36 \ If "O" was pressed, do the following three jumps, BNE not_home \ otherwise skip to not_home to continue checking key \ presses \ --- End of replacement ------------------------------> JSR TT103 \ Draw small crosshairs at coordinates (QQ9, QQ10), \ which will erase the crosshairs currently there JSR ping \ Set the target system to the current system (which \ will move the location in (QQ9, QQ10) to the current \ home system JSR TT103 \ Draw small crosshairs at coordinates (QQ9, QQ10), \ which will draw the crosshairs at our current home \ system .ee2 JSR TT16 \ Call TT16 to move the crosshairs by the amount in X \ and Y, which were passed to this subroutine as \ arguments .t95 RTS \ Return from the subroutine \ --- Mod: Code added for Elite-A: --------------------> .not_home CMP #&21 \ If "W" was pressed, continue on to move the crosshairs BNE ee2 \ to the special cargo destination, otherwise skip to \ ee2 to continue LDA cmdr_cour \ If there is no special cargo delivery mission in ORA cmdr_cour+1 \ progress, then the mission timer in cmdr_cour(1 0) BEQ ee2 \ will be zero, so skip to ee2 to continue JSR TT103 \ Draw small crosshairs at coordinates (QQ9, QQ10), \ which will erase the crosshairs currently there LDA cmdr_courx \ Set the galactic coordinates in (QQ9, QQ10) to the STA QQ9 \ current special cargo delivery destination in LDA cmdr_coury \ (cmdr_courx, cmdr_coury) STA QQ10 JSR TT103 \ Draw small crosshairs at coordinates (QQ9, QQ10), \ which will draw the crosshairs at our current home \ system \ --- End of added code -------------------------------> .T95 \ If we get here, "D" was pressed, so we need to show \ the distance to the selected system (if we are in a \ chart view) LDA QQ11 \ If the current view is a chart (QQ11 = 64 or 128), AND #%11000000 \ keep going, otherwise return from the subroutine (as BEQ t95 \ t95 contains an RTS) JSR hm \ Call hm to move the crosshairs to the target system \ in (QQ9, QQ10), returning with A = 0 STA QQ17 \ Set QQ17 = 0 to switch to ALL CAPS JSR cpl \ Print control code 3 (the selected system name) LDA #%10000000 \ Set bit 7 of QQ17 to switch to Sentence Case, with the STA QQ17 \ next letter in capitals LDA #1 \ Move the text cursor to column 1 and down one line STA XC \ (in other words, to the start of the next line) INC YC JMP TT146 \ Print the distance to the selected system and return \ from the subroutine using a tail callName: TT102 [Show more] Type: Subroutine Category: Keyboard Summary: Process function key, save key, hyperspace and chart key pressesContext: See this subroutine in context in the source code References: This subroutine is called as follows: * Main game loop (Part 6 of 6) calls TT102 * HME2 calls via T95
Process function key presses, plus "@" (save commander), "H" (hyperspace), "D" (show distance to system) and "O" (move chart cursor back to current system). We can also pass cursor position deltas in X and Y to indicate that the cursor keys or joystick have been used (i.e. the values that are returned by routine TT17).
Arguments: A The internal key number of the key pressed (see p.142 of the Advanced User Guide for a list of internal key numbers) X The amount to move the crosshairs in the x-axis Y The amount to move the crosshairs in the y-axis
Other entry points: T95 Print the distance to the selected system
[X]
Subroutine CLYNS (category: Drawing the screen)
Clear the bottom three text rows of the space view
[X]
Subroutine CTRL (category: Keyboard)
Scan the keyboard to see if CTRL is currently pressed
[X]
Subroutine DETOK (category: Text)
Print an extended recursive token from the TKN1 token table
[X]
Label HME1 is local to this routine
[X]
Subroutine HME2 (category: Charts)
Search the galaxy for a system
[X]
Label LABEL_3 is local to this routine
[X]
Label NWDAV5 is local to this routine
[X]
Subroutine TT103 (category: Charts)
Draw a small set of crosshairs on a chart
[X]
Subroutine TT111 (category: Universe)
Set the current system to the nearest system to a point
[X]
Subroutine TT146 (category: Universe)
Print the distance to the selected system in light years
[X]
Subroutine TT16 (category: Charts)
Move the crosshairs on a chart
[X]
Subroutine TT22 (category: Charts)
Show the Long-range Chart (red key f4)
[X]
Subroutine TT23 (category: Charts)
Show the Short-range Chart (red key f5)
[X]
Subroutine TT25 (category: Universe)
Show the Data on System screen (red key f6) or Encyclopedia screen (CTRL-f6)
[X]
Label TT92 is local to this routine
[X]
Variable cmdr_courx in workspace UP
The galactic x-coordinate for the current special cargo delivery destination
[X]
Variable cmdr_coury in workspace UP
The galactic y-coordinate for the current special cargo delivery destination
[X]
Subroutine cpl (category: Universe)
Print the selected system name
[X]
Label ee2 is local to this routine
[X]
Configuration variable f0 = &20
Internal key number for red key f0 (Launch, Front)
[X]
Configuration variable f1 = &71
Internal key number for red key f1 (Buy Cargo, Rear)
[X]
Configuration variable f2 = &72
Internal key number for red key f2 (Sell Cargo, Left)
[X]
Configuration variable f3 = &73
Internal key number for red key f3 (Equip Ship, Right)
[X]
Configuration variable f4 = &14
Internal key number for red key f4 (Long-range Chart)
[X]
Configuration variable f5 = &74
Internal key number for red key f5 (Short-range Chart)
[X]
Configuration variable f6 = &75
Internal key number for red key f6 (Data on System)
[X]
Configuration variable f7 = &16
Internal key number for red key f7 (Market Price)
[X]
Configuration variable f8 = &76
Internal key number for red key f8 (Status Mode)
[X]
Configuration variable f9 = &77
Internal key number for red key f9 (Inventory)
[X]
Subroutine hm (category: Charts)
Select the closest system and redraw the chart crosshairs
[X]
Label jump_data is local to this routine
[X]
Subroutine launch (category: Loader)
Load and run the main docked code in 1.D
[X]
Label not_home is local to this routine
[X]
Label not_invnt is local to this routine
[X]
Label not_price is local to this routine
[X]
Subroutine ping (category: Universe)
Set the selected system to the current system
[X]
Label t95 is local to this routine