Skip to navigation

Elite on the BBC Micro

Start and end: BR1 (Part 1 of 2) [Elite-A, Parasite]

Name: BR1 (Part 1 of 2) [Show more] Type: Subroutine Category: Start and end Summary: Start or restart the game
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * BRBR calls BR1 * DK4 calls BR1 * INBAY calls BR1

BRKV is set to point to BR1 by the loading process.
.BR1 LDX #10 \ Install ship number 10 (Cobra Mk III) into blueprint LDY #CYL \ position #CYL (11) so it can be shown on the first JSR install_ship \ title screen LDX #19 \ Install ship number 19 (Krait) into blueprint position LDY #KRA \ #KRA (19) so it can be shown on the second title JSR install_ship \ screen LDX #&FF \ Set the stack pointer to &01FF, which is the standard TXS \ location for the 6502 stack, so this instruction \ effectively resets the stack LDX #3 \ Set XC = 3 (set text cursor to column 3) STX XC JSR FX200 \ Disable the ESCAPE key and clear memory if the BREAK \ key is pressed (*FX 200,3) 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 CMP #&44 \ Did we press "Y"? If not, jump to QU5, otherwise BNE QU5 \ continue on to load a new commander 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