Skip to navigation

Elite on the BBC Micro and NES

Version analysis of TT167

This code appears in the following versions (click to see it in the source code):

Code variations between these versions are shown below.

Name: TT167 Type: Subroutine Category: Market

Code variation 1 of 6A variation in the comments only

Tap on a block to expand it, and tap it again to revert.

Summary: Show the Market Price screen (red key f7)
Summary: Show the Market Price screen (FUNC-8)
.TT167

Code variation 2 of 6Related to the 6502SP version

In the 6502SP version, you can send the Market Price screen to the printer by pressing CTRL-f7.

Tap on a block to expand it, and tap it again to revert.

LDA #16 \ Clear the top part of the screen, draw a white border, JSR TT66 \ and set the current view type in QQ11 to 16 (Market \ Price screen)
LDA #16 \ Clear the top part of the screen, draw a white border, JSR TRADEMODE \ and set up a printable trading screen with a view type \ in QQ11 of 32 (Market Price screen)

Code variation 3 of 6Related to Elite's use of the Tube

Tap on a block to expand it, and tap it again to revert.

LDA #5 \ Move the text cursor to column 5 STA XC
LDA #5 \ Move the text cursor to column 5 JSR DOXC
 LDA #167               \ Print recursive token 7 ("{current system name} MARKET
 JSR NLIN3              \ PRICES") and draw a horizontal line at pixel row 19
                        \ to box in the title

Code variation 4 of 6Related to Elite's use of the Tube

Tap on a block to expand it, and tap it again to revert.

LDA #3 \ Move the text cursor to row 3 STA YC
LDA #3 \ Move the text cursor to row 3 JSR DOYC
 JSR TT163              \ Print the column headers for the prices table

Code variation 5 of 6Related to Elite's use of the Tube

This variation is blank in the Cassette, Disc (flight), Disc (docked) and Electron versions.

Tap on a block to expand it, and tap it again to revert.

LDA #6 \ Move the text cursor to row 6 STA YC
LDA #6 \ Move the text cursor to row 6 JSR DOYC
 LDA #0                 \ We're going to loop through all the available market
 STA QQ29               \ items, so we set up a counter in QQ29 to denote the
                        \ current item and start it at 0

.TT168

 LDX #%10000000         \ Set bit 7 of QQ17 to switch to Sentence Case, with the
 STX QQ17               \ next letter in capitals

 JSR TT151              \ Call TT151 to print the item name, market price and
                        \ availability of the current item, and set QQ24 to the
                        \ item's price / 4, QQ25 to the quantity available and
                        \ QQ19+1 to byte #1 from the market prices table for
                        \ this item

Code variation 6 of 6Related to Elite's use of the Tube

Tap on a block to expand it, and tap it again to revert.

INC YC \ Move the text cursor down one row
JSR INCYC \ Move the text cursor down one row
 INC QQ29               \ Increment QQ29 to point to the next item

 LDA QQ29               \ If QQ29 >= 17 then jump to TT168 as we have done the
 CMP #17                \ last item
 BCC TT168

 RTS                    \ Return from the subroutine