Prev: 26911 Up: Map Next: 26995
26936: Highlight Menu Item
Used by the routines at Handle_Menu and Read_Menu_Key.
Moves the highlight until FRAMES wraps, then returns *Menu_Highlight.
Input
A Initial selection
Output
A Highlighted selection
Set the timeout, then apply the initial selection.
Highlight_Menu_Item 26936 EX AF,AF' Stash the selection in AF'.
26937 LD A,200 Write 200 to *FRAMES.
26939 LD (23672),A
26942 EX AF,AF' Restore the selection from AF'.
26943 JR Test_Menu_Choice Jump to Test_Menu_Choice.
Scan for a new choice.
Highlight_Menu_Loop 26945 CALL Scan_Menu_Keys Call Scan_Menu_Keys.
26948 CP 255 Jump to Check_Highlight_Timeout if no key is pressed.
26950 JR Z,Check_Highlight_Timeout
Leave the highlight if the choice is unchanged.
Test_Menu_Choice 26952 LD B,A Jump to Check_Highlight_Timeout if the choice matches *Menu_Highlight.
26953 LD A,(57840)
26956 CP B
26957 JR Z,Check_Highlight_Timeout
Unhighlight the old row, and highlight the new one.
26959 LD A,B Stash the new choice in AF'.
26960 EX AF,AF'
26961 LD A,(57840) Fetch *Menu_Highlight.
26964 CALL Menu_Attribute_Address Call Menu_Attribute_Address.
26967 CALL Fill_Menu_Attributes Call Fill_Menu_Attributes.
26970 EX AF,AF' Restore the new choice from AF'.
26971 LD (57840),A Write the choice to *Menu_Highlight.
26974 CALL Menu_Attribute_Address Call Menu_Attribute_Address.
26977 CALL Fill_Menu_Highlight Call Fill_Menu_Highlight.
26980 LD A,200 Write 200 to *FRAMES.
26982 LD (23672),A
Loop until the frame counter wraps.
Check_Highlight_Timeout 26985 LD A,(23672) Jump to Highlight_Menu_Loop until *FRAMES wraps.
26988 INC A
26989 JR NZ,Highlight_Menu_Loop
Return the highlighted selection.
26991 LD A,(57840) Fetch *Menu_Highlight.
26994 RET Return.
Prev: 26911 Up: Map Next: 26995