![]() |
Routines |
| Prev: 7C90 | Up: Map | Next: 7CEA |
|
Used by the routine at GameInitialisation.
Prints the seven menu lines, then the copyright message and the title. The icons were drawn by MenuIcons. The main registers are used to step through the attribute table at GameSelection_Attributes, whilst the shadow registers step through the Y position table at GameSelection_Position and the text at GameSelection_Text.
|
|||||
|
|||||
| GameMenu | 7CAF | LD HL,$BE4C | Write BE4C (the main font, see MainFont) to FontPointer. | ||
| 7CB2 | LD ($5E01),HL | ||||
| 7CB5 | LD DE,$7CEA | Point DE at the menu attribute table at GameSelection_Attributes. | |||
| 7CB8 | EXX | Switch to the shadow registers. | |||
| 7CB9 | LD HL,$7CF1 | Point HL' at the menu Y position table at GameSelection_Position. | |||
| 7CBC | LD DE,$7CF8 | Point DE' at the menu text at GameSelection_Text. | |||
|
There are seven lines of text.
|
|||||
| 7CBF | LD B,$07 | B'=07 (the number of lines to print). | |||
| GameMenu_Loop | 7CC1 | EXX | Switch back to the normal registers. | ||
| 7CC2 | LD A,(DE) | Copy the attribute of the line from the menu attribute table to Current_MenuAttribute. | |||
| 7CC3 | LD ($5E22),A | ||||
| 7CC6 | INC DE | Move DE on to the text of the line. | |||
| 7CC7 | EXX | Switch to the shadow registers. | |||
| 7CC8 | PUSH BC | Stash the line counter on the stack. | |||
| 7CC9 | LD A,(HL) | Fetch the Y position of the line. | |||
| 7CCA | INC HL | Move HL' on to the next Y position in the table. | |||
| 7CCB | PUSH HL | Stash the position table pointer on the stack. | |||
| 7CCC | LD H,A | Set the Y position of the line in H'. | |||
| 7CCD | LD L,$58 | Set the X position of the line to 58 in L'. | |||
| 7CCF | CALL MenuWriteText | Call MenuWriteText to print the line. | |||
| 7CD2 | EXX | Switch to the shadow registers. | |||
| 7CD3 | POP HL | Restore the position table pointer from the stack. | |||
| 7CD4 | POP BC | Restore the line counter from the stack. | |||
| 7CD5 | INC DE | Move DE' on to the start of the next line of text. | |||
| 7CD6 | DJNZ GameMenu_Loop | Decrease the line counter by one and loop back to GameMenu_Loop until all seven lines have been printed. | |||
|
Print the copyright message at the bottom of the screen.
|
|||||
| 7CD8 | LD HL,$B800 | HL=B800 (a Y position of B8 and an X position of 00). | |||
| 7CDB | LD DE,$7D51 | Point DE at the copyright messaging at Message_Copyright. | |||
| 7CDE | CALL PrintStringColour | Call PrintStringColour to print the string. | |||
|
Print the title at the top of the screen.
|
|||||
| 7CE1 | LD HL,$0020 | HL=0020 (a Y position of 00 and an X position of 20). | |||
| 7CE4 | LD DE,$7D72 | Point DE at the game selection title text at GameSelection_Title. | |||
| 7CE7 | JP PrintStringColour | Jump to PrintStringColour to print the string. | |||
|
View the equivalent code in;
|
|||||
| Prev: 7C90 | Up: Map | Next: 7CEA |