Prev: 48267 Up: Map Next: 48357
48308: Display Menu
Used by the routine at GameMenu.
Prints the seven lines of the menu, each in its own colour and position. The first time that this is called the frame is drawn as well and the whole buffer is copied to the screen: after that only the attributes change, as the line that flashes is changed by writing them straight to the screen.
Point at the menu colours, positions and text.
DisplayMenu 48308 LD DE,48113 Point DE at MenuColours.
48311 EXX Switch to the shadow registers.
48312 LD HL,48120 Point HL at MenuPositions.
48315 LD DE,48134 Point DE at MenuText.
48318 LD B,7 Set the number of lines to 7.
This entry point is used by the routines at ShowVictoryScreen and ShowGameOverScreen.
Print one line from the three lists.
DisplayMenu_Next 48320 EXX Switch back to the main registers.
48321 LD A,(DE) Fetch the attribute of the line.
48322 LD (42806),A Set TextAttribute.
48325 INC DE Move on to the next attribute.
48326 EXX Switch to the shadow registers.
48327 PUSH BC Stash the number of lines on the stack.
48328 LD A,(HL) Fetch the x position.
48329 INC HL Move on to the next pair of positions.
48330 INC HL
48331 PUSH HL Stash the address of the next pair on the stack.
48332 DEC HL Point HL at the y position.
48333 LD H,(HL) Fetch the y position.
48334 LD L,A Set the x position.
48335 CALL PrintTextSingleColour Call PrintTextSingleColour.
48338 POP HL Restore the address of the next pair and the number of lines from the stack.
48339 POP BC
48340 DJNZ DisplayMenu_Next Jump to DisplayMenu_Next until all of the lines have been printed.
Draw the border the first time.
48342 LD A,(42804) Return if BorderDrawnFlag is set.
48345 AND A
48346 RET NZ
48347 INC A Write 1 to BorderDrawnFlag.
48348 LD (42804),A
48351 CALL PrintBorder Call PrintBorder.
48354 JP UpdateScreen Jump to UpdateScreen.
View the equivalent code in;
After DisplayMenu
display-menu
Prev: 48267 Up: Map Next: 48357