Skip to navigation

Elite on the BBC Micro

Version analysis of BRKBK

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

Code variations between these versions are shown below.

Name: BRKBK Type: Subroutine Category: Save and load Summary: Set the standard BRKV handler for the game

Code variation 1 of 2A variation in the comments only

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

6502SP

BRKV is set to this routine by the BRKBK routine, which is called by the decryption routine at DEEOR just before the game is run for the first time, and at the end of the SVE routine after the disc access menu has been processed (so this resets BRKV to the standard BRKV handler for the game).
.BRKBK

Code variation 2 of 2Specific to an individual platform

Tap on a version to expand it, and tap it again to show to all variations.

Docked

Master

6502SP

LDA #LO(BRBR) \ Set BRKV to point to the BRBR routine STA BRKV LDA #HI(BRBR) STA BRKV+1 RTS \ Return from the subroutine
LDA #LO(BRBR) \ Set BRKV to point to the BRBR routine STA BRKV LDA #HI(BRBR) STA BRKV+1 LDA #LO(CHPR) \ Set WRCHV to point to the CHPR routine STA WRCHV LDA #HI(CHPR) STA WRCHV+1 JSR SAVEZP \ Call SAVEZP to backup the top part of zero page JSR STARTUP \ Call STARTUP to set various vectors, interrupts and \ timers JMP SRESET \ Call SRESET to reset the sound buffers and return from \ the subroutine using a tail call IF _SNG47 CLI \ These instructions are never reached and have no RTI \ effect ENDIF
LDA #LO(BRBR) \ Set BRKV to point to the BRBR routine, disabling SEI \ interrupts while we make the change and re-enabling STA BRKV \ them once we are done LDA #HI(BRBR) STA BRKV+1 CLI RTS \ Return from the subroutine
RSS Feed