![]() |
Routines |
| Prev: 6249 | Up: Map | Next: 627C |
|
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 | 6250 | LD DE,$627C | Point DE at the table of menu attributes (GameSelection_Attributes). | ||
| 6253 | EXX | Switch to the shadow registers. | |||
| 6254 | LD HL,$6282 | HL'=GameSelection_Position (the table of Y positions). | |||
| 6257 | LD DE,$6288 | DE'=GameSelection_Text (the text of the menu). | |||
|
There are six lines of text.
|
|||||
| 625A | LD B,$06 | Set the line counter in B' to 06. | |||
| GameMenu_Loop | 625C | EXX | Switch back to the normal registers. | ||
| 625D | LD A,(DE) | Store the attribute byte of the line to Current_MenuAttribute. | |||
| 625E | LD ($5E21),A | ||||
| 6261 | INC DE | Move onto the next menu attribute. | |||
| 6262 | EXX | Switch to the shadow registers. | |||
| 6263 | PUSH BC | Stash the line counter (BC') on the stack. | |||
| 6264 | LD A,(HL) | Fetch the Y position of the line from the table. | |||
| 6265 | INC HL | Move onto the next Y position in the table. | |||
| 6266 | PUSH HL | Stash the table pointer on the stack. | |||
| 6267 | LD H,A | Set the Y position of the line in H' and the X position (38) in L'. | |||
| 6268 | LD L,$38 | ||||
| 626A | CALL MenuWriteText | Print the line using MenuWriteText. | |||
| 626D | EXX | Switch to the shadow registers. | |||
| 626E | POP HL | Restore the table pointer and the line counter from the stack. | |||
| 626F | POP BC | ||||
| 6270 | INC DE | Move DE' onto the next line of text. | |||
| 6271 | 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.
|
|||||
| 6273 | LD HL,$B800 | HL=B800 (the screen position of the copyright message). | |||
| 6276 | LD DE,$5EF5 | DE=the copyright message (Message_Copyright). | |||
| 6279 | JP PrintStringColour | Jump to PrintStringColour. | |||
|
View the equivalent code in;
|
|||||
| Prev: 6249 | Up: Map | Next: 627C |