Skip to navigation

Elite on the BBC Micro and NES

Workspaces: T%

[BBC Micro cassette version]

Name: T% [Show more] Type: Workspace Address: &0300 to &035F Category: Workspaces Summary: Current commander data and stardust data blocks
Context: See this workspace in context in the source code Variations: See code variations for this workspace in the different versions References: No direct references to this workspace in this source file

Contains the current commander data (NT% bytes at location TP), and the stardust data blocks (NOST bytes at location SX)
ORG &0300 .T% SKIP 0 \ The start of the T% workspace .TP SKIP 1 \ The current mission status, which is always 0 for the \ cassette version of Elite as there are no missions \ \ [Show more]
\ \ This variable is used by the following: \ \ * QU5 \ * SVE \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.QQ0 SKIP 1 \ The current system's galactic x-coordinate (0-256) \ \ [Show more]
\ \ This variable is used by the following: \ \ * jmp \ * ping \ * TT105 \ * TT111 \ * TT14 \ * TT23 \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.QQ1 SKIP 1 \ The current system's galactic y-coordinate (0-256) \ \ [Show more]
\ \ This variable is used by the following: \ \ * jmp \ * MJP \ * TT105 \ * TT111 \ * TT14 \ * TT23 \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.QQ21 SKIP 6 \ The three 16-bit seeds for the current galaxy \ \ These seeds define system 0 in the current galaxy, so \ they can be used as a starting point to generate all \ 256 systems in the galaxy \ \ Using a galactic hyperdrive rotates each byte to the \ left (rolling each byte within itself) to get the \ seeds for the next galaxy, so after eight galactic \ jumps, the seeds roll around to the first galaxy again \ \ See the deep dives on "Galaxy and system seeds" and \ "Twisting the system seeds" for more details \ \ [Show more]
\ \ This variable is used by the following: \ \ * Ghy \ * TT81 \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.CASH SKIP 4 \ Our current cash pot \ \ The cash stash is stored as a 32-bit unsigned integer, \ with the most significant byte in CASH and the least \ significant in CASH+3. This is big-endian, which is \ the opposite way round to most of the numbers used in \ Elite - to use our notation for multi-byte numbers, \ the amount of cash is CASH(0 1 2 3) \ \ [Show more]
\ \ This variable is used by the following: \ \ * csh \ * LCASH \ * MCASH \ * SVE \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.QQ14 SKIP 1 \ Our current fuel level (0-70) \ \ The fuel level is stored as the number of light years \ multiplied by 10, so QQ14 = 1 represents 0.1 light \ years, and the maximum possible value is 70, for 7.0 \ light years \ \ [Show more]
\ \ This variable is used by the following: \ \ * DIALS (Part 4 of 4) \ * EQSHP \ * ESCAPE \ * fwl \ * hyp \ * Main flight loop (Part 15 of 16) \ * TT14 \ * TT18 \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.COK SKIP 1 \ Flags used to generate the competition code \ \ See the deep dive on "The competition code" for \ details of these flags and how they are used in \ generating and decoding the competition code \ \ [Show more]
\ \ This variable is used by the following: \ \ * MJP \ * QU5 \ * SVE \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.GCNT SKIP 1 \ The number of the current galaxy (0-7) \ \ When this is displayed in-game, 1 is added to the \ number, so we start in galaxy 1 in-game, but it's \ stored as galaxy 0 internally \ \ The galaxy number increases by one every time a \ galactic hyperdrive is used, and wraps back around to \ the start after eight galaxies \ \ [Show more]
\ \ This variable is used by the following: \ \ * Ghy \ * tal \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.LASER SKIP 4 \ The specifications of the lasers fitted to each of the \ four space views: \ \ * Byte #0 = front view \ * Byte #1 = rear view \ * Byte #2 = left view \ * Byte #3 = right view \ \ For each of the views: \ \ * 0 = no laser is fitted to this view \ \ * Non-zero = a laser is fitted to this view, with \ the following specification: \ \ * Bits 0-6 contain the laser's power \ \ * Bit 7 determines whether or not the laser pulses \ (0 = pulse laser) or is always on (1 = beam \ laser) \ \ [Show more]
\ \ This variable is used by the following: \ \ * EQSHP \ * Main flight loop (Part 3 of 16) \ * SIGHT \ * STATUS \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
SKIP 2 \ These bytes appear to be unused (they were originally \ used for up/down lasers, but they were dropped) .CRGO SKIP 1 \ Our ship's cargo capacity \ \ * 22 = standard cargo bay of 20 tonnes \ \ * 37 = large cargo bay of 35 tonnes \ \ The value is two greater than the actual capacity to \ make the maths in tnpr slightly more efficient \ \ [Show more]
\ \ This variable is used by the following: \ \ * EQSHP \ * STATUS \ * tnpr \ * TT213 \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.QQ20 SKIP 17 \ The contents of our cargo hold \ \ The amount of market item X that we have in our hold \ can be found in the X-th byte of QQ20. For example: \ \ * QQ20 contains the amount of food (item 0) \ \ * QQ20+7 contains the amount of computers (item 7) \ \ See QQ23 for a list of market item numbers and their \ storage units \ \ [Show more]
\ \ This variable is used by the following: \ \ * BAD \ * ESCAPE \ * Main flight loop (Part 8 of 16) \ * OUCH \ * tnpr \ * TT210 \ * TT219 \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.ECM SKIP 1 \ E.C.M. system \ \ * 0 = not fitted \ \ * &FF = fitted \ \ [Show more]
\ \ This variable is used by the following: \ \ * EQSHP \ * Main flight loop (Part 3 of 16) \ * STATUS \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.BST SKIP 1 \ Fuel scoops (BST stands for "barrel status") \ \ * 0 = not fitted \ \ * &FF = fitted \ \ [Show more]
\ \ This variable is used by the following: \ \ * EQSHP \ * Main flight loop (Part 7 of 16) \ * Main flight loop (Part 15 of 16) \ * STATUS \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.BOMB SKIP 1 \ Energy bomb \ \ * 0 = not fitted \ \ * &7F = fitted \ \ [Show more]
\ \ This variable is used by the following: \ \ * EQSHP \ * Main flight loop (Part 3 of 16) \ * Main flight loop (Part 5 of 16) \ * Main flight loop (Part 13 of 16) \ * STATUS \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.ENGY SKIP 1 \ Energy unit \ \ * 0 = not fitted \ \ * Non-zero = fitted \ \ The actual value determines the refresh rate of our \ energy banks, as they refresh by ENGY+1 each time (so \ our ship's energy level goes up by 2 each time if we \ have an energy unit fitted, otherwise it goes up by 1) \ \ [Show more]
\ \ This variable is used by the following: \ \ * EQSHP \ * Main flight loop (Part 13 of 16) \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.DKCMP SKIP 1 \ Docking computer \ \ * 0 = not fitted \ \ * &FF = fitted \ \ [Show more]
\ \ This variable is used by the following: \ \ * EQSHP \ * Main flight loop (Part 3 of 16) \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.GHYP SKIP 1 \ Galactic hyperdrive \ \ * 0 = not fitted \ \ * &FF = fitted \ \ [Show more]
\ \ This variable is used by the following: \ \ * EQSHP \ * Ghy \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.ESCP SKIP 1 \ Escape pod \ \ * 0 = not fitted \ \ * &FF = fitted \ \ [Show more]
\ \ This variable is used by the following: \ \ * EQSHP \ * ESCAPE \ * IRQ1 \ * Main flight loop (Part 3 of 16) \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
SKIP 4 \ These bytes appear to be unused .NOMSL SKIP 1 \ The number of missiles we have fitted (0-4) \ \ [Show more]
\ \ This variable is used by the following: \ \ * ABORT2 \ * EQSHP \ * FRMIS \ * Main flight loop (Part 3 of 16) \ * msblob \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.FIST SKIP 1 \ Our legal status (FIST stands for "fugitive/innocent \ status"): \ \ * 0 = Clean \ \ * 1-49 = Offender \ \ * 50+ = Fugitive \ \ You get 64 points if you kill a cop, so that's a fast \ ticket to fugitive status \ \ [Show more]
\ \ This variable is used by the following: \ \ * ESCAPE \ * Ghy \ * Main flight loop (Part 12 of 16) \ * Main game loop (Part 3 of 6) \ * SOLAR \ * STATUS \ * TT110 \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.AVL SKIP 17 \ Market availability in the current system \ \ The available amount of market item X is stored in \ the X-th byte of AVL, so for example: \ \ * AVL contains the amount of food (item 0) \ \ * AVL+7 contains the amount of computers (item 7) \ \ See QQ23 for a list of market item numbers and their \ storage units, and the deep dive on "Market item \ prices and availability" for details of the algorithm \ used for calculating each item's availability \ \ [Show more]
\ \ This variable is used by the following: \ \ * GVL \ * TT151 \ * TT219 \ * var \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.QQ26 SKIP 1 \ A random value used to randomise market data \ \ This value is set to a new random number for each \ change of system, so we can add a random factor into \ the calculations for market prices (for details of how \ this is used, see the deep dive on "Market prices") \ \ [Show more]
\ \ This variable is used by the following: \ \ * GVL \ * TT151 \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.TALLY SKIP 2 \ Our combat rank \ \ The combat rank is stored as the number of kills, in a \ 16-bit number TALLY(1 0) - so the high byte is in \ TALLY+1 and the low byte in TALLY \ \ If the high byte in TALLY+1 is 0 then we have between \ 0 and 255 kills, so our rank is Harmless, Mostly \ Harmless, Poor, Average or Above Average, according to \ the value of the low byte in TALLY: \ \ Harmless = %00000000 to %00000011 = 0 to 3 \ Mostly Harmless = %00000100 to %00000111 = 4 to 7 \ Poor = %00001000 to %00001111 = 8 to 15 \ Average = %00010000 to %00011111 = 16 to 31 \ Above Average = %00100000 to %11111111 = 32 to 255 \ \ If the high byte in TALLY+1 is non-zero then we are \ Competent, Dangerous, Deadly or Elite, according to \ the high byte in TALLY+1: \ \ Competent = 1 = 256 to 511 kills \ Dangerous = 2 to 9 = 512 to 2559 kills \ Deadly = 10 to 24 = 2560 to 6399 kills \ Elite = 25 and up = 6400 kills and up \ \ You can see the rating calculation in the STATUS \ subroutine \ \ [Show more]
\ \ This variable is used by the following: \ \ * EXNO2 \ * STATUS \ * SVE \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.SVC SKIP 1 \ The save count \ \ When a new commander is created, the save count gets \ set to 128. This value gets halved each time the \ commander file is saved, but it is otherwise unused. \ It is presumably part of the security system for the \ competition, possibly another flag to catch out \ entries with manually altered commander files \ \ [Show more]
\ \ This variable is used by the following: \ \ * SVE \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
SKIP 2 \ The commander file checksum \ \ These two bytes are reserved for the commander file \ checksum, so when the current commander block is \ copied from here to the last saved commander block at \ NA%, CHK and CHK2 get overwritten NT% = SVC + 2 - TP \ This sets the variable NT% to the size of the current \ commander data block, which starts at TP and ends at \ SVC+2 (inclusive) .SX SKIP NOST + 1 \ This is where we store the x_hi coordinates for all \ the stardust particles \ \ [Show more]
\ \ This variable is used by the following: \ \ * FLIP \ * nWq \ * STARS1 \ * STARS2 \ * STARS6 \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
.SXL SKIP NOST + 1 \ This is where we store the x_lo coordinates for all \ the stardust particles \ \ [Show more]
\ \ This variable is used by the following: \ \ * STARS1 \ * STARS2 \ * STARS6 \ \ This list only includes code that refers to the \ variable by name; there may be other references to \ this memory location that don't use this label, and \ these will not be mentioned above
PRINT "T% workspace from ", ~T%, " to ", ~P%