Prev: 5F07 Up: Map Next: 5F97
5F6C: Game Selection Menu
Used by the routine at GameInitialisation.
Prints the five lines of the game selection menu. The X position of the text is 68 (held at Temp_Text_Pos_X), the colour of each line comes from the table at GameSelection_Attributes, the Y positions come from the table at GameSelection_Position and the text itself is held at GameSelection_Text. The shadow registers hold the pointer to the Y positions (HL'), the pointer to the text (DE') and the line counter (B'). The main registers hold the pointer to the attributes (DE).
game-selection-menu
GameMenu 5F6C LD A,$68 Write the X position of the menu text, 68 to Temp_Text_Pos_X.
5F6E LD ($5E48),A
5F71 LD DE,$5FA7 Point DE at the table of menu line colours (GameSelection_Attributes).
5F74 EXX Switch to the shadow registers.
5F75 LD HL,$5FAC Point HL' at the table of menu line Y positions (GameSelection_Position).
5F78 LD DE,$5FB1 Point DE' at the menu text (GameSelection_Text).
There are five lines of text.
5F7B LD B,$05 Set the line counter to 05 one for each line of the menu.
This entry point is used by the routine at DisplayCongratsMessaging.
GameMenu_Loop 5F7D EXX Switch back to the main registers.
5F7E LD A,(DE) Fetch the colour of this menu line and write it to Current_MenuAttribute.
5F7F LD ($5E3F),A
5F82 INC DE Move on to the colour of the next menu line.
5F83 EXX Switch to the shadow registers.
5F84 PUSH BC Stash the line counter on the stack.
5F85 LD A,(HL) Fetch the Y position of this menu line.
5F86 INC HL Move on to the Y position of the next menu line.
5F87 PUSH HL Stash the Y position pointer on the stack.
5F88 LD H,A Set H to the Y position of the line.
5F89 LD A,($5E48) Set L to the X position of the text, from Temp_Text_Pos_X.
5F8C LD L,A
5F8D CALL MenuWriteText Print the line of text using MenuWriteText.
5F90 EXX Switch to the shadow registers.
5F91 POP HL Restore the Y position pointer and the line counter from the stack.
5F92 POP BC
5F93 INC DE Move the text pointer on to the start of the next line of text.
5F94 DJNZ GameMenu_Loop Decrease the line counter by one and loop back to GameMenu_Loop until all of the lines have been printed.
5F96 RET Return.
Prev: 5F07 Up: Map Next: 5F97