Changeset 390 in xtideuniversalbios for trunk/Assembly_Library


Ignore:
Timestamp:
Apr 17, 2012, 2:35:52 PM (13 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.
Location:
trunk/Assembly_Library
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Inc/Display.inc

    r370 r390  
    8282%endif
    8383
    84 ; Attribute flags for DISPLAY_LIB.SetCharacterOutputFunctionFromAXwithAttributeFlagInDL
     84; Attribute flags for DISPLAY_LIB.SetCharacterOutputFunctionFromAXwithAttributeFlagInBL
    8585ATTRIBUTES_NOT_USED                         EQU     0
    8686ATTRIBUTES_ARE_USED                         EQU     FLG_CONTEXT_ATTRIBUTES
    8787
    88 ; Character output functions for DISPLAY_LIB.SetCharacterOutputFunctionFromAXwithAttributeFlagInDL
     88; Character output functions for DISPLAY_LIB.SetCharacterOutputFunctionFromAXwithAttributeFlagInBL
    8989TELETYPE_OUTPUT_WITH_ATTRIBUTE              EQU     DisplayCharOut_TeletypeOutputWithAttribute
    9090TELETYPE_OUTPUT_WITHOUT_ATTRIBUTE           EQU     DisplayCharOut_TeletypeOutput
  • trunk/Assembly_Library/Inc/Emulate.inc

    r293 r390  
    164164%endmacro
    165165
     166%macro eCMOVNC 2
     167    jc      SHORT %%Return
     168    mov     %1, %2
     169%%Return:
     170%endmacro
     171
    166172%macro eCMOVZ 2
    167173    jnz     SHORT %%Return
     
    186192%macro eCMOVB 2
    187193    jnb     SHORT %%Return
     194    mov     %1, %2
     195%%Return:
     196%endmacro
     197
     198%macro eCMOVS 2
     199    jns     SHORT %%Return
    188200    mov     %1, %2
    189201%%Return:
  • 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.