Changeset 177 in xtideuniversalbios for trunk


Ignore:
Timestamp:
Oct 22, 2011, 9:31:12 PM (13 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

Optimiztion, replaced the jump tables for MENU_LIB and DISPLAY_LIB with direct jump offsets

Location:
trunk/Assembly_Library
Files:
4 edited

Legend:

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

    r134 r177  
    2525        call    DisplayContext_PrepareOffScreenBufferInESBXwithLengthInCX
    2626    %else
    27         mov     di, DISPLAY_LIB.%1
     27        mov     di, %1
    2828        call    Display_FunctionFromDI
    2929    %endif
    3030%endmacro
    3131
     32%if 0
     33;;;
     34;;; struc no longer needed with direct calls to functions
     35;;;
    3236
    3337; Display library functions
     
    7074    .ClearScreenWithCharInALandAttrInAH             resb    2
    7175endstruc
     76%endif
    7277
    7378; Attribute flags for DISPLAY_LIB.SetCharacterOutputFunctionFromAXwithAttributeFlagInDL
  • trunk/Assembly_Library/Inc/Menu.inc

    r105 r177  
    4848
    4949    %else
    50         mov     di, MENU_LIB.%1
     50        mov     di, %1
    5151        call    Menu_FunctionFromDI
    5252    %endif
    5353%endmacro
     54
     55%if 0
     56;;;
     57;;; struc no longer needed with direct call to function
     58;;;
    5459
    5560; Menu library functions
     
    8994%endif
    9095endstruc
    91 
     96%endif
    9297
    9398; Menu initialization parameters
  • trunk/Assembly_Library/Src/Display/Display.asm

    r134 r177  
    2424    cld
    2525    LOAD_BDA_SEGMENT_TO ds, dx
    26     mov     dx, [cs:di+.rgfnDisplayLibraryFunctions]
     26    mov     dx, di
    2727    les     di, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition]
    2828    call    dx
     
    3535
    3636;--------------------------------------------------------------------
    37 ; .FormatNullTerminatedStringFromCSSI
     37; Display_FormatNullTerminatedStringFromCSSI
    3838;   Parameters:
    3939;       Same as DisplayPrint_FormattedNullTerminatedStringFromCSSI
     
    4444;--------------------------------------------------------------------
    4545ALIGN JUMP_ALIGN
    46 .FormatNullTerminatedStringFromCSSI:
     46Display_FormatNullTerminatedStringFromCSSI:
    4747    pop     ax                  ; Discard return address to inside Display_FunctionFromDI
    4848    call    DisplayPrint_FormattedNullTerminatedStringFromCSSI
     
    5757    jmp     ax
    5858
    59 
    60 ALIGN WORD_ALIGN
    61 .rgfnDisplayLibraryFunctions:
    62 istruc DISPLAY_LIB
    63     at  DISPLAY_LIB.InitializeDisplayContext,                       dw  DisplayContext_Initialize
     59       
     60%define InitializeDisplayContext                        DisplayContext_Initialize
    6461
    6562%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    66     at  DISPLAY_LIB.SetCharacterPointerFromBXAX,                    dw  DisplayContext_SetCharacterPointerFromBXAX
     63%define SetCharacterPointerFromBXAX                     DisplayContext_SetCharacterPointerFromBXAX
    6764%endif
    68     at  DISPLAY_LIB.SetCharOutputFunctionFromAXwithAttribFlagInBL,  dw  DisplayContext_SetCharOutputFunctionFromAXwithAttribFlagInBL
    69     at  DISPLAY_LIB.SetCharacterOutputParameterFromAX,              dw  DisplayContext_SetCharacterOutputParameterFromAX
    70     at  DISPLAY_LIB.SetCharacterAttributeFromAL,                    dw  DisplayContext_SetCharacterAttributeFromAL
    71     at  DISPLAY_LIB.SetCursorShapeFromAX,                           dw  DisplayCursor_SetShapeFromAX
    72     at  DISPLAY_LIB.SetCursorCoordinatesFromAX,                     dw  DisplayCursor_SetCoordinatesFromAX
    73     at  DISPLAY_LIB.SetNewPageFromAL,                               dw  DisplayPage_SetFromAL
    74     at  DISPLAY_LIB.SynchronizeDisplayContextToHardware,            dw  DisplayContext_SynchronizeToHardware
     65%define SetCharOutputFunctionFromAXwithAttribFlagInBL   DisplayContext_SetCharOutputFunctionFromAXwithAttribFlagInBL
     66%define SetCharacterOutputParameterFromAX               DisplayContext_SetCharacterOutputParameterFromAX
     67%define SetCharacterAttributeFromAL                     DisplayContext_SetCharacterAttributeFromAL
     68%define SetCursorShapeFromAX                            DisplayCursor_SetShapeFromAX
     69%define SetCursorCoordinatesFromAX                      DisplayCursor_SetCoordinatesFromAX
     70%define SetNewPageFromAL                                DisplayPage_SetFromAL
     71%define SynchronizeDisplayContextToHardware             DisplayContext_SynchronizeToHardware
    7572
    7673%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    77     at  DISPLAY_LIB.GetCharacterPointerToBXAX,                      dw  DisplayContext_GetCharacterPointerToBXAX
     74%define GetCharacterPointerToBXAX                       DisplayContext_GetCharacterPointerToBXAX
    7875%endif
    79     at  DISPLAY_LIB.GetSoftwareCoordinatesToAX,                     dw  DisplayCursor_GetSoftwareCoordinatesToAX
    80     at  DISPLAY_LIB.GetColumnsToALandRowsToAH,                      dw  DisplayPage_GetColumnsToALandRowsToAH
     76%define GetSoftwareCoordinatesToAX                      DisplayCursor_GetSoftwareCoordinatesToAX
     77%define GetColumnsToALandRowsToAH                       DisplayPage_GetColumnsToALandRowsToAH
    8178
    82     at  DISPLAY_LIB.FormatNullTerminatedStringFromCSSI,             dw  .FormatNullTerminatedStringFromCSSI
     79%define FormatNullTerminatedStringFromCSSI              Display_FormatNullTerminatedStringFromCSSI
    8380%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    84     at  DISPLAY_LIB.PrintSignedWordFromAXWithBaseInBX,              dw  DisplayPrint_SignedWordFromAXWithBaseInBX
     81%define PrintSignedWordFromAXWithBaseInBX               DisplayPrint_SignedWordFromAXWithBaseInBX
    8582%endif
    86     at  DISPLAY_LIB.PrintWordFromAXwithBaseInBX,                    dw  DisplayPrint_WordFromAXWithBaseInBX
    87     at  DISPLAY_LIB.PrintCharBufferFromBXSIwithLengthInCX,          dw  DisplayPrint_CharacterBufferFromBXSIwithLengthInCX
    88     at  DISPLAY_LIB.PrintNullTerminatedStringFromBXSI,              dw  DisplayPrint_NullTerminatedStringFromBXSI
    89     at  DISPLAY_LIB.PrintNullTerminatedStringFromCSSI,              dw  DisplayPrint_NullTerminatedStringFromCSSI
    90     at  DISPLAY_LIB.PrintRepeatedCharacterFromALwithCountInCX,      dw  DisplayPrint_RepeatCharacterFromALwithCountInCX
    91     at  DISPLAY_LIB.PrintCharacterFromAL,                           dw  DisplayPrint_CharacterFromAL
    92     at  DISPLAY_LIB.PrintNewlineCharacters,                         dw  DisplayPrint_Newline
     83%define PrintWordFromAXwithBaseInBX                     DisplayPrint_WordFromAXWithBaseInBX
     84%define PrintCharBufferFromBXSIwithLengthInCX           DisplayPrint_CharacterBufferFromBXSIwithLengthInCX
     85%define PrintNullTerminatedStringFromBXSI               DisplayPrint_NullTerminatedStringFromBXSI
     86%define PrintNullTerminatedStringFromCSSI               DisplayPrint_NullTerminatedStringFromCSSI
     87%define PrintRepeatedCharacterFromALwithCountInCX       DisplayPrint_RepeatCharacterFromALwithCountInCX
     88%define PrintCharacterFromAL                            DisplayPrint_CharacterFromAL
     89%define PrintNewlineCharacters                          DisplayPrint_Newline
    9390%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    94     at  DISPLAY_LIB.ClearAreaWithHeightInAHandWidthInAL,            dw  DisplayPrint_ClearAreaWithHeightInAHandWidthInAL
     91%define ClearAreaWithHeightInAHandWidthInAL             DisplayPrint_ClearAreaWithHeightInAHandWidthInAL
    9592%endif
    96     at  DISPLAY_LIB.ClearScreenWithCharInALandAttrInAH,             dw  DisplayPrint_ClearScreenWithCharInALandAttributeInAH
    97 iend
     93%define ClearScreenWithCharInALandAttrInAH              DisplayPrint_ClearScreenWithCharInALandAttributeInAH
     94
  • trunk/Assembly_Library/Src/Menu/Menu.asm

    r104 r177  
    2323    push    cx
    2424    push    bx
    25     call    [cs:di+.rgfnMenuLibraryFunctions]
     25    call    di
    2626    pop     bx
    2727    pop     cx
     
    3131
    3232
    33 ALIGN WORD_ALIGN
    34 .rgfnMenuLibraryFunctions:
    35 istruc MENU_LIB
    36     at  MENU_LIB.DisplayWithHandlerInBXandUserDataInDXAX,   dw  MenuInit_DisplayMenuWithHandlerInBXandUserDataInDXAX
    37     ;at MENU_LIB.Close,                         dw  MenuInit_CloseMenuWindow                ; Special case in CALL_MENU_LIBRARY
    38     at  MENU_LIB.RefreshWindow,                 dw  MenuInit_RefreshMenuWindow
     33%define DisplayWithHandlerInBXandUserDataInDXAX     MenuInit_DisplayMenuWithHandlerInBXandUserDataInDXAX
     34;%define Close                                      MenuInit_CloseMenuWindow                ; Special case in CALL_MENU_LIBRARY
     35%define RefreshWindow                       MenuInit_RefreshMenuWindow
    3936
    40     ;at MENU_LIB.SetUserDataFromDSSI,           dw  MenuInit_SetUserDataFromDSSI            ; Special case in CALL_MENU_LIBRARY
    41     ;at MENU_LIB.GetUserDataToDSSI,             dw  MenuInit_GetUserDataToDSSI              ; Special case in CALL_MENU_LIBRARY
     37;%define SetUserDataFromDSSI                MenuInit_SetUserDataFromDSSI            ; Special case in CALL_MENU_LIBRARY
     38;%define GetUserDataToDSSI                  MenuInit_GetUserDataToDSSI              ; Special case in CALL_MENU_LIBRARY
    4239
    43     ;at MENU_LIB.SetTitleHeightFromAL,          dw  MenuInit_SetTitleHeightFromAL           ; Special case in CALL_MENU_LIBRARY
    44     at  MENU_LIB.ClearTitleArea,                dw  MenuText_ClearTitleArea
    45     at  MENU_LIB.RefreshTitle,                  dw  MenuText_RefreshTitle
     40;%define SetTitleHeightFromAL               MenuInit_SetTitleHeightFromAL           ; Special case in CALL_MENU_LIBRARY
     41%define ClearTitleArea                      MenuText_ClearTitleArea
     42%define RefreshTitle                        MenuText_RefreshTitle
    4643
    47     at  MENU_LIB.HighlightItemFromAX,           dw  MenuInit_HighlightItemFromAX
    48     ;at MENU_LIB.SetTotalItemsFromAX,           dw  MenuInit_SetTotalItemsFromAX            ; Special case in CALL_MENU_LIBRARY
    49     at  MENU_LIB.RefreshItemFromAX,             dw  MenuText_RefreshItemFromAX
     44%define HighlightItemFromAX                 MenuInit_HighlightItemFromAX
     45;%define SetTotalItemsFromAX                MenuInit_SetTotalItemsFromAX            ; Special case in CALL_MENU_LIBRARY
     46%define RefreshItemFromAX                   MenuText_RefreshItemFromAX
    5047
    51     ;at MENU_LIB.SetInformationHeightFromAL,    dw  MenuInit_SetInformationHeightFromAL     ; Special case in CALL_MENU_LIBRARY
    52     at  MENU_LIB.ClearInformationArea,          dw  MenuText_ClearInformationArea
    53     at  MENU_LIB.RefreshInformation,            dw  MenuText_RefreshInformation
     48;%define SetInformationHeightFromAL                     MenuInit_SetInformationHeightFromAL     ; Special case in CALL_MENU_LIBRARY
     49%define ClearInformationArea                            MenuText_ClearInformationArea
     50%define RefreshInformation                              MenuText_RefreshInformation
    5451
    55     at  MENU_LIB.StartSelectionTimeoutWithTicksInAX,    dw  MenuTime_StartSelectionTimeoutWithTicksInAX
     52%define StartSelectionTimeoutWithTicksInAX              MenuTime_StartSelectionTimeoutWithTicksInAX
    5653
    5754%ifdef INCLUDE_MENU_DIALOGS
    58     at  MENU_LIB.StartProgressTaskWithIoInDSSIandParamInDXAX,   dw  DialogProgress_StartProgressTaskWithIoInDSSIandParamInDXAX
    59     at  MENU_LIB.SetProgressValueFromAX,                        dw  DialogProgress_SetProgressValueFromAX
     55%define StartProgressTaskWithIoInDSSIandParamInDXAX     DialogProgress_StartProgressTaskWithIoInDSSIandParamInDXAX
     56%define SetProgressValueFromAX                          DialogProgress_SetProgressValueFromAX
    6057
    61     at  MENU_LIB.DisplayMessageWithInputInDSSI,                 dw  DialogMessage_DisplayMessageWithInputInDSSI
    62     at  MENU_LIB.GetSelectionToAXwithInputInDSSI,               dw  DialogSelection_GetSelectionToAXwithInputInDSSI
    63     at  MENU_LIB.GetWordWithIoInDSSI,                           dw  DialogWord_GetWordWithIoInDSSI
    64     at  MENU_LIB.GetStringWithIoInDSSI,                         dw  DialogString_GetStringWithIoInDSSI
    65     at  MENU_LIB.GetFileNameWithIoInDSSI,                       dw  DialogFile_GetFileNameWithIoInDSSI
    66     at  MENU_LIB.GetDriveWithIoInDSSI,                          dw  DialogDrive_GetDriveWithIoInDSSI
     58%define DisplayMessageWithInputInDSSI                   DialogMessage_DisplayMessageWithInputInDSSI
     59%define GetSelectionToAXwithInputInDSSI                 DialogSelection_GetSelectionToAXwithInputInDSSI
     60%define GetWordWithIoInDSSI                             DialogWord_GetWordWithIoInDSSI
     61%define GetStringWithIoInDSSI                           DialogString_GetStringWithIoInDSSI
     62%define GetFileNameWithIoInDSSI                         DialogFile_GetFileNameWithIoInDSSI
     63%define GetDriveWithIoInDSSI                            DialogDrive_GetDriveWithIoInDSSI
    6764%endif
    68 iend
     65
Note: See TracChangeset for help on using the changeset viewer.