Skip to navigation


Version analysis of TRADEMODE

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

Code variations between these versions are shown below.

Name: TRADEMODE Type: Subroutine Category: Drawing the screen

Code variation 1 of 6A variation in the comments only

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

Summary: Clear the screen and set up a trading screen
Summary: Clear the screen and set up a printable trading screen

Code variation 2 of 6A variation in the comments only

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

Clear the top part of the screen, draw a border box, set the palette for trading screens, and set the current view type in QQ11 to A.
Clear the top part of the screen, draw a border box, set the print flag if CTRL is being pressed, set the palette for trading screens, and set the current view type in QQ11 to A.

Arguments: A The type of the new current view (see QQ11 for a list of view types)

Code variation 3 of 6A variation in the comments only

This variation is blank in the 6502 Second Processor version.

Other entry points: TRADEMODE2 Set the palette for trading screens and switch the current colour to white
.TRADEMODE

Code variation 4 of 6Related to the 6502SP version

The 6502SP version implements printable trade screens by checking whether CTRL is being pressed before displaying the relevant screen.

This variation is blank in the Master version.

PHA \ Store the view type on the stack so we can restore it \ after the call to CTRL JSR CTRL \ Scan the keyboard to see if CTRL is currently pressed STA printflag \ Store the result in printflag, which will have bit 7 \ set (and will therefore enable printing) if CTRL is \ being pressed PLA \ Restore the view type from the stack
 JSR TT66               \ Clear the top part of the screen, draw a border box,
                        \ and set the current view type in QQ11 to A

Code variation 5 of 6Specific to an individual platform

JSR FLKB \ Call FLKB to flush the keyboard buffer

Code variation 6 of 6Minor and very low-impact

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

.TRADEMODE2 LDA #48 \ Switch to the mode 1 palette for trading screens, JSR DOVDU19 \ which is yellow (colour 1), magenta (colour 2) and \ white (colour 3) LDA #CYAN \ Switch to colour 3, which is white in the trade view STA COL RTS \ Return from the subroutine
LDA #48 \ Send a #SETVDU19 48 command to the I/O processor to JSR DOVDU19 \ switch to the mode 1 palette for trading screens, \ which is yellow (colour 1), magenta (colour 2) and \ white (colour 3) LDA #CYAN \ Send a #SETCOL CYAN command to the I/O processor to JMP DOCOL \ switch to colour 3, which is white in the trade view, \ and return from the subroutine using a tail call