![]() |
Routines |
| Prev: 51739 | Up: Map | Next: 51797 |
|
Used by the routine at GameMenu.
Prints the eight lines of the game selection menu. The first time that it is called it also draws the frame around the screen.
|
||||||||
|
Point at the menu colours, positions and text.
|
||||||||
| DisplayMenu | 51755 | LD DE,51554 | Point DE at MenuLineAttributes. | |||||
| 51758 | EXX | Switch to the shadow registers. | ||||||
| 51759 | LD HL,51562 | Point HL at MenuLinePositions. | ||||||
| 51762 | LD DE,51578 | Point DE at MenuText. | ||||||
| 51765 | LD B,8 | Set the number of lines to 8. | ||||||
|
Print one line from the three lists.
|
||||||||
| DisplayMenu_Loop | 51767 | LD A,(HL) | Fetch the x position. | |||||
| 51768 | INC HL | Move on to the next pair of positions. | ||||||
| 51769 | INC HL | |||||||
| 51770 | PUSH HL | Stash the address of the next pair on the stack. | ||||||
| 51771 | DEC HL | Point HL at the y position. | ||||||
| 51772 | LD H,(HL) | Fetch the y position. | ||||||
| 51773 | LD L,A | Set the x position. | ||||||
| 51774 | EXX | Switch to the shadow registers. | ||||||
| 51775 | LD A,(DE) | Fetch the attribute of the line. | ||||||
| 51776 | INC DE | Move on to the next attribute. | ||||||
| 51777 | EX AF,AF' | Keep the attribute in AF'. | ||||||
| 51778 | EXX | Switch back to the main registers. | ||||||
| 51779 | CALL PrintString | Call PrintString. | ||||||
| 51782 | POP HL | Restore the address of the next pair from the stack. | ||||||
| 51783 | DJNZ DisplayMenu_Loop | Jump to DisplayMenu_Loop until all of the lines have been printed. | ||||||
|
Draw the frame the first time.
|
||||||||
| 51785 | LD A,(48063) | Return if MenuFrameDrawnFlag is set. | ||||||
| 51788 | AND A | |||||||
| 51789 | RET NZ | |||||||
| 51790 | INC A | Write 1 to *MenuFrameDrawnFlag. | ||||||
| 51791 | LD (48063),A | |||||||
| 51794 | JP DrawFrame | Jump to DrawFrame. | ||||||
|
View the equivalent code in;
|
||||||||
| Prev: 51739 | Up: Map | Next: 51797 |