Changeset 390 in xtideuniversalbios for trunk/Assembly_Library/Src/Menu/MenuInit.asm


Ignore:
Timestamp:
Apr 17, 2012, 2:35:52 PM (10 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to Assembly Library:

  • Menu library now stores and restores display context.
  • Added couple of new eCMOVx macros.
File:
1 edited

Legend:

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

    r376 r390  
    3636    push    es
    3737    push    ds
    38     LOAD_BDA_SEGMENT_TO ds, cx, !
    39     push    WORD [BDA.wVidCurShape]
    40     mov     cl, MENU_size
    41     eENTER_STRUCT cx
    42 
     38    xchg    cx, ax          ; Backup user data
     39    CALL_DISPLAY_LIBRARY    PushDisplayContext
     40
     41    ; Create MENU struct to stack
     42    mov     ax, MENU_size
     43    eENTER_STRUCT   ax
     44    xchg    ax, cx          ; Restore user data to AX
    4345    call    Memory_ZeroSSBPwithSizeInCX
    44     call    MenuInit_EnterMenuWithHandlerInBXandUserDataInDXAX
     46
     47    ; Display menu
     48    call    EnterMenuWithHandlerInBXandUserDataInDXAX
     49
     50    ; Get menu selection and destroy menu variables from stack
    4551    mov     dx, [bp+MENUINIT.wHighlightedItem]
    46 
    47     eLEAVE_STRUCT MENU_size
    48     pop     ax
    49     CALL_DISPLAY_LIBRARY SetCursorShapeFromAX
    50     CALL_DISPLAY_LIBRARY SynchronizeDisplayContextToHardware
     52    eLEAVE_STRUCT   MENU_size
     53
     54    CALL_DISPLAY_LIBRARY    PopDisplayContext
    5155    xchg    ax, dx          ; Return highlighted item in AX
    5256    pop     ds
     
    5660
    5761;--------------------------------------------------------------------
    58 ; MenuInit_EnterMenuWithHandlerInBXandUserDataInDXAX
     62; EnterMenuWithHandlerInBXandUserDataInDXAX
    5963;   Parameters
    6064;       DX:AX:  User specified data
     
    6771;--------------------------------------------------------------------
    6872ALIGN MENU_JUMP_ALIGN
    69 MenuInit_EnterMenuWithHandlerInBXandUserDataInDXAX:
     73EnterMenuWithHandlerInBXandUserDataInDXAX:
    7074    mov     [bp+MENU.fnEventHandler], bx
    7175    mov     [bp+MENU.dwUserData], ax
Note: See TracChangeset for help on using the changeset viewer.