Prev: 26650 Up: Map Next: 26819
26734: Handle Menu
Used by the routines at Display_Status and Initialise_Game.
Shows Menu_Control_Options and Menu_Skill_Options, reads the choice, and writes it to Control_Choice and Menu_Choice.
Control Options Skill Options
menu-control menu-skill
Handle_Menu 26734 EXX Switch to the shadow registers, and stash HL' on the stack.
26735 PUSH HL
26736 JR Draw_Control_Page Jump to Draw_Control_Page.
Replay the menu after a cancelled choice.
Replay_Menu 26738 LD A,15 Write 15 to *Status_Value.
26740 LD (61316),A
26743 CALL Play_Briefing_Set Call Play_Briefing_Set.
Draw the first menu page.
Draw_Control_Page 26746 CALL Clear_Work_Buffers Call Clear_Work_Buffers.
26749 LD HL,27046 Point HL at Menu_Control_Options.
26752 LD B,5 Set the row counter to 5 in B.
26754 CALL Print_Menu_Rows Call Print_Menu_Rows.
26757 LD HL,22600 Point HL at 22600 (attribute buffer).
26760 CALL Fill_Menu_Highlight Call Fill_Menu_Highlight.
26763 CALL Read_Menu_Key Call Read_Menu_Key.
Replay if the wait timed out.
26766 CP 254 Jump to Replay_Menu if the choice is equal to 254.
26768 JR Z,Replay_Menu
26770 LD (61420),A Write the choice to *Menu_Store.
Draw the second menu page.
26773 CALL Clear_Work_Buffers Call Clear_Work_Buffers.
26776 LD HL,27046 Point HL at Menu_Control_Options.
26779 LD B,1 Set the row counter to 1 in B.
26781 CALL Print_Menu_Rows Call Print_Menu_Rows.
26784 LD HL,27136 Point HL at Menu_Skill_Options.
26787 LD B,4 Set the row counter to 4 in B.
26789 CALL Print_Menu_Rows Call Print_Menu_Rows.
26792 LD HL,22600 Point HL at 22600 (attribute buffer).
26795 CALL Fill_Menu_Highlight Call Fill_Menu_Highlight.
26798 CALL Read_Menu_Key Call Read_Menu_Key.
Use option 0 if the wait timed out.
26801 CP 254 Jump to Store_Menu_Choice if the choice is not equal to 254.
26803 JR NZ,Store_Menu_Choice
26805 XOR A Set the choice to 0.
26806 CALL Highlight_Menu_Item Call Highlight_Menu_Item.
Store the chosen value.
Store_Menu_Choice 26809 ADD A,A Double the choice.
26810 LD (57838),A Write the choice to *Control_Choice and *Menu_Choice.
26813 LD (61321),A
26816 POP HL Restore HL' from the stack.
26817 EXX Switch back.
26818 RET Return.
Prev: 26650 Up: Map Next: 26819