This code appears in the following versions (click to see it in the source code):
Code variations between these versions are shown below.
Name: TT22 Type: Subroutine Category: Charts
.TT22 LDA #64 \ Clear the top part of the screen, draw a white border, JSR TT66 \ and set the current view type in QQ11 to 32 (Long- \ range Chart)
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.
JSR TT81 \ Set the seeds in QQ15 to those of system 0 in the \ current galaxy (i.e. copy the seeds from QQ21 to QQ15) LDA #199 \ Print recursive token 39 ("GALACTIC CHART{galaxy JSR TT27 \ number right-aligned to width 3}") JSR NLIN \ Draw a horizontal line at pixel row 23 to box in the \ title and act as the top frame of the chart, and move \ the text cursor down one line
The bottom border of the Long-range Chart is one pixel lower down the screen in the Master version than in the other versions.
Tap on a block to expand it, and tap it again to revert.
JSR TT14 \ Call TT14 to draw a circle with crosshairs at the \ current system's galactic coordinates LDX #0 \ We're now going to plot each of the galaxy's systems, \ so set up a counter in X for each system, starting at \ 0 and looping through to 255 .TT83 STX XSAV \ Store the counter in XSAV LDX QQ15+3 \ Fetch the s1_hi seed into X, which gives us the \ galactic x-coordinate of this system LDY QQ15+4 \ Fetch the s2_lo seed and set bits 4 and 6, storing the TYA \ result in ZZ to give a random number between 80 and ORA #%01010000 \ (but which will always be the same for this system). STA ZZ \ We use this value to determine the size of the point \ for this system on the chart by passing it as the \ distance argument to the PIXEL routine below
The Master version shows systems in the Long-range Chart in yellow, while the 650SP version shows them in "white" (cyan/red).
See below for more variations related to this code.
This variation is blank in the Cassette, Disc (flight), Disc (docked), 6502 Second Processor and Electron versions.
LDA #YELLOW \ Switch to colour 1, which is yellow STA COL
LDA QQ15+1 \ Fetch the s0_hi seed into A, which gives us the \ galactic y-coordinate of this system
The Master version contains code to scale the chart views, though it has no effect in this version. The code is left over from the non-BBC versions, which needed to be able to scale the charts to fit their different-sized screens.
See below for more variations related to this code.
Tap on a block to expand it, and tap it again to revert.
JSR TT20 \ We want to move on to the next system, so call TT20 \ to twist the three 16-bit seeds in QQ15 LDX XSAV \ Restore the loop counter from XSAV INX \ Increment the counter BNE TT83 \ If X > 0 then we haven't done all 256 systems yet, so \ loop back up to TT83
This variation is blank in the Cassette, Disc (flight), Disc (docked), Master and Electron versions.
JSR PBFL \ Call PBFL to send the contents of the pixel buffer to \ the I/O processor for plotting on-screen
Code variation 8 of 9
See variation 6 above for details.
Tap on a block to expand it, and tap it again to revert.
Code variation 9 of 9
See variation 5 above for details.
This variation is blank in the Cassette, Disc (flight), Disc (docked), 6502 Second Processor and Electron versions.
LDA #GREEN \ Switch to stripe 3-1-3-1, which is white/yellow in the STA COL \ chart view
\ Fall through into TT15 to draw crosshairs of size 4 at \ the selected system's coordinates