JMP TT213 ; Jump to TT213 to show the Inventory screen instead of ; the Market Price screen .TT167 LDA #$BA ; If we are already showing the Market Price screen CMP QQ11 ; (i.e. QQ11 is $BA), then jump to TT213 to show the BEQ TT167-3 ; Inventory screen, so the icon bar button toggles ; between the two JSR SetNewViewType ; We are not already showing the Market Price screen, ; so that's what we do now, by clearing the screen and ; setting the view type in QQ11 to $BA (Market Price) LDA #5 ; Move the text cursor to column 5 STA XC LDA #167 ; Print recursive token 7 ("{current system name} MARKET JSR NLIN3 ; PRICES") on the top row LDA #2 ; Move the text cursor to row 2 STA YC JSR TT163 ; Print the column headers for the prices table LDX languageIndex ; Move the text cursor to the correct row for the Market LDA yMarketPrice,X ; Prices title in the chosen language STA YC 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 JSR SetupPPUForIconBar ; If the PPU has started drawing the icon bar, configure ; the PPU to use nametable 0 and pattern table 0 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 INC YC ; 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 ; Fall through into BuyAndSellCargo to process the ; buying and selling of cargo on the Market Price ; screenName: TT167 [Show more] Type: Subroutine Category: Market Summary: Show the Market Price screenContext: See this subroutine in context in the source code References: This subroutine is called as follows: * RedrawCurrentView calls TT167 * TT102 calls TT167
[X]
Subroutine NLIN3 (category: Drawing lines)
Print a title and draw a screen-wide horizontal line on tile row 2 to box it in
[X]
Subroutine SetNewViewType (category: Drawing the screen)
Clear the screen, set the current view type and move the cursor to row 0
[X]
Subroutine SetupPPUForIconBar (category: PPU)
If the PPU has started drawing the icon bar, configure the PPU to use nametable 0 and pattern table 0, while preserving A
[X]
Subroutine TT151 (category: Market)
Print the name, price and availability of a market item
[X]
Subroutine TT163 (category: Market)
Print the headers for the table of market prices
[X]
Subroutine TT167 (category: Market)
Show the Market Price screen
[X]
[X]
Label TT168 is local to this routine
[X]
Subroutine TT213 (category: Market)
Show the Inventory screen
[X]
Variable languageIndex in workspace WP
The language that was chosen on the Start screen as an index into the various lookup tables
[X]
Variable yMarketPrice (category: Market)
The text row for the Market Price title for each language