├── .gitattributes ├── .gitignore ├── 1-source-files ├── README.md ├── boot-files │ ├── $.!BOOT.bin │ ├── $.MENU.bin │ ├── $.SCREEN.bin │ └── README.md ├── images │ ├── P.(C)ASFT.bin │ ├── P.A-SOFT.bin │ ├── P.DIALS.bin │ ├── P.ELITE.bin │ └── README.md └── main-sources │ ├── README.md │ ├── elite-build-options.asm │ ├── elite-disc.asm │ ├── elite-loader-sideways-ram.asm │ ├── elite-loader1.asm │ ├── elite-loader2.asm │ ├── elite-loader3.asm │ ├── elite-missile.asm │ ├── elite-readme.asm │ ├── elite-ships-a.asm │ ├── elite-ships-b.asm │ ├── elite-ships-c.asm │ ├── elite-ships-d.asm │ ├── elite-ships-e.asm │ ├── elite-ships-f.asm │ ├── elite-ships-g.asm │ ├── elite-ships-h.asm │ ├── elite-ships-i.asm │ ├── elite-ships-j.asm │ ├── elite-ships-k.asm │ ├── elite-ships-l.asm │ ├── elite-ships-m.asm │ ├── elite-ships-n.asm │ ├── elite-ships-o.asm │ ├── elite-ships-p.asm │ ├── elite-source-docked.asm │ ├── elite-source-flight.asm │ └── elite-text-tokens.asm ├── 2-build-files ├── README.md ├── crc32.py ├── elite-checksum.py ├── elite-decrypt.py ├── libiconv2.dll ├── libintl3.dll └── make.exe ├── 3-assembled-output ├── D.CODE.bin ├── D.CODE.unprot.bin ├── D.MOA.bin ├── D.MOB.bin ├── D.MOC.bin ├── D.MOD.bin ├── D.MOE.bin ├── D.MOF.bin ├── D.MOG.bin ├── D.MOH.bin ├── D.MOI.bin ├── D.MOJ.bin ├── D.MOK.bin ├── D.MOL.bin ├── D.MOM.bin ├── D.MON.bin ├── D.MOO.bin ├── D.MOP.bin ├── ELITE2.bin ├── ELITE3.bin ├── ELITE4.bin ├── ELITE4.unprot.bin ├── MISSILE.bin ├── MNUCODE.bin ├── README.md ├── README.txt ├── T.CODE.bin ├── T.CODE.unprot.bin ├── WORDS.bin └── compile.txt ├── 4-reference-binaries ├── README.md ├── ib-disc │ ├── !BOOT.bin │ ├── D.CODE.bin │ ├── D.CODE.unprot.bin │ ├── D.MOA.bin │ ├── D.MOB.bin │ ├── D.MOC.bin │ ├── D.MOD.bin │ ├── D.MOE.bin │ ├── D.MOF.bin │ ├── D.MOG.bin │ ├── D.MOH.bin │ ├── D.MOI.bin │ ├── D.MOJ.bin │ ├── D.MOK.bin │ ├── D.MOL.bin │ ├── D.MOM.bin │ ├── D.MON.bin │ ├── D.MOO.bin │ ├── D.MOP.bin │ ├── ELITE2.bin │ ├── ELITE3.bin │ ├── ELITE4.bin │ ├── ELITE4.unprot.bin │ ├── ELITE5.bin │ ├── ELITE6.bin │ ├── MISSILE.bin │ ├── T.CODE.bin │ ├── T.CODE.unprot.bin │ └── WORDS.bin ├── sideways-ram │ ├── D.CODE.bin │ ├── D.CODE.unprot.bin │ ├── D.MOA.bin │ ├── D.MOB.bin │ ├── D.MOC.bin │ ├── D.MOD.bin │ ├── D.MOE.bin │ ├── D.MOF.bin │ ├── D.MOG.bin │ ├── D.MOH.bin │ ├── D.MOI.bin │ ├── D.MOJ.bin │ ├── D.MOK.bin │ ├── D.MOL.bin │ ├── D.MOM.bin │ ├── D.MON.bin │ ├── D.MOO.bin │ ├── D.MOP.bin │ ├── ELITE4.bin │ ├── ELITE4.unprot.bin │ ├── MISSILE.bin │ ├── MNUCODE.bin │ ├── T.CODE.bin │ ├── T.CODE.unprot.bin │ └── WORDS.bin └── sth │ ├── D.CODE.bin │ ├── D.CODE.unprot.bin │ ├── D.MOA.bin │ ├── D.MOB.bin │ ├── D.MOC.bin │ ├── D.MOD.bin │ ├── D.MOE.bin │ ├── D.MOF.bin │ ├── D.MOG.bin │ ├── D.MOH.bin │ ├── D.MOI.bin │ ├── D.MOJ.bin │ ├── D.MOK.bin │ ├── D.MOL.bin │ ├── D.MOM.bin │ ├── D.MON.bin │ ├── D.MOO.bin │ ├── D.MOP.bin │ ├── ELITE2.bin │ ├── ELITE3.bin │ ├── ELITE4.bin │ ├── ELITE4.unprot.bin │ ├── MISSILE.bin │ ├── T.CODE.bin │ ├── T.CODE.unprot.bin │ └── WORDS.bin ├── 5-compiled-game-discs ├── README.md ├── elite-disc-ib-disc.ssd ├── elite-disc-sideways-ram.ssd └── elite-disc-sth.ssd ├── Makefile ├── README.md └── make.bat /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows thumbnail cache files 2 | Thumbs.db 3 | ehthumbs.db 4 | ehthumbs_vista.db 5 | 6 | # Folder config file 7 | Desktop.ini 8 | 9 | # Recycle Bin used on file shares 10 | $RECYCLE.BIN/ 11 | 12 | # Windows Installer files 13 | *.cab 14 | *.msi 15 | *.msm 16 | *.msp 17 | 18 | # Windows shortcuts 19 | *.lnk 20 | 21 | # IDE files 22 | .vscode/ 23 | *.code-workspace 24 | run.bat 25 | -------------------------------------------------------------------------------- /1-source-files/README.md: -------------------------------------------------------------------------------- 1 | # Source files for the BBC Micro disc version of Elite 2 | 3 | This folder contains the source files for the BBC Micro disc version of Elite. 4 | 5 | * [images](images) contains the image binaries for the title screen and dashboard 6 | 7 | * [main-sources](main-sources) contains the annotated source code 8 | 9 | --- 10 | 11 | Right on, Commanders! 12 | 13 | _Mark Moxon_ -------------------------------------------------------------------------------- /1-source-files/boot-files/$.!BOOT.bin: -------------------------------------------------------------------------------- 1 | *BASIC CHAIN"MENU" -------------------------------------------------------------------------------- /1-source-files/boot-files/$.MENU.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/1-source-files/boot-files/$.MENU.bin -------------------------------------------------------------------------------- /1-source-files/boot-files/$.SCREEN.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/1-source-files/boot-files/$.SCREEN.bin -------------------------------------------------------------------------------- /1-source-files/boot-files/README.md: -------------------------------------------------------------------------------- 1 | # Boot files for the sideways RAM variant of BBC Micro disc version of Elite 2 | 3 | This folder contains the boot and menu files from the disc containing the sideways RAM variant of Elite on Ian Bell's personal website. 4 | 5 | * [$.!BOOT.bin]($.!BOOT.bin) is the boot file from the sideways RAM disc 6 | 7 | * [$.MENU.bin]($.MENU.bin) is the menu file from the sideways RAM disc 8 | 9 | * [$.SCREEN.bin]($.SCREEN.bin) displays the Acornsoft loading screen from the sideways RAM disc 10 | 11 | --- 12 | 13 | Right on, Commanders! 14 | 15 | _Mark Moxon_ -------------------------------------------------------------------------------- /1-source-files/images/P.(C)ASFT.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/1-source-files/images/P.(C)ASFT.bin -------------------------------------------------------------------------------- /1-source-files/images/P.A-SOFT.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/1-source-files/images/P.A-SOFT.bin -------------------------------------------------------------------------------- /1-source-files/images/P.DIALS.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/1-source-files/images/P.DIALS.bin -------------------------------------------------------------------------------- /1-source-files/images/P.ELITE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/1-source-files/images/P.ELITE.bin -------------------------------------------------------------------------------- /1-source-files/images/README.md: -------------------------------------------------------------------------------- 1 | # Image binaries for the BBC Micro disc version of Elite 2 | 3 | This folder contains the image binaries from the original game disc for the BBC Micro disc version of Elite on Ian Bell's personal website. 4 | 5 | * [P.(C)ASFT.bin](P.(C)ASFT.bin) is the "(c) ACORNSOFT 1984" image for the bottom of the title screen 6 | 7 | * [P.A-SOFT.bin](P.A-SOFT.bin) is the "ACORNSOFT" image for the very top of the title screen 8 | 9 | * [P.DIALS.bin](P.DIALS2P.bin) is the dashboard image 10 | 11 | * [P.ELITE.bin](P.ELITE.bin) is the "ELITE" image for the title screen 12 | 13 | --- 14 | 15 | Right on, Commanders! 16 | 17 | _Mark Moxon_ -------------------------------------------------------------------------------- /1-source-files/main-sources/README.md: -------------------------------------------------------------------------------- 1 | # Annotated source code for the BBC Micro disc version of Elite 2 | 3 | This folder contains the annotated source code for the BBC Micro disc version of Elite. 4 | 5 | * Main source files: 6 | 7 | * [elite-source-docked.asm](elite-source-docked.asm) contains the main source for the docked portion of the game 8 | 9 | * [elite-source-flight.asm](elite-source-flight.asm) contains the main source for the flight portion of the game 10 | 11 | * [elite-text-tokens.asm](elite-text-tokens.asm) contains the source for the game's text 12 | 13 | * [elite-missile.asm](elite-missile.asm) contains the source for the missile's ship blueprint 14 | 15 | * [elite-ships-a.asm](elite-ships-a.asm) through [elite-ships-p.asm](elite-ships-p.asm) generate the ship blueprint files D.MOA to D.MOP 16 | 17 | * Other source files: 18 | 19 | * [elite-loader1.asm](elite-loader1.asm) contains the source for the first stage of the loader 20 | 21 | * [elite-loader2.asm](elite-loader2.asm) contains the source for the second stage of the loader 22 | 23 | * [elite-loader3.asm](elite-loader3.asm) contains the source for the third stage of the loader 24 | 25 | * [elite-disc.asm](elite-disc.asm) builds the SSD disc image from the assembled binaries and other source files 26 | 27 | * [elite-readme.asm](elite-readme.asm) generates a README file for inclusion on the SSD disc image 28 | 29 | * Files that are generated during the build process: 30 | 31 | * [elite-build-options.asm](elite-build-options.asm) stores the make options in BeebAsm format so they can be included in the assembly process 32 | 33 | --- 34 | 35 | Right on, Commanders! 36 | 37 | _Mark Moxon_ -------------------------------------------------------------------------------- /1-source-files/main-sources/elite-build-options.asm: -------------------------------------------------------------------------------- 1 | _VERSION=2 2 | _VARIANT=2 3 | _REMOVE_CHECKSUMS=FALSE 4 | _MATCH_ORIGINAL_BINARIES=TRUE 5 | _MAX_COMMANDER=FALSE 6 | -------------------------------------------------------------------------------- /1-source-files/main-sources/elite-disc.asm: -------------------------------------------------------------------------------- 1 | \ ****************************************************************************** 2 | \ 3 | \ BBC MICRO DISC ELITE DISC IMAGE SCRIPT 4 | \ 5 | \ BBC Micro disc Elite was written by Ian Bell and David Braben and is copyright 6 | \ Acornsoft 1984 7 | \ 8 | \ The code in this file has been reconstructed from a disassembly of the version 9 | \ released on Ian Bell's personal website at http://www.elitehomepage.org/ 10 | \ 11 | \ The commentary is copyright Mark Moxon, and any misunderstandings or mistakes 12 | \ in the documentation are entirely my fault 13 | \ 14 | \ The terminology and notations used in this commentary are explained at 15 | \ https://elite.bbcelite.com/terminology 16 | \ 17 | \ The deep dive articles referred to in this commentary can be found at 18 | \ https://elite.bbcelite.com/deep_dives 19 | \ 20 | \ ------------------------------------------------------------------------------ 21 | \ 22 | \ This source file produces an SSD disc image for BBC Micro disc Elite. 23 | \ 24 | \ ------------------------------------------------------------------------------ 25 | \ 26 | \ This source file produces one of the following SSD disc images, depending on 27 | \ which release is being built: 28 | \ 29 | \ * elite-disc-sth.ssd 30 | \ * elite-disc-ib-disc.ssd 31 | \ * elite-disc-sideways-ram.ssd 32 | \ 33 | \ This can be loaded into an emulator or a real BBC Micro. 34 | \ 35 | \ ****************************************************************************** 36 | 37 | INCLUDE "1-source-files/main-sources/elite-build-options.asm" 38 | 39 | _IB_DISC = (_VARIANT = 1) 40 | _STH_DISC = (_VARIANT = 2) 41 | _SRAM_DISC = (_VARIANT = 3) 42 | 43 | IF _STH_DISC OR _IB_DISC 44 | 45 | PUTFILE "3-assembled-output/ELITE2.bin", "ELITE2", &FF2F00, &FF2F23 46 | PUTFILE "3-assembled-output/ELITE3.bin", "ELITE3", &FF5700, &FF5700 47 | PUTFILE "3-assembled-output/ELITE4.bin", "ELITE4", &FF1900, &FF197B 48 | 49 | ELIF _SRAM_DISC 50 | 51 | PUTFILE "1-source-files/boot-files/$.!BOOT.bin", "!BOOT", &FFFFFF, &FFFFFF 52 | PUTFILE "1-source-files/boot-files/$.MENU.bin", "MENU", &FF1900, &FF8023 53 | PUTFILE "1-source-files/boot-files/$.SCREEN.bin", "SCREEN", &007800, &007BE8 54 | PUTFILE "3-assembled-output/MNUCODE.bin", "MNUCODE", &007400, &00743B 55 | PUTFILE "3-assembled-output/ELITE4.bin", "INTRO", &001900, &00197B 56 | 57 | ENDIF 58 | 59 | PUTFILE "3-assembled-output/D.CODE.bin", "D.CODE", &0011E3, &0011E3 60 | PUTFILE "3-assembled-output/T.CODE.bin", "T.CODE", &0011E3, &0011E3 61 | 62 | PUTFILE "3-assembled-output/D.MOA.bin", "D.MOA", &005600, &005600 63 | PUTFILE "3-assembled-output/D.MOB.bin", "D.MOB", &005600, &005600 64 | PUTFILE "3-assembled-output/D.MOC.bin", "D.MOC", &005600, &005600 65 | PUTFILE "3-assembled-output/D.MOD.bin", "D.MOD", &005600, &005600 66 | PUTFILE "3-assembled-output/D.MOE.bin", "D.MOE", &005600, &005600 67 | PUTFILE "3-assembled-output/D.MOF.bin", "D.MOF", &005600, &005600 68 | PUTFILE "3-assembled-output/D.MOG.bin", "D.MOG", &005600, &005600 69 | PUTFILE "3-assembled-output/D.MOH.bin", "D.MOH", &005600, &005600 70 | PUTFILE "3-assembled-output/D.MOI.bin", "D.MOI", &005600, &005600 71 | PUTFILE "3-assembled-output/D.MOJ.bin", "D.MOJ", &005600, &005600 72 | PUTFILE "3-assembled-output/D.MOK.bin", "D.MOK", &005600, &005600 73 | PUTFILE "3-assembled-output/D.MOL.bin", "D.MOL", &005600, &005600 74 | PUTFILE "3-assembled-output/D.MOM.bin", "D.MOM", &005600, &005600 75 | PUTFILE "3-assembled-output/D.MON.bin", "D.MON", &005600, &005600 76 | PUTFILE "3-assembled-output/D.MOO.bin", "D.MOO", &005600, &005600 77 | PUTFILE "3-assembled-output/D.MOP.bin", "D.MOP", &005600, &005600 78 | 79 | PUTFILE "3-assembled-output/README.txt", "README", &FFFFFF, &FFFFFF 80 | -------------------------------------------------------------------------------- /1-source-files/main-sources/elite-loader1.asm: -------------------------------------------------------------------------------- 1 | \ ****************************************************************************** 2 | \ 3 | \ BBC MICRO DISC ELITE GAME LOADER SOURCE (PART 1 OF 3) 4 | \ 5 | \ BBC Micro disc Elite was written by Ian Bell and David Braben and is copyright 6 | \ Acornsoft 1984 7 | \ 8 | \ The code in this file has been reconstructed from a disassembly of the version 9 | \ released on Ian Bell's personal website at http://www.elitehomepage.org/ 10 | \ 11 | \ The commentary is copyright Mark Moxon, and any misunderstandings or mistakes 12 | \ in the documentation are entirely my fault 13 | \ 14 | \ The terminology and notations used in this commentary are explained at 15 | \ https://elite.bbcelite.com/terminology 16 | \ 17 | \ The deep dive articles referred to in this commentary can be found at 18 | \ https://elite.bbcelite.com/deep_dives 19 | \ 20 | \ ------------------------------------------------------------------------------ 21 | \ 22 | \ This source file contains the first of three game loaders for BBC Micro disc 23 | \ Elite. 24 | \ 25 | \ ------------------------------------------------------------------------------ 26 | \ 27 | \ This source file produces the following binary file: 28 | \ 29 | \ * ELITE2.bin 30 | \ 31 | \ ****************************************************************************** 32 | 33 | INCLUDE "1-source-files/main-sources/elite-build-options.asm" 34 | 35 | _IB_DISC = (_VARIANT = 1) 36 | _STH_DISC = (_VARIANT = 2) 37 | _SRAM_DISC = (_VARIANT = 3) 38 | 39 | GUARD &7C00 \ Guard against assembling over screen memory 40 | 41 | \ ****************************************************************************** 42 | \ 43 | \ Configuration variables 44 | \ 45 | \ ****************************************************************************** 46 | 47 | CODE% = &2F00 \ The address where the code will be run 48 | 49 | LOAD% = &2F00 \ The address where the code will be loaded 50 | 51 | BYTEV = &020A \ The BYTEV vector that we check as part of the copy 52 | \ protection 53 | 54 | OSWRCH = &FFEE \ The address for the OSWRCH routine 55 | 56 | OSBYTE = &FFF4 \ The address for the OSBYTE routine 57 | 58 | OSWORD = &FFF1 \ The address for the OSWORD routine 59 | 60 | OSCLI = &FFF7 \ The address for the OSCLI routine 61 | 62 | \ ****************************************************************************** 63 | \ 64 | \ Name: ZP 65 | \ Type: Workspace 66 | \ Address: &0001 to &0002 67 | \ Category: Workspaces 68 | \ Summary: Important variables used by the loader 69 | \ 70 | \ ****************************************************************************** 71 | 72 | ORG &0001 73 | 74 | .ZP 75 | 76 | SKIP 2 \ Stores addresses used for moving content around 77 | 78 | \ ****************************************************************************** 79 | \ 80 | \ ELITE LOADER 81 | \ 82 | \ ****************************************************************************** 83 | 84 | ORG CODE% 85 | 86 | \ ****************************************************************************** 87 | \ 88 | \ Name: BEGIN 89 | \ Type: Subroutine 90 | \ Category: Copy protection 91 | \ Summary: Decrypt the loader code using a rolling EOR that uses the 92 | \ decryption routine itself to seed the decryption 93 | \ 94 | \ ****************************************************************************** 95 | 96 | .BEGIN 97 | 98 | \ Note that the following copy protection code is 99 | \ skipped in the unprotected version built here, as the 100 | \ binaries are not encrypted and therefore do not need 101 | \ to be decrypted 102 | \ 103 | \ Instead, the execution address for the ELITE2 binary 104 | \ points to ENTRY rather than BEGIN 105 | 106 | LDX p1c+1 \ Set X to the comparison value from the CMP instruction 107 | \ below, which has the value p1d - BEGIN, which we use 108 | \ as the offset of the first byte to decrypt (so we 109 | \ decrypt from p1d onwards) 110 | 111 | .p1 112 | 113 | LDA BEGIN \ Fetch the first byte from BEGIN to act as the initial 114 | \ seed for the rolling EOR process (this address gets 115 | \ modified by the following to work through the whole 116 | \ decryption routine) 117 | 118 | .p1a 119 | 120 | EOR BEGIN,X \ Set A = A EOR the X-th byte of the loader 121 | 122 | STA BEGIN,X \ Store the decrypted byte in the X-th byte the loader 123 | 124 | INX \ Increment the pointer 125 | 126 | BNE p1a \ Loop back until we have decrypted to the end of the 127 | \ page 128 | 129 | .p1b 130 | 131 | INC p1+1 \ Increment the low byte of the argument to the LDA 132 | \ instruction at p1 above, so this would change it from 133 | \ LDA BEGIN to LDA BEGIN+1, for example (so the next 134 | \ time we do the EOR, we choose the next byte of the 135 | \ decryption routine as the initial seed) 136 | 137 | BEQ p1d \ If it equals zero (so the LDA BEGIN has worked itself 138 | \ to LDA BEGIN+255 and round again to LDA BEGIN), jump 139 | \ down to p1d as we have finally finished decrypting 140 | \ the code 141 | 142 | LDA p1+1 \ Fetch the newly incremented low byte of the argument 143 | \ to the LDA instruction at p1 above 144 | 145 | .p1c 146 | 147 | CMP #(p1d - BEGIN) \ If we have used all the bytes from the decryption 148 | BEQ p1b \ routine as seeds, skip one byte and then continue on 149 | \ to keep using seeds until we have done the whole page. 150 | \ This means we decrypt using the following seeds: 151 | \ 152 | \ * The contents of BEGIN 153 | \ * The contents of BEGIN+1 154 | \ * The contents of BEGIN+2 155 | \ ... 156 | \ * The contents of p1d-1 157 | \ * The contents of p1d+1 158 | \ ... 159 | \ * The contents of BEGIN+254 160 | \ * The contents of BEGIN+255 161 | \ 162 | \ and then we are done 163 | 164 | JMP BEGIN \ Otherwise look up to BEGIN to do another decryption 165 | \ run, but using the next byte of the decryption routine 166 | \ as the seed 167 | 168 | .p1d 169 | 170 | \ From this point on, the code is encrypted by 171 | \ elite-checksum.py 172 | 173 | BIT BYTEV+1 \ If the high byte of BYTEV does not have bit 7 set (so 174 | BPL BEGIN \ BYTEV is less than &8000, i.e. it's pointing to user 175 | \ RAM rather than the ROM routine), then jump up to 176 | \ BEGIN to hang machine, as it has presumably been 177 | \ changed by someone trying to crack the game 178 | 179 | \ Otherwise fall through into the now-decrypted loader 180 | \ code to get on with loading the game 181 | 182 | \ ****************************************************************************** 183 | \ 184 | \ Name: Elite loader 185 | \ Type: Subroutine 186 | \ Category: Loader 187 | \ Summary: Reset vectors, change to mode 7, and load and run the ELITE3 188 | \ loader 189 | \ 190 | \ ------------------------------------------------------------------------------ 191 | \ 192 | \ Other entry points: 193 | \ 194 | \ load3 Load and run the next part of the loader in the ELITE3 195 | \ binary 196 | \ 197 | \ ****************************************************************************** 198 | 199 | .ENTRY 200 | 201 | LDA #0 \ Call OSBYTE with A = 0 and X = 1 to fetch bit 0 of the 202 | LDX #1 \ operating system version into X 203 | JSR OSBYTE 204 | 205 | LDY #0 \ Set Y to 0 so we can use it as an index for setting 206 | \ all the vectors to their default states 207 | 208 | SEI \ Disable all interrupts 209 | 210 | CPX #1 \ If X = 1 then this is OS 1.20, so jump to os120 211 | BEQ os120 212 | 213 | .os100 214 | 215 | LDA &D941,Y \ Copy the Y-th byte from the default vector table at 216 | STA &0200 \ &D941 into location &0200 (this is surely supposed to 217 | \ be the Y-th byte in &0200, i.e. STA &0200,Y, but it 218 | \ isn't, which feels like a bug) 219 | 220 | INY \ Increment the loop counter 221 | 222 | CPY #54 \ Loop back to copy the next byte until we have copied 223 | BNE os100 \ 54 bytes (27 vectors) 224 | 225 | BEQ disk \ Jump down to disk to skip the OS 1.20 routine 226 | 227 | .os120 228 | 229 | LDA &FFB7 \ Set ZP(1 0) to the location stored in &FFB7-&FFB8, 230 | STA ZP \ which contains the address of the default vector table 231 | LDA &FFB8 232 | STA ZP+1 233 | 234 | .ABCDEFG 235 | 236 | LDA (ZP),Y \ Copy the Y-th byte from the default vector table into 237 | STA &0200,Y \ the vector table in &0200 238 | 239 | INY \ Increment the loop counter 240 | 241 | CPY &FFB6 \ Compare the loop counter with the contents of &FFB6, 242 | \ which contains the length of the default vector table 243 | 244 | BNE ABCDEFG \ Loop back for the next vector until we have done them 245 | \ all 246 | 247 | .disk 248 | 249 | CLI \ Re-enable interrupts 250 | 251 | LDX #LO(MESS1) \ Set (Y X) to point to MESS1 ("DISK") 252 | LDY #HI(MESS1) 253 | 254 | JSR OSCLI \ Call OSCLI to run the OS command in MESS1, which 255 | \ switches to the disc filing system (DFS) 256 | 257 | LDA #201 \ Call OSBYTE with A = 201, X = 1 and Y = 0 to disable 258 | LDX #1 \ the keyboard 259 | LDY #0 260 | JSR OSBYTE 261 | 262 | LDA #200 \ Call OSBYTE with A = 200, X = 0 and Y = 0 to enable 263 | LDX #0 \ the ESCAPE key and disable memory clearing if the 264 | LDY #0 \ BREAK key is pressed 265 | JSR OSBYTE 266 | 267 | LDA #119 \ Call OSBYTE with A = 119 to close any *SPOOL or *EXEC 268 | JSR OSBYTE \ files 269 | 270 | LDY #0 \ Set Y to 0 so we can use it as an index for the 271 | \ following, which has been disabled (so perhaps this 272 | \ was part of the copy protection) 273 | 274 | .loop1 275 | 276 | LDA BLOCK,Y \ Fetch the Y-th byte from BLOCK 277 | 278 | NOP \ This instruction has been disabled, so this loop does 279 | \ nothing 280 | 281 | INY \ Increment the loop counter 282 | 283 | CPY #9 \ Loop back to do the next byte until we have done 9 of 284 | BNE loop1 \ them 285 | 286 | LDY #0 \ We are now going to send the 12 VDU bytes in the table 287 | \ at B% to OSWRCH to switch to mode 7 288 | 289 | .loop2 290 | 291 | LDA B%,Y \ Pass the Y-th byte of the B% table to OSWRCH 292 | JSR OSWRCH 293 | 294 | INY \ Increment the loop counter 295 | 296 | CPY #12 \ Loop back for the next byte until we have done all 10 297 | BNE loop2 \ of them 298 | 299 | .load3 300 | 301 | LDX #LO(MESS2) \ Set (Y X) to point to MESS2 ("LOAD Elite3") 302 | LDY #HI(MESS2) 303 | 304 | JSR OSCLI \ Call OSCLI to run the OS command in MESS2, which loads 305 | \ the ELITE3 binary to its load address of &5700 306 | 307 | JMP &5700 \ Jump to the start of the ELITE3 loader code at &5700 308 | 309 | NOP \ These bytes appear to be unused 310 | NOP 311 | NOP 312 | NOP 313 | 314 | \ ****************************************************************************** 315 | \ 316 | \ Name: MESS2 317 | \ Type: Variable 318 | \ Category: Loader 319 | \ Summary: The OS command string for loading the ELITE3 binary 320 | \ 321 | \ ****************************************************************************** 322 | 323 | .MESS2 324 | 325 | EQUS "LOAD Elite3" 326 | EQUB 13 327 | 328 | \ ****************************************************************************** 329 | \ 330 | \ Name: LOAD 331 | \ Type: Subroutine 332 | \ Category: Copy protection 333 | \ Summary: Load a hidden file from disc (not used in this version as disc 334 | \ protection is disabled) 335 | \ 336 | \ ****************************************************************************** 337 | 338 | .LOAD 339 | 340 | JSR p2 \ Call p2 below 341 | 342 | JMP load3 \ Jump to load3 to load and run the next part of the 343 | \ loader 344 | 345 | LDA #2 \ Set PARAMS1+8 = 2, which is the track number in the 346 | STA PARAMS1+8 \ OSWORD parameter block 347 | 348 | LDA #127 \ Call OSWORD with A = 127 and (Y X) = PARAMS1 to seek 349 | LDX #LO(PARAMS1) \ disc track 2 350 | LDY #HI(PARAMS1) 351 | JMP OSWORD 352 | 353 | .p2 354 | 355 | STA PARAMS2+7 \ Set PARAMS2+7 = A, which is the track number in the 356 | \ OSWORD parameter block 357 | 358 | LDA #127 \ Call OSWORD with A = 127 and (Y X) = PARAMS2 to seek 359 | LDX #LO(PARAMS2) \ the disc track given in A 360 | LDY #HI(PARAMS2) 361 | JMP OSWORD 362 | 363 | \ ****************************************************************************** 364 | \ 365 | \ Name: B% 366 | \ Type: Variable 367 | \ Category: Drawing the screen 368 | \ Summary: VDU commands for switching to a mode 7 screen 369 | \ 370 | \ ****************************************************************************** 371 | 372 | .B% 373 | 374 | EQUB 22, 7 \ Switch to screen mode 7 375 | 376 | EQUB 23, 0, 10, 32 \ Set 6845 register R10 = %00100000 = 32 377 | EQUB 0, 0, 0 \ 378 | EQUB 0, 0, 0 \ This is the "cursor start" register, and bits 5 and 6 379 | \ define the "cursor display mode", as follows: 380 | \ 381 | \ * %00 = steady, non-blinking cursor 382 | \ 383 | \ * %01 = do not display a cursor 384 | \ 385 | \ * %10 = fast blinking cursor (blink at 1/16 of the 386 | \ field rate) 387 | \ 388 | \ * %11 = slow blinking cursor (blink at 1/32 of the 389 | \ field rate) 390 | \ 391 | \ We can therefore turn off the cursor completely by 392 | \ setting cursor display mode %01, with bit 6 of R10 393 | \ clear and bit 5 of R10 set 394 | 395 | SKIP 2 \ These bytes appear to be unused 396 | 397 | \ ****************************************************************************** 398 | \ 399 | \ Name: PARAMS3 400 | \ Type: Variable 401 | \ Category: Copy protection 402 | \ Summary: OSWORD parameter block for loading the ELITE3 loader file (not 403 | \ used in this version as disc protection is disabled) 404 | \ 405 | \ ****************************************************************************** 406 | 407 | .PARAMS3 408 | 409 | EQUB &FF \ 0 = Drive = &FF (previously used drive and density) 410 | EQUD &FFFF5700 \ 1 = Data address (&FFFF5700) 411 | EQUB 3 \ 5 = Number of parameters = 3 412 | EQUB &53 \ 6 = Command = &53 (read data) 413 | EQUB 38 \ 7 = Track = 38 414 | EQUB 246 \ 8 = Sector = 246 415 | EQUB %00101001 \ 9 = Load 9 sectors of 256 bytes 416 | EQUB 0 \ 10 = The result of the OSWORD call is returned here 417 | 418 | \ ****************************************************************************** 419 | \ 420 | \ Name: PARAMS2 421 | \ Type: Variable 422 | \ Category: Copy protection 423 | \ Summary: OSWORD parameter block for accessing a specific track on the disc 424 | \ (not used in this version as disc protection is disabled) 425 | \ 426 | \ ****************************************************************************** 427 | 428 | .PARAMS2 429 | 430 | EQUB &FF \ 0 = Drive = &FF (previously used drive and density) 431 | EQUD &FFFFFFFF \ 1 = Data address (not required) 432 | EQUB 1 \ 5 = Number of parameters = 1 433 | EQUB &69 \ 6 = Command = &69 (seek track) 434 | EQUB 2 \ 7 = Parameter = 2 (track number) 435 | EQUB 0 \ 8 = The result of the OSWORD call is returned here 436 | 437 | \ ****************************************************************************** 438 | \ 439 | \ Name: PARAMS1 440 | \ Type: Variable 441 | \ Category: Copy protection 442 | \ Summary: OSWORD parameter block for accessing a specific track on the disc 443 | \ (not used in this version as disc protection is disabled) 444 | \ 445 | \ ****************************************************************************** 446 | 447 | .PARAMS1 448 | 449 | EQUB &FF \ 0 = Drive = &FF (previously used drive and density) 450 | EQUD &FFFFFFFF \ 1 = Data address (not required) 451 | EQUB 2 \ 5 = Number of parameters = 2 452 | EQUB &7A \ 6 = Command = &7A (write special register) 453 | EQUB &12 \ 7 = Parameter = &12 (register = track number) 454 | EQUB 38 \ 8 = Parameter = &26 (track number) 455 | EQUB &00 \ 9 = The result of the OSWORD call is returned here 456 | 457 | \ ****************************************************************************** 458 | \ 459 | \ Name: MESS1 460 | \ Type: Variable 461 | \ Category: Loader 462 | \ Summary: The OS command string for switching to the disc filing system 463 | \ 464 | \ ****************************************************************************** 465 | 466 | .MESS1 467 | 468 | EQUS "DISK" 469 | EQUB 13 470 | 471 | \ ****************************************************************************** 472 | \ 473 | \ Name: BLOCK 474 | \ Type: Variable 475 | \ Category: Copy protection 476 | \ Summary: These bytes are copied and decrypted by the loader routine (not 477 | \ used in this version as disc protection is disabled) 478 | \ 479 | \ ****************************************************************************** 480 | 481 | .BLOCK 482 | 483 | EQUB &19, &7A, &02, &01, &EC, &19, &00, &56 484 | EQUB &FF, &00, &00 485 | 486 | \ ****************************************************************************** 487 | \ 488 | \ Save ELITE2.bin 489 | \ 490 | \ ****************************************************************************** 491 | 492 | PRINT "S.ELITE2 ", ~CODE%, " ", ~P%, " ", ~LOAD%, " ", ~LOAD% 493 | SAVE "3-assembled-output/ELITE2.bin", CODE%, P%, LOAD% -------------------------------------------------------------------------------- /1-source-files/main-sources/elite-missile.asm: -------------------------------------------------------------------------------- 1 | \ ****************************************************************************** 2 | \ 3 | \ BBC MICRO DISC ELITE MISSILE SHIP BLUEPRINT FILE 4 | \ 5 | \ BBC Micro disc Elite was written by Ian Bell and David Braben and is copyright 6 | \ Acornsoft 1984 7 | \ 8 | \ The code in this file has been reconstructed from a disassembly of the version 9 | \ released on Ian Bell's personal website at http://www.elitehomepage.org/ 10 | \ 11 | \ The commentary is copyright Mark Moxon, and any misunderstandings or mistakes 12 | \ in the documentation are entirely my fault 13 | \ 14 | \ The terminology and notations used in this commentary are explained at 15 | \ https://elite.bbcelite.com/terminology 16 | \ 17 | \ The deep dive articles referred to in this commentary can be found at 18 | \ https://elite.bbcelite.com/deep_dives 19 | \ 20 | \ ------------------------------------------------------------------------------ 21 | \ 22 | \ This source file contains the missile ship blueprint for BBC Micro disc Elite. 23 | \ 24 | \ ------------------------------------------------------------------------------ 25 | \ 26 | \ This source file produces the following binary file: 27 | \ 28 | \ * MISSILE.bin 29 | \ 30 | \ This gets loaded as part of elite-loader3.asm and gets moved to &7F00 during 31 | \ the loading process. 32 | \ 33 | \ ****************************************************************************** 34 | 35 | INCLUDE "1-source-files/main-sources/elite-build-options.asm" 36 | 37 | _IB_DISC = (_VARIANT = 1) 38 | _STH_DISC = (_VARIANT = 2) 39 | _SRAM_DISC = (_VARIANT = 3) 40 | 41 | GUARD &6000 \ Guard against assembling over screen memory 42 | 43 | \ ****************************************************************************** 44 | \ 45 | \ Configuration variables 46 | \ 47 | \ ****************************************************************************** 48 | 49 | CODE% = &7F00 \ The address where the code will be run 50 | 51 | LOAD% = &244B \ The address where the code will be loaded 52 | 53 | ORG CODE% 54 | 55 | \ ****************************************************************************** 56 | \ 57 | \ Name: VERTEX 58 | \ Type: Macro 59 | \ Category: Drawing ships 60 | \ Summary: Macro definition for adding vertices to ship blueprints 61 | \ Deep dive: Ship blueprints 62 | \ Drawing ships 63 | \ 64 | \ ------------------------------------------------------------------------------ 65 | \ 66 | \ The following macro is used to build the ship blueprints: 67 | \ 68 | \ VERTEX x, y, z, face1, face2, face3, face4, visibility 69 | \ 70 | \ ------------------------------------------------------------------------------ 71 | \ 72 | \ Arguments: 73 | \ 74 | \ x The vertex's x-coordinate 75 | \ 76 | \ y The vertex's y-coordinate 77 | \ 78 | \ z The vertex's z-coordinate 79 | \ 80 | \ face1 The number of face 1 associated with this vertex 81 | \ 82 | \ face2 The number of face 2 associated with this vertex 83 | \ 84 | \ face3 The number of face 3 associated with this vertex 85 | \ 86 | \ face4 The number of face 4 associated with this vertex 87 | \ 88 | \ visibility The visibility distance, beyond which the vertex is not 89 | \ shown 90 | \ 91 | \ ****************************************************************************** 92 | 93 | MACRO VERTEX x, y, z, face1, face2, face3, face4, visibility 94 | 95 | IF x < 0 96 | s_x = 1 << 7 97 | ELSE 98 | s_x = 0 99 | ENDIF 100 | 101 | IF y < 0 102 | s_y = 1 << 6 103 | ELSE 104 | s_y = 0 105 | ENDIF 106 | 107 | IF z < 0 108 | s_z = 1 << 5 109 | ELSE 110 | s_z = 0 111 | ENDIF 112 | 113 | s = s_x + s_y + s_z + visibility 114 | f1 = face1 + (face2 << 4) 115 | f2 = face3 + (face4 << 4) 116 | ax = ABS(x) 117 | ay = ABS(y) 118 | az = ABS(z) 119 | 120 | EQUB ax, ay, az, s, f1, f2 121 | 122 | ENDMACRO 123 | 124 | \ ****************************************************************************** 125 | \ 126 | \ Name: EDGE 127 | \ Type: Macro 128 | \ Category: Drawing ships 129 | \ Summary: Macro definition for adding edges to ship blueprints 130 | \ Deep dive: Ship blueprints 131 | \ Drawing ships 132 | \ 133 | \ ------------------------------------------------------------------------------ 134 | \ 135 | \ The following macro is used to build the ship blueprints: 136 | \ 137 | \ EDGE vertex1, vertex2, face1, face2, visibility 138 | \ 139 | \ When stored in memory, bytes #2 and #3 contain the vertex numbers multiplied 140 | \ by 4, so we can use them as indices into the heap at XX3 to fetch the screen 141 | \ coordinates for each vertex, as they are stored as four bytes containing two 142 | \ 16-bit numbers (see part 10 of the LL9 routine for details). 143 | \ 144 | \ ------------------------------------------------------------------------------ 145 | \ 146 | \ Arguments: 147 | \ 148 | \ vertex1 The number of the vertex at the start of the edge 149 | \ 150 | \ vertex1 The number of the vertex at the end of the edge 151 | \ 152 | \ face1 The number of face 1 associated with this edge 153 | \ 154 | \ face2 The number of face 2 associated with this edge 155 | \ 156 | \ visibility The visibility distance, beyond which the edge is not 157 | \ shown 158 | \ 159 | \ ****************************************************************************** 160 | 161 | MACRO EDGE vertex1, vertex2, face1, face2, visibility 162 | 163 | f = face1 + (face2 << 4) 164 | EQUB visibility, f, vertex1 << 2, vertex2 << 2 165 | 166 | ENDMACRO 167 | 168 | \ ****************************************************************************** 169 | \ 170 | \ Name: FACE 171 | \ Type: Macro 172 | \ Category: Drawing ships 173 | \ Summary: Macro definition for adding faces to ship blueprints 174 | \ Deep dive: Ship blueprints 175 | \ Drawing ships 176 | \ 177 | \ ------------------------------------------------------------------------------ 178 | \ 179 | \ The following macro is used to build the ship blueprints: 180 | \ 181 | \ FACE normal_x, normal_y, normal_z, visibility 182 | \ 183 | \ ------------------------------------------------------------------------------ 184 | \ 185 | \ Arguments: 186 | \ 187 | \ normal_x The face normal's x-coordinate 188 | \ 189 | \ normal_y The face normal's y-coordinate 190 | \ 191 | \ normal_z The face normal's z-coordinate 192 | \ 193 | \ visibility The visibility distance, beyond which the edge is always 194 | \ shown 195 | \ 196 | \ ****************************************************************************** 197 | 198 | MACRO FACE normal_x, normal_y, normal_z, visibility 199 | 200 | IF normal_x < 0 201 | s_x = 1 << 7 202 | ELSE 203 | s_x = 0 204 | ENDIF 205 | 206 | IF normal_y < 0 207 | s_y = 1 << 6 208 | ELSE 209 | s_y = 0 210 | ENDIF 211 | 212 | IF normal_z < 0 213 | s_z = 1 << 5 214 | ELSE 215 | s_z = 0 216 | ENDIF 217 | 218 | s = s_x + s_y + s_z + visibility 219 | ax = ABS(normal_x) 220 | ay = ABS(normal_y) 221 | az = ABS(normal_z) 222 | 223 | EQUB s, ax, ay, az 224 | 225 | ENDMACRO 226 | 227 | \ ****************************************************************************** 228 | \ 229 | \ Name: SHIP_MISSILE 230 | \ Type: Variable 231 | \ Category: Drawing ships 232 | \ Summary: Ship blueprint for a missile 233 | \ Deep dive: Ship blueprints 234 | \ Comparing ship specifications 235 | \ 236 | \ ****************************************************************************** 237 | 238 | .SHIP_MISSILE 239 | 240 | EQUB 0 \ Max. canisters on demise = 0 241 | EQUW 40 * 40 \ Targetable area = 40 * 40 242 | 243 | EQUB LO(SHIP_MISSILE_EDGES - SHIP_MISSILE) \ Edges data offset (low) 244 | EQUB LO(SHIP_MISSILE_FACES - SHIP_MISSILE) \ Faces data offset (low) 245 | 246 | EQUB 81 \ Max. edge count = (81 - 1) / 4 = 20 247 | EQUB 0 \ Gun vertex = 0 248 | EQUB 10 \ Explosion count = 1, as (4 * n) + 6 = 10 249 | EQUB 102 \ Number of vertices = 102 / 6 = 17 250 | EQUB 24 \ Number of edges = 24 251 | EQUW 0 \ Bounty = 0 252 | EQUB 36 \ Number of faces = 36 / 4 = 9 253 | EQUB 14 \ Visibility distance = 14 254 | EQUB 2 \ Max. energy = 2 255 | EQUB 44 \ Max. speed = 44 256 | 257 | EQUB HI(SHIP_MISSILE_EDGES - SHIP_MISSILE) \ Edges data offset (high) 258 | EQUB HI(SHIP_MISSILE_FACES - SHIP_MISSILE) \ Faces data offset (high) 259 | 260 | EQUB 2 \ Normals are scaled by = 2^2 = 4 261 | EQUB %00000000 \ Laser power = 0 262 | \ Missiles = 0 263 | 264 | .SHIP_MISSILE_VERTICES 265 | 266 | \ x, y, z, face1, face2, face3, face4, visibility 267 | VERTEX 0, 0, 68, 0, 1, 2, 3, 31 \ Vertex 0 268 | VERTEX 8, -8, 36, 1, 2, 4, 5, 31 \ Vertex 1 269 | VERTEX 8, 8, 36, 2, 3, 4, 7, 31 \ Vertex 2 270 | VERTEX -8, 8, 36, 0, 3, 6, 7, 31 \ Vertex 3 271 | VERTEX -8, -8, 36, 0, 1, 5, 6, 31 \ Vertex 4 272 | VERTEX 8, 8, -44, 4, 7, 8, 8, 31 \ Vertex 5 273 | VERTEX 8, -8, -44, 4, 5, 8, 8, 31 \ Vertex 6 274 | VERTEX -8, -8, -44, 5, 6, 8, 8, 31 \ Vertex 7 275 | VERTEX -8, 8, -44, 6, 7, 8, 8, 31 \ Vertex 8 276 | VERTEX 12, 12, -44, 4, 7, 8, 8, 8 \ Vertex 9 277 | VERTEX 12, -12, -44, 4, 5, 8, 8, 8 \ Vertex 10 278 | VERTEX -12, -12, -44, 5, 6, 8, 8, 8 \ Vertex 11 279 | VERTEX -12, 12, -44, 6, 7, 8, 8, 8 \ Vertex 12 280 | VERTEX -8, 8, -12, 6, 7, 7, 7, 8 \ Vertex 13 281 | VERTEX -8, -8, -12, 5, 6, 6, 6, 8 \ Vertex 14 282 | VERTEX 8, 8, -12, 4, 7, 7, 7, 8 \ Vertex 15 283 | VERTEX 8, -8, -12, 4, 5, 5, 5, 8 \ Vertex 16 284 | 285 | .SHIP_MISSILE_EDGES 286 | 287 | \ vertex1, vertex2, face1, face2, visibility 288 | EDGE 0, 1, 1, 2, 31 \ Edge 0 289 | EDGE 0, 2, 2, 3, 31 \ Edge 1 290 | EDGE 0, 3, 0, 3, 31 \ Edge 2 291 | EDGE 0, 4, 0, 1, 31 \ Edge 3 292 | EDGE 1, 2, 4, 2, 31 \ Edge 4 293 | EDGE 1, 4, 1, 5, 31 \ Edge 5 294 | EDGE 3, 4, 0, 6, 31 \ Edge 6 295 | EDGE 2, 3, 3, 7, 31 \ Edge 7 296 | EDGE 2, 5, 4, 7, 31 \ Edge 8 297 | EDGE 1, 6, 4, 5, 31 \ Edge 9 298 | EDGE 4, 7, 5, 6, 31 \ Edge 10 299 | EDGE 3, 8, 6, 7, 31 \ Edge 11 300 | EDGE 7, 8, 6, 8, 31 \ Edge 12 301 | EDGE 5, 8, 7, 8, 31 \ Edge 13 302 | EDGE 5, 6, 4, 8, 31 \ Edge 14 303 | EDGE 6, 7, 5, 8, 31 \ Edge 15 304 | EDGE 6, 10, 5, 8, 8 \ Edge 16 305 | EDGE 5, 9, 7, 8, 8 \ Edge 17 306 | EDGE 8, 12, 7, 8, 8 \ Edge 18 307 | EDGE 7, 11, 5, 8, 8 \ Edge 19 308 | EDGE 9, 15, 4, 7, 8 \ Edge 20 309 | EDGE 10, 16, 4, 5, 8 \ Edge 21 310 | EDGE 12, 13, 6, 7, 8 \ Edge 22 311 | EDGE 11, 14, 5, 6, 8 \ Edge 23 312 | 313 | .SHIP_MISSILE_FACES 314 | 315 | \ normal_x, normal_y, normal_z, visibility 316 | FACE -64, 0, 16, 31 \ Face 0 317 | FACE 0, -64, 16, 31 \ Face 1 318 | FACE 64, 0, 16, 31 \ Face 2 319 | FACE 0, 64, 16, 31 \ Face 3 320 | FACE 32, 0, 0, 31 \ Face 4 321 | FACE 0, -32, 0, 31 \ Face 5 322 | FACE -32, 0, 0, 31 \ Face 6 323 | 324 | IF _STH_DISC OR _IB_DISC 325 | 326 | FACE 0, 160, 110, 31 \ Face 7 327 | FACE 0, 64, 4, 0 \ Face 8 328 | 329 | ELIF _SRAM_DISC 330 | 331 | FACE 0, 32, 0, 31 \ Face 7 332 | FACE 0, 0, -176, 31 \ Face 8 333 | 334 | ENDIF 335 | 336 | \ ****************************************************************************** 337 | \ 338 | \ Name: VEC 339 | \ Type: Variable 340 | \ Category: Drawing the screen 341 | \ Summary: The original value of the IRQ1 vector 342 | \ 343 | \ ****************************************************************************** 344 | 345 | .VEC 346 | 347 | IF _STH_DISC OR _IB_DISC 348 | 349 | EQUW &0004 \ VEC = &7FFE 350 | \ 351 | \ This gets set to the value of the original IRQ1 vector 352 | \ by the loading process 353 | \ 354 | \ This default value is random workspace noise left over 355 | \ from the BBC Micro assembly process; it gets 356 | \ overwritten 357 | 358 | ELIF _SRAM_DISC 359 | 360 | SKIP 2 \ VEC = &7FFE 361 | \ 362 | \ This gets set to the value of the original IRQ1 vector 363 | \ by the loading process 364 | 365 | ENDIF 366 | 367 | \ ****************************************************************************** 368 | \ 369 | \ Save MISSILE.bin 370 | \ 371 | \ ****************************************************************************** 372 | 373 | PRINT "MISSILE" 374 | PRINT "Assembled at ", ~CODE% 375 | PRINT "Ends at ", ~P% 376 | PRINT "Code size is ", ~(P% - CODE%) 377 | PRINT "Execute at ", ~LOAD% 378 | PRINT "Reload at ", ~LOAD% 379 | 380 | PRINT "S.MISSILE ", ~CODE%, " ", ~P%, " ", ~LOAD%, " ", ~LOAD% 381 | SAVE "3-assembled-output/MISSILE.bin", CODE%, P%, LOAD% 382 | -------------------------------------------------------------------------------- /1-source-files/main-sources/elite-readme.asm: -------------------------------------------------------------------------------- 1 | \ ****************************************************************************** 2 | \ 3 | \ BBC MICRO DISC ELITE README SOURCE 4 | \ 5 | \ BBC Micro disc Elite was written by Ian Bell and David Braben and is copyright 6 | \ Acornsoft 1984 7 | \ 8 | \ The code in this file has been reconstructed from a disassembly of the version 9 | \ released on Ian Bell's personal website at http://www.elitehomepage.org/ 10 | \ 11 | \ The commentary is copyright Mark Moxon, and any misunderstandings or mistakes 12 | \ in the documentation are entirely my fault 13 | \ 14 | \ The terminology and notations used in this commentary are explained at 15 | \ https://elite.bbcelite.com/terminology 16 | \ 17 | \ The deep dive articles referred to in this commentary can be found at 18 | \ https://elite.bbcelite.com/deep_dives 19 | \ 20 | \ ------------------------------------------------------------------------------ 21 | \ 22 | \ This source file produces a README file for BBC Micro disc Elite. 23 | \ 24 | \ ------------------------------------------------------------------------------ 25 | \ 26 | \ This source file produces the following binary file: 27 | \ 28 | \ * README.txt 29 | \ 30 | \ ****************************************************************************** 31 | 32 | INCLUDE "1-source-files/main-sources/elite-build-options.asm" 33 | 34 | _IB_DISC = (_VARIANT = 1) 35 | _STH_DISC = (_VARIANT = 2) 36 | _SRAM_DISC = (_VARIANT = 3) 37 | 38 | .readme 39 | 40 | EQUB 10, 13 41 | EQUS "---------------------------------------" 42 | EQUB 10, 13 43 | EQUS "Acornsoft Elite" 44 | EQUB 10, 13 45 | EQUB 10, 13 46 | EQUS "Version: BBC Micro disc" 47 | EQUB 10, 13 48 | 49 | IF _IB_DISC 50 | 51 | EQUS "Variant: Ian Bell's game disc" 52 | EQUB 10, 13 53 | EQUS "Product: Acornsoft SNG38" 54 | EQUB 10, 13 55 | 56 | ELIF _STH_DISC 57 | 58 | EQUS "Variant: Stairway to Hell archive" 59 | EQUB 10, 13 60 | EQUS "Product: Acornsoft SNG38" 61 | EQUB 10, 13 62 | EQUS " Acornsoft SNG47" 63 | EQUB 10, 13 64 | 65 | ELIF _SRAM_DISC 66 | 67 | EQUS "Variant: BBC Micro Sideways RAM version" 68 | EQUB 10, 13 69 | 70 | ENDIF 71 | 72 | EQUB 10, 13 73 | EQUS "See www.bbcelite.com for details" 74 | EQUB 10, 13 75 | EQUS "---------------------------------------" 76 | EQUB 10, 13 77 | 78 | SAVE "3-assembled-output/README.txt", readme, P% 79 | 80 | -------------------------------------------------------------------------------- /1-source-files/main-sources/elite-text-tokens.asm: -------------------------------------------------------------------------------- 1 | \ ****************************************************************************** 2 | \ 3 | \ BBC MICRO DISC ELITE GAME DATA SOURCE 4 | \ 5 | \ BBC Micro disc Elite was written by Ian Bell and David Braben and is copyright 6 | \ Acornsoft 1984 7 | \ 8 | \ The code in this file has been reconstructed from a disassembly of the version 9 | \ released on Ian Bell's personal website at http://www.elitehomepage.org/ 10 | \ 11 | \ The commentary is copyright Mark Moxon, and any misunderstandings or mistakes 12 | \ in the documentation are entirely my fault 13 | \ 14 | \ The terminology and notations used in this commentary are explained at 15 | \ https://elite.bbcelite.com/terminology 16 | \ 17 | \ The deep dive articles referred to in this commentary can be found at 18 | \ https://elite.bbcelite.com/deep_dives 19 | \ 20 | \ ------------------------------------------------------------------------------ 21 | \ 22 | \ This source file contains the game data for BBC Micro disc Elite, including 23 | \ the game text. 24 | \ 25 | \ ------------------------------------------------------------------------------ 26 | \ 27 | \ This source file produces the following binary file: 28 | \ 29 | \ * WORDS.bin 30 | \ 31 | \ This gets loaded as part of elite-loader3.asm and gets moved to &0400 during 32 | \ the loading process. 33 | \ 34 | \ The binary file also includes the sine and arctan tables, so the three parts 35 | \ end up as follows: 36 | \ 37 | \ * Recursive token table: QQ18 = &0400 to &07FF 38 | \ * Sine lookup table: SNE = &07C0 to &07DF 39 | \ * Arctan lookup table: ACT = &07E0 to &07FF 40 | \ 41 | \ ****************************************************************************** 42 | 43 | INCLUDE "1-source-files/main-sources/elite-build-options.asm" 44 | 45 | _IB_DISC = (_VARIANT = 1) 46 | _STH_DISC = (_VARIANT = 2) 47 | _SRAM_DISC = (_VARIANT = 3) 48 | 49 | GUARD &6000 \ Guard against assembling over screen memory 50 | 51 | \ ****************************************************************************** 52 | \ 53 | \ Configuration variables 54 | \ 55 | \ ****************************************************************************** 56 | 57 | CODE_WORDS% = &0400 \ The address where the text data will be run 58 | 59 | LOAD_WORDS% = &254B \ The address where the text data will be loaded 60 | 61 | RE = &23 \ The obfuscation byte used to hide the recursive tokens 62 | \ table from crackers viewing the binary code 63 | 64 | ORG CODE_WORDS% 65 | 66 | \ ****************************************************************************** 67 | \ 68 | \ Name: CHAR 69 | \ Type: Macro 70 | \ Category: Text 71 | \ Summary: Macro definition for characters in the recursive token table 72 | \ Deep dive: Printing text tokens 73 | \ 74 | \ ------------------------------------------------------------------------------ 75 | \ 76 | \ The following macro is used when building the recursive token table: 77 | \ 78 | \ CHAR 'x' Insert ASCII character "x" 79 | \ 80 | \ To include an apostrophe, use a backtick character, as in CHAR '`'. 81 | \ 82 | \ ------------------------------------------------------------------------------ 83 | \ 84 | \ Arguments: 85 | \ 86 | \ 'x' The character to insert into the table 87 | \ 88 | \ ****************************************************************************** 89 | 90 | MACRO CHAR x 91 | 92 | IF x = '`' 93 | EQUB 39 EOR RE 94 | ELSE 95 | EQUB x EOR RE 96 | ENDIF 97 | 98 | ENDMACRO 99 | 100 | \ ****************************************************************************** 101 | \ 102 | \ Name: TWOK 103 | \ Type: Macro 104 | \ Category: Text 105 | \ Summary: Macro definition for two-letter tokens in the token table 106 | \ Deep dive: Printing text tokens 107 | \ 108 | \ ------------------------------------------------------------------------------ 109 | \ 110 | \ The following macro is used when building the recursive token table: 111 | \ 112 | \ TWOK 'x', 'y' Insert two-letter token "xy" 113 | \ 114 | \ ------------------------------------------------------------------------------ 115 | \ 116 | \ Arguments: 117 | \ 118 | \ 'x' The first letter of the two-letter token to insert into 119 | \ the table 120 | \ 121 | \ 'y' The second letter of the two-letter token to insert into 122 | \ the table 123 | \ 124 | \ ****************************************************************************** 125 | 126 | MACRO TWOK t, k 127 | 128 | IF t = 'A' AND k = 'L' 129 | EQUB 128 EOR RE 130 | ENDIF 131 | 132 | IF t = 'L' AND k = 'E' 133 | EQUB 129 EOR RE 134 | ENDIF 135 | 136 | IF t = 'X' AND k = 'E' 137 | EQUB 130 EOR RE 138 | ENDIF 139 | 140 | IF t = 'G' AND k = 'E' 141 | EQUB 131 EOR RE 142 | ENDIF 143 | 144 | IF t = 'Z' AND k = 'A' 145 | EQUB 132 EOR RE 146 | ENDIF 147 | 148 | IF t = 'C' AND k = 'E' 149 | EQUB 133 EOR RE 150 | ENDIF 151 | 152 | IF t = 'B' AND k = 'I' 153 | EQUB 134 EOR RE 154 | ENDIF 155 | 156 | IF t = 'S' AND k = 'O' 157 | EQUB 135 EOR RE 158 | ENDIF 159 | 160 | IF t = 'U' AND k = 'S' 161 | EQUB 136 EOR RE 162 | ENDIF 163 | 164 | IF t = 'E' AND k = 'S' 165 | EQUB 137 EOR RE 166 | ENDIF 167 | 168 | IF t = 'A' AND k = 'R' 169 | EQUB 138 EOR RE 170 | ENDIF 171 | 172 | IF t = 'M' AND k = 'A' 173 | EQUB 139 EOR RE 174 | ENDIF 175 | 176 | IF t = 'I' AND k = 'N' 177 | EQUB 140 EOR RE 178 | ENDIF 179 | 180 | IF t = 'D' AND k = 'I' 181 | EQUB 141 EOR RE 182 | ENDIF 183 | 184 | IF t = 'R' AND k = 'E' 185 | EQUB 142 EOR RE 186 | ENDIF 187 | 188 | IF t = 'A' AND k = '?' 189 | EQUB 143 EOR RE 190 | ENDIF 191 | 192 | IF t = 'E' AND k = 'R' 193 | EQUB 144 EOR RE 194 | ENDIF 195 | 196 | IF t = 'A' AND k = 'T' 197 | EQUB 145 EOR RE 198 | ENDIF 199 | 200 | IF t = 'E' AND k = 'N' 201 | EQUB 146 EOR RE 202 | ENDIF 203 | 204 | IF t = 'B' AND k = 'E' 205 | EQUB 147 EOR RE 206 | ENDIF 207 | 208 | IF t = 'R' AND k = 'A' 209 | EQUB 148 EOR RE 210 | ENDIF 211 | 212 | IF t = 'L' AND k = 'A' 213 | EQUB 149 EOR RE 214 | ENDIF 215 | 216 | IF t = 'V' AND k = 'E' 217 | EQUB 150 EOR RE 218 | ENDIF 219 | 220 | IF t = 'T' AND k = 'I' 221 | EQUB 151 EOR RE 222 | ENDIF 223 | 224 | IF t = 'E' AND k = 'D' 225 | EQUB 152 EOR RE 226 | ENDIF 227 | 228 | IF t = 'O' AND k = 'R' 229 | EQUB 153 EOR RE 230 | ENDIF 231 | 232 | IF t = 'Q' AND k = 'U' 233 | EQUB 154 EOR RE 234 | ENDIF 235 | 236 | IF t = 'A' AND k = 'N' 237 | EQUB 155 EOR RE 238 | ENDIF 239 | 240 | IF t = 'T' AND k = 'E' 241 | EQUB 156 EOR RE 242 | ENDIF 243 | 244 | IF t = 'I' AND k = 'S' 245 | EQUB 157 EOR RE 246 | ENDIF 247 | 248 | IF t = 'R' AND k = 'I' 249 | EQUB 158 EOR RE 250 | ENDIF 251 | 252 | IF t = 'O' AND k = 'N' 253 | EQUB 159 EOR RE 254 | ENDIF 255 | 256 | ENDMACRO 257 | 258 | \ ****************************************************************************** 259 | \ 260 | \ Name: CONT 261 | \ Type: Macro 262 | \ Category: Text 263 | \ Summary: Macro definition for control codes in the recursive token table 264 | \ Deep dive: Printing text tokens 265 | \ 266 | \ ------------------------------------------------------------------------------ 267 | \ 268 | \ The following macro is used when building the recursive token table: 269 | \ 270 | \ CONT n Insert control code token {n} 271 | \ 272 | \ ------------------------------------------------------------------------------ 273 | \ 274 | \ Arguments: 275 | \ 276 | \ n The control code to insert into the table 277 | \ 278 | \ ****************************************************************************** 279 | 280 | MACRO CONT n 281 | 282 | EQUB n EOR RE 283 | 284 | ENDMACRO 285 | 286 | \ ****************************************************************************** 287 | \ 288 | \ Name: RTOK 289 | \ Type: Macro 290 | \ Category: Text 291 | \ Summary: Macro definition for recursive tokens in the recursive token table 292 | \ Deep dive: Printing text tokens 293 | \ 294 | \ ------------------------------------------------------------------------------ 295 | \ 296 | \ The following macro is used when building the recursive token table: 297 | \ 298 | \ RTOK n Insert recursive token [n] 299 | \ 300 | \ * Tokens 0-95 get stored as n + 160 301 | \ 302 | \ * Tokens 128-145 get stored as n - 114 303 | \ 304 | \ * Tokens 96-127 get stored as n 305 | \ 306 | \ ------------------------------------------------------------------------------ 307 | \ 308 | \ Arguments: 309 | \ 310 | \ n The number of the recursive token to insert into the 311 | \ table, in the range 0 to 145 312 | \ 313 | \ ****************************************************************************** 314 | 315 | MACRO RTOK n 316 | 317 | IF n >= 0 AND n <= 95 318 | t = n + 160 319 | ELIF n >= 128 320 | t = n - 114 321 | ELSE 322 | t = n 323 | ENDIF 324 | 325 | EQUB t EOR RE 326 | 327 | ENDMACRO 328 | 329 | \ ****************************************************************************** 330 | \ 331 | \ Name: QQ18 332 | \ Type: Variable 333 | \ Category: Text 334 | \ Summary: The recursive token table for tokens 0-148 335 | \ Deep dive: Printing text tokens 336 | \ 337 | \ ------------------------------------------------------------------------------ 338 | \ 339 | \ The encodings shown for each recursive text token use the following notation: 340 | \ 341 | \ {n} Control code n = 0 to 13 342 | \ Two-letter token n = 128 to 159 343 | \ [n] Recursive token n = 0 to 148 344 | \ 345 | \ ****************************************************************************** 346 | 347 | .QQ18 348 | 349 | RTOK 111 \ Token 0: "FUEL SCOOPS ON {beep}" 350 | RTOK 131 \ 351 | CONT 7 \ Encoded as: "[111][131]{7}" 352 | EQUB 0 353 | 354 | CHAR ' ' \ Token 1: " CHART" 355 | CHAR 'C' \ 356 | CHAR 'H' \ Encoded as: " CH<138>T" 357 | TWOK 'A', 'R' 358 | CHAR 'T' 359 | EQUB 0 360 | 361 | CHAR 'G' \ Token 2: "GOVERNMENT" 362 | CHAR 'O' \ 363 | TWOK 'V', 'E' \ Encoded as: "GO<150>RNM<146>T" 364 | CHAR 'R' 365 | CHAR 'N' 366 | CHAR 'M' 367 | TWOK 'E', 'N' 368 | CHAR 'T' 369 | EQUB 0 370 | 371 | CHAR 'D' \ Token 3: "DATA ON {selected system name}" 372 | TWOK 'A', 'T' \ 373 | CHAR 'A' \ Encoded as: "D<145>A[131]{3}" 374 | RTOK 131 375 | CONT 3 376 | EQUB 0 377 | 378 | TWOK 'I', 'N' \ Token 4: "INVENTORY{cr} 379 | TWOK 'V', 'E' \ " 380 | CHAR 'N' \ 381 | CHAR 'T' \ Encoded as: "<140><150>NT<153>Y{12}" 382 | TWOK 'O', 'R' 383 | CHAR 'Y' 384 | CONT 12 385 | EQUB 0 386 | 387 | CHAR 'S' \ Token 5: "SYSTEM" 388 | CHAR 'Y' \ 389 | CHAR 'S' \ Encoded as: "SYS<156>M" 390 | TWOK 'T', 'E' 391 | CHAR 'M' 392 | EQUB 0 393 | 394 | CHAR 'P' \ Token 6: "PRICE" 395 | TWOK 'R', 'I' \ 396 | TWOK 'C', 'E' \ Encoded as: "P<158><133>" 397 | EQUB 0 398 | 399 | CONT 2 \ Token 7: "{current system name} MARKET PRICES" 400 | CHAR ' ' \ 401 | TWOK 'M', 'A' \ Encoded as: "{2} <139>RKET [6]S" 402 | CHAR 'R' 403 | CHAR 'K' 404 | CHAR 'E' 405 | CHAR 'T' 406 | CHAR ' ' 407 | RTOK 6 408 | CHAR 'S' 409 | EQUB 0 410 | 411 | TWOK 'I', 'N' \ Token 8: "INDUSTRIAL" 412 | CHAR 'D' \ 413 | TWOK 'U', 'S' \ Encoded as: "<140>D<136>T<158><128>" 414 | CHAR 'T' 415 | TWOK 'R', 'I' 416 | TWOK 'A', 'L' 417 | EQUB 0 418 | 419 | CHAR 'A' \ Token 9: "AGRICULTURAL" 420 | CHAR 'G' \ 421 | TWOK 'R', 'I' \ Encoded as: "AG<158>CULTU<148>L" 422 | CHAR 'C' 423 | CHAR 'U' 424 | CHAR 'L' 425 | CHAR 'T' 426 | CHAR 'U' 427 | TWOK 'R', 'A' 428 | CHAR 'L' 429 | EQUB 0 430 | 431 | TWOK 'R', 'I' \ Token 10: "RICH " 432 | CHAR 'C' \ 433 | CHAR 'H' \ Encoded as: "<158>CH " 434 | CHAR ' ' 435 | EQUB 0 436 | 437 | CHAR 'A' \ Token 11: "AVERAGE " 438 | TWOK 'V', 'E' \ 439 | TWOK 'R', 'A' \ Encoded as: "A<150><148><131> " 440 | TWOK 'G', 'E' 441 | CHAR ' ' 442 | EQUB 0 443 | 444 | CHAR 'P' \ Token 12: "POOR " 445 | CHAR 'O' \ 446 | TWOK 'O', 'R' \ Encoded as: "PO<153> " 447 | CHAR ' ' 448 | EQUB 0 449 | 450 | TWOK 'M', 'A' \ Token 13: "MAINLY " 451 | TWOK 'I', 'N' \ 452 | CHAR 'L' \ Encoded as: "<139><140>LY " 453 | CHAR 'Y' 454 | CHAR ' ' 455 | EQUB 0 456 | 457 | CHAR 'U' \ Token 14: "UNIT" 458 | CHAR 'N' \ 459 | CHAR 'I' \ Encoded as: "UNIT" 460 | CHAR 'T' 461 | EQUB 0 462 | 463 | CHAR 'V' \ Token 15: "VIEW " 464 | CHAR 'I' \ 465 | CHAR 'E' \ Encoded as: "VIEW " 466 | CHAR 'W' 467 | CHAR ' ' 468 | EQUB 0 469 | 470 | TWOK 'Q', 'U' \ Token 16: "QUANTITY" 471 | TWOK 'A', 'N' \ 472 | TWOK 'T', 'I' \ Encoded as: "<154><155><151>TY" 473 | CHAR 'T' 474 | CHAR 'Y' 475 | EQUB 0 476 | 477 | TWOK 'A', 'N' \ Token 17: "ANARCHY" 478 | TWOK 'A', 'R' \ 479 | CHAR 'C' \ Encoded as: "<155><138>CHY" 480 | CHAR 'H' 481 | CHAR 'Y' 482 | EQUB 0 483 | 484 | CHAR 'F' \ Token 18: "FEUDAL" 485 | CHAR 'E' \ 486 | CHAR 'U' \ Encoded as: "FEUD<128>" 487 | CHAR 'D' 488 | TWOK 'A', 'L' 489 | EQUB 0 490 | 491 | CHAR 'M' \ Token 19: "MULTI-GOVERNMENT" 492 | CHAR 'U' \ 493 | CHAR 'L' \ Encoded as: "MUL<151>-[2]" 494 | TWOK 'T', 'I' 495 | CHAR '-' 496 | RTOK 2 497 | EQUB 0 498 | 499 | TWOK 'D', 'I' \ Token 20: "DICTATORSHIP" 500 | CHAR 'C' \ 501 | CHAR 'T' \ Encoded as: "<141>CT<145><153>[25]" 502 | TWOK 'A', 'T' 503 | TWOK 'O', 'R' 504 | RTOK 25 505 | EQUB 0 506 | 507 | RTOK 91 \ Token 21: "COMMUNIST" 508 | CHAR 'M' \ 509 | CHAR 'U' \ Encoded as: "[91]MUN<157>T" 510 | CHAR 'N' 511 | TWOK 'I', 'S' 512 | CHAR 'T' 513 | EQUB 0 514 | 515 | CHAR 'C' \ Token 22: "CONFEDERACY" 516 | TWOK 'O', 'N' \ 517 | CHAR 'F' \ Encoded as: "C<159>F<152><144>ACY" 518 | TWOK 'E', 'D' 519 | TWOK 'E', 'R' 520 | CHAR 'A' 521 | CHAR 'C' 522 | CHAR 'Y' 523 | EQUB 0 524 | 525 | CHAR 'D' \ Token 23: "DEMOCRACY" 526 | CHAR 'E' \ 527 | CHAR 'M' \ Encoded as: "DEMOC<148>CY" 528 | CHAR 'O' 529 | CHAR 'C' 530 | TWOK 'R', 'A' 531 | CHAR 'C' 532 | CHAR 'Y' 533 | EQUB 0 534 | 535 | CHAR 'C' \ Token 24: "CORPORATE STATE" 536 | TWOK 'O', 'R' \ 537 | CHAR 'P' \ Encoded as: "C<153>P<153><145>E [43]<145>E" 538 | TWOK 'O', 'R' 539 | TWOK 'A', 'T' 540 | CHAR 'E' 541 | CHAR ' ' 542 | RTOK 43 543 | TWOK 'A', 'T' 544 | CHAR 'E' 545 | EQUB 0 546 | 547 | CHAR 'S' \ Token 25: "SHIP" 548 | CHAR 'H' \ 549 | CHAR 'I' \ Encoded as: "SHIP" 550 | CHAR 'P' 551 | EQUB 0 552 | 553 | CHAR 'P' \ Token 26: "PRODUCT" 554 | RTOK 94 \ 555 | CHAR 'D' \ Encoded as: "P[94]]DUCT" 556 | CHAR 'U' 557 | CHAR 'C' 558 | CHAR 'T' 559 | EQUB 0 560 | 561 | CHAR ' ' \ Token 27: " LASER" 562 | TWOK 'L', 'A' \ 563 | CHAR 'S' \ Encoded as: " <149>S<144>" 564 | TWOK 'E', 'R' 565 | EQUB 0 566 | 567 | CHAR 'H' \ Token 28: "HUMAN COLONIAL" 568 | CHAR 'U' \ 569 | CHAR 'M' \ Encoded as: "HUM<155> COL<159>I<128>" 570 | TWOK 'A', 'N' 571 | CHAR ' ' 572 | CHAR 'C' 573 | CHAR 'O' 574 | CHAR 'L' 575 | TWOK 'O', 'N' 576 | CHAR 'I' 577 | TWOK 'A', 'L' 578 | EQUB 0 579 | 580 | CHAR 'H' \ Token 29: "HYPERSPACE " 581 | CHAR 'Y' \ 582 | CHAR 'P' \ Encoded as: "HYP<144>SPA<133> " 583 | TWOK 'E', 'R' 584 | CHAR 'S' 585 | CHAR 'P' 586 | CHAR 'A' 587 | TWOK 'C', 'E' 588 | CHAR ' ' 589 | EQUB 0 590 | 591 | CHAR 'S' \ Token 30: "SHORT RANGE CHART" 592 | CHAR 'H' \ 593 | TWOK 'O', 'R' \ Encoded as: "SH<153>T [42][1]" 594 | CHAR 'T' 595 | CHAR ' ' 596 | RTOK 42 597 | RTOK 1 598 | EQUB 0 599 | 600 | TWOK 'D', 'I' \ Token 31: "DISTANCE" 601 | RTOK 43 \ 602 | TWOK 'A', 'N' \ Encoded as: "<141>[43]<155><133>" 603 | TWOK 'C', 'E' 604 | EQUB 0 605 | 606 | CHAR 'P' \ Token 32: "POPULATION" 607 | CHAR 'O' \ 608 | CHAR 'P' \ Encoded as: "POPUL<145>I<159>" 609 | CHAR 'U' 610 | CHAR 'L' 611 | TWOK 'A', 'T' 612 | CHAR 'I' 613 | TWOK 'O', 'N' 614 | EQUB 0 615 | 616 | CHAR 'G' \ Token 33: "GROSS PRODUCTIVITY" 617 | RTOK 94 \ 618 | CHAR 'S' \ Encoded as: "G[94]SS [26]IVITY" 619 | CHAR 'S' 620 | CHAR ' ' 621 | RTOK 26 622 | CHAR 'I' 623 | CHAR 'V' 624 | CHAR 'I' 625 | CHAR 'T' 626 | CHAR 'Y' 627 | EQUB 0 628 | 629 | CHAR 'E' \ Token 34: "ECONOMY" 630 | CHAR 'C' \ 631 | TWOK 'O', 'N' \ Encoded as: "EC<159>OMY" 632 | CHAR 'O' 633 | CHAR 'M' 634 | CHAR 'Y' 635 | EQUB 0 636 | 637 | CHAR ' ' \ Token 35: " LIGHT YEARS" 638 | CHAR 'L' \ 639 | CHAR 'I' \ Encoded as: " LIGHT YE<138>S" 640 | CHAR 'G' 641 | CHAR 'H' 642 | CHAR 'T' 643 | CHAR ' ' 644 | CHAR 'Y' 645 | CHAR 'E' 646 | TWOK 'A', 'R' 647 | CHAR 'S' 648 | EQUB 0 649 | 650 | TWOK 'T', 'E' \ Token 36: "TECH.LEVEL" 651 | CHAR 'C' \ 652 | CHAR 'H' \ Encoded as: "<156>CH.<129><150>L" 653 | CHAR '.' 654 | TWOK 'L', 'E' 655 | TWOK 'V', 'E' 656 | CHAR 'L' 657 | EQUB 0 658 | 659 | CHAR 'C' \ Token 37: "CASH" 660 | CHAR 'A' \ 661 | CHAR 'S' \ Encoded as: "CASH" 662 | CHAR 'H' 663 | EQUB 0 664 | 665 | CHAR ' ' \ Token 38: " BILLION" 666 | TWOK 'B', 'I' \ 667 | RTOK 129 \ Encoded as: " <134>[129]I<159>" 668 | CHAR 'I' 669 | TWOK 'O', 'N' 670 | EQUB 0 671 | 672 | RTOK 122 \ Token 39: "GALACTIC CHART{galaxy number}" 673 | RTOK 1 \ 674 | CONT 1 \ Encoded as: "[122][1]{1}" 675 | EQUB 0 676 | 677 | CHAR 'T' \ Token 40: "TARGET LOST" 678 | TWOK 'A', 'R' \ 679 | TWOK 'G', 'E' \ Encoded as: "T<138><131>T LO[43]" 680 | CHAR 'T' 681 | CHAR ' ' 682 | CHAR 'L' 683 | CHAR 'O' 684 | RTOK 43 685 | EQUB 0 686 | 687 | RTOK 106 \ Token 41: "MISSILE JAMMED" 688 | CHAR ' ' \ 689 | CHAR 'J' \ Encoded as: "[106] JAMM<152>" 690 | CHAR 'A' 691 | CHAR 'M' 692 | CHAR 'M' 693 | TWOK 'E', 'D' 694 | EQUB 0 695 | 696 | CHAR 'R' \ Token 42: "RANGE" 697 | TWOK 'A', 'N' \ 698 | TWOK 'G', 'E' \ Encoded as: "R<155><131>" 699 | EQUB 0 700 | 701 | CHAR 'S' \ Token 43: "ST" 702 | CHAR 'T' \ 703 | EQUB 0 \ Encoded as: "ST" 704 | 705 | RTOK 16 \ Token 44: "QUANTITY OF " 706 | CHAR ' ' \ 707 | CHAR 'O' \ Encoded as: "[16] OF " 708 | CHAR 'F' 709 | CHAR ' ' 710 | EQUB 0 711 | 712 | CHAR 'S' \ Token 45: "SELL" 713 | CHAR 'E' \ 714 | RTOK 129 \ Encoded as: "SE[129]" 715 | EQUB 0 716 | 717 | CHAR ' ' \ Token 46: " CARGO{sentence case}" 718 | CHAR 'C' \ 719 | TWOK 'A', 'R' \ Encoded as: " C<138>GO{6}" 720 | CHAR 'G' 721 | CHAR 'O' 722 | CONT 6 723 | EQUB 0 724 | 725 | CHAR 'E' \ Token 47: "EQUIP" 726 | TWOK 'Q', 'U' \ 727 | CHAR 'I' \ Encoded as: "E<154>IP" 728 | CHAR 'P' 729 | EQUB 0 730 | 731 | CHAR 'F' \ Token 48: "FOOD" 732 | CHAR 'O' \ 733 | CHAR 'O' \ Encoded as: "FOOD" 734 | CHAR 'D' 735 | EQUB 0 736 | 737 | TWOK 'T', 'E' \ Token 49: "TEXTILES" 738 | CHAR 'X' \ 739 | TWOK 'T', 'I' \ Encoded as: "<156>X<151>L<137>" 740 | CHAR 'L' 741 | TWOK 'E', 'S' 742 | EQUB 0 743 | 744 | TWOK 'R', 'A' \ Token 50: "RADIOACTIVES" 745 | TWOK 'D', 'I' \ 746 | CHAR 'O' \ Encoded as: "<148><141>OAC<151><150>S" 747 | CHAR 'A' 748 | CHAR 'C' 749 | TWOK 'T', 'I' 750 | TWOK 'V', 'E' 751 | CHAR 'S' 752 | EQUB 0 753 | 754 | CHAR 'S' \ Token 51: "SLAVES" 755 | TWOK 'L', 'A' \ 756 | TWOK 'V', 'E' \ Encoded as: "S<149><150>S" 757 | CHAR 'S' 758 | EQUB 0 759 | 760 | CHAR 'L' \ Token 52: "LIQUOR/WINES" 761 | CHAR 'I' \ 762 | TWOK 'Q', 'U' \ Encoded as: "LI<154><153>/W<140><137>" 763 | TWOK 'O', 'R' 764 | CHAR '/' 765 | CHAR 'W' 766 | TWOK 'I', 'N' 767 | TWOK 'E', 'S' 768 | EQUB 0 769 | 770 | CHAR 'L' \ Token 53: "LUXURIES" 771 | CHAR 'U' \ 772 | CHAR 'X' \ Encoded as: "LUXU<158><137>" 773 | CHAR 'U' 774 | TWOK 'R', 'I' 775 | TWOK 'E', 'S' 776 | EQUB 0 777 | 778 | CHAR 'N' \ Token 54: "NARCOTICS" 779 | TWOK 'A', 'R' \ 780 | CHAR 'C' \ Encoded as: "N<138>CO<151>CS" 781 | CHAR 'O' 782 | TWOK 'T', 'I' 783 | CHAR 'C' 784 | CHAR 'S' 785 | EQUB 0 786 | 787 | RTOK 91 \ Token 55: "COMPUTERS" 788 | CHAR 'P' \ 789 | CHAR 'U' \ Encoded as: "[91]PUT<144>S" 790 | CHAR 'T' 791 | TWOK 'E', 'R' 792 | CHAR 'S' 793 | EQUB 0 794 | 795 | TWOK 'M', 'A' \ Token 56: "MACHINERY" 796 | CHAR 'C' \ 797 | CHAR 'H' \ Encoded as: "<139>CH<140><144>Y" 798 | TWOK 'I', 'N' 799 | TWOK 'E', 'R' 800 | CHAR 'Y' 801 | EQUB 0 802 | 803 | CHAR 'A' \ Token 57: "ALLOYS" 804 | CHAR 'L' \ 805 | CHAR 'L' \ Encoded as: "ALLOYS" 806 | CHAR 'O' 807 | CHAR 'Y' 808 | CHAR 'S' 809 | EQUB 0 810 | 811 | CHAR 'F' \ Token 58: "FIREARMS" 812 | CHAR 'I' \ 813 | TWOK 'R', 'E' \ Encoded as: "FI<142><138>MS" 814 | TWOK 'A', 'R' 815 | CHAR 'M' 816 | CHAR 'S' 817 | EQUB 0 818 | 819 | CHAR 'F' \ Token 59: "FURS" 820 | CHAR 'U' \ 821 | CHAR 'R' \ Encoded as: "FURS" 822 | CHAR 'S' 823 | EQUB 0 824 | 825 | CHAR 'M' \ Token 60: "MINERALS" 826 | TWOK 'I', 'N' \ 827 | TWOK 'E', 'R' \ Encoded as: "M<140><144><128>S" 828 | TWOK 'A', 'L' 829 | CHAR 'S' 830 | EQUB 0 831 | 832 | CHAR 'G' \ Token 61: "GOLD" 833 | CHAR 'O' \ 834 | CHAR 'L' \ Encoded as: "GOLD" 835 | CHAR 'D' 836 | EQUB 0 837 | 838 | CHAR 'P' \ Token 62: "PLATINUM" 839 | CHAR 'L' \ 840 | TWOK 'A', 'T' \ Encoded as: "PL<145><140>UM" 841 | TWOK 'I', 'N' 842 | CHAR 'U' 843 | CHAR 'M' 844 | EQUB 0 845 | 846 | TWOK 'G', 'E' \ Token 63: "GEM-STONES" 847 | CHAR 'M' \ 848 | CHAR '-' \ Encoded as: "<131>M-[43]<159><137>" 849 | RTOK 43 850 | TWOK 'O', 'N' 851 | TWOK 'E', 'S' 852 | EQUB 0 853 | 854 | TWOK 'A', 'L' \ Token 64: "ALIEN ITEMS" 855 | CHAR 'I' \ 856 | TWOK 'E', 'N' \ Encoded as: "<128>I<146> [127]S" 857 | CHAR ' ' 858 | RTOK 127 859 | CHAR 'S' 860 | EQUB 0 861 | 862 | CONT 12 \ Token 65: "{cr} 863 | CHAR '1' \ 10{cash} CR{cr} 864 | CHAR '0' \ 5{cash} CR{cr} 865 | CONT 0 \ " 866 | CHAR '5' \ 867 | CONT 0 \ Encoded as: "{12}10{0}5{0}" 868 | EQUB 0 869 | 870 | CHAR ' ' \ Token 66: " CR" 871 | CHAR 'C' \ 872 | CHAR 'R' \ Encoded as: " CR" 873 | EQUB 0 874 | 875 | CHAR 'L' \ Token 67: "LARGE" 876 | TWOK 'A', 'R' \ 877 | TWOK 'G', 'E' \ Encoded as: "L<138><131>" 878 | EQUB 0 879 | 880 | CHAR 'F' \ Token 68: "FIERCE" 881 | CHAR 'I' \ 882 | TWOK 'E', 'R' \ Encoded as: "FI<144><133>" 883 | TWOK 'C', 'E' 884 | EQUB 0 885 | 886 | CHAR 'S' \ Token 69: "SMALL" 887 | TWOK 'M', 'A' \ 888 | RTOK 129 \ Encoded as: "S<139>[129]" 889 | EQUB 0 890 | 891 | CHAR 'G' \ Token 70: "GREEN" 892 | TWOK 'R', 'E' \ 893 | TWOK 'E', 'N' \ Encoded as: "G<142><146>" 894 | EQUB 0 895 | 896 | CHAR 'R' \ Token 71: "RED" 897 | TWOK 'E', 'D' \ 898 | EQUB 0 \ Encoded as: "R<152>" 899 | 900 | CHAR 'Y' \ Token 72: "YELLOW" 901 | CHAR 'E' \ 902 | RTOK 129 \ Encoded as: "YE[129]OW" 903 | CHAR 'O' 904 | CHAR 'W' 905 | EQUB 0 906 | 907 | CHAR 'B' \ Token 73: "BLUE" 908 | CHAR 'L' \ 909 | CHAR 'U' \ Encoded as: "BLUE" 910 | CHAR 'E' 911 | EQUB 0 912 | 913 | CHAR 'B' \ Token 74: "BLACK" 914 | TWOK 'L', 'A' \ 915 | CHAR 'C' \ Encoded as: "B<149>CK" 916 | CHAR 'K' 917 | EQUB 0 918 | 919 | RTOK 136 \ Token 75: "HARMLESS" 920 | EQUB 0 \ 921 | \ Encoded as: "[136]" 922 | 923 | CHAR 'S' \ Token 76: "SLIMY" 924 | CHAR 'L' \ 925 | CHAR 'I' \ Encoded as: "SLIMY" 926 | CHAR 'M' 927 | CHAR 'Y' 928 | EQUB 0 929 | 930 | CHAR 'B' \ Token 77: "BUG-EYED" 931 | CHAR 'U' \ 932 | CHAR 'G' \ Encoded as: "BUG-EY<152>" 933 | CHAR '-' 934 | CHAR 'E' 935 | CHAR 'Y' 936 | TWOK 'E', 'D' 937 | EQUB 0 938 | 939 | CHAR 'H' \ Token 78: "HORNED" 940 | TWOK 'O', 'R' \ 941 | CHAR 'N' \ Encoded as: "H<153>N<152>" 942 | TWOK 'E', 'D' 943 | EQUB 0 944 | 945 | CHAR 'B' \ Token 79: "BONY" 946 | TWOK 'O', 'N' \ 947 | CHAR 'Y' \ Encoded as: "B<159>Y" 948 | EQUB 0 949 | 950 | CHAR 'F' \ Token 80: "FAT" 951 | TWOK 'A', 'T' \ 952 | EQUB 0 \ Encoded as: "F<145>" 953 | 954 | CHAR 'F' \ Token 81: "FURRY" 955 | CHAR 'U' \ 956 | CHAR 'R' \ Encoded as: "FURRY" 957 | CHAR 'R' 958 | CHAR 'Y' 959 | EQUB 0 960 | 961 | RTOK 94 \ Token 82: "RODENT" 962 | CHAR 'D' \ 963 | TWOK 'E', 'N' \ Encoded as: "[94]D<146>T" 964 | CHAR 'T' 965 | EQUB 0 966 | 967 | CHAR 'F' \ Token 83: "FROG" 968 | RTOK 94 \ 969 | CHAR 'G' \ Encoded as: "F[94]G" 970 | EQUB 0 971 | 972 | CHAR 'L' \ Token 84: "LIZARD" 973 | CHAR 'I' \ 974 | TWOK 'Z', 'A' \ Encoded as: "LI<132>RD" 975 | CHAR 'R' 976 | CHAR 'D' 977 | EQUB 0 978 | 979 | CHAR 'L' \ Token 85: "LOBSTER" 980 | CHAR 'O' \ 981 | CHAR 'B' \ Encoded as: "LOB[43]<144>" 982 | RTOK 43 983 | TWOK 'E', 'R' 984 | EQUB 0 985 | 986 | TWOK 'B', 'I' \ Token 86: "BIRD" 987 | CHAR 'R' \ 988 | CHAR 'D' \ Encoded as: "<134>RD" 989 | EQUB 0 990 | 991 | CHAR 'H' \ Token 87: "HUMANOID" 992 | CHAR 'U' \ 993 | CHAR 'M' \ Encoded as: "HUM<155>OID" 994 | TWOK 'A', 'N' 995 | CHAR 'O' 996 | CHAR 'I' 997 | CHAR 'D' 998 | EQUB 0 999 | 1000 | CHAR 'F' \ Token 88: "FELINE" 1001 | CHAR 'E' \ 1002 | CHAR 'L' \ Encoded as: "FEL<140>E" 1003 | TWOK 'I', 'N' 1004 | CHAR 'E' 1005 | EQUB 0 1006 | 1007 | TWOK 'I', 'N' \ Token 89: "INSECT" 1008 | CHAR 'S' \ 1009 | CHAR 'E' \ Encoded as: "<140>SECT" 1010 | CHAR 'C' 1011 | CHAR 'T' 1012 | EQUB 0 1013 | 1014 | RTOK 11 \ Token 90: "AVERAGE RADIUS" 1015 | TWOK 'R', 'A' \ 1016 | TWOK 'D', 'I' \ Encoded as: "[11]<148><141><136>" 1017 | TWOK 'U', 'S' 1018 | EQUB 0 1019 | 1020 | CHAR 'C' \ Token 91: "COM" 1021 | CHAR 'O' \ 1022 | CHAR 'M' \ Encoded as: "COM" 1023 | EQUB 0 1024 | 1025 | RTOK 91 \ Token 92: "COMMANDER" 1026 | CHAR 'M' \ 1027 | TWOK 'A', 'N' \ Encoded as: "[91]M<155>D<144>" 1028 | CHAR 'D' 1029 | TWOK 'E', 'R' 1030 | EQUB 0 1031 | 1032 | CHAR ' ' \ Token 93: " DESTROYED" 1033 | CHAR 'D' \ 1034 | TWOK 'E', 'S' \ Encoded as: " D<137>T[94]Y<152>" 1035 | CHAR 'T' 1036 | RTOK 94 1037 | CHAR 'Y' 1038 | TWOK 'E', 'D' 1039 | EQUB 0 1040 | 1041 | CHAR 'R' \ Token 94: "RO" 1042 | CHAR 'O' \ 1043 | EQUB 0 \ Encoded as: "RO" 1044 | 1045 | RTOK 14 \ Token 95: "UNIT QUANTITY{cr} 1046 | CHAR ' ' \ PRODUCT UNIT PRICE FOR SALE{cr}{lf} 1047 | CHAR ' ' \ " 1048 | RTOK 16 \ 1049 | CONT 12 \ Encoded as: "[14] [16]{13} [26] [14] [6] F<153> 1050 | CHAR ' ' \ SA<129>{12}{10}" 1051 | RTOK 26 1052 | CHAR ' ' 1053 | CHAR ' ' 1054 | CHAR ' ' 1055 | RTOK 14 1056 | CHAR ' ' 1057 | RTOK 6 1058 | CHAR ' ' 1059 | CHAR 'F' 1060 | TWOK 'O', 'R' 1061 | CHAR ' ' 1062 | CHAR 'S' 1063 | CHAR 'A' 1064 | TWOK 'L', 'E' 1065 | CONT 12 1066 | CONT 10 1067 | EQUB 0 1068 | 1069 | CHAR 'F' \ Token 96: "FRONT" 1070 | CHAR 'R' \ 1071 | TWOK 'O', 'N' \ Encoded as: "FR<159>T" 1072 | CHAR 'T' 1073 | EQUB 0 1074 | 1075 | TWOK 'R', 'E' \ Token 97: "REAR" 1076 | TWOK 'A', 'R' \ 1077 | EQUB 0 \ Encoded as: "<142><138>" 1078 | 1079 | TWOK 'L', 'E' \ Token 98: "LEFT" 1080 | CHAR 'F' \ 1081 | CHAR 'T' \ Encoded as: "<129>FT" 1082 | EQUB 0 1083 | 1084 | TWOK 'R', 'I' \ Token 99: "RIGHT" 1085 | CHAR 'G' \ 1086 | CHAR 'H' \ Encoded as: "<158>GHT" 1087 | CHAR 'T' 1088 | EQUB 0 1089 | 1090 | RTOK 121 \ Token 100: "ENERGY LOW{beep}" 1091 | CHAR 'L' \ 1092 | CHAR 'O' \ Encoded as: "[121]LOW{7}" 1093 | CHAR 'W' 1094 | CONT 7 1095 | EQUB 0 1096 | 1097 | RTOK 99 \ Token 101: "RIGHT ON COMMANDER!" 1098 | RTOK 131 \ 1099 | RTOK 92 \ Encoded as: "[99][131][92]!" 1100 | CHAR '!' 1101 | EQUB 0 1102 | 1103 | CHAR 'E' \ Token 102: "EXTRA " 1104 | CHAR 'X' \ 1105 | CHAR 'T' \ Encoded as: "EXT<148> " 1106 | TWOK 'R', 'A' 1107 | CHAR ' ' 1108 | EQUB 0 1109 | 1110 | CHAR 'P' \ Token 103: "PULSE LASER" 1111 | CHAR 'U' \ 1112 | CHAR 'L' \ Encoded as: "PULSE[27]" 1113 | CHAR 'S' 1114 | CHAR 'E' 1115 | RTOK 27 1116 | EQUB 0 1117 | 1118 | TWOK 'B', 'E' \ Token 104: "BEAM LASER" 1119 | CHAR 'A' \ 1120 | CHAR 'M' \ Encoded as: "<147>AM[27]" 1121 | RTOK 27 1122 | EQUB 0 1123 | 1124 | CHAR 'F' \ Token 105: "FUEL" 1125 | CHAR 'U' \ 1126 | CHAR 'E' \ Encoded as: "FUEL" 1127 | CHAR 'L' 1128 | EQUB 0 1129 | 1130 | CHAR 'M' \ Token 106: "MISSILE" 1131 | TWOK 'I', 'S' \ 1132 | CHAR 'S' \ Encoded as: "M<157>SI<129>" 1133 | CHAR 'I' 1134 | TWOK 'L', 'E' 1135 | EQUB 0 1136 | 1137 | RTOK 67 \ Token 107: "LARGE CARGO{sentence case} BAY" 1138 | RTOK 46 \ 1139 | CHAR ' ' \ Encoded as: "[67][46] BAY" 1140 | CHAR 'B' 1141 | CHAR 'A' 1142 | CHAR 'Y' 1143 | EQUB 0 1144 | 1145 | CHAR 'E' \ Token 108: "E.C.M.SYSTEM" 1146 | CHAR '.' \ 1147 | CHAR 'C' \ Encoded as: "E.C.M.[5]" 1148 | CHAR '.' 1149 | CHAR 'M' 1150 | CHAR '.' 1151 | RTOK 5 1152 | EQUB 0 1153 | 1154 | RTOK 102 \ Token 109: "EXTRA PULSE LASERS" 1155 | RTOK 103 \ 1156 | CHAR 'S' \ Encoded as: "[102][103]S" 1157 | EQUB 0 1158 | 1159 | RTOK 102 \ Token 110: "EXTRA BEAM LASERS" 1160 | RTOK 104 \ 1161 | CHAR 'S' \ Encoded as: "[102][104]S" 1162 | EQUB 0 1163 | 1164 | RTOK 105 \ Token 111: "FUEL SCOOPS" 1165 | CHAR ' ' \ 1166 | CHAR 'S' \ Encoded as: "[105] SCOOPS" 1167 | CHAR 'C' 1168 | CHAR 'O' 1169 | CHAR 'O' 1170 | CHAR 'P' 1171 | CHAR 'S' 1172 | EQUB 0 1173 | 1174 | TWOK 'E', 'S' \ Token 112: "ESCAPE POD" 1175 | CHAR 'C' \ 1176 | CHAR 'A' \ Encoded as: "<137>CAPE POD" 1177 | CHAR 'P' 1178 | CHAR 'E' 1179 | CHAR ' ' 1180 | CHAR 'P' 1181 | CHAR 'O' 1182 | CHAR 'D' 1183 | EQUB 0 1184 | 1185 | RTOK 121 \ Token 113: "ENERGY BOMB" 1186 | CHAR 'B' \ 1187 | CHAR 'O' \ Encoded as: "[121]BOMB" 1188 | CHAR 'M' 1189 | CHAR 'B' 1190 | EQUB 0 1191 | 1192 | RTOK 121 \ Token 114: "ENERGY UNIT" 1193 | RTOK 14 \ 1194 | EQUB 0 \ Encoded as: "[121][14]" 1195 | 1196 | CHAR 'D' \ Token 115: "DOCKING COMPUTERS" 1197 | CHAR 'O' \ 1198 | CHAR 'C' \ Encoded as: "DOCK<140>G [55]" 1199 | CHAR 'K' 1200 | TWOK 'I', 'N' 1201 | CHAR 'G' 1202 | CHAR ' ' 1203 | RTOK 55 1204 | EQUB 0 1205 | 1206 | RTOK 122 \ Token 116: "GALACTIC HYPERSPACE " 1207 | CHAR ' ' \ 1208 | RTOK 29 \ Encoded as: "[122] [29]" 1209 | EQUB 0 1210 | 1211 | CHAR 'M' \ Token 117: "MILITARY LASER" 1212 | CHAR 'I' \ 1213 | CHAR 'L' \ Encoded as: "MILIT<138>Y [27]" 1214 | CHAR 'I' 1215 | CHAR 'T' 1216 | TWOK 'A', 'R' 1217 | CHAR 'Y' 1218 | CHAR ' ' 1219 | RTOK 27 1220 | EQUB 0 1221 | 1222 | CHAR 'M' \ Token 118: "MINING LASER" 1223 | TWOK 'I', 'N' \ 1224 | TWOK 'I', 'N' \ Encoded as: "M<140><140>G [27]" 1225 | CHAR 'G' 1226 | CHAR ' ' 1227 | RTOK 27 1228 | EQUB 0 1229 | 1230 | RTOK 37 \ Token 119: "CASH:{cash} CR{cr} 1231 | CHAR ':' \ " 1232 | CONT 0 \ 1233 | EQUB 0 \ Encoded as: "[37]:{0}" 1234 | 1235 | TWOK 'I', 'N' \ Token 120: "INCOMING MISSILE" 1236 | RTOK 91 \ 1237 | TWOK 'I', 'N' \ Encoded as: "<140>[91]<140>G [106]" 1238 | CHAR 'G' 1239 | CHAR ' ' 1240 | RTOK 106 1241 | EQUB 0 1242 | 1243 | TWOK 'E', 'N' \ Token 121: "ENERGY " 1244 | TWOK 'E', 'R' \ 1245 | CHAR 'G' \ Encoded as: "<146><144>GY " 1246 | CHAR 'Y' 1247 | CHAR ' ' 1248 | EQUB 0 1249 | 1250 | CHAR 'G' \ Token 122: "GALACTIC" 1251 | CHAR 'A' \ 1252 | TWOK 'L', 'A' \ Encoded as: "GA<149>C<151>C" 1253 | CHAR 'C' 1254 | TWOK 'T', 'I' 1255 | CHAR 'C' 1256 | EQUB 0 1257 | 1258 | RTOK 115 \ Token 123: "DOCKING COMPUTERS ON" 1259 | CHAR ' ' \ 1260 | CHAR 'O' \ Encoded as: "[115] ON" 1261 | CHAR 'N' 1262 | EQUB 0 1263 | 1264 | CHAR 'A' \ Token 124: "ALL" 1265 | RTOK 129 \ 1266 | EQUB 0 \ Encoded as: "A[129]" 1267 | 1268 | CONT 5 \ Token 125: "FUEL: {fuel level} LIGHT YEARS{cr} 1269 | TWOK 'L', 'E' \ CASH:{cash} CR{cr} 1270 | CHAR 'G' \ LEGAL STATUS:" 1271 | TWOK 'A', 'L' \ 1272 | CHAR ' ' \ Encoded as: "{5}<129>G<128> [43]<145><136>:" 1273 | RTOK 43 1274 | TWOK 'A', 'T' 1275 | TWOK 'U', 'S' 1276 | CHAR ':' 1277 | EQUB 0 1278 | 1279 | RTOK 92 \ Token 126: "COMMANDER {commander name}{cr} 1280 | CHAR ' ' \ {cr} 1281 | CONT 4 \ {cr} 1282 | CONT 12 \ {sentence case}PRESENT SYSTEM{tab to 1283 | CONT 12 \ column 21}:{current system name}{cr} 1284 | CONT 12 \ HYPERSPACE SYSTEM{tab to column 21}: 1285 | CONT 6 \ {selected system name}{cr} 1286 | RTOK 145 \ CONDITION{tab to column 21}:" 1287 | CHAR ' ' \ 1288 | RTOK 5 \ Encoded as: "[92] {4}{12}{12}{12}{6}[145] [5]{9}{2} 1289 | CONT 9 \ {12}[29][5]{9}{3}{13}C<159><141><151> 1290 | CONT 2 \ <159>{9}" 1291 | CONT 12 1292 | RTOK 29 1293 | RTOK 5 1294 | CONT 9 1295 | CONT 3 1296 | CONT 12 1297 | CHAR 'C' 1298 | TWOK 'O', 'N' 1299 | TWOK 'D', 'I' 1300 | TWOK 'T', 'I' 1301 | TWOK 'O', 'N' 1302 | CONT 9 1303 | EQUB 0 1304 | 1305 | CHAR 'I' \ Token 127: "ITEM" 1306 | TWOK 'T', 'E' \ 1307 | CHAR 'M' \ Encoded as: "I<156>M" 1308 | EQUB 0 1309 | 1310 | EQUB 0 \ Token 128: "" 1311 | \ 1312 | \ Encoded as: "" 1313 | 1314 | CHAR 'L' \ Token 129: "LL" 1315 | CHAR 'L' \ 1316 | EQUB 0 \ Encoded as: "LL" 1317 | 1318 | TWOK 'R', 'A' \ Token 130: "RATING:" 1319 | TWOK 'T', 'I' \ 1320 | CHAR 'N' \ Encoded as: "<148><151>NG:" 1321 | CHAR 'G' 1322 | CHAR ':' 1323 | EQUB 0 1324 | 1325 | CHAR ' ' \ Token 131: " ON " 1326 | TWOK 'O', 'N' \ 1327 | CHAR ' ' \ Encoded as: " <159> " 1328 | EQUB 0 1329 | 1330 | CONT 12 \ Token 132: "{cr} 1331 | CONT 8 \ {all caps}EQUIPMENT: {sentence case}" 1332 | RTOK 47 \ 1333 | CHAR 'M' \ Encoded as: "{12}{8}[47]M<146>T:{6}" 1334 | TWOK 'E', 'N' 1335 | CHAR 'T' 1336 | CHAR ':' 1337 | CONT 6 1338 | EQUB 0 1339 | 1340 | CHAR 'C' \ Token 133: "CLEAN" 1341 | TWOK 'L', 'E' \ 1342 | TWOK 'A', 'N' \ Encoded as: "C<129><155>" 1343 | EQUB 0 1344 | 1345 | CHAR 'O' \ Token 134: "OFFENDER" 1346 | CHAR 'F' \ 1347 | CHAR 'F' \ Encoded as: "OFF<146>D<144>" 1348 | TWOK 'E', 'N' 1349 | CHAR 'D' 1350 | TWOK 'E', 'R' 1351 | EQUB 0 1352 | 1353 | CHAR 'F' \ Token 135: "FUGITIVE" 1354 | CHAR 'U' \ 1355 | CHAR 'G' \ Encoded as: "FUGI<151><150>" 1356 | CHAR 'I' 1357 | TWOK 'T', 'I' 1358 | TWOK 'V', 'E' 1359 | EQUB 0 1360 | 1361 | CHAR 'H' \ Token 136: "HARMLESS" 1362 | TWOK 'A', 'R' \ 1363 | CHAR 'M' \ Encoded as: "H<138>M<129>SS" 1364 | TWOK 'L', 'E' 1365 | CHAR 'S' 1366 | CHAR 'S' 1367 | EQUB 0 1368 | 1369 | CHAR 'M' \ Token 137: "MOSTLY HARMLESS" 1370 | CHAR 'O' \ 1371 | RTOK 43 \ Encoded as: "MO[43]LY [136]" 1372 | CHAR 'L' 1373 | CHAR 'Y' 1374 | CHAR ' ' 1375 | RTOK 136 1376 | EQUB 0 1377 | 1378 | RTOK 12 \ Token 138: "POOR " 1379 | EQUB 0 \ 1380 | \ Encoded as: "[12]" 1381 | 1382 | RTOK 11 \ Token 139: "AVERAGE " 1383 | EQUB 0 \ 1384 | \ Encoded as: "[11]" 1385 | 1386 | CHAR 'A' \ Token 140: "ABOVE AVERAGE " 1387 | CHAR 'B' \ 1388 | CHAR 'O' \ Encoded as: "ABO<150> [11]" 1389 | TWOK 'V', 'E' 1390 | CHAR ' ' 1391 | RTOK 11 1392 | EQUB 0 1393 | 1394 | RTOK 91 \ Token 141: "COMPETENT" 1395 | CHAR 'P' \ 1396 | CHAR 'E' \ Encoded as: "[91]PET<146>T" 1397 | CHAR 'T' 1398 | TWOK 'E', 'N' 1399 | CHAR 'T' 1400 | EQUB 0 1401 | 1402 | CHAR 'D' \ Token 142: "DANGEROUS" 1403 | TWOK 'A', 'N' \ 1404 | TWOK 'G', 'E' \ Encoded as: "D<155><131>[94]<136>" 1405 | RTOK 94 1406 | TWOK 'U', 'S' 1407 | EQUB 0 1408 | 1409 | CHAR 'D' \ Token 143: "DEADLY" 1410 | CHAR 'E' \ 1411 | CHAR 'A' \ Encoded as: "DEADLY" 1412 | CHAR 'D' 1413 | CHAR 'L' 1414 | CHAR 'Y' 1415 | EQUB 0 1416 | 1417 | CHAR '-' \ Token 144: "---- E L I T E ----" 1418 | CHAR '-' \ 1419 | CHAR '-' \ Encoded as: "---- E L I T E ----" 1420 | CHAR '-' 1421 | CHAR ' ' 1422 | CHAR 'E' 1423 | CHAR ' ' 1424 | CHAR 'L' 1425 | CHAR ' ' 1426 | CHAR 'I' 1427 | CHAR ' ' 1428 | CHAR 'T' 1429 | CHAR ' ' 1430 | CHAR 'E' 1431 | CHAR ' ' 1432 | CHAR '-' 1433 | CHAR '-' 1434 | CHAR '-' 1435 | CHAR '-' 1436 | EQUB 0 1437 | 1438 | CHAR 'P' \ Token 145: "PRESENT" 1439 | TWOK 'R', 'E' \ 1440 | CHAR 'S' \ Encoded as: "P<142>S<146>T" 1441 | TWOK 'E', 'N' 1442 | CHAR 'T' 1443 | EQUB 0 1444 | 1445 | CONT 8 \ Token 146: "{all caps}GAME OVER" 1446 | CHAR 'G' \ 1447 | CHAR 'A' \ Encoded as: "{8}GAME O<150>R" 1448 | CHAR 'M' 1449 | CHAR 'E' 1450 | CHAR ' ' 1451 | CHAR 'O' 1452 | TWOK 'V', 'E' 1453 | CHAR 'R' 1454 | EQUB 0 1455 | 1456 | SKIP 5 \ These bytes appear to be unused 1457 | 1458 | \ ****************************************************************************** 1459 | \ 1460 | \ Name: SNE 1461 | \ Type: Variable 1462 | \ Category: Maths (Geometry) 1463 | \ Summary: Sine/cosine table 1464 | \ Deep dive: The sine, cosine and arctan tables 1465 | \ Drawing circles 1466 | \ Drawing ellipses 1467 | \ 1468 | \ ------------------------------------------------------------------------------ 1469 | \ 1470 | \ This lookup table contains sine values for the first half of a circle, from 0 1471 | \ to 180 degrees (0 to PI radians). In terms of circle or ellipse line segments, 1472 | \ there are 64 segments in a circle, so this contains sine values for segments 1473 | \ 0 to 31. 1474 | \ 1475 | \ In terms of segments, to calculate the sine of the angle at segment x, we look 1476 | \ up the value in SNE + x, and to calculate the cosine of the angle we look up 1477 | \ the value in SNE + ((x + 16) mod 32). 1478 | \ 1479 | \ In terms of radians, to calculate the following: 1480 | \ 1481 | \ sin(theta) * 256 1482 | \ 1483 | \ where theta is in radians, we look up the value in: 1484 | \ 1485 | \ SNE + (theta * 10) 1486 | \ 1487 | \ To calculate the following: 1488 | \ 1489 | \ cos(theta) * 256 1490 | \ 1491 | \ where theta is in radians, look up the value in: 1492 | \ 1493 | \ SNE + ((theta * 10) + 16) mod 32 1494 | \ 1495 | \ Theta must be between 0 and 3.1 radians, so theta * 10 is between 0 and 31. 1496 | \ 1497 | \ ****************************************************************************** 1498 | 1499 | .SNE 1500 | 1501 | FOR I%, 0, 31 1502 | 1503 | N = ABS(SIN((I% / 64) * 2 * PI)) 1504 | 1505 | IF N >= 1 1506 | EQUB 255 1507 | ELSE 1508 | EQUB INT(256 * N + 0.5) 1509 | ENDIF 1510 | 1511 | NEXT 1512 | 1513 | \ ****************************************************************************** 1514 | \ 1515 | \ Name: ACT 1516 | \ Type: Variable 1517 | \ Category: Maths (Geometry) 1518 | \ Summary: Arctan table 1519 | \ Deep dive: The sine, cosine and arctan tables 1520 | \ 1521 | \ ------------------------------------------------------------------------------ 1522 | \ 1523 | \ This table contains lookup values for arctangent calculations involving angles 1524 | \ in the range 0 to 45 degrees (or 0 to PI / 4 radians). 1525 | \ 1526 | \ To calculate the value of theta in the following: 1527 | \ 1528 | \ theta = arctan(t) 1529 | \ 1530 | \ where 0 <= t < 1, we look up the value in: 1531 | \ 1532 | \ ACT + (t * 32) 1533 | \ 1534 | \ The result will be an integer representing the angle in radians, where 256 1535 | \ represents a full circle of 360 degrees (2 * PI radians). The result of the 1536 | \ lookup will therefore be an integer in the range 0 to 31, as this represents 1537 | \ 0 to 45 degrees (0 to PI / 4 radians). 1538 | \ 1539 | \ The table does not support values of t >= 1 or t < 0 directly, so if we need 1540 | \ to calculate the arctangent for an angle greater than 45 degrees, we can apply 1541 | \ the following calculation to the result from the table: 1542 | \ 1543 | \ * For t > 1, arctan(t) = 64 - arctan(1 / t) 1544 | \ 1545 | \ For negative values of t where -1 < t < 0, we can apply the following 1546 | \ calculation to the result from the table: 1547 | \ 1548 | \ * For t < 0, arctan(-t) = 128 - arctan(t) 1549 | \ 1550 | \ Finally, if t < -1, we can do the first calculation to get arctan(|t|), and 1551 | \ the second to get arctan(-|t|). 1552 | \ 1553 | \ ****************************************************************************** 1554 | 1555 | .ACT 1556 | 1557 | FOR I%, 0, 31 1558 | 1559 | EQUB INT((128 / PI) * ATN(I% / 32) + 0.5) 1560 | 1561 | NEXT 1562 | 1563 | \ ****************************************************************************** 1564 | \ 1565 | \ Save WORDS.bin 1566 | \ 1567 | \ ****************************************************************************** 1568 | 1569 | PRINT "WORDS" 1570 | PRINT "Assembled at ", ~CODE_WORDS% 1571 | PRINT "Ends at ", ~P% 1572 | PRINT "Code size is ", ~(P% - CODE_WORDS%) 1573 | PRINT "Execute at ", ~LOAD_WORDS% 1574 | PRINT "Reload at ", ~LOAD_WORDS% 1575 | 1576 | PRINT "S.WORDS ", ~CODE_WORDS%, " ", ~P%, " ", ~LOAD_WORDS%, " ", ~LOAD_WORDS% 1577 | SAVE "3-assembled-output/WORDS.bin", CODE_WORDS%, P%, LOAD_WORDS% 1578 | -------------------------------------------------------------------------------- /2-build-files/README.md: -------------------------------------------------------------------------------- 1 | # Build files for the BBC Micro disc version of Elite 2 | 3 | This folder contains support scripts for building the BBC Micro disc version of Elite. 4 | 5 | * [crc32.py](crc32.py) calculates checksums during the verify stage and compares the results with the relevant binaries in the [4-reference-binaries](../4-reference-binaries) folder 6 | 7 | * [elite-checksum.py](elite-checksum.py) adds checksums and encryption to the assembled output 8 | 9 | * [elite-decrypt.py](elite-decrypt.py) decrypts an encrypted game binary by doing the opposite to the elite-checksum.py script (this is not used in the build process, but is useful when trying to decrypt any new releases that might be found) 10 | 11 | It also contains the `make.exe` executable for Windows, plus the required DLL files. 12 | 13 | --- 14 | 15 | Right on, Commanders! 16 | 17 | _Mark Moxon_ -------------------------------------------------------------------------------- /2-build-files/crc32.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # ****************************************************************************** 4 | # 5 | # ELITE VERIFICATION SCRIPT 6 | # 7 | # Written by Kieran Connell, extended by Mark Moxon 8 | # 9 | # This script performs checksums on the compiled files from the build process, 10 | # and checks them against the extracted files from the original source disc 11 | # 12 | # ****************************************************************************** 13 | 14 | from __future__ import print_function 15 | import sys 16 | import os 17 | import os.path 18 | import zlib 19 | 20 | 21 | def main(): 22 | if len(sys.argv) <= 2: 23 | # Do CRC on single folder 24 | folder = sys.argv[1] if len(sys.argv) == 2 else "." 25 | names = sorted(os.listdir(folder)) 26 | 27 | print() 28 | print('Checksum Size Filename') 29 | print('------------------------------------------') 30 | 31 | for name in names: 32 | if name.endswith(".bin"): 33 | full_name = os.path.join(folder, name) 34 | if not os.path.isfile(full_name): 35 | continue 36 | with open(full_name, 'rb') as f: 37 | data = f.read() 38 | print('%08x %5d %s' % ( 39 | zlib.crc32(data) & 0xffffffff, 40 | len(data), 41 | full_name) 42 | ) 43 | print() 44 | else: 45 | # Do CRC on two folders 46 | folder1 = sys.argv[1] 47 | names1 = sorted(os.listdir(folder1)) 48 | folder2 = sys.argv[2] 49 | names2 = sorted(os.listdir(folder2)) 50 | names = list(names1) 51 | names.extend(x for x in names2 if x not in names) 52 | 53 | if '4-reference-binaries' in folder1: 54 | src = '[--originals--]' 55 | elif 'output' in folder1: 56 | src = '[---output----]' 57 | else: 58 | src = '[{0: ^13}]'.format(folder1[0:13]).replace(' ', '-') 59 | 60 | if '4-reference-binaries' in folder2: 61 | dest = '[--originals--]' 62 | elif 'output' in folder2: 63 | dest = '[---output----]' 64 | else: 65 | dest = '[{0: ^13}]'.format(folder2[0:13]).replace(' ', '-') 66 | 67 | print('Results for variant: ' + os.path.basename(folder1)) 68 | print(src + ' ' + dest) 69 | print('Checksum Size Checksum Size Match Filename') 70 | print('-----------------------------------------------------------') 71 | 72 | for name in names: 73 | if name.endswith(".bin"): 74 | full_name1 = os.path.join(folder1, name) 75 | full_name2 = os.path.join(folder2, name) 76 | 77 | if name in names1 and name in names2 and os.path.isfile(full_name1) and os.path.isfile(full_name2): 78 | with open(full_name1, 'rb') as f: 79 | data1 = f.read() 80 | with open(full_name2, 'rb') as f: 81 | data2 = f.read() 82 | crc1 = zlib.crc32(data1) & 0xffffffff 83 | crc2 = zlib.crc32(data2) & 0xffffffff 84 | match = ' Yes ' if crc1 == crc2 and len(data1) == len(data2) else ' No ' 85 | print('%08x %5d %08x %5d %s %s' % ( 86 | crc1, 87 | len(data1), 88 | crc2, 89 | len(data2), 90 | match, 91 | name) 92 | ) 93 | elif name in names1 and os.path.isfile(full_name1): 94 | with open(full_name1, 'rb') as f: 95 | data = f.read() 96 | print('%08x %5d %s %s %s %s' % ( 97 | zlib.crc32(data) & 0xffffffff, 98 | len(data), 99 | '- ', 100 | ' -', 101 | ' - ', 102 | name) 103 | ) 104 | elif name in names2 and os.path.isfile(full_name2): 105 | with open(full_name2, 'rb') as f: 106 | data = f.read() 107 | print('%s %s %08x %5d %s %s' % ( 108 | '- ', 109 | ' -', 110 | zlib.crc32(data) & 0xffffffff, 111 | len(data), 112 | ' - ', 113 | name) 114 | ) 115 | print() 116 | 117 | 118 | if __name__ == '__main__': 119 | main() 120 | -------------------------------------------------------------------------------- /2-build-files/elite-checksum.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # ****************************************************************************** 4 | # 5 | # DISC ELITE CHECKSUM SCRIPT 6 | # 7 | # Written by Mark Moxon 8 | # 9 | # This script applies encryption and checksums to the compiled binary for the 10 | # main game code. It reads these unencrypted binary files: 11 | # 12 | # * ELITE4.unprot.bin 13 | # * D.CODE.unprot.bin 14 | # * T.CODE.unprot.bin 15 | # 16 | # and generates encrypted versions as follows: 17 | # 18 | # * ELITE4.bin 19 | # * D.CODE.bin 20 | # * T.CODE.bin 21 | # 22 | # ****************************************************************************** 23 | 24 | from __future__ import print_function 25 | import sys 26 | 27 | argv = sys.argv 28 | argc = len(argv) 29 | encrypt = True 30 | Scramble = True 31 | release = 1 32 | 33 | for arg in argv[1:]: 34 | if arg == "-u": 35 | encrypt = False 36 | if arg == "-rel1": 37 | release = 1 38 | if arg == "-rel2": 39 | release = 2 40 | if arg == "-rel3": 41 | Scramble = False 42 | release = 3 43 | 44 | print("Disc Elite Checksum") 45 | print("Encryption = ", encrypt) 46 | print("Scramble main code = ", Scramble) 47 | 48 | # Configuration variables for scrambling code and calculating checksums 49 | # 50 | # Values must match those in 3-assembled-output/compile.txt 51 | # 52 | # If you alter the source code, then you should extract the correct values for 53 | # the following variables and plug them into the following, otherwise the game 54 | # will fail the checksum process and will hang on loading 55 | # 56 | # You can find the correct values for these variables by building your updated 57 | # source, and then searching compile.txt for "elite-checksum.py", where the new 58 | # values will be listed 59 | 60 | load_address = 0x1900 61 | 62 | # TVT1code block 63 | scramble1_from = 0x2962 # TVT1code 64 | scramble1_to = 0x2A62 # ELITE 65 | scramble1_eor = 0xA5 66 | 67 | # LOADcode block 68 | scramble2_from = 0x1AED # LOADcode 69 | scramble2_to = 0x1B4F # CATDcode 70 | scramble2_eor = 0x18 71 | 72 | # DIALS, SHIP_MISSILE and WORDS blocks 73 | scramble3_from = 0x1D4B # DIALS 74 | scramble3_to = 0x294B # OSBmod 75 | scramble3_eor = 0xA5 76 | 77 | # ELITE, ASOFT and CpASOFT blocks, plus padding to the end of the file 78 | if release == 1 or release == 2: 79 | scramble4_from = 0x2A62 # ELITE 80 | scramble4_to = 0x2E00 # End of ELITE4 file 81 | scramble4_eor = 0xA5 82 | elif release == 3: 83 | scramble4_from = 0x2A62 # ELITE 84 | scramble4_to = 0x2DF0 # End of ELITE4 file (at PROT4) 85 | scramble4_eor = 0xA5 86 | 87 | # Commander file checksum 88 | tvt1_code = 0x2962 # TVT1code 89 | tvt1 = 0x1100 # TVT1 90 | na_per_cent = 0x1181 # NA% 91 | chk2 = 0x11D3 # CHK2 92 | 93 | # Load assembled code file for ELITE4 94 | 95 | data_block = bytearray() 96 | 97 | elite_file = open("3-assembled-output/ELITE4.unprot.bin", "rb") 98 | data_block.extend(elite_file.read()) 99 | elite_file.close() 100 | 101 | # Commander data checksum 102 | 103 | na_per_cent_offset = na_per_cent - tvt1 + tvt1_code - load_address 104 | checksum_offset = chk2 - tvt1 + tvt1_code - load_address 105 | CH = 0x4B - 2 106 | CY = 0 107 | for i in range(CH, 0, -1): 108 | CH = CH + CY + data_block[na_per_cent_offset + i + 7] 109 | CY = (CH > 255) & 1 110 | CH = CH % 256 111 | CH = CH ^ data_block[na_per_cent_offset + i + 8] 112 | 113 | print("Commander checksum = ", hex(CH)) 114 | 115 | data_block[checksum_offset] = CH ^ 0xA9 116 | data_block[checksum_offset + 1] = CH 117 | 118 | # Extract unscrambled &1100-&11E3 for use in &55FF checksum below 119 | 120 | start_1100 = scramble1_from - load_address 121 | end_1100 = start_1100 + 0xE3 122 | block_1100 = data_block[start_1100:end_1100] 123 | 124 | # EOR bytes in the various blocks 125 | 126 | for n in range(scramble1_from, scramble1_to): 127 | data_block[n - load_address] = data_block[n - load_address] ^ scramble1_eor 128 | 129 | for n in range(scramble2_from, scramble2_to): 130 | data_block[n - load_address] = data_block[n - load_address] ^ scramble2_eor 131 | 132 | for n in range(scramble3_from, scramble3_to): 133 | data_block[n - load_address] = data_block[n - load_address] ^ scramble3_eor 134 | 135 | for n in range(scramble4_from, scramble4_to): 136 | data_block[n - load_address] = data_block[n - load_address] ^ scramble4_eor 137 | 138 | # Write output file for ELITE4 139 | 140 | output_file = open("3-assembled-output/ELITE4.bin", "wb") 141 | output_file.write(data_block) 142 | output_file.close() 143 | 144 | print("3-assembled-output/ELITE4.bin file saved") 145 | 146 | # Configuration variables for D.CODE 147 | 148 | load_address = 0x11E3 149 | scramble_from = 0x1300 150 | scramble_to = 0x5600 151 | scramble_eor = 0x33 152 | 153 | # Load assembled code file for D.CODE 154 | 155 | data_block = bytearray() 156 | 157 | elite_file = open("3-assembled-output/D.CODE.unprot.bin", "rb") 158 | data_block.extend(elite_file.read()) 159 | elite_file.close() 160 | 161 | # SC routine, which EORs bytes between &1300 and &55FF 162 | 163 | if Scramble: 164 | for n in range(scramble_from, scramble_to): 165 | data_block[n - load_address] = data_block[n - load_address] ^ (n % 256) ^ scramble_eor 166 | 167 | # Write output file for D.CODE 168 | 169 | output_file = open("3-assembled-output/D.CODE.bin", "wb") 170 | output_file.write(data_block) 171 | output_file.close() 172 | 173 | print("3-assembled-output/D.CODE.bin file saved") 174 | 175 | # Configuration variables for T.CODE 176 | 177 | load_address = 0x11E3 178 | scramble_from = 0x1300 179 | scramble_to = 0x6000 180 | scramble_eor = 0x33 181 | 182 | # Load assembled code file for T.CODE 183 | 184 | data_block = bytearray() 185 | 186 | elite_file = open("3-assembled-output/T.CODE.unprot.bin", "rb") 187 | data_block.extend(elite_file.read()) 188 | elite_file.close() 189 | 190 | # SC routine, which EORs bytes between &1300 and &9FFF 191 | 192 | if Scramble: 193 | for n in range(scramble_from, scramble_to): 194 | data_block[n - load_address] = data_block[n - load_address] ^ (n % 256) ^ scramble_eor 195 | 196 | # LOAD routine, which calculates checksum at &55FF in docked code 197 | # This checksum is not correct - need to fix this at some point 198 | 199 | checksum_address = 0x55FF 200 | block_to_checksum = block_1100 + data_block 201 | 202 | d_checksum = 0x11 203 | carry = 1 204 | for x in range(0x11, 0x54): 205 | for y in [0] + list(range(255, 0, -1)): 206 | i = x * 256 + y 207 | d_checksum += block_to_checksum[i - 0x1100] + carry 208 | if d_checksum > 255: 209 | carry = 1 210 | else: 211 | carry = 0 212 | d_checksum = d_checksum % 256 213 | carry = 0 214 | d_checksum = d_checksum % 256 215 | d_checksum = d_checksum % 256 216 | 217 | if release == 3: 218 | # Override the checksum to match value in binary, as the 219 | # checksum is disabled in LOAD in the sideways RAM variant 220 | d_checksum = 0xE6 221 | 222 | if encrypt: 223 | data_block[checksum_address - load_address] = d_checksum 224 | 225 | print("&55FF docked code checksum = ", hex(d_checksum)) 226 | 227 | # Write output file for T.CODE 228 | 229 | output_file = open("3-assembled-output/T.CODE.bin", "wb") 230 | output_file.write(data_block) 231 | output_file.close() 232 | 233 | print("3-assembled-output/T.CODE.bin file saved") 234 | -------------------------------------------------------------------------------- /2-build-files/elite-decrypt.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # ****************************************************************************** 4 | # 5 | # DISC ELITE DECRYPTION SCRIPT 6 | # 7 | # Written by Mark Moxon 8 | # 9 | # This script removes encryption and checksums from the compiled binaries for 10 | # the main game code. It reads the encrypted "D.CODE.bin" and "T.CODE.bin" 11 | # binaries and generates decrypted versions as "D.CODE.decrypt.bin" and 12 | # "T.CODE.decrypt.bin" 13 | # 14 | # Files are saved using the decrypt.bin suffix so they don't overwrite any 15 | # existing unprot.bin files, so they can be compared if required 16 | # 17 | # Run this script by changing directory to the repository's root folder and 18 | # running the script with "python 2-build-files/elite-decrypt.py" 19 | # 20 | # You can decrypt specific releases by adding the following arguments, as in 21 | # "python 2-build-files/elite-decrypt.py -rel1" for example: 22 | # 23 | # -rel1 Decrypt the release from Ian Bell's site 24 | # -rel2 Decrypt the Stairway to Hell release 25 | # 26 | # If unspecified, the default is rel2 27 | # 28 | # ****************************************************************************** 29 | 30 | from __future__ import print_function 31 | import sys 32 | 33 | print() 34 | print("BBC disc Elite decryption") 35 | 36 | argv = sys.argv 37 | release = 2 38 | folder = "sth" 39 | 40 | for arg in argv[1:]: 41 | if arg == "-rel1": 42 | release = 1 43 | folder = "ib-disc" 44 | if arg == "-rel2": 45 | release = 2 46 | folder = "sth" 47 | if arg == "-rel3": 48 | print("Sideways RAM variant is not encrypted") 49 | exit() 50 | 51 | # Configuration variables for D.CODE 52 | 53 | load_address = 0x11E3 54 | unscramble_from = 0x5600 55 | unscramble_to = 0x1300 56 | scramble_eor = 0x33 57 | 58 | data_block = bytearray() 59 | 60 | # Load assembled code file 61 | 62 | elite_file = open("4-reference-binaries/" + folder + "/D.CODE.bin", "rb") 63 | data_block.extend(elite_file.read()) 64 | elite_file.close() 65 | 66 | print() 67 | print("[ Read ] 4-reference-binaries/" + folder + "/D.CODE.bin") 68 | 69 | # Do decryption 70 | 71 | # SC routine, which EORs bytes between &1300 and &9FFF 72 | # Can be reversed by simply repeating the EOR 73 | 74 | for n in range(unscramble_to, unscramble_from): 75 | data_block[n - load_address] = data_block[n - load_address] ^ (n % 256) ^ scramble_eor 76 | 77 | print("[ Decrypt ] 4-reference-binaries/" + folder + "/D.CODE.bin") 78 | 79 | # Write output file for D.CODE.decrypt 80 | 81 | output_file = open("4-reference-binaries/" + folder + "/D.CODE.decrypt.bin", "wb") 82 | output_file.write(data_block) 83 | output_file.close() 84 | 85 | print("[ Save ] 4-reference-binaries/" + folder + "/D.CODE.decrypt.bin") 86 | 87 | # Configuration variables for T.CODE 88 | 89 | load_address = 0x11E3 90 | unscramble_to = 0x1300 91 | unscramble_from = 0x6000 92 | scramble_eor = 0x33 93 | 94 | data_block = bytearray() 95 | 96 | # Load assembled code file 97 | 98 | elite_file = open("4-reference-binaries/" + folder + "/T.CODE.bin", "rb") 99 | data_block.extend(elite_file.read()) 100 | elite_file.close() 101 | 102 | print() 103 | print("[ Read ] 4-reference-binaries/" + folder + "/T.CODE.bin") 104 | 105 | # Do decryption 106 | 107 | # SC routine, which EORs bytes between &1300 and &9FFF 108 | # Can be reversed by simply repeating the EOR 109 | 110 | for n in range(unscramble_to, unscramble_from): 111 | data_block[n - load_address] = data_block[n - load_address] ^ (n % 256) ^ scramble_eor 112 | 113 | print("[ Decrypt ] 4-reference-binaries/" + folder + "/T.CODE.bin") 114 | 115 | # Write output file for T.CODE.decrypt 116 | 117 | output_file = open("4-reference-binaries/" + folder + "/T.CODE.decrypt.bin", "wb") 118 | output_file.write(data_block) 119 | output_file.close() 120 | 121 | print("[ Save ] 4-reference-binaries/" + folder + "/T.CODE.decrypt.bin") 122 | print() 123 | -------------------------------------------------------------------------------- /2-build-files/libiconv2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/2-build-files/libiconv2.dll -------------------------------------------------------------------------------- /2-build-files/libintl3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/2-build-files/libintl3.dll -------------------------------------------------------------------------------- /2-build-files/make.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/2-build-files/make.exe -------------------------------------------------------------------------------- /3-assembled-output/D.CODE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/D.CODE.bin -------------------------------------------------------------------------------- /3-assembled-output/D.CODE.unprot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/D.CODE.unprot.bin -------------------------------------------------------------------------------- /3-assembled-output/D.MOA.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/D.MOA.bin -------------------------------------------------------------------------------- /3-assembled-output/D.MOB.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/D.MOB.bin -------------------------------------------------------------------------------- /3-assembled-output/D.MOC.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/D.MOC.bin -------------------------------------------------------------------------------- /3-assembled-output/D.MOD.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/D.MOD.bin -------------------------------------------------------------------------------- /3-assembled-output/D.MOE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/D.MOE.bin -------------------------------------------------------------------------------- /3-assembled-output/D.MOF.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/D.MOF.bin -------------------------------------------------------------------------------- /3-assembled-output/D.MOG.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/D.MOG.bin -------------------------------------------------------------------------------- /3-assembled-output/D.MOH.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/D.MOH.bin -------------------------------------------------------------------------------- /3-assembled-output/D.MOI.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/D.MOI.bin -------------------------------------------------------------------------------- /3-assembled-output/D.MOJ.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/D.MOJ.bin -------------------------------------------------------------------------------- /3-assembled-output/D.MOK.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/D.MOK.bin -------------------------------------------------------------------------------- /3-assembled-output/D.MOL.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/D.MOL.bin -------------------------------------------------------------------------------- /3-assembled-output/D.MOM.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/D.MOM.bin -------------------------------------------------------------------------------- /3-assembled-output/D.MON.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/D.MON.bin -------------------------------------------------------------------------------- /3-assembled-output/D.MOO.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/D.MOO.bin -------------------------------------------------------------------------------- /3-assembled-output/D.MOP.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/D.MOP.bin -------------------------------------------------------------------------------- /3-assembled-output/ELITE2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/ELITE2.bin -------------------------------------------------------------------------------- /3-assembled-output/ELITE3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/ELITE3.bin -------------------------------------------------------------------------------- /3-assembled-output/ELITE4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/ELITE4.bin -------------------------------------------------------------------------------- /3-assembled-output/ELITE4.unprot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/ELITE4.unprot.bin -------------------------------------------------------------------------------- /3-assembled-output/MISSILE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/MISSILE.bin -------------------------------------------------------------------------------- /3-assembled-output/MNUCODE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/MNUCODE.bin -------------------------------------------------------------------------------- /3-assembled-output/README.md: -------------------------------------------------------------------------------- 1 | # Assembled output for the BBC Micro disc version of Elite 2 | 3 | This folder contains the output binaries from the build process for the BBC Micro disc version of Elite. 4 | 5 | It also contains [compile.txt](compile.txt), which contains the output from the assembly process. This is very useful when debugging the build process. 6 | 7 | --- 8 | 9 | Right on, Commanders! 10 | 11 | _Mark Moxon_ -------------------------------------------------------------------------------- /3-assembled-output/README.txt: -------------------------------------------------------------------------------- 1 | 2 | --------------------------------------- 3 | Acornsoft Elite 4 | 5 | Version: BBC Micro disc 6 | Variant: Stairway to Hell archive 7 | Product: Acornsoft SNG38 8 | Acornsoft SNG47 9 | 10 | See www.bbcelite.com for details 11 | --------------------------------------- 12 | -------------------------------------------------------------------------------- /3-assembled-output/T.CODE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/T.CODE.bin -------------------------------------------------------------------------------- /3-assembled-output/T.CODE.unprot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/T.CODE.unprot.bin -------------------------------------------------------------------------------- /3-assembled-output/WORDS.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/3-assembled-output/WORDS.bin -------------------------------------------------------------------------------- /4-reference-binaries/README.md: -------------------------------------------------------------------------------- 1 | # Original binaries for the BBC Micro disc version of Elite 2 | 3 | This folder contains the binaries from the game disc for the BBC Micro disc version of Elite on Ian Bell's personal website, as well as reference binaries for the other releases. 4 | 5 | * [ib-disc](ib-disc) contains the binaries from the disc version on Ian Bell's personal website 6 | 7 | * [sideways-ram](sideways-ram) contains the binaries from the sideways RAM variant on Ian Bell's personal website 8 | 9 | * [sth](sth) contains the binaries from the Stairway to Hell version 10 | 11 | --- 12 | 13 | Right on, Commanders! 14 | 15 | _Mark Moxon_ -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/!BOOT.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/!BOOT.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/D.CODE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/D.CODE.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/D.CODE.unprot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/D.CODE.unprot.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/D.MOA.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/D.MOA.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/D.MOB.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/D.MOB.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/D.MOC.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/D.MOC.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/D.MOD.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/D.MOD.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/D.MOE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/D.MOE.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/D.MOF.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/D.MOF.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/D.MOG.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/D.MOG.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/D.MOH.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/D.MOH.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/D.MOI.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/D.MOI.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/D.MOJ.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/D.MOJ.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/D.MOK.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/D.MOK.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/D.MOL.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/D.MOL.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/D.MOM.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/D.MOM.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/D.MON.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/D.MON.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/D.MOO.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/D.MOO.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/D.MOP.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/D.MOP.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/ELITE2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/ELITE2.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/ELITE3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/ELITE3.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/ELITE4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/ELITE4.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/ELITE4.unprot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/ELITE4.unprot.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/ELITE5.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/ELITE5.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/ELITE6.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/ELITE6.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/MISSILE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/MISSILE.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/T.CODE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/T.CODE.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/T.CODE.unprot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/T.CODE.unprot.bin -------------------------------------------------------------------------------- /4-reference-binaries/ib-disc/WORDS.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/ib-disc/WORDS.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/D.CODE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/D.CODE.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/D.CODE.unprot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/D.CODE.unprot.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/D.MOA.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/D.MOA.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/D.MOB.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/D.MOB.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/D.MOC.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/D.MOC.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/D.MOD.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/D.MOD.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/D.MOE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/D.MOE.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/D.MOF.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/D.MOF.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/D.MOG.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/D.MOG.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/D.MOH.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/D.MOH.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/D.MOI.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/D.MOI.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/D.MOJ.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/D.MOJ.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/D.MOK.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/D.MOK.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/D.MOL.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/D.MOL.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/D.MOM.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/D.MOM.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/D.MON.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/D.MON.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/D.MOO.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/D.MOO.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/D.MOP.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/D.MOP.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/ELITE4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/ELITE4.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/ELITE4.unprot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/ELITE4.unprot.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/MISSILE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/MISSILE.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/MNUCODE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/MNUCODE.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/T.CODE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/T.CODE.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/T.CODE.unprot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/T.CODE.unprot.bin -------------------------------------------------------------------------------- /4-reference-binaries/sideways-ram/WORDS.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sideways-ram/WORDS.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/D.CODE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/D.CODE.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/D.CODE.unprot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/D.CODE.unprot.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/D.MOA.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/D.MOA.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/D.MOB.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/D.MOB.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/D.MOC.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/D.MOC.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/D.MOD.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/D.MOD.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/D.MOE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/D.MOE.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/D.MOF.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/D.MOF.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/D.MOG.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/D.MOG.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/D.MOH.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/D.MOH.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/D.MOI.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/D.MOI.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/D.MOJ.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/D.MOJ.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/D.MOK.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/D.MOK.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/D.MOL.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/D.MOL.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/D.MOM.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/D.MOM.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/D.MON.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/D.MON.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/D.MOO.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/D.MOO.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/D.MOP.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/D.MOP.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/ELITE2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/ELITE2.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/ELITE3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/ELITE3.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/ELITE4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/ELITE4.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/ELITE4.unprot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/ELITE4.unprot.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/MISSILE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/MISSILE.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/T.CODE.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/T.CODE.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/T.CODE.unprot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/T.CODE.unprot.bin -------------------------------------------------------------------------------- /4-reference-binaries/sth/WORDS.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/4-reference-binaries/sth/WORDS.bin -------------------------------------------------------------------------------- /5-compiled-game-discs/README.md: -------------------------------------------------------------------------------- 1 | # Compiled game discs for the BBC Micro disc version of Elite 2 | 3 | This folder contains the SSD disc images for the BBC Micro disc version of Elite, as produced by the build process. There is one SSD file for each supported release. These SSD images can be loaded into an emulator like JSBeeb or BeebEm, or into a real BBC Micro using a device like a Gotek. 4 | 5 | --- 6 | 7 | Right on, Commanders! 8 | 9 | _Mark Moxon_ -------------------------------------------------------------------------------- /5-compiled-game-discs/elite-disc-ib-disc.ssd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/5-compiled-game-discs/elite-disc-ib-disc.ssd -------------------------------------------------------------------------------- /5-compiled-game-discs/elite-disc-sideways-ram.ssd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/5-compiled-game-discs/elite-disc-sideways-ram.ssd -------------------------------------------------------------------------------- /5-compiled-game-discs/elite-disc-sth.ssd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markmoxon/elite-source-code-bbc-micro-disc/84d3a3cd883cf927e89f9641b62325fec5a53192/5-compiled-game-discs/elite-disc-sth.ssd -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | BEEBASM?=beebasm 2 | PYTHON?=python 3 | 4 | # A make command with no arguments will build the Stairway to Hell variant 5 | # with encrypted binaries, checksums enabled, the standard commander and 6 | # crc32 verification of the game binaries 7 | # 8 | # Optional arguments for the make command are: 9 | # 10 | # variant= Build the specified variant: 11 | # 12 | # sth (default) 13 | # ib-disc 14 | # sideways-ram 15 | # 16 | # commander=max Start with a maxed-out commander 17 | # 18 | # encrypt=no Disable encryption and checksum routines 19 | # 20 | # match=no Do not attempt to match the original game binaries 21 | # (i.e. omit workspace noise) 22 | # 23 | # verify=no Disable crc32 verification of the game binaries 24 | # 25 | # So, for example: 26 | # 27 | # make variant=ib-disc commander=max encrypt=no match=no verify=no 28 | # 29 | # will build an unencrypted Ian Bell disc variant with a maxed-out commander, 30 | # no workspace noise and no crc32 verification 31 | # 32 | # The following variables are written into elite-build-options.asm depending on 33 | # the above arguments, so they can be passed to BeebAsm: 34 | # 35 | # _VERSION 36 | # 2 = BBC Micro disc 37 | # 38 | # _VARIANT 39 | # 1 = Ian Bell's game disc 40 | # 2 = Stairway to Hell (default) 41 | # 3 = BBC Micro Sideways RAM version 42 | # 43 | # _MAX_COMMANDER 44 | # TRUE = Maxed-out commander 45 | # FALSE = Standard commander 46 | # 47 | # _REMOVE_CHECKSUMS 48 | # TRUE = Disable checksum routines 49 | # FALSE = Enable checksum routines 50 | # 51 | # _MATCH_ORIGINAL_BINARIES 52 | # TRUE = Match binaries to released version (i.e. fill workspaces with noise) 53 | # FALSE = Zero-fill workspaces 54 | # 55 | # The encrypt and verify arguments are passed to the elite-checksum.py and 56 | # crc32.py scripts, rather than BeebAsm 57 | 58 | ifeq ($(commander), max) 59 | max-commander=TRUE 60 | else 61 | max-commander=FALSE 62 | endif 63 | 64 | ifeq ($(encrypt), no) 65 | unencrypt=-u 66 | remove-checksums=TRUE 67 | else 68 | unencrypt= 69 | remove-checksums=FALSE 70 | endif 71 | 72 | ifeq ($(match), no) 73 | match-original-binaries=FALSE 74 | else 75 | match-original-binaries=TRUE 76 | endif 77 | 78 | ifeq ($(variant), ib-disc) 79 | variant-number=1 80 | folder=ib-disc 81 | suffix=-ib-disc 82 | boot=-boot ELITE2 83 | else ifeq ($(variant), sideways-ram) 84 | variant-number=3 85 | folder=sideways-ram 86 | suffix=-sideways-ram 87 | boot=-opt 3 88 | else 89 | variant-number=2 90 | folder=sth 91 | suffix=-sth 92 | boot=-boot ELITE2 93 | endif 94 | 95 | .PHONY:all 96 | all: 97 | echo _VERSION=2 > 1-source-files/main-sources/elite-build-options.asm 98 | echo _VARIANT=$(variant-number) >> 1-source-files/main-sources/elite-build-options.asm 99 | echo _REMOVE_CHECKSUMS=$(remove-checksums) >> 1-source-files/main-sources/elite-build-options.asm 100 | echo _MATCH_ORIGINAL_BINARIES=$(match-original-binaries) >> 1-source-files/main-sources/elite-build-options.asm 101 | echo _MAX_COMMANDER=$(max-commander) >> 1-source-files/main-sources/elite-build-options.asm 102 | $(BEEBASM) -i 1-source-files/main-sources/elite-text-tokens.asm -v > 3-assembled-output/compile.txt 103 | $(BEEBASM) -i 1-source-files/main-sources/elite-missile.asm -v >> 3-assembled-output/compile.txt 104 | $(BEEBASM) -i 1-source-files/main-sources/elite-loader1.asm -v >> 3-assembled-output/compile.txt 105 | $(BEEBASM) -i 1-source-files/main-sources/elite-loader2.asm -v >> 3-assembled-output/compile.txt 106 | $(BEEBASM) -i 1-source-files/main-sources/elite-loader3.asm -v >> 3-assembled-output/compile.txt 107 | $(BEEBASM) -i 1-source-files/main-sources/elite-loader-sideways-ram.asm -v >> 3-assembled-output/compile.txt 108 | $(BEEBASM) -i 1-source-files/main-sources/elite-source-flight.asm -v >> 3-assembled-output/compile.txt 109 | $(BEEBASM) -i 1-source-files/main-sources/elite-source-docked.asm -v >> 3-assembled-output/compile.txt 110 | $(BEEBASM) -i 1-source-files/main-sources/elite-ships-a.asm -v >> 3-assembled-output/compile.txt 111 | $(BEEBASM) -i 1-source-files/main-sources/elite-ships-b.asm -v >> 3-assembled-output/compile.txt 112 | $(BEEBASM) -i 1-source-files/main-sources/elite-ships-c.asm -v >> 3-assembled-output/compile.txt 113 | $(BEEBASM) -i 1-source-files/main-sources/elite-ships-d.asm -v >> 3-assembled-output/compile.txt 114 | $(BEEBASM) -i 1-source-files/main-sources/elite-ships-e.asm -v >> 3-assembled-output/compile.txt 115 | $(BEEBASM) -i 1-source-files/main-sources/elite-ships-f.asm -v >> 3-assembled-output/compile.txt 116 | $(BEEBASM) -i 1-source-files/main-sources/elite-ships-g.asm -v >> 3-assembled-output/compile.txt 117 | $(BEEBASM) -i 1-source-files/main-sources/elite-ships-h.asm -v >> 3-assembled-output/compile.txt 118 | $(BEEBASM) -i 1-source-files/main-sources/elite-ships-i.asm -v >> 3-assembled-output/compile.txt 119 | $(BEEBASM) -i 1-source-files/main-sources/elite-ships-j.asm -v >> 3-assembled-output/compile.txt 120 | $(BEEBASM) -i 1-source-files/main-sources/elite-ships-k.asm -v >> 3-assembled-output/compile.txt 121 | $(BEEBASM) -i 1-source-files/main-sources/elite-ships-l.asm -v >> 3-assembled-output/compile.txt 122 | $(BEEBASM) -i 1-source-files/main-sources/elite-ships-m.asm -v >> 3-assembled-output/compile.txt 123 | $(BEEBASM) -i 1-source-files/main-sources/elite-ships-n.asm -v >> 3-assembled-output/compile.txt 124 | $(BEEBASM) -i 1-source-files/main-sources/elite-ships-o.asm -v >> 3-assembled-output/compile.txt 125 | $(BEEBASM) -i 1-source-files/main-sources/elite-ships-p.asm -v >> 3-assembled-output/compile.txt 126 | $(BEEBASM) -i 1-source-files/main-sources/elite-readme.asm -v >> 3-assembled-output/compile.txt 127 | $(PYTHON) 2-build-files/elite-checksum.py $(unencrypt) -rel$(variant-number) 128 | $(BEEBASM) -i 1-source-files/main-sources/elite-disc.asm -do 5-compiled-game-discs/elite-disc$(suffix).ssd $(boot) -title "E L I T E" 129 | ifneq ($(verify), no) 130 | @$(PYTHON) 2-build-files/crc32.py 4-reference-binaries/$(folder) 3-assembled-output 131 | endif 132 | 133 | .PHONY:b2 134 | b2: 135 | curl -G "http://localhost:48075/reset/b2" 136 | curl -H "Content-Type:application/binary" --upload-file "5-compiled-game-discs/elite-disc$(suffix).ssd" "http://localhost:48075/run/b2?name=elite-disc$(suffix).ssd" 137 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Fully documented source code for the disc version of Elite on the BBC Micro 2 | 3 | [BBC Micro cassette Elite](https://github.com/markmoxon/elite-source-code-bbc-micro-cassette) | **BBC Micro disc Elite** | [Acorn Electron Elite](https://github.com/markmoxon/elite-source-code-acorn-electron) | [6502 Second Processor Elite](https://github.com/markmoxon/elite-source-code-6502-second-processor) | [Commodore 64 Elite](https://github.com/markmoxon/elite-source-code-commodore-64) | [Apple II Elite](https://github.com/markmoxon/elite-source-code-apple-ii) | [BBC Master Elite](https://github.com/markmoxon/elite-source-code-bbc-master) | [NES Elite](https://github.com/markmoxon/elite-source-code-nes) | [Elite-A](https://github.com/markmoxon/elite-a-source-code-bbc-micro) | [Teletext Elite](https://github.com/markmoxon/teletext-elite) | [Elite Universe Editor](https://github.com/markmoxon/elite-universe-editor) | [Elite Compendium (BBC Master)](https://github.com/markmoxon/elite-compendium-bbc-master) | [Elite Compendium (BBC Micro)](https://github.com/markmoxon/elite-compendium-bbc-micro) | [Elite over Econet](https://github.com/markmoxon/elite-over-econet) | [!EliteNet](https://github.com/markmoxon/elite-over-econet-acorn-archimedes) | [Flicker-free Commodore 64 Elite](https://github.com/markmoxon/c64-elite-flicker-free) | [BBC Micro Aviator](https://github.com/markmoxon/aviator-source-code-bbc-micro) | [BBC Micro Revs](https://github.com/markmoxon/revs-source-code-bbc-micro) | [Archimedes Lander](https://github.com/markmoxon/lander-source-code-acorn-archimedes) 4 | 5 | ![Screenshot of the first mission in the disc version of Elite on the BBC Micro](https://elite.bbcelite.com/images/github/mission1a.png) 6 | 7 | This repository contains source code for the disc version of Elite on the BBC Micro, with every single line documented and (for the most part) explained. It has been reconstructed by hand from a disassembly of the original game binaries. 8 | 9 | It is a companion to the [elite.bbcelite.com website](https://elite.bbcelite.com). 10 | 11 | See the [introduction](#introduction) for more information, or jump straight into the [documented source code](1-source-files/main-sources). 12 | 13 | ## Contents 14 | 15 | * [Introduction](#introduction) 16 | 17 | * [Acknowledgements](#acknowledgements) 18 | 19 | * [A note on licences, copyright etc.](#user-content-a-note-on-licences-copyright-etc) 20 | 21 | * [Browsing the source in an IDE](#browsing-the-source-in-an-ide) 22 | 23 | * [Folder structure](#folder-structure) 24 | 25 | * [Flicker-free Elite](#flicker-free-elite) 26 | 27 | * [BBC Micro Elite with music](#bbc-micro-elite-with-music) 28 | 29 | * [BBC Micro Elite on the BBC Master](#bbc-micro-elite-on-the-bbc-master) 30 | 31 | * [Elite Compendium](#elite-compendium) 32 | 33 | * [Elite over Econet](#elite-over-econet) 34 | 35 | * [Building BBC Micro disc Elite from the source](#building-bbc-micro-disc-elite-from-the-source) 36 | 37 | * [Requirements](#requirements) 38 | * [Windows](#windows) 39 | * [Mac and Linux](#mac-and-linux) 40 | * [Build options](#build-options) 41 | * [Updating the checksum scripts if you change the code](#updating-the-checksum-scripts-if-you-change-the-code) 42 | * [Verifying the output](#verifying-the-output) 43 | * [Log files](#log-files) 44 | * [Auto-deploying to the b2 emulator](#auto-deploying-to-the-b2-emulator) 45 | 46 | * [Building different variants of the disc version of Elite](#building-different-variants-of-the-disc-version-of-elite) 47 | 48 | * [Building the Stairway to Hell variant](#building-the-stairway-to-hell-variant) 49 | * [Building the Ian Bell disc variant](#building-the-ian-bell-disc-variant) 50 | * [Building the sideways RAM variant](#building-the-sideways-ram-variant) 51 | * [Differences between the variants](#differences-between-the-variants) 52 | 53 | ## Introduction 54 | 55 | This repository contains source code for the disc version of Elite on the BBC Micro, with every single line documented and (for the most part) explained. 56 | 57 | You can build the fully functioning game from this source. [Three variants](#building-different-variants-of-the-disc-version-of-elite) are currently supported: the disc version from Ian Bell's personal website, the disc version from the Stairway to Hell archive, and the unreleased sideways RAM variant from Ian Bell's personal website. 58 | 59 | This repository is a companion to the [elite.bbcelite.com website](https://elite.bbcelite.com), which contains all the code from this repository, but laid out in a much more human-friendly fashion. The links at the top of this page will take you to repositories for the other versions of Elite that are covered by this project. 60 | 61 | * If you want to browse the source and read about how Elite works under the hood, you will probably find [the website](https://elite.bbcelite.com) a better place to start than this repository. 62 | 63 | * If you would rather explore the source code in your favourite IDE, then the [annotated source](1-source-files/main-sources) is what you're looking for. It contains the exact same content as the website, so you won't be missing out (the website is generated from the source files, so they are guaranteed to be identical). You might also like to read the section on [browsing the source in an IDE](#browsing-the-source-in-an-ide) for some tips. 64 | 65 | * If you want to build BBC Micro disc Elite from the source on a modern computer, to produce a working game disc that can be loaded into a BBC Micro or an emulator, then you want the section on [building BBC Micro disc Elite from the source](#building-bbc-micro-disc-elite-from-the-source)). 66 | 67 | My hope is that this repository and the [accompanying website](https://elite.bbcelite.com) will be useful for those who want to learn more about Elite and what makes it tick. It is provided on an educational and non-profit basis, with the aim of helping people appreciate one of the most iconic games of the 8-bit era. 68 | 69 | ## Acknowledgements 70 | 71 | BBC Micro Elite was written by Ian Bell and David Braben and is copyright © Acornsoft 1984. 72 | 73 | The code on this site has been reconstructed from a disassembly of the version released on [Ian Bell's personal website](http://www.elitehomepage.org/). 74 | 75 | The commentary is copyright © Mark Moxon. Any misunderstandings or mistakes in the documentation are entirely my fault. 76 | 77 | Huge thanks are due to the original authors for not only creating such an important piece of my childhood, but also for releasing the source code for us to play with; to Paul Brink for his annotated disassembly; and to Kieran Connell for his [BeebAsm version](https://github.com/kieranhj/elite-beebasm), which I forked as the original basis for this project. You can find more information about this project in the [accompanying website's project page](https://elite.bbcelite.com/about_site/about_this_project.html). 78 | 79 | Thanks to the Bitshifters for their help in building the [musical version of BBC Micro Elite](#bbc-micro-elite-with-music), and in particular Kieran Connell, Simon Morris and Negative Charge for the music player and ported music files. Thanks also to Tricky and J.G.Harston for their sideways RAM utilities. 80 | 81 | The following archive from Ian Bell's personal website forms the basis for this project: 82 | 83 | * [BBC Elite, disc version](http://www.elitehomepage.org/archive/a/a4100000.zip) 84 | 85 | ### A note on licences, copyright etc. 86 | 87 | This repository is _not_ provided with a licence, and there is intentionally no `LICENSE` file provided. 88 | 89 | According to [GitHub's licensing documentation](https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/licensing-a-repository), this means that "the default copyright laws apply, meaning that you retain all rights to your source code and no one may reproduce, distribute, or create derivative works from your work". 90 | 91 | The reason for this is that my commentary is intertwined with the original Elite source code, and the original source code is copyright. The whole site is therefore covered by default copyright law, to ensure that this copyright is respected. 92 | 93 | Under GitHub's rules, you have the right to read and fork this repository... but that's it. No other use is permitted, I'm afraid. 94 | 95 | My hope is that the educational and non-profit intentions of this repository will enable it to stay hosted and available, but the original copyright holders do have the right to ask for it to be taken down, in which case I will comply without hesitation. I do hope, though, that along with the various other disassemblies and commentaries of this source, it will remain viable. 96 | 97 | ## Browsing the source in an IDE 98 | 99 | If you want to browse the source in an IDE, you might find the following useful. 100 | 101 | * The most interesting files are in the [main-sources](1-source-files/main-sources) folder: 102 | 103 | * The main game's source code is in the [elite-source-flight.asm](1-source-files/main-sources/elite-source-flight.asm) and [elite-source-docked.asm](1-source-files/main-sources/elite-source-docked.asm) files (for when we're in-flight or docked) - this is the motherlode and probably contains all the stuff you're interested in. 104 | 105 | * The game's loader is in the [elite-loader1.asm](1-source-files/main-sources/elite-loader1.asm), [elite-loader2.asm](1-source-files/main-sources/elite-loader2.asm) and [elite-loader3.asm](1-source-files/main-sources/elite-loader3.asm) files - these are mainly concerned with setup and copy protection. 106 | 107 | * It's probably worth skimming through the [notes on terminology and notations](https://elite.bbcelite.com/terminology/) on the accompanying website, as this explains a number of terms used in the commentary, without which it might be a bit tricky to follow at times (in particular, you should understand the terminology I use for multi-byte numbers). 108 | 109 | * The accompanying website contains [a number of "deep dive" articles](https://elite.bbcelite.com/deep_dives/), each of which goes into an aspect of the game in detail. Routines that are explained further in these articles are tagged with the label `Deep dive:` and the relevant article name. 110 | 111 | * There are loads of routines and variables in Elite - literally hundreds. You can find them in the source files by searching for the following: `Type: Subroutine`, `Type: Variable`, `Type: Workspace` and `Type: Macro`. 112 | 113 | * If you know the name of a routine, you can find it by searching for `Name: `, as in `Name: SCAN` (for the 3D scanner routine) or `Name: LL9` (for the ship-drawing routine). 114 | 115 | * The entry point for the [main game code](1-source-files/main-sources/elite-source-docked.asm) is routine `TT170`, which you can find by searching for `Name: TT170`. If you want to follow the program flow all the way from the title screen around the main game loop, then you can find a number of [deep dives on program flow](https://elite.bbcelite.com/deep_dives/) on the accompanying website. 116 | 117 | * The source code is designed to be read at an 80-column width and with a monospaced font, just like in the good old days. 118 | 119 | I hope you enjoy exploring the inner workings of BBC Elite as much as I have. 120 | 121 | ## Folder structure 122 | 123 | There are five main folders in this repository, which reflect the order of the build process. 124 | 125 | * [1-source-files](1-source-files) contains all the different source files, such as the main assembler source files, image binaries, fonts, boot files and so on. 126 | 127 | * [2-build-files](2-build-files) contains build-related scripts, such as the checksum, encryption and crc32 verification scripts. 128 | 129 | * [3-assembled-output](3-assembled-output) contains the output from the assembly process, when the source files are assembled and the results processed by the build files. 130 | 131 | * [4-reference-binaries](4-reference-binaries) contains the correct binaries for each variant, so we can verify that our assembled output matches the reference. 132 | 133 | * [5-compiled-game-discs](5-compiled-game-discs) contains the final output of the build process: an SSD disc image that contains the compiled game and which can be run on real hardware or in an emulator. 134 | 135 | ## Flicker-free Elite 136 | 137 | This repository also includes a flicker-free version, which incorporates the backported flicker-free ship-drawing routines from the BBC Master, as well as a fix for planets so they no longer flicker. The flicker-free code is in a separate branch called `flicker-free`, and apart from the code differences for reducing flicker, this branch is identical to the main branch and the same build process applies. 138 | 139 | The annotated source files in the `flicker-free` branch contain both the original Acornsoft code and all of the modifications for flicker-free Elite, so you can look through the source to see exactly what's changed. Any code that I've removed from the original version is commented out in the source files, so when they are assembled they produce the flicker-free binaries, while still containing details of all the modifications. You can find all the diffs by searching the sources for `Mod:`. 140 | 141 | The repository also includes a variant that incorporates both the flicker-free ship-drawing routines and a fix for planets so they no longer flicker, though this version only works when running on a BBC Master. The flicker-free code is in a separate branch called `bbc-master-flicker-free`. 142 | 143 | For more information on flicker-free Elite, see the [hacks section of the accompanying website](https://elite.bbcelite.com/hacks/flicker-free_elite.html). 144 | 145 | ## BBC Micro Elite with music 146 | 147 | This repository also includes a version of BBC Micro Elite that includes the music from the Commodore 64 version. The music-specific code is in a separate branch called `music`, and apart from the code differences for adding the music, this branch is identical to the main branch and the same build process applies. 148 | 149 | The annotated source files in the `music` branch contain both the original Acornsoft code and all of the modifications for the musical version of Elite, so you can look through the source to see exactly what's changed. Any code that I've removed from the original version is commented out in the source files, so when they are assembled they produce the music-enabled binaries, while still containing details of all the modifications. You can find all the diffs by searching the sources for `Mod:`. 150 | 151 | The music itself is built as a sideways ROM using the code in the [elite-music repository](https://github.com/markmoxon/elite-music/). 152 | 153 | For more information on the music, see the [hacks section of the accompanying website](https://elite.bbcelite.com/hacks/bbc_elite_with_music.html). 154 | 155 | ## BBC Micro Elite on the BBC Master 156 | 157 | This repository also includes a version of BBC Micro disc Elite that will run on a BBC Master (unlike the original, which crashes when loaded into a Master). The BBC Master version is in a separate branch called `bbc-master`, and apart from the code differences for supporting the Master, this branch is identical to the main branch and the same build process applies. 158 | 159 | The annotated source files in the `bbc-master` branch contain both the original Acornsoft code and all of the modifications required to make BBC Micro Elite run on the Master, so you can look through the source to see exactly what's changed. Any code that I've removed from the original version is commented out in the source files, so when they are assembled they produce the Master-compatible binaries, while still containing details of all the modifications. You can find all the diffs by searching the sources for `Mod:`. 160 | 161 | The repository also includes a variant of the BBC Master version that incorporates both the flicker-free ship-drawing routines and a fix for planets so they no longer flicker. The flicker-free code is in a separate branch called `bbc-master-flicker-free`. 162 | 163 | For more information on the port to the BBC Master, see the [hacks section of the accompanying website](https://elite.bbcelite.com/hacks/bbc_master_disc_elite.html). 164 | 165 | ## Elite Compendium 166 | 167 | This repository also includes a version of BBC Micro disc Elite for the Elite Compendium, which incorporates all the available hacks in one game. The Compendium versions are in separate branches called `elite-compendium-bbc-master` and `elite-compendium-bbc-micro`, which are included in the [Elite Compendium (BBC Master)](https://github.com/markmoxon/elite-compendium-bbc-master) and [Elite Compendium (BBC Micro)](https://github.com/markmoxon/elite-compendium-bbc-micro) repositories as submodules. 168 | 169 | The annotated source files in the `elite-compendium` branch contain both the original Acornsoft code and all of the modifications for the Elite Compendium, so you can look through the source to see exactly what's changed. Any code that I've removed from the original version is commented out in the source files, so when they are assembled they produce the Compendium binaries, while still containing details of all the modifications. You can find all the diffs by searching the sources for `Mod:`. 170 | 171 | For more information on the Elite Compendium, see the [hacks section of the accompanying website](https://elite.bbcelite.com/hacks/elite_compendium.html). 172 | 173 | ## Elite over Econet 174 | 175 | This repository also includes a version of BBC Micro disc Elite that loads over Econet and supports multiplayer scoreboards. The Elite over Econet version is in a separate branch called `econet`, which is included in the [Elite over Econet](https://github.com/markmoxon/elite-over-econet) repository as a submodule. 176 | 177 | The annotated source files in the `econet` branch contain both the original Acornsoft code and all of the modifications for Elite over Econet, so you can look through the source to see exactly what's changed. Any code that I've removed from the original version is commented out in the source files, so when they are assembled they produce the Elite over Econet binaries, while still containing details of all the modifications. You can find all the diffs by searching the sources for `Mod:`. 178 | 179 | For more information on Elite over Econet, see the [hacks section of the accompanying website](https://elite.bbcelite.com/hacks/elite_over_econet.html). 180 | 181 | ## Building BBC Micro disc Elite from the source 182 | 183 | Builds are supported for both Windows and Mac/Linux systems. In all cases the build process is defined in the `Makefile` provided. 184 | 185 | ### Requirements 186 | 187 | You will need the following to build BBC Micro disc Elite from the source: 188 | 189 | * BeebAsm, which can be downloaded from the [BeebAsm repository](https://github.com/stardot/beebasm). Mac and Linux users will have to build their own executable with `make code`, while Windows users can just download the `beebasm.exe` file. 190 | 191 | * Python. The build process has only been tested on 3.x, but 2.7 might work. 192 | 193 | * Mac and Linux users may need to install `make` if it isn't already present (for Windows users, `make.exe` is included in this repository). 194 | 195 | For details of how the build process works, see the [build documentation on bbcelite.com](https://elite.bbcelite.com/about_site/building_elite.html). 196 | 197 | Let's look at how to build BBC Micro disc Elite from the source. 198 | 199 | ### Windows 200 | 201 | For Windows users, there is a batch file called `make.bat` which you can use to build the game. Before this will work, you should edit the batch file and change the values of the `BEEBASM` and `PYTHON` variables to point to the locations of your `beebasm.exe` and `python.exe` executables. You also need to change directory to the repository folder (i.e. the same folder as `make.bat`). 202 | 203 | All being well, entering the following into a command window: 204 | 205 | ``` 206 | make.bat 207 | ``` 208 | 209 | will produce a file called `elite-disc-sth.ssd` in the `5-compiled-game-discs` folder that contains the Stairway to Hell variant, which you can then load into an emulator, or into a real BBC Micro using a device like a Gotek. 210 | 211 | ### Mac and Linux 212 | 213 | The build process uses a standard GNU `Makefile`, so you just need to install `make` if your system doesn't already have it. If BeebAsm or Python are not on your path, then you can either fix this, or you can edit the `Makefile` and change the `BEEBASM` and `PYTHON` variables in the first two lines to point to their locations. You also need to change directory to the repository folder (i.e. the same folder as `Makefile`). 214 | 215 | All being well, entering the following into a terminal window: 216 | 217 | ``` 218 | make 219 | ``` 220 | 221 | will produce a file called `elite-disc-sth.ssd` in the `5-compiled-game-discs` folder that contains the Stairway to Hell variant, which you can then load into an emulator, or into a real BBC Micro using a device like a Gotek. 222 | 223 | ### Build options 224 | 225 | By default the build process will create a typical Elite game disc with a standard commander and verified binaries. There are various arguments you can pass to the build to change how it works. They are: 226 | 227 | * `variant=` - Build the specified variant: 228 | 229 | * `variant=sth` (default) 230 | * `variant=ib-disc` 231 | * `variant=sideways-ram` 232 | 233 | * `commander=max` - Start with a maxed-out commander (specifically, this is the test commander file from the original source, which is almost but not quite maxed-out) 234 | 235 | * `encrypt=no` - Disable encryption and checksum routines 236 | 237 | * `match=no` - Do not attempt to match the original game binaries (i.e. omit workspace noise) 238 | 239 | * `verify=no` - Disable crc32 verification of the game binaries 240 | 241 | So, for example: 242 | 243 | `make variant=ib-disc commander=max encrypt=no match=no verify=no` 244 | 245 | will build an unencrypted version of the variant from Ian Bell's website, with a maxed-out commander, no workspace noise and no crc32 verification. 246 | 247 | The unencrypted version should be more useful for anyone who wants to make modifications to the game code. As this argument produces unencrypted files, the binaries produced will be quite different to the binaries on the original source disc, which are encrypted. 248 | 249 | See below for more on the verification process. 250 | 251 | ### Updating the checksum scripts if you change the code 252 | 253 | If you change the source code in any way, you may break the game; if so, it will typically hang at the loading screen, though in some versions it may hang when launching from the space station. 254 | 255 | To fix this, you may need to update some of the hard-coded addresses in the checksum script so that they match the new addresses in your changed version of the code. See the comments in the [elite-checksum.py](2-build-files/elite-checksum.py) script for details. 256 | 257 | ### Verifying the output 258 | 259 | The default build process prints out checksums of all the generated files, along with the checksums of the files from the original sources. You can disable verification by passing `verify=no` to the build. 260 | 261 | The Python script `crc32.py` in the `2-build-files` folder does the actual verification, and shows the checksums and file sizes of both sets of files, alongside each other, and with a Match column that flags any discrepancies. If you are building an unencrypted set of files then there will be lots of differences, while the encrypted files should mostly match (see the Differences section below for more on this). 262 | 263 | The binaries in the `4-reference-binaries` folder are those extracted from the released version of the game, while those in the `3-assembled-output` folder are produced by the build process. For example, if you don't make any changes to the code and build the project with `make`, then this is the output of the verification process: 264 | 265 | ``` 266 | Results for variant: sth 267 | [--originals--] [---output----] 268 | Checksum Size Checksum Size Match Filename 269 | ----------------------------------------------------------- 270 | a9ee9d74 17437 a9ee9d74 17437 Yes D.CODE.bin 271 | dad7d3a3 17437 dad7d3a3 17437 Yes D.CODE.unprot.bin 272 | 9f4a04fd 2560 9f4a04fd 2560 Yes D.MOA.bin 273 | d9eb34f9 2560 d9eb34f9 2560 Yes D.MOB.bin 274 | 93fe2e13 2560 93fe2e13 2560 Yes D.MOC.bin 275 | 64e8ebb4 2560 64e8ebb4 2560 Yes D.MOD.bin 276 | 80afbff9 2560 80afbff9 2560 Yes D.MOE.bin 277 | b86fe100 2560 b86fe100 2560 Yes D.MOF.bin 278 | 72f99614 2560 72f99614 2560 Yes D.MOG.bin 279 | 29b6ce81 2560 29b6ce81 2560 Yes D.MOH.bin 280 | 0eeab415 2560 0eeab415 2560 Yes D.MOI.bin 281 | 7911181d 2560 7911181d 2560 Yes D.MOJ.bin 282 | 851d789f 2560 851d789f 2560 Yes D.MOK.bin 283 | 3025e5d8 2560 3025e5d8 2560 Yes D.MOL.bin 284 | d6c01098 2560 d6c01098 2560 Yes D.MOM.bin 285 | 6930e1c7 2560 6930e1c7 2560 Yes D.MON.bin 286 | 43caddc7 2560 43caddc7 2560 Yes D.MOO.bin 287 | ac1d57b2 2560 ac1d57b2 2560 Yes D.MOP.bin 288 | c73d535a 256 c73d535a 256 Yes ELITE2.bin 289 | 17eefeec 2816 17eefeec 2816 Yes ELITE3.bin 290 | ec04b4d2 5376 ec04b4d2 5376 Yes ELITE4.bin 291 | 10417c14 5376 10417c14 5376 Yes ELITE4.unprot.bin 292 | 0f9e270b 256 0f9e270b 256 Yes MISSILE.bin 293 | 42f42f63 19997 42f42f63 19997 Yes T.CODE.bin 294 | 8819c78b 19997 8819c78b 19997 Yes T.CODE.unprot.bin 295 | 52bac547 1024 52bac547 1024 Yes WORDS.bin 296 | ``` 297 | 298 | All the compiled binaries match the originals, so we know we are producing the same final game as the Stairway to Hell variant. 299 | 300 | ### Log files 301 | 302 | During compilation, details of every step are output in a file called `compile.txt` in the `3-assembled-output` folder. If you have problems, it might come in handy, and it's a great reference if you need to know the addresses of labels and variables for debugging (or just snooping around). 303 | 304 | ### Auto-deploying to the b2 emulator 305 | 306 | For users of the excellent [b2 emulator](https://github.com/tom-seddon/b2), you can include the build parameter `b2` to automatically load and boot the assembled disc image in b2. The b2 emulator must be running for this to work. 307 | 308 | For example, to build, verify and load the game into b2, you can do this on Windows: 309 | 310 | ``` 311 | make.bat all b2 312 | ``` 313 | 314 | or this on Mac/Linux: 315 | 316 | ``` 317 | make all b2 318 | ``` 319 | 320 | If you omit the `all` target then b2 will start up with the results of the last successful build. 321 | 322 | Note that you should manually choose the correct platform in b2 (I intentionally haven't automated this part to make it easier to test across multiple platforms). 323 | 324 | ## Building different variants of the disc version of Elite 325 | 326 | This repository contains the source code for two different variants of the disc version of Elite: 327 | 328 | * The variant from the Stairway to Hell archive 329 | 330 | * The variant from the game disc on Ian Bell's website 331 | 332 | * The sideways RAM variant from Ian Bell's website 333 | 334 | By default the build process builds the Stairway to Hell variant, but you can build a specified variant using the `variant=` build parameter. 335 | 336 | ### Building the Stairway to Hell variant 337 | 338 | You can add `variant=sth` to produce the `elite-disc-sth.ssd` file containing the Stairway to Hell variant, though that's the default value so it isn't necessary. In other words, you can build it like this: 339 | 340 | ``` 341 | make.bat variant=sth 342 | ``` 343 | 344 | or this on a Mac or Linux: 345 | 346 | ``` 347 | make variant=sth 348 | ``` 349 | 350 | This will produce a file called `elite-disc-sth.ssd` in the `5-compiled-game-discs` folder that contains the Stairway to Hell variant. 351 | 352 | The verification checksums for this version are as follows: 353 | 354 | ``` 355 | Results for variant: sth 356 | [--originals--] [---output----] 357 | Checksum Size Checksum Size Match Filename 358 | ----------------------------------------------------------- 359 | a9ee9d74 17437 a9ee9d74 17437 Yes D.CODE.bin 360 | dad7d3a3 17437 dad7d3a3 17437 Yes D.CODE.unprot.bin 361 | 9f4a04fd 2560 9f4a04fd 2560 Yes D.MOA.bin 362 | d9eb34f9 2560 d9eb34f9 2560 Yes D.MOB.bin 363 | 93fe2e13 2560 93fe2e13 2560 Yes D.MOC.bin 364 | 64e8ebb4 2560 64e8ebb4 2560 Yes D.MOD.bin 365 | 80afbff9 2560 80afbff9 2560 Yes D.MOE.bin 366 | b86fe100 2560 b86fe100 2560 Yes D.MOF.bin 367 | 72f99614 2560 72f99614 2560 Yes D.MOG.bin 368 | 29b6ce81 2560 29b6ce81 2560 Yes D.MOH.bin 369 | 0eeab415 2560 0eeab415 2560 Yes D.MOI.bin 370 | 7911181d 2560 7911181d 2560 Yes D.MOJ.bin 371 | 851d789f 2560 851d789f 2560 Yes D.MOK.bin 372 | 3025e5d8 2560 3025e5d8 2560 Yes D.MOL.bin 373 | d6c01098 2560 d6c01098 2560 Yes D.MOM.bin 374 | 6930e1c7 2560 6930e1c7 2560 Yes D.MON.bin 375 | 43caddc7 2560 43caddc7 2560 Yes D.MOO.bin 376 | ac1d57b2 2560 ac1d57b2 2560 Yes D.MOP.bin 377 | c73d535a 256 c73d535a 256 Yes ELITE2.bin 378 | 17eefeec 2816 17eefeec 2816 Yes ELITE3.bin 379 | ec04b4d2 5376 ec04b4d2 5376 Yes ELITE4.bin 380 | 10417c14 5376 10417c14 5376 Yes ELITE4.unprot.bin 381 | 0f9e270b 256 0f9e270b 256 Yes MISSILE.bin 382 | 42f42f63 19997 42f42f63 19997 Yes T.CODE.bin 383 | 8819c78b 19997 8819c78b 19997 Yes T.CODE.unprot.bin 384 | 52bac547 1024 52bac547 1024 Yes WORDS.bin 385 | - - fbf74546 883 - MNUCODE.bin 386 | ``` 387 | 388 | ### Building the Ian Bell disc variant 389 | 390 | You can build the Ian Bell disc variant by appending `variant=ib-disc` to the `make` command, like this on Windows: 391 | 392 | ``` 393 | make.bat variant=ib-disc 394 | ``` 395 | 396 | or this on a Mac or Linux: 397 | 398 | ``` 399 | make variant=ib-disc 400 | ``` 401 | 402 | This will produce a file called `elite-disc-ib-disc.ssd` in the `5-compiled-game-discs` folder that contains the Ian Bell disc variant. 403 | 404 | The verification checksums for this version are as follows: 405 | 406 | ``` 407 | Results for variant: ib-disc 408 | [--originals--] [---output----] 409 | Checksum Size Checksum Size Match Filename 410 | ----------------------------------------------------------- 411 | 7b8eceb7 1418 - - - !BOOT.bin 412 | 25be225d 17437 25be225d 17437 Yes D.CODE.bin 413 | 56876c8a 17437 56876c8a 17437 Yes D.CODE.unprot.bin 414 | 9f4a04fd 2560 9f4a04fd 2560 Yes D.MOA.bin 415 | d9eb34f9 2560 d9eb34f9 2560 Yes D.MOB.bin 416 | 93fe2e13 2560 93fe2e13 2560 Yes D.MOC.bin 417 | 64e8ebb4 2560 64e8ebb4 2560 Yes D.MOD.bin 418 | 80afbff9 2560 80afbff9 2560 Yes D.MOE.bin 419 | b86fe100 2560 b86fe100 2560 Yes D.MOF.bin 420 | 72f99614 2560 72f99614 2560 Yes D.MOG.bin 421 | 29b6ce81 2560 29b6ce81 2560 Yes D.MOH.bin 422 | 0eeab415 2560 0eeab415 2560 Yes D.MOI.bin 423 | 7911181d 2560 7911181d 2560 Yes D.MOJ.bin 424 | 851d789f 2560 851d789f 2560 Yes D.MOK.bin 425 | 3025e5d8 2560 3025e5d8 2560 Yes D.MOL.bin 426 | d6c01098 2560 d6c01098 2560 Yes D.MOM.bin 427 | 6930e1c7 2560 6930e1c7 2560 Yes D.MON.bin 428 | 43caddc7 2560 43caddc7 2560 Yes D.MOO.bin 429 | ac1d57b2 2560 ac1d57b2 2560 Yes D.MOP.bin 430 | 86e4a1ef 256 c73d535a 256 No ELITE2.bin 431 | fd788d2a 2304 17eefeec 2816 No ELITE3.bin 432 | 7abce0df 5376 74278df9 5376 No ELITE4.bin 433 | 10417c14 5376 8862453f 5376 No ELITE4.unprot.bin 434 | e51c9eae 256 - - - ELITE5.bin 435 | e99072dc 256 - - - ELITE6.bin 436 | 0f9e270b 256 0f9e270b 256 Yes MISSILE.bin 437 | 6b22a971 19997 6b22a971 19997 Yes T.CODE.bin 438 | a1cf4199 19997 a1cf4199 19997 Yes T.CODE.unprot.bin 439 | 52bac547 1024 52bac547 1024 Yes WORDS.bin 440 | - - fbf74546 883 - MNUCODE.bin 441 | ``` 442 | 443 | The failed matches are because I haven't yet converted the loader into BeebAsm source files (see the next section for details). 444 | 445 | ### Building the sideways RAM variant 446 | 447 | You can build the sideways RAM variant by appending `variant=sideways-ram` to the `make` command, like this on Windows: 448 | 449 | ``` 450 | make.bat variant=sideways-ram 451 | ``` 452 | 453 | or this on a Mac or Linux: 454 | 455 | ``` 456 | make variant=sideways-ram 457 | ``` 458 | 459 | This will produce a file called `elite-disc-sideways-ram.ssd` in the `5-compiled-game-discs` folder that contains the sideways RAM variant. 460 | 461 | The verification checksums for this version are as follows: 462 | 463 | ``` 464 | Results for variant: sideways-ram 465 | [--originals--] [---output----] 466 | Checksum Size Checksum Size Match Filename 467 | ----------------------------------------------------------- 468 | 5917731b 17437 5917731b 17437 Yes D.CODE.bin 469 | 5917731b 17437 5917731b 17437 Yes D.CODE.unprot.bin 470 | 9f4a04fd 2560 9f4a04fd 2560 Yes D.MOA.bin 471 | d9eb34f9 2560 d9eb34f9 2560 Yes D.MOB.bin 472 | 93fe2e13 2560 93fe2e13 2560 Yes D.MOC.bin 473 | 64e8ebb4 2560 64e8ebb4 2560 Yes D.MOD.bin 474 | 80afbff9 2560 80afbff9 2560 Yes D.MOE.bin 475 | b86fe100 2560 b86fe100 2560 Yes D.MOF.bin 476 | 72f99614 2560 72f99614 2560 Yes D.MOG.bin 477 | 29b6ce81 2560 29b6ce81 2560 Yes D.MOH.bin 478 | 0eeab415 2560 0eeab415 2560 Yes D.MOI.bin 479 | 7911181d 2560 7911181d 2560 Yes D.MOJ.bin 480 | 851d789f 2560 851d789f 2560 Yes D.MOK.bin 481 | 3025e5d8 2560 3025e5d8 2560 Yes D.MOL.bin 482 | d6c01098 2560 d6c01098 2560 Yes D.MOM.bin 483 | 6930e1c7 2560 6930e1c7 2560 Yes D.MON.bin 484 | 43caddc7 2560 43caddc7 2560 Yes D.MOO.bin 485 | ac1d57b2 2560 ac1d57b2 2560 Yes D.MOP.bin 486 | f1c2e0e6 5376 f1c2e0e6 5376 Yes ELITE4.bin 487 | 5a89086e 5376 5a89086e 5376 Yes ELITE4.unprot.bin 488 | 4f2febe4 256 4f2febe4 256 Yes MISSILE.bin 489 | fbf74546 883 fbf74546 883 Yes MNUCODE.bin 490 | 201036b2 19997 201036b2 19997 Yes T.CODE.bin 491 | 201036b2 19997 201036b2 19997 Yes T.CODE.unprot.bin 492 | 52bac547 1024 52bac547 1024 Yes WORDS.bin 493 | - - c73d535a 256 - ELITE2.bin 494 | - - 17eefeec 2816 - ELITE3.bin 495 | ``` 496 | 497 | ### Differences between the variants 498 | 499 | You can see the differences between the variants by searching the source code for `_STH_DISC` (for features in the Stairway to Hell variant), `_IB_DISC` (for features in the Ian Bell game disc variant) or `_SRAM_DISC` (for features in the sideways RAM variant). There are only a few differences between the Ian Bell variant and the others: 500 | 501 | * The Ian Bell variant contains the refund bug, which has been fixed in the other variants 502 | 503 | * The Ian Bell variant never spawns asteroids, which has been fixed in the other variants 504 | 505 | * The Ian Bell variant sets bit 2 of the competition flag in the commander file, while the other variants set bit 5 506 | 507 | In other words, the Ian Bell variant appears to be the very first release of the disc version of Elite, while the Stairway to Hell and sideways RAM variants have both bugs fixed and a bumped-up number in the competition flag. 508 | 509 | The sideways RAM variant has the following extra features: 510 | 511 | * All ship blueprints are available in sideways RAM at the same time, so all ship types can appear at any time without the restrictions of the disc version's blueprint files, and loading is quicker on launch and there is no disc access at all when hyperspacing 512 | 513 | * The missile blueprint is the version from the non-disc versions 514 | 515 | * The scanner shows the space station, asteroids, escape pods and cargo in red, as opposed to the yellow/green of the original 516 | 517 | * Different parts of the copy protection are disabled compared to the other variants 518 | 519 | * The main docked and flight binaries in T.CODE and D.CODE are not encrypted 520 | 521 | * The sideways RAM loader is a mod in the true sense, in that it works with the normal disc version, converting it to work with sideways RAM 522 | 523 | See the [accompanying website](https://elite.bbcelite.com/disc/releases.html) for a comprehensive list of differences between the variants. 524 | 525 | Note that I have only included differences that appear in the main game code, rather than those that appear in the loaders, as these files can differ extensively between variants without affecting the game itself. The variant on Ian Bell's personal website contains a whole load of copy protection differences when compared to the same code in the Stairway to Hell variant, and it also contains two more binary files (`ELITE5` and `ELITE6`), plus a `!BOOT` file that contains even more copy protection code. I haven't disassembled the loader files from this variant as that's a whole different rabbit hole, so if you build the Ian Bell variant with `make`, the compiled loader binaries will not match those extracted from the original disc. The main binaries will match, however, which is the interesting part from a digital archaeology perspective, as that's where the bug fixes live. 526 | 527 | --- 528 | 529 | Right on, Commanders! 530 | 531 | _Mark Moxon_ -------------------------------------------------------------------------------- /make.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL 3 | SET BEEBASM=C:\Users\user\bin\beebasm.exe 4 | SET PYTHON=C:\Users\user\AppData\Local\Microsoft\WindowsApps\python.exe 5 | 2-build-files\make %* 6 | --------------------------------------------------------------------------------