Changeset 52 in xtideuniversalbios for trunk/Assembly_Library/Src/Menu/Dialog/Dialog.asm


Ignore:
Timestamp:
Oct 12, 2010, 6:51:07 PM (14 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to Assembly Library:
Completely rewritten line splitting (slower but no need to modify string).
Some changes to string processing functions.
Saved few bytes from CGA detection.

File:
1 edited

Legend:

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

    r50 r52  
    22; Project name  :   Assembly Library
    33; Created date  :   6.8.2010
    4 ; Last update   :   9.10.2010
     4; Last update   :   12.10.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Common functions for many dialogs.
     
    3838    call    Keyboard_RemoveAllKeystrokesFromBuffer
    3939
    40     mov     ax, [bp+MENU.wHighlightedItem]
     40    mov     ax, [bp+MENUINIT.wHighlightedItem]
    4141    eLEAVE_STRUCT DIALOG_size
    4242    pop     ds
     
    7878
    7979;--------------------------------------------------------------------
    80 ; Dialog_EventInitializeMenuinitFromDSSIforSingleItem
    81 ;   Parameters:
     80; Dialog_EventInitializeMenuinitFromDSSIforSingleItemWithHighlightedItemInAX
     81;   Parameters:
     82;       AX:         Index of highlighted item
    8283;       DS:SI:      Ptr to MENUINIT struct to initialize
    8384;       SS:BP:      Ptr to DIALOG
     
    8788;--------------------------------------------------------------------
    8889ALIGN JUMP_ALIGN
    89 Dialog_EventInitializeMenuinitFromDSSIforSingleItem:
     90Dialog_EventInitializeMenuinitFromDSSIforSingleItemWithHighlightedItemInAX:
    9091    les     di, [bp+DIALOG.fpDialogIO]
    9192    mov     WORD [es:di+DIALOG_INPUT.fszItems], g_szSingleItem
    9293    mov     [es:di+DIALOG_INPUT.fszItems+2], cs
    93     ; Fall to Dialog_EventInitializeMenuinitFromDSSI
    94 
    95 ;--------------------------------------------------------------------
    96 ; Dialog_EventInitializeMenuinitFromDSSI
    97 ;   Parameters:
     94    ; Fall to Dialog_EventInitializeMenuinitFromDSSIwithHighlightedItemInAX
     95
     96;--------------------------------------------------------------------
     97; Dialog_EventInitializeMenuinitFromDSSIwithHighlightedItemInAX
     98;   Parameters:
     99;       AX:         Index of highlighted item
    98100;       DS:SI:      Ptr to MENUINIT struct to initialize
    99101;       SS:BP:      Ptr to DIALOG
     
    103105;--------------------------------------------------------------------
    104106ALIGN JUMP_ALIGN
    105 Dialog_EventInitializeMenuinitFromDSSI:
     107Dialog_EventInitializeMenuinitFromDSSIwithHighlightedItemInAX:
     108    mov     [bp+MENUINIT.wHighlightedItem], ax
    106109    les     di, [bp+DIALOG.fpDialogIO]
    107110    call    .GetWidthBasedOnParentMenuToAL
    108111    mov     [bp+MENUINIT.bWidth], al
    109112
    110     call    MenuLocation_GetMaxTextLineLengthToAX
    111     mov     bx, ax
    112113    lds     si, [es:di+DIALOG_INPUT.fszTitle]
    113     call    LineSplitter_SplitStringFromDSSIwithMaxLineLengthInAXandGetLineCountToAX
     114    call    ItemLineSplitter_GetLinesToAXforStringInDSSI
    114115    mov     [bp+MENUINIT.bTitleLines], al
    115116
    116     mov     ax, bx
    117117    lds     si, [es:di+DIALOG_INPUT.fszItems]
    118     call    LineSplitter_SplitStringFromDSSIwithMaxLineLengthInAXandGetLineCountToAX
     118    call    ItemLineSplitter_GetLinesToAXforStringInDSSI
    119119    mov     [bp+MENUINIT.wItems], ax
    120120
    121     xchg    ax, bx
    122121    lds     si, [es:di+DIALOG_INPUT.fszInfo]
    123     call    LineSplitter_SplitStringFromDSSIwithMaxLineLengthInAXandGetLineCountToAX
     122    call    ItemLineSplitter_GetLinesToAXforStringInDSSI
    124123    mov     [bp+MENUINIT.bInfoLines], al
    125124
     
    178177ALIGN JUMP_ALIGN
    179178Dialog_EventRefreshTitle:
    180     mov     dl, [bp+MENUINIT.bTitleLines]
    181179    lds     si, [bp+DIALOG.fpDialogIO]
    182     les     di, [si+DIALOG_INPUT.fszTitle]
    183     jmp     SHORT PrintDLlinesFromESDI
     180    lds     si, [si+DIALOG_INPUT.fszTitle]
     181    jmp     SHORT PrintTitleOrInfoLine
    184182
    185183ALIGN JUMP_ALIGN
    186184Dialog_EventRefreshInformation:
    187     mov     dl, [bp+MENUINIT.bInfoLines]
    188185    lds     si, [bp+DIALOG.fpDialogIO]
    189     les     di, [si+DIALOG_INPUT.fszInfo]
    190     ; Fall to PrintDLlinesFromESDI
    191 
    192 ALIGN JUMP_ALIGN
    193 PrintDLlinesFromESDI:
    194     xor     cx, cx              ; Start from line zero
    195     mov     dh, cl              ; Line count now in DX
    196 ALIGN JUMP_ALIGN
    197 .PrintNextLine:
    198     call    LineSplitter_PrintLineInCXfromStringInESDI
    199     push    di
    200     CALL_DISPLAY_LIBRARY PrintNewlineCharacters
    201     pop     di
    202     inc     cx
    203     dec     dx
    204     jnz     SHORT .PrintNextLine
     186    lds     si, [si+DIALOG_INPUT.fszInfo]
     187    ; Fall to PrintTitleOrInfoLine
     188
     189ALIGN JUMP_ALIGN
     190PrintTitleOrInfoLine:
     191    mov     bx, ds
     192    CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromBXSI
    205193    stc
    206194    ret
     
    218206Dialog_EventRefreshItemFromCX:
    219207    lds     si, [bp+DIALOG.fpDialogIO]
    220     les     di, [si+DIALOG_INPUT.fszItems]
    221     call    LineSplitter_PrintLineInCXfromStringInESDI
     208    lds     si, [si+DIALOG_INPUT.fszItems]
     209    call    ItemLineSplitter_GetLineToDSSIandLengthToCXfromStringInDSSIwithIndexInCX
     210    jnc     SHORT .LineNotFound
     211
     212    mov     bx, ds
     213    CALL_DISPLAY_LIBRARY PrintCharBufferFromBXSIwithLengthInCX
     214.LineNotFound:
    222215    stc
    223216    ret
Note: See TracChangeset for help on using the changeset viewer.