Skip to navigation

Elite on the BBC Micro and NES

Market: PrintNumberInHold

[NES version, Bank 0]

Name: PrintNumberInHold [Show more] Type: Subroutine Category: Market Summary: Print the number of units of a specified item that we have in the hold
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * TT151 calls PrintNumberInHold

Arguments: QQ29 The item number
.PrintNumberInHold SETUP_PPU_FOR_ICON_BAR ; If the PPU has started drawing the icon bar, configure ; the PPU to use nametable 0 and pattern table 0 LDY QQ29 ; Set Y to the current item number LDA #3 ; Set A = 3 to use as the number of digits below LDX QQ20,Y ; Set X to the number of units of this item that we ; already have in the hold BEQ PrintSpacedHyphen ; If we don't have any units of this item in the hold, ; jump to PrintSpacedHyphen to print two spaces, a "-", ; and two spaces CLC ; Otherwise print the 8-bit number in X to 3 digits, as JSR pr2+2 ; we set A to 3 above JMP TT152 ; Print the unit ("t", "kg" or "g") for the market item, ; with a following space if required to make it two ; characters long, and return from the subroutine using ; a tail call