Prev: 24327 Up: Map Next: 24471
24428: 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 104 (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 24428 LD A,104 Write the X position of the menu text, 104 to Temp_Text_Pos_X.
24430 LD (24136),A
24433 LD DE,24487 Point DE at the table of menu line colours (GameSelection_Attributes).
24436 EXX Switch to the shadow registers.
24437 LD HL,24492 Point HL' at the table of menu line Y positions (GameSelection_Position).
24440 LD DE,24497 Point DE' at the menu text (GameSelection_Text).
There are five lines of text.
24443 LD B,5 Set the line counter to 5 one for each line of the menu.
This entry point is used by the routine at DisplayCongratsMessaging.
GameMenu_Loop 24445 EXX Switch back to the main registers.
24446 LD A,(DE) Fetch the colour of this menu line and write it to Current_MenuAttribute.
24447 LD (24127),A
24450 INC DE Move on to the colour of the next menu line.
24451 EXX Switch to the shadow registers.
24452 PUSH BC Stash the line counter on the stack.
24453 LD A,(HL) Fetch the Y position of this menu line.
24454 INC HL Move on to the Y position of the next menu line.
24455 PUSH HL Stash the Y position pointer on the stack.
24456 LD H,A Set H to the Y position of the line.
24457 LD A,(24136) Set L to the X position of the text, from Temp_Text_Pos_X.
24460 LD L,A
24461 CALL MenuWriteText Print the line of text using MenuWriteText.
24464 EXX Switch to the shadow registers.
24465 POP HL Restore the Y position pointer and the line counter from the stack.
24466 POP BC
24467 INC DE Move the text pointer on to the start of the next line of text.
24468 DJNZ GameMenu_Loop Decrease the line counter by one and loop back to GameMenu_Loop until all of the lines have been printed.
24470 RET Return.
Prev: 24327 Up: Map Next: 24471