![]() |
Routines |
| Prev: 25161 | Up: Map | Next: 25212 |
|
Used by the routine at Game_Restart.
Prints the six lines of the game selection menu, each with its own attribute byte and Y position, and then the copyright message at the bottom of the screen. The main registers hold the pointer to the attribute table, and the shadow registers hold the pointer to the Y position table (HL'), the pointer to the text (DE') and the line counter (B').
|
|||||
| GameMenu | 25168 | LD DE,25212 | Point DE at the table of menu attributes (GameSelection_Attributes). | ||
| 25171 | EXX | Switch to the shadow registers. | |||
| 25172 | LD HL,25218 | HL'=GameSelection_Position (the table of Y positions). | |||
| 25175 | LD DE,25224 | DE'=GameSelection_Text (the text of the menu). | |||
|
There are six lines of text.
|
|||||
| 25178 | LD B,6 | Set the line counter in B' to 6. | |||
| GameMenu_Loop | 25180 | EXX | Switch back to the normal registers. | ||
| 25181 | LD A,(DE) | Store the attribute byte of the line to Current_MenuAttribute. | |||
| 25182 | LD (24097),A | ||||
| 25185 | INC DE | Move onto the next menu attribute. | |||
| 25186 | EXX | Switch to the shadow registers. | |||
| 25187 | PUSH BC | Stash the line counter (BC') on the stack. | |||
| 25188 | LD A,(HL) | Fetch the Y position of the line from the table. | |||
| 25189 | INC HL | Move onto the next Y position in the table. | |||
| 25190 | PUSH HL | Stash the table pointer on the stack. | |||
| 25191 | LD H,A | Set the Y position of the line in H' and the X position (56) in L'. | |||
| 25192 | LD L,56 | ||||
| 25194 | CALL MenuWriteText | Print the line using MenuWriteText. | |||
| 25197 | EXX | Switch to the shadow registers. | |||
| 25198 | POP HL | Restore the table pointer and the line counter from the stack. | |||
| 25199 | POP BC | ||||
| 25200 | INC DE | Move DE' onto the next line of text. | |||
| 25201 | DJNZ GameMenu_Loop | Decrease the line counter by one and loop back to GameMenu_Loop until all six lines have been printed. | |||
|
Print the copyright footer.
|
|||||
| 25203 | LD HL,47104 | HL=47104 (the screen position of the copyright message). | |||
| 25206 | LD DE,24309 | DE=the copyright message (Message_Copyright). | |||
| 25209 | JP PrintStringColour | Jump to PrintStringColour. | |||
|
View the equivalent code in;
|
|||||
| Prev: 25161 | Up: Map | Next: 25212 |