![]() |
Routines |
| Prev: 37088 | Up: Map | Next: 37145 |
|
Used by the routine at Select_Game_Options.
Prints the five lines of the game selection menu, the copyright message and the title.
The attributes of the lines are read through DE from GameSelection_Attributes, while the y positions and the strings are read through HL' and DE'.
|
||||||
|
Set up the pointers and the counter of the five lines.
|
||||||
| GameMenu | 37092 | LD DE,37145 | Point at the attributes of the lines (GameSelection_Attributes). | |||
| 37095 | EXX | Switch to the shadow registers. | ||||
| 37096 | LD HL,37151 | HL'=GameSelection_Position (the y positions of the lines). | ||||
| 37099 | LD DE,37157 | DE'=GameSelection_Text (the first string). | ||||
| 37102 | LD B,5 | B'=5 (the number of lines). | ||||
| GameMenu_Loop | 37104 | EXX | Switch to the main registers. | |||
|
Print each of the lines.
|
||||||
| 37105 | LD A,(DE) | Fetch the attribute of the line. | ||||
| 37106 | LD (36584),A | Store it in the print attribute (Current_MenuAttribute). | ||||
| 37109 | INC DE | Move on to the next attribute. | ||||
| 37110 | EXX | Switch to the shadow registers. | ||||
| 37111 | PUSH BC | Stash the counter on the stack. | ||||
| 37112 | LD A,(HL) | Fetch the y position of the line. | ||||
| 37113 | INC HL | Move on to the next y position. | ||||
| 37114 | PUSH HL | Stash the pointer to the y positions on the stack. | ||||
| 37115 | LD H,A | Use it as the y position of the line. | ||||
| 37116 | LD L,88 | L'=88 (the x position of the lines). | ||||
| 37118 | CALL MenuWriteText | Print the string. | ||||
| 37121 | EXX | Switch to the shadow registers. | ||||
| 37122 | POP HL | Restore the pointer to the y positions. | ||||
| 37123 | POP BC | Restore the counter. | ||||
| 37124 | INC DE | Move on to the next string. | ||||
| 37125 | DJNZ GameMenu_Loop | Repeat for each of the lines. | ||||
|
Print the copyright message and the title.
|
||||||
| 37127 | LD HL,47104 | Set the x position to 0 and the y position to 184 (47104). | ||||
| 37130 | LD DE,37236 | Point at the copyright message (Message_Copyright). | ||||
| 37133 | CALL PrintStringColour | Print the copyright message. | ||||
| 37136 | LD HL,16 | Set the x position to 16 and the y position to 0 (16). | ||||
| 37139 | LD DE,37269 | Point at the title (GameSelection_Title). | ||||
| 37142 | JP PrintStringColour | Jump to PrintStringColour. | ||||
|
View the equivalent code in;
|
||||||
| Prev: 37088 | Up: Map | Next: 37145 |