This code appears in the following versions (click to see it in the source code):
Code variations between these versions are shown below.
Name: TITLE Type: Subroutine Category: Start and end Summary: Display a title screen with a rotating ship and prompt
Display the title screen, with a rotating ship and a text token at the bottom of the screen.
Arguments:
X The type of the ship to show (see variable XX21 for a list of ship types)
This variation is blank in the Cassette, Disc (docked), 6502 Second Processor and Electron versions.
Y The distance to show the ship rotating, once it has finished moving towards us
.TITLE
In the Master version, the Cobra Mk III shown on the first title page is further away than in the other versions, which is implemented by a new variable that contains the distance that the ship should be shown at.
See below for more variations related to this code.
This variation is blank in the Cassette, Disc (docked), 6502 Second Processor and Electron versions.
STY distaway \ Store the ship distance in distaway
PHA \ Store the token number on the stack for later STX TYPE \ Store the ship type in location TYPE JSR RESET \ Reset our ship so we can use it for the rotating \ title ship
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.
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.
The Master version has a unique view type for the title screen (13).
Tap on a block to expand it, and tap it again to revert.
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.
LDA #96 \ Set nosev_z hi = 96 (96 is the value of unity in the STA INWK+14 \ rotation vector)
The disc version contains various bits of copy protection code injected into the loader, and the results get checked in the main title sequence to make sure nothing has been changed.
This variation is blank in the Cassette, 6502 Second Processor, Master and Electron versions.
LDA &9F \ As part of the copy protection, location &9F is set to CMP #219 \ 219 in the OSBmod routine in elite-loader3.asm. This BEQ tiwe \ jumps to tiwe if the value is unchanged, otherwise it \ crashes the game with the following (as presumably \ the game code has been tampered with) LDA #&10 \ Modify the STA DELTA instruction in RES2 to &10 &FE, STA modify+2 \ which is a BPL P%-2 instruction, to create an infinite LDA #&FE \ loop and hang the game STA modify+3 .tiwe
Code variation 11 of 35
See variation 4 above for details.
This variation is blank in the Cassette, Disc (docked), 6502 Second Processor and Electron versions.
LDA #96 \ Set A = 96 as the distance that the ship starts at
This variation is blank in the Disc (docked), 6502 Second Processor, Master and Electron versions.
\LSR A \ This instruction is commented out in the original \ source. It would halve the value of z_hi to 48, so the \ ship would start off closer to the viewer
STA INWK+7 \ Set z_hi, the high byte of the ship's z-coordinate, \ to 96, which is the distance at which the rotating \ ship starts out before coming towards us LDX #127 \ Set roll counter = 127, so don't dampen the roll and STX INWK+29 \ make the roll direction clockwise STX INWK+30 \ Set pitch counter = 127, so don't dampen the pitch and \ set the pitch direction to dive INX \ Set QQ17 to 128 (so bit 7 is set) to switch to STX QQ17 \ Sentence Case, with the next letter printing in upper \ case LDA TYPE \ Set up a new ship, using the ship type in TYPE JSR NWSHP
This variation is blank in the Disc (docked), 6502 Second Processor, Master and Electron versions.
JSR DELAY \ Wait for 6/50 of a second (0.12 seconds)
LDA #30 \ Print recursive token 144 ("---- E L I T E ----") JSR plf \ followed by a newline
LDA PATG \ If PATG = 0, skip the following two lines, which BEQ awe \ print the author credits (PATG can be toggled by \ pausing the game and pressing "X")
.awe
This variation is blank in the Cassette, Disc (docked), 6502 Second Processor and Electron versions.
LDY #0 \ Set DELTA = 0 (i.e. ship speed = 0) STY DELTA STY JSTK \ Set JSTK = 0 (i.e. keyboard, not joystick)
LDA brkd \ If brkd = 0, jump to BRBR2 to skip the following, as BEQ BRBR2 \ we do not have a system error message to display INC brkd \ Increment the brkd counter
The Master version shows the "Load New Commander (Y/N)?" prompt on row 20, while the other versions show it one line lower, on row 21.
See below for more variations related to this code.
This variation is blank in the Cassette and Electron versions.
Tap on a block to expand it, and tap it again to revert.
\ The following loop prints out the null-terminated \ message pointed to by (&FD &FE), which is the MOS \ error message pointer - so this prints the error \ message on the next line LDY #0 \ Set Y = 0 to act as a character counter JSR OSWRCH \ Print the character in A (which contains a line feed \ on the first loop iteration), and then any non-zero \ characters we fetch from the error message INY \ Increment the loop counter LDA (&FD),Y \ Fetch the Y-th byte of the block pointed to by \ (&FD &FE), so that's the Y-th character of the message \ pointed to by the MOS error message pointer BNE P%-6 \ If the fetched character is non-zero, loop back to the \ JSR OSWRCH above to print it, and keep looping until \ we fetch a zero (which marks the end of the message) .BRBR2
Code variation 21 of 35
See variation 19 above for details.
This variation is blank in the Master version.
JSR CLYNS \ Clear the bottom three text rows of the upper screen, \ and move the text cursor to the first cleared row. \ It also returns with Y = 0 STY DELTA \ Set DELTA = 0 (i.e. ship speed = 0) STY JSTK \ Set JSTK = 0 (i.e. keyboard, not joystick)
The Master version shows the copyright year on the title screen as 1986 rather than 1984.
Tap on a block to expand it, and tap it again to revert.
The 6502SP version adds two loop counters to the title screen so we can start the demo after a certain period on the title screen.
See below for more variations related to this code.
This variation is blank in the Cassette, Disc (docked) and Electron versions.
LDA #12 \ Set CNT2 = 12 as the outer loop counter for the loop STA CNT2 \ starting at TLL2 LDA #5 \ Set the main loop counter in MCNT to 5, to act as the STA MCNT \ inner loop counter for the loop starting at TLL2
This variation is blank in the Cassette, Disc (docked), 6502 Second Processor and Electron versions.
STZ JSTK \ Set JSTK = 0 (i.e. keyboard, not joystick)
.TLL2 LDA INWK+7 \ If z_hi (the ship's distance) is 1, jump to TL1 to CMP #1 \ skip the following decrement BEQ TL1 DEC INWK+7 \ Decrement the ship's distance, to bring the ship \ a bit closer to us .TL1 JSR MVEIT \ Move the ship in space according to the orientation \ vectors and the new value in z_hi
The 6502SP version only scans for key presses every four iterations on the title screen (as opposed to every iteration in the other versions), so you have to hold down "Y", "N" or Space for noticeably longer to load a commander or start the game.
This variation is blank in the Cassette, Disc (docked), Master and Electron versions.
LDA MCNT \ This value will be zero on one out of every four AND #3 \ iterations, so for the other three, skip to nodesire BNE nodesire \ so we only scan for key presses once every four loops STX NEEDKEY \ Set NEEDKEY = 128, so the call to LL9 below draws the \ ship and scans for key presses (LL9 resets NEEDKEY to \ 0 so we have to reset NEEDKEY every four iterations \ round the inner loop) .nodesire
JSR LL9 \ Call LL9 to display the ship
DEC MCNT \ Decrement the main loop counter
As joysticks are not supported in the Electron version, it doesn't check for the joystick fire button being pressed during the "Press Fire Or Space,Commander." stage of the title screen.
See below for more variations related to this code.
This variation is blank in the Electron version.
Tap on a block to expand it, and tap it again to revert.
This variation is blank in the Disc (docked), Master and Electron versions.
Tap on a block to expand it, and tap it again to revert.
Code variation 31 of 35
See variation 29 above for details.
This variation is blank in the Electron version.
Tap on a block to expand it, and tap it again to revert.
Code variation 33 of 35
See variation 23 above for details.
This variation is blank in the Cassette, Disc (docked), Master and Electron versions.
DEC MCNT \ Decrement the inner loop counter BNE TLL2 \ Loop back to keep the ship rotating, until the inner \ loop counter is zero DEC CNT2 \ Decrement the outer loop counter in CNT2 BNE TLL2 \ Loop back to keep the ship rotating, until the outer \ loop counter is zero JMP DEMON \ Once we have iterated through CNT2 iterations of MCNT, \ jump to DEMON to start the demo
Code variation 34 of 35
See variation 29 above for details.
This variation is blank in the Electron version.
Tap on a block to expand it, and tap it again to revert.