.TT22 LDA #64 ; Clear the top part of the screen, draw a border box, JSR TT66 ; and set the current view type in QQ11 to 32 (Long- ; range Chart) LDA #7 ; Move the text cursor to column 7 STA XC 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}") LDA #GCYT-1 ; Draw a screen-wide horizontal line at pixel row JSR NLIN5 ; GCYT-1, to act as the bottom of the title box and the ; top border of the chart LDA #GCYB+1 ; Draw a horizontal line from x-coordinate 31 to 228 on STA Y1 ; pixel row GCYB+1 for the bottom edge of the chart, so LDA #31 ; the chart itself is 128 * 0.75 pixels high STA X1 LDA #228 STA X2 JSR HLOIN LDA #30 ; Draw a vertical line from (30, GCYT) to (30, GCYB), JSR DVLOIN ; for the left edge of the chart LDA #226 ; Draw a vertical line from (226, GCYT) to (226, GCYB), JSR DVLOIN ; for the right edge of the chart 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 LDA QQ15+3 ; Fetch the s1_hi seed into A, which gives us the ; galactic x-coordinate of this system JSR SCALEX ; Call SCALEX to reduce the size of the chart to ; three-quarters of the original size, so it can fit ; into the Apple's screen mode, which is smaller than ; the original BBC Micro screen TAX ; Copy the scaled x-coordinate into X LDA #255 ; Set ZZ = 255 so the call to PIXEL below draws each STA ZZ ; system as a single-height two-pixel dash LDA QQ15+1 ; Fetch the s0_hi seed into A, which gives us the ; galactic y-coordinate of this system JSR SCALEY ; We halve the y-coordinate because the galaxy in ; in Elite is rectangular rather than square, and is ; twice as wide (x-axis) as it is high (y-axis), so the ; chart is 256 pixels wide and 128 high ; ; The call to SCALEY halves the y-coordinate, and then ; reduces the result to three-quarters of the original ; value, so we can fit the chart into the Apple's screen ; mode, which is smaller than the original BBC Micro ; screen CLC ; Add GCYT to the scaled y-coordinate in A (so the top ADC #GCYT ; of the chart is on pixel row GCYT) JSR PIXEL ; Call PIXEL to draw a point at (X, A), with the size of ; the point dependent on the distance specified in ZZ, ; so as we set ZZ to 255 earlier, this will draw the ; system as a single-height two-pixel dash 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 LDA QQ9 ; Set QQ19 to the selected system's x-coordinate JSR SCALEX ; STA QQ19 ; The call to SCALEX reduces the size of the chart to ; three-quarters of the original size, so it can fit ; into the Apple's screen mode, which is smaller than ; the original BBC Micro screen LDA QQ10 ; Set QQ19+1 to the selected system's y-coordinate JSR SCALEY ; STA QQ19+1 ; ; The call to SCALEY halves the value in A (as the chart ; is half as tall as it is wide), and then it reduces ; the result to three-quarters of the original value, so ; we can fit the chart into the Apple's screen mode, ; which is smaller than the original BBC Micro screen LDA #4 ; Set QQ19+2 to size 4 for the crosshairs size STA QQ19+2 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 coordinatesName: TT22 [Show more] Type: Subroutine Category: Charts Summary: Show the Long-range Chart Deep dive: A sense of scaleContext: See this subroutine in context in the source code References: This subroutine is called as follows: * TT102 calls TT22 * TT114 calls TT22
[X]
Subroutine DVLOIN (category: Drawing lines)
Draw a vertical line from (A, GCYT) to (A, GCYB)
[X]
Configuration variable GCYB = GCYT + 0.75*128
The y-coordinate of the bottom of the Long-range chart
[X]
Configuration variable GCYT = 19
The y-coordinate of the top of the Long-range Chart
[X]
Configuration variable GREEN = 8
Offset into the MASKT table for green
[X]
Subroutine HLOIN (category: Drawing lines)
Draw a horizontal line from (X1, Y1) to (X2, Y1)
[X]
Subroutine PIXEL (category: Drawing pixels)
Draw a two-pixel dash, three-pixel dash or double-height three-pixel dash
[X]
Subroutine SCALEX (category: Maths (Geometry))
Scale the x-coordinate in A to 32 + 0.75 * A
[X]
Subroutine SCALEY (category: Maths (Geometry))
Scale the y-coordinate in A to 0.375 * A
[X]
Subroutine TT14 (category: Drawing circles)
Draw a circle with crosshairs on a chart
[X]
Subroutine TT20 (category: Universe)
Twist the selected system's seeds four times
[X]
Subroutine TT27 (category: Text)
Print a text token
[X]
Subroutine TT66 (category: Drawing the screen)
Clear the screen and set the current view type
[X]
Subroutine TT81 (category: Universe)
Set the selected system's seeds to those of system 0
[X]
Label TT83 is local to this routine