Changeset 58 in xtideuniversalbios for trunk/Assembly_Library/Src/Menu/MenuLoop.asm


Ignore:
Timestamp:
Nov 18, 2010, 2:42:28 PM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to Assembly Library:

  • Exiting menu with ESC can now be canceled.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Src/Menu/MenuLoop.asm

    r52 r58  
    22; Project name  :   Assembly Library
    33; Created date  :   22.7.2010
    4 ; Last update   :   12.10.2010
     4; Last update   :   18.10.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Menu loop for waiting keystrokes.
     
    2020ALIGN JUMP_ALIGN
    2121MenuLoop_Enter:
     22    call    KeystrokeProcessing
     23    call    TimeoutProcessing
     24    call    IdleTimeProcessing
    2225    test    BYTE [bp+MENU.bFlags], FLG_MENU_EXIT
    23     jnz     SHORT .ExitMenu
    24     call    IdleTimeProcessing
    25 
    26     call    MenuTime_UpdateSelectionTimeout
    27     mov     ah, MENU_KEY_ENTER          ; Fake ENTER to select item
    28     jc      SHORT .ProcessFakedKeystrokeCausedByTimeout
    29 
    30     call    Keyboard_GetKeystrokeToAX
    3126    jz      SHORT MenuLoop_Enter
    32 .ProcessFakedKeystrokeCausedByTimeout:
    33     call    ProcessKeystrokeFromAX
    34     jmp     SHORT MenuLoop_Enter
    35 
    36 ALIGN JUMP_ALIGN
    37 .ExitMenu:
    38     jmp     MenuEvent_ExitMenu
     27    ret
    3928
    4029
    4130;--------------------------------------------------------------------
    4231; IdleTimeProcessing
     32; TimeoutProcessing
     33; KeystrokeProcessing
    4334;   Parameters
    4435;       SS:BP:  Ptr to MENU
     
    4637;       Nothing
    4738;   Corrupts registers:
    48 ;       AX, BX, DX
     39;       All, except SS:BP
    4940;--------------------------------------------------------------------
    5041ALIGN JUMP_ALIGN
    5142IdleTimeProcessing:
    52     jmp     MenuEvent_IdleProcessing    ; User idle processing
     43    jmp     MenuEvent_IdleProcessing        ; User idle processing
     44
     45ALIGN JUMP_ALIGN
     46TimeoutProcessing:
     47    call    MenuTime_UpdateSelectionTimeout
     48    mov     ah, MENU_KEY_ENTER              ; Fake ENTER to select item
     49    jc      SHORT ProcessKeystrokeFromAX    ; Process faked ENTER
     50    ret
     51
     52ALIGN JUMP_ALIGN
     53KeystrokeProcessing:
     54    call    Keyboard_GetKeystrokeToAX
     55    jnz     SHORT ProcessKeystrokeFromAX
     56    ret
    5357
    5458
     
    101105ALIGN JUMP_ALIGN
    102106.LeaveMenuWithoutSelectingItem:
     107    call    MenuEvent_ExitMenu
     108    jnc     SHORT .CancelMenuExit
    103109    call    MenuInit_CloseMenuWindow
    104110    mov     WORD [bp+MENUINIT.wHighlightedItem], NO_ITEM_HIGHLIGHTED
     111.CancelMenuExit:
    105112    stc
    106113    ret
Note: See TracChangeset for help on using the changeset viewer.