Prev: BC8B Up: Map Next: BCE5
BCB4: 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 BCB4 LD DE,$BBF1 Point DE at MenuColours.
BCB7 EXX Switch to the shadow registers.
BCB8 LD HL,$BBF8 Point HL at MenuPositions.
BCBB LD DE,$BC06 Point DE at MenuText.
BCBE LD B,$07 Set the number of lines to 07.
This entry point is used by the routines at ShowVictoryScreen and ShowGameOverScreen.
Print one line from the three lists.
DisplayMenu_Next BCC0 EXX Switch back to the main registers.
BCC1 LD A,(DE) Fetch the attribute of the line.
BCC2 LD ($A736),A Set TextAttribute.
BCC5 INC DE Move on to the next attribute.
BCC6 EXX Switch to the shadow registers.
BCC7 PUSH BC Stash the number of lines on the stack.
BCC8 LD A,(HL) Fetch the x position.
BCC9 INC HL Move on to the next pair of positions.
BCCA INC HL
BCCB PUSH HL Stash the address of the next pair on the stack.
BCCC DEC HL Point HL at the y position.
BCCD LD H,(HL) Fetch the y position.
BCCE LD L,A Set the x position.
BCCF CALL PrintTextSingleColour Call PrintTextSingleColour.
BCD2 POP HL Restore the address of the next pair and the number of lines from the stack.
BCD3 POP BC
BCD4 DJNZ DisplayMenu_Next Jump to DisplayMenu_Next until all of the lines have been printed.
Draw the border the first time.
BCD6 LD A,($A734) Return if BorderDrawnFlag is set.
BCD9 AND A
BCDA RET NZ
BCDB INC A Write 01 to BorderDrawnFlag.
BCDC LD ($A734),A
BCDF CALL PrintBorder Call PrintBorder.
BCE2 JP UpdateScreen Jump to UpdateScreen.
View the equivalent code in;
After DisplayMenu
display-menu
Prev: BC8B Up: Map Next: BCE5