![]() |
Routines |
| Prev: AB6A | Up: Map | Next: AC23 |
|
Used by the routine at InitialiseGame.
Shows the title screen, which has three revolvers on the left and the game name at the top. A bullet shoots out of each revolver and leaves a line of text behind it: the number of players, the controls, and "START GAME". Keys 1 and 2 change the first two and fire their bullet again, and key 3 starts the game. It returns when the bullet for key 3 has been fired.
|
|||||
|
Clear the screen.
|
|||||
| GameMenu | AB77 | XOR A | Write 00 to TunePlayedFlag to allow the title tune to play. | ||
| AB78 | LD ($A242),A | ||||
| AB7B | CALL ClearScreen | Clear the screen. | |||
| AB7E | LD E,$45 | Set the attribute to INK:CYAN, PAPER:BLACK (BRIGHT). | |||
| AB80 | CALL SetAttributes | Set all the attributes. | |||
| AB83 | LD HL,$8A70 | Point HL at TitleTiles. | |||
| AB86 | LD ($A20F),HL | Set the tiles to use. | |||
|
Draw the first revolver.
|
|||||
| AB89 | LD HL,$4062 | Point HL at 4062 (in the screen buffer). | |||
| AB8C | LD A,$47 | Set the attribute to INK:WHITE, PAPER:BLACK (BRIGHT). | |||
| AB8E | CALL DrawRevolver | Draw the revolver. | |||
| AB91 | LD BC,$8EB0 | Point BC at Font_Digits. | |||
|
Draw its digit.
|
|||||
| AB94 | LD HL,$40C7 | Point HL at 40C7 (in the screen buffer). | |||
| AB97 | LD A,$01 | Set the digit to one. | |||
| AB99 | CALL DrawCharacter | Draw the digit. | |||
|
Draw the second revolver.
|
|||||
| AB9C | LD HL,$4842 | Point HL at 4842 (in the screen buffer). | |||
| AB9F | LD A,$46 | Set the attribute to INK:YELLOW, PAPER:BLACK (BRIGHT). | |||
| ABA1 | CALL DrawRevolver | Draw the revolver. | |||
| ABA4 | LD BC,$8EB0 | Point BC at Font_Digits. | |||
|
Draw its digit.
|
|||||
| ABA7 | LD HL,$48A7 | Point HL at 48A7 (in the screen buffer). | |||
| ABAA | LD A,$02 | Set the digit to two. | |||
| ABAC | CALL DrawCharacter | Draw the digit. | |||
|
Draw the third revolver.
|
|||||
| ABAF | LD HL,$5022 | Point HL at 5022 (in the screen buffer). | |||
| ABB2 | LD A,$44 | Set the attribute to INK:GREEN, PAPER:BLACK (BRIGHT). | |||
| ABB4 | CALL DrawRevolver | Draw the revolver. | |||
| ABB7 | LD BC,$8EB0 | Point BC at Font_Digits. | |||
|
Draw its digit.
|
|||||
| ABBA | LD HL,$5087 | Point HL at 5087 (in the screen buffer). | |||
| ABBD | LD A,$03 | Set the digit to three. | |||
| ABBF | CALL DrawCharacter | Draw the digit. | |||
|
Colour the first column black.
|
|||||
| ABC2 | LD C,$00 | Set the attribute to INK:BLACK, PAPER:BLACK. | |||
| ABC4 | LD HL,$5800 | Point HL at 5800 (in the attribute buffer). | |||
| ABC7 | CALL FillAttributeColumn | Colour the column. | |||
|
Colour the last column black.
|
|||||
| ABCA | LD HL,$581F | Point HL at 581F (in the attribute buffer). | |||
| ABCD | CALL FillAttributeColumn | Colour the column. | |||
|
Colour the tenth column red.
|
|||||
| ABD0 | LD C,$42 | Set the attribute to INK:RED, PAPER:BLACK (BRIGHT). | |||
| ABD2 | LD HL,$5809 | Point HL at 5809 (in the attribute buffer). | |||
| ABD5 | CALL FillAttributeColumn | Colour the column. | |||
|
Colour the eleventh column red.
|
|||||
| ABD8 | LD HL,$580A | Point HL at 580A (in the attribute buffer). | |||
| ABDB | CALL FillAttributeColumn | Colour the column. | |||
|
Print the game name.
|
|||||
| ABDE | LD HL,$4006 | Point HL at 4006 (in the screen buffer). | |||
| ABE1 | LD DE,$AC32 | Point DE at TitleTexts_GameName. | |||
| ABE4 | CALL PrintLargeText | Print the game name in large letters. | |||
|
Print the copyright message.
|
|||||
| ABE7 | LD HL,$50EA | Point HL at 50EA (in the screen buffer). | |||
| ABEA | LD DE,$AC23 | Point DE at TitleTexts. | |||
| ABED | CALL PrintText | Print the copyright message. | |||
|
Set up the four menu entries.
|
|||||
| ABF0 | LD HL,$AC3E | Point HL at InitialMenuEntries. | |||
| ABF3 | LD DE,$AC4E | Point DE at MenuEntries. | |||
| ABF6 | LD BC,$0010 | Set the number of bytes to copy. | |||
| ABF9 | LDIR | Copy the entries. | |||
|
Run each of the menu entries once per frame.
|
|||||
| GameMenu_Loop | ABFB | LD IX,$AC4E | Point IX at the first menu entry. | ||
| ABFF | XOR A | Write 00 to MenuEntryNumber, the number of the menu entry. | |||
| AC00 | LD ($A20E),A | ||||
| GameMenu_Entry | AC03 | LD A,(IX+$00) | Fetch the state of the entry. | ||
| AC06 | LD BC,$AC5E | Point BC at MenuHandlers. | |||
| AC09 | CALL RunTableRoutine | Run the handler for the state. | |||
| AC0C | LD HL,$A20E | Point HL at MenuEntryNumber. | |||
| AC0F | INC (HL) | Move on to the next entry. | |||
| AC10 | LD BC,$0004 | Set the size of an entry. | |||
| AC13 | ADD IX,BC | Move on to the next entry. | |||
| AC15 | PUSH IX | Copy IX to HL (using the stack). | |||
| AC17 | POP HL | ||||
| AC18 | LD BC,$AC5E | Point BC at the end of the entries. | |||
| AC1B | AND A | Subtract the address of the end of the entries. | |||
| AC1C | SBC HL,BC | ||||
| AC1E | JR C,GameMenu_Entry | Loop back until all four entries have been run. | |||
| AC20 | JP GameMenu_Loop | Start the next frame. | |||
| Prev: AB6A | Up: Map | Next: AC23 |