Skip to navigation

Elite on the BBC Micro and NES

Version analysis of BRKBK / COLD

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

Code variations between these versions are shown below.

Code variation 1 of 3A variation in the comments only

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

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

Code variation 2 of 3A variation in the comments only

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

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).

Code variation 3 of 3Specific to an individual platform

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

.BRKBK LDA #LO(BRBR) \ Set BRKV to point to the BRBR routine STA BRKV LDA #HI(BRBR) STA BRKV+1 RTS \ Return from the subroutine
.COLD LDA #LO(NEWBRK) \ Set BRKV to point to the NEWBRK routine STA BRKV LDA #HI(NEWBRK) STA BRKV+1 LDA #LO(CHPR) \ Set WRCHV to point to the CHPR routine STA WRCHV LDA #HI(CHPR) STA WRCHV+1 JSR setzp \ Call setzp to copy the top part of zero page into \ the buffer at &3000 JSR SETINTS \ Call SETINTS to set various vectors, interrupts and \ timers JMP SOFLUSH \ Call SOFLUSH to reset the sound buffers and return \ from the subroutine using a tail call IF _SNG47 .NMIpissoff CLI \ These instructions are never reached and have no RTI \ effect ENDIF
.BRKBK 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