Skip to navigation

Elite on the BBC Micro and NES

Version analysis of BR1 (Part 1 of 2)

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

Code variations between these versions are shown below.

Name: BR1 (Part 1 of 2) Type: Subroutine Category: Start and end Summary: Show the "Load New Commander (Y/N)?" screen and start the game

Code variation 1 of 11A variation in the comments only

This variation is blank in the 6502 Second Processor version.

BRKV is set to point to BR1 by the loading process.

Code variation 2 of 11A variation in the comments only

This variation is blank in the Cassette and Electron versions.

Other entry points: QU5 Restart the game using the last saved commander without asking whether to load a new commander file
.BR1

Code variation 3 of 11Related to Elite's use of the Tube

This variation is blank in the Cassette, Disc (docked) and Electron versions.

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

JSR ZEKTRAN \ Call ZEKTRAN to clear the key logger
JSR ZEKTRAN \ Reset the key logger buffer that gets returned from \ the I/O processor

Code variation 4 of 11Related to Elite's use of the Tube

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

LDX #3 \ Set XC = 3 (set text cursor to column 3) STX XC
LDA #3 \ Set XC = 3 (set text cursor to column 3) STA XC \JSR startat \ This instruction is commented out in the original \ source
LDA #3 \ Move the text cursor to column 3 JSR DOXC LDX #3 \ Set X = 3 for the call to FX200

Code variation 5 of 11Specific to an individual platform

This variation is blank in the Master version.

JSR FX200 \ Disable the ESCAPE key and clear memory if the BREAK \ key is pressed (*FX 200,3)

Code variation 6 of 11Related to the 6502SP version

If speech is enabled on the Executive version, it will say "Elite" when the title screen is displayed.

This variation is blank in the Cassette, Disc (docked), Master and Electron versions.

IF _EXECUTIVE LDX #3 \ Call TALK with X = 3 to say "Elite" using the Watford JSR TALK \ Electronics Beeb Speech Synthesiser (if one is fitted \ and speech has been enabled) ENDIF

Code variation 7 of 11Related to the Master version

The rotating Cobra Mk III on the title screen is further away on the Master version compared to the other versions, so it doesn't overlap the title text as much.

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

LDX #CYL \ Call TITLE to show a rotating Cobra Mk III (#CYL) and LDA #128 \ token 128 (" LOAD NEW COMMANDER (Y/N)?{crlf}{crlf}"), JSR TITLE \ returning with the internal number of the key pressed \ in A
LDX #CYL \ Call TITLE to show a rotating Cobra Mk III (#CYL) and LDA #6 \ token 6 ("LOAD NEW {single cap}COMMANDER {all caps} JSR TITLE \ (Y/N)?{sentence case}{cr}{cr}"), returning with the \ internal number of the key pressed in A
LDX #CYL \ Call TITLE to show a rotating Cobra Mk III (#CYL) and LDA #6 \ token 6 ("LOAD NEW {single cap}COMMANDER {all caps} LDY #200 \ (Y/N)?{sentence case}{cr}{cr}"), with the ship at a JSR TITLE \ distance of 200, returning with the internal number \ of the key pressed in A

Code variation 8 of 11Related to the 6502SP version

Pressing TAB in the title screen of the 6502SP version will start the demo.

This variation is blank in the Cassette, Disc (docked), Master and Electron versions.

CMP #&60 \ Did we press TAB? If not, skip the following BNE P%+5 \ instruction .BRGO JMP DEMON \ We pressed TAB, so jump to DEMON to show the demo

Code variation 9 of 11Specific to an individual platform

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

CMP #&44 \ Did we press "Y"? If not, jump to QU5, otherwise BNE QU5 \ continue on to load a new commander
CPX #'Y' \ Did we press "Y"? If not, jump to QU5, otherwise BNE QU5 \ continue on to load a new commander

Code variation 10 of 11A variation in the comments only

This variation is blank in the Disc (docked), 6502 Second Processor, Master and Electron versions.

\BR1 \ These instructions are commented out in the original \LDX #3 \ source. This block starts with the same *FX call as \STX XC \ above, then clears the screen, calls a routine to \JSR FX200 \ flush the keyboard buffer (FLKB) that isn't present \LDA #1 \ in the cassette version but is in other versions, \JSR TT66 \ and then it displays "LOAD NEW COMMANDER (Y/N)?" and \JSR FLKB \ lists the current cargo, before falling straight into \LDA #14 \ the load routine below, whether or not we have \JSR TT214 \ pressed "Y". This may be a bit of testing code, as the \BCC QU5 \ first line is a commented label, BR1, which is where \ BRKV points, so when this is uncommented, pressing \ the BREAK key should jump straight to the load screen

Code variation 11 of 11Specific to an individual platform

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

JSR GTNME \ We want to load a new commander, so we need to get \ the commander name to load JSR LOD \ We then call the LOD subroutine to load the commander \ file to address NA%+8, which is where we store the \ commander save file JSR TRNME \ Once loaded, we copy the commander name to NA% JSR TTX66 \ And we clear the top part of the screen and draw a \ white border
JSR DFAULT \ Call DFAULT to reset the current commander data block \ to the last saved commander JSR SVE \ Call SVE to load a new commander into the last saved \ commander data block .QU5 JSR DFAULT \ Call DFAULT to reset the current commander data block \ to the last saved commander
\JSR stopat \ This instruction is commented out in the original \ source JSR DFAULT \ Call DFAULT to reset the current commander data block \ to the last saved commander JSR SVE \ Call SVE to load a new commander into the last saved \ commander data block \JSR startat \ This instruction is commented out in the original \ source .QU5 JSR DFAULT \ Call DFAULT to reset the current commander data block \ to the last saved commander