.DrawTitleScreen STA screenType \ Store the screen type in A in screenType, so we can \ refer to it below LDA #128 \ Set objectYawAngle+63 = 128 STA objectYawAngle+63 \ \ The degree system in the Sentinel looks like this: \ \ 0 \ -32 | +32 Overhead view of object \ \ | / \ \ | / 0 = looking straight ahead \ \|/ +64 = looking sharp right \ -64 -----+----- +64 -64 = looking sharp left \ /|\ \ / | \ \ / | \ \ -96 | +96 \ 128 \ \ So this makes object #63 face directly out of the \ screen LDA #&E0 \ For object #63, set the following: STA yObjectLo+63 \ LDA #&02 \ yObject(Hi Lo) = &2E0 STA yObjectHi+63 \ \ So this sets the altitude of object #63 to just under \ three full block heights (2.875, to be precise) \ \ We use object #63 for drawing the 3D text blocks in \ the game title in the main title screen, or the code \ in the secret code screen, so this ensures that the \ text blocks are drawn at the correct height to get the \ title effect SEC \ Set bit 7 of drawingTitleScreen to indicate that we ROR drawingTitleScreen \ are drawing a title screen LDA #0 \ Call ProcessTileData with A = 0 to zero the tile data JSR ProcessTileData \ for the whole landscape BIT screenType \ If bit 7 of the screen type is clear, jump to titl1 to BPL titl1 \ draw "THE SENTINEL" in large 3D text for the main \ title screen \ If we get here then bit 7 of the argument is set, so \ we now draw the secret code JSR SpawnSecretCode3D \ Spawn the secret code in large 3D text blocks LDX #3 \ Set X = 3 to pass to DrawTitleView so the background \ of the secret code screen is black with stars LDA #0 \ Set A = 0 so the call to DrawTitleView draws a robot \ on the right of the screen BEQ titl3 \ Jump to titl3 to skip the following and draw the robot \ (this BEQ is effectively a JMP as A is always zero) .titl1 LDX #0 \ We now look through all the characters in the title \ text, drawing each one in turn, so set X as a \ character index .titl2 LDA titleText,X \ Set A to the X-th character in the title text JSR SpawnCharacter3D \ Spawn the 3D text blocks for drawing the character in \ A in large 3D text INX \ Increment the character index CPX #15 \ Loop back until we have drawn all 15 characters in the BCC titl2 \ title text LDX #1 \ Set X = 1 to pass to DrawTitleView so the background \ of the landscape preview is solid blue LDA #5 \ Set A = 5 so the call to DrawTitleView draws the \ Sentinel on the right of the screen .titl3 LDY #1 \ Set Y = 1 to pass to DrawTitleView so it draws the \ screen with the correct perspective for the title \ screen JSR DrawTitleView \ Draw the title screen with the object and background \ defined in A and X LSR drawingTitleScreen \ Clear bit 7 of drawingTitleScreen to indicate we are \ no longer drawing a title screen RTS \ Return from the subroutineName: DrawTitleScreen [Show more] Type: Subroutine Category: Title screen Summary: Draw the title screen or the screen showing the secret codeContext: See this subroutine in context in the source code References: This subroutine is called as follows: * FinishLandscape calls DrawTitleScreen * MainTitleLoop calls DrawTitleScreen * SecretCodeError calls DrawTitleScreen
Arguments: A Determines the type of screen to draw: * If bit 7 = 0 then draw the title screen * If bit 7 = 1 then draw the secret code screen
[X]
Subroutine DrawTitleView (category: Title screen)
Draw the main title screen, the secret code screen or the landscape preview
[X]
Subroutine ProcessTileData (category: Landscape)
Process the tile data for all tiles in the landscape
[X]
Subroutine SpawnCharacter3D (Part 1 of 2) (category: Title screen)
Spawn a character on the landscape in large 3D blocks for drawing on the main title screen or secret code screen
[X]
Subroutine SpawnSecretCode3D (category: Title screen)
Draw the landscape's secret code by spawning a set of large 3D text block objects
[X]
Variable drawingTitleScreen in workspace Main variable workspace
A flag to indicate whether we are currently drawing a title screen in the DrawTitleScreen routine
[X]
Variable objectYawAngle (category: 3D objects)
The yaw angle for each object (i.e. the horizontal direction in which they are facing)
[X]
Variable screenType (category: Title screen)
A variable that determines whether we are drawing the title screen or the secret code screen in the DrawTitleScreen routine
[X]
Label titl1 is local to this routine
[X]
Label titl2 is local to this routine
[X]
Label titl3 is local to this routine
[X]
Variable titleText (category: Title screen)
The text to draw on the title screen
[X]
Variable yObjectHi (category: 3D objects)
The y-coordinates in 3D space for the 3D objects (high byte)
[X]
Variable yObjectLo (category: 3D objects)
The y-coordinates in 3D space for the 3D objects (low byte)