SEC ; Decrement A (for when this routine is called via SBC #1 ; prx-3) .prx ASL A ; Set Y = A * 2, so it can act as an index into the TAY ; PRXS table, which has two bytes per entry LDX PRXS,Y ; Fetch the low byte of the price into X LDA PRXS+1,Y ; Fetch the high byte of the price into A and transfer TAY ; it to X, so the price is now in (Y X) .c RTS ; Return from the subroutine LDX priceDebug ; This code is never run, but it looks like it might LDA #0 ; have been used to override the price of equipment TAY ; during testing, as it sets (Y X) to (0 priceDebug) RTS ; before returning from the subroutineName: prx [Show more] Type: Subroutine Category: Equipment Summary: Return the price of a piece of equipmentContext: See this subroutine in context in the source code References: This subroutine is called as follows: * eq calls prx * EQSHP calls prx * refund calls prx * PrintEquipment calls via prx-3 * eq calls via c
This routine returns the price of equipment as listed in the table at PRXS.
Arguments: A The item number of the piece of equipment (0-13) as shown in the table at PRXS
Returns: (Y X) The item price in Cr * 10 (Y = high byte, X = low byte)
Other entry points: prx-3 Return the price of the item with number A - 1 c Contains an RTS
[X]
Variable PRXS (category: Equipment)
Equipment prices
[X]
Variable priceDebug in workspace WP
This is only referenced by some disabled test code in the prx routine, where it was presumably used for testing different equipment prices