![]() |
Routines |
| Prev: 25985 | Up: Map | Next: 26090 |
|
Used by the routine at Initialise_Lives.
Displays the pre-game title screen and waits for the player to press ENTER to start the game. The title screen is stored as room 12.
|
||||||||||||||||||||
|
Load and display the title screen.
|
||||||||||||||||||||
| MainMenu | 26011 | LD A,12 | Write 12 to; | |||||||||||||||||
| 26013 | LD (24517),A | |||||||||||||||||||
| 26016 | LD (24481),A | |||||||||||||||||||
| 26019 | CALL PopulateRoomBuffer | Call PopulateRoomBuffer. | ||||||||||||||||||
| 26022 | XOR A | Write 0 to *Screen_Initialised_Flag. | ||||||||||||||||||
| 26023 | LD (24481),A | |||||||||||||||||||
|
Print the credits text onto the title screen.
|
||||||||||||||||||||
| 26026 | LD HL,18582 | Point HL at 18582 (screen buffer position for the credits). | ||||||||||||||||||
| 26029 | LD B,4 | Set the row counter to 4 in B. | ||||||||||||||||||
| 26031 | LD DE,26125 | Point DE to Messaging_PressEnterToStart. | ||||||||||||||||||
| Print_Credits_Row_Loop | 26034 | PUSH BC | Stash the row counter and screen buffer pointer on the stack. | |||||||||||||||||
| 26035 | PUSH HL | |||||||||||||||||||
| 26036 | LD B,5 | Set a counter in B for 5 characters to print in each row. | ||||||||||||||||||
| Print_Credits_Char_Loop | 26038 | PUSH HL | Stash the screen buffer pointer, message pointer and the character counter on the stack. | |||||||||||||||||
| 26039 | PUSH DE | |||||||||||||||||||
| 26040 | PUSH BC | |||||||||||||||||||
| 26041 | LD A,(DE) | Fetch the next character from the text data. | ||||||||||||||||||
| 26042 | CALL PrintCharacter | Call PrintCharacter. | ||||||||||||||||||
| 26045 | POP BC | Restore the character counter, message pointer and the screen buffer pointer from the stack. | ||||||||||||||||||
| 26046 | POP DE | |||||||||||||||||||
| 26047 | POP HL | |||||||||||||||||||
| 26048 | INC L | Advance to the next screen column. | ||||||||||||||||||
| 26049 | INC DE | Advance to the next character in the text data. | ||||||||||||||||||
| 26050 | DJNZ Print_Credits_Char_Loop | Decrease the character counter and loop back to Print_Credits_Char_Loop until all 5 characters in the row are printed. | ||||||||||||||||||
| 26052 | POP HL | Restore the screen buffer pointer from the stack. | ||||||||||||||||||
| 26053 | LD BC,32 | Advance HL by 0032 to move to the next character row. | ||||||||||||||||||
| 26056 | ADD HL,BC | |||||||||||||||||||
| 26057 | POP BC | Restore the row counter from the stack. | ||||||||||||||||||
| 26058 | DJNZ Print_Credits_Row_Loop | Decrease the row counter and loop back to Print_Credits_Row_Loop until all 4 rows are printed. | ||||||||||||||||||
|
Play the title screen music.
|
||||||||||||||||||||
| 26060 | LD B,61 | B=61. | ||||||||||||||||||
| 26062 | CALL Print_AuthorByline | Call Print_AuthorByline. | ||||||||||||||||||
|
Wait for the player to press ENTER to start the game.
|
||||||||||||||||||||
| 26065 | LD BC,49150 | Read from the keyboard;
|
||||||||||||||||||
| WaitForEnterToStart_Loop | 26068 | IN A,(C) | ||||||||||||||||||
| 26070 | RRCA | Jump to WaitForEnterToStart_Loop if "ENTER" is not being pressed. | ||||||||||||||||||
| 26071 | JR C,WaitForEnterToStart_Loop | |||||||||||||||||||
|
ENTER pressed; initialise the game state and start the game.
|
||||||||||||||||||||
| 26073 | LD A,1 | Set the border to BLUE. | ||||||||||||||||||
| 26075 | OUT (254),A | |||||||||||||||||||
| 26077 | LD B,10 | Set the clear counter to 10 in B. | ||||||||||||||||||
| 26079 | LD HL,24481 | Point HL at Screen_Initialised_Flag. | ||||||||||||||||||
| Clear_Game_State_Loop | 26082 | LD (HL),0 | Write 0 to *HL. | |||||||||||||||||
| 26084 | INC HL | Increment HL by one. | ||||||||||||||||||
| 26085 | DJNZ Clear_Game_State_Loop | Decrease the counter and loop back to Clear_Game_State_Loop until 10 bytes from Screen_Initialised_Flag onwards are cleared. | ||||||||||||||||||
| 26087 | JP SetUpNewLevel | Jump to SetUpNewLevel. | ||||||||||||||||||
| Prev: 25985 | Up: Map | Next: 26090 |