Changeset 67 in xtideuniversalbios for trunk/Assembly_Library/Src/Menu


Ignore:
Timestamp:
Dec 9, 2010, 5:14:25 PM (14 years ago)
Author:
Tomi Tilli
google:author:
aitotat
Message:

Changes to Assembly Library:

  • Forgot to update SI on new File Read and Write functions.
  • Screen clearing function now accepts any character and attribute.
  • Menu library now accepts CR,LF combination as line feed. Previously only LF,CR worked properly.
Location:
trunk/Assembly_Library/Src/Menu
Files:
3 edited

Legend:

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

    r62 r67  
    22; Project name  :   Assembly Library
    33; Created date  :   14.7.2010
    4 ; Last update   :   30.11.2010
     4; Last update   :   9.12.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Functions for drawing menu borders.
     
    2929MenuBorders_RefreshAll:
    3030    call    MenuBorders_AdjustDisplayContextForDrawingBorders
    31     call    GetNumberOfMiddleCharactersToDX
     31    call    MenuBorders_GetNumberOfMiddleCharactersToDX
    3232    call    RefreshTitleBorders
    3333    call    RefreshItemBorders
     
    5151    call    MenuLocation_GetBottomBordersTopLeftCoordinatesToAX
    5252    CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
    53     call    GetNumberOfMiddleCharactersToDX
     53    call    MenuBorders_GetNumberOfMiddleCharactersToDX
    5454    jmp     SHORT DrawBottomBorderLine
    5555
     
    9595    CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
    9696
    97     call    GetNumberOfMiddleCharactersToDX
     97    call    MenuBorders_GetNumberOfMiddleCharactersToDX
    9898    jmp     SHORT RefreshItemBorders
    9999
    100100
    101101;--------------------------------------------------------------------
    102 ; GetNumberOfMiddleCharactersToDX
     102; MenuBorders_GetNumberOfMiddleCharactersToDX
    103103;   Parameters
    104104;       SS:BP:  Ptr to MENU
     
    109109;--------------------------------------------------------------------
    110110ALIGN JUMP_ALIGN
    111 GetNumberOfMiddleCharactersToDX:
     111MenuBorders_GetNumberOfMiddleCharactersToDX:
    112112    eMOVZX  dx, BYTE [bp+MENUINIT.bWidth]
    113113    sub     dx, BYTE MENU_HORIZONTAL_BORDER_LINES
     
    300300    pop     bx
    301301
    302     call    PrintMultipleBorderCharactersFromAL ; AL does not matter
     302    call    MenuBorders_PrintMultipleBorderCharactersFromAL ; AL does not matter
    303303
    304304    CALL_DISPLAY_LIBRARY PopDisplayContext
     
    326326    eSEG    cs
    327327    lodsb           ; Load from [si+BORDER_CHARS.cMiddle] to AL
    328     call    PrintMultipleBorderCharactersFromAL
     328    call    MenuBorders_PrintMultipleBorderCharactersFromAL
    329329
    330330    eSEG    cs
     
    334334;--------------------------------------------------------------------
    335335; MenuBorders_PrintSingleBorderCharacterFromAL
    336 ; PrintMultipleBorderCharactersFromAL
     336; MenuBorders_PrintMultipleBorderCharactersFromAL
    337337;   Parameters
    338338;       AL:     Character to print
    339 ;       DX:     Repeat count (PrintMultipleBorderCharactersFromAL)
     339;       DX:     Repeat count (MenuBorders_PrintMultipleBorderCharactersFromAL)
    340340;       SS:BP:  Ptr to MENU
    341341;   Returns:
     
    350350
    351351ALIGN JUMP_ALIGN
    352 PrintMultipleBorderCharactersFromAL:
     352MenuBorders_PrintMultipleBorderCharactersFromAL:
    353353    push    cx
    354354    mov     cx, dx
  • trunk/Assembly_Library/Src/Menu/MenuScrollbars.asm

    r52 r67  
    22; Project name  :   Assembly Library
    33; Created date  :   20.7.2010
    4 ; Last update   :   12.10.2010
     4; Last update   :   9.12.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Functions for drawing scroll bars over menu borders.
     
    1717;               Cleared if no scroll bars needed
    1818;   Corrupts registers:
    19 ;       CX
     19;       AX
    2020;--------------------------------------------------------------------
    2121ALIGN JUMP_ALIGN
    2222MenuScrollbars_AreScrollbarsNeeded:
     23    xchg    ax, cx
    2324    call    MenuScrollbars_GetMaxVisibleItemsOnPageToCX
    2425    cmp     cx, [bp+MENUINIT.wItems]        ; Set CF if max visible < total items
     26    xchg    cx, ax
    2527    ret
    2628
  • trunk/Assembly_Library/Src/Menu/MenuText.asm

    r54 r67  
    22; Project name  :   Assembly Library
    33; Created date  :   21.7.2010
    4 ; Last update   :   24.10.2010
     4; Last update   :   9.12.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Functions for drawing menu texts by the user.
     
    126126MenuText_RefreshItemFromAX:
    127127    push    cx
    128     mov     cx, ax                  ; Backup item to CX
    129 
     128    push    ax
     129
     130    xchg    cx, ax
    130131    call    MenuScrollbars_IsItemInCXonVisiblePage
    131132    jnc     SHORT .InvalidItem
    132133    call    MenuText_AdjustDisplayContextForDrawingItemFromCX
     134    call    ClearPreviousItem
    133135    call    MenuEvent_RefreshItemFromCX
    134     call    DrawScrollbarIfNecessary
     136    call    DrawScrollbarCharacterForItemInCXifNecessary
    135137.InvalidItem:
    136     xchg    ax, cx                  ; Restore AX
     138    pop     ax
    137139    pop     cx
    138140    ret
     
    181183
    182184;--------------------------------------------------------------------
     185; ClearPreviousItem
     186;   Parameters
     187;       SS:BP:  Ptr to MENU
     188;   Returns:
     189;       Nothing
     190;   Corrupts registers:
     191;       AX, BX, DX, DI
     192;--------------------------------------------------------------------
     193ALIGN JUMP_ALIGN
     194ClearPreviousItem:
     195    CALL_DISPLAY_LIBRARY GetSoftwareCoordinatesToAX
     196    xchg    bx, ax
     197
     198    call    MenuBorders_GetNumberOfMiddleCharactersToDX
     199    sub     dx, BYTE MENU_TEXT_COLUMN_OFFSET
     200    mov     al, [cs:g_rgbTextBorderCharacters+BORDER_CHARS.cMiddle]
     201    call    MenuBorders_PrintMultipleBorderCharactersFromAL
     202
     203    xchg    ax, bx
     204    CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
     205    ret
     206
     207
     208;--------------------------------------------------------------------
    183209; GetItemTextAttributeTypeToSIforItemInCX
    184210;   Parameters
     
    205231
    206232;--------------------------------------------------------------------
    207 ; DrawScrollbarIfNecessary
     233; DrawScrollbarCharacterForItemInCXifNecessary
    208234;   Parameters
    209235;       CX:     Item to refresh
     
    212238;       Nothing
    213239;   Corrupts registers:
    214 ;       AX, BX, DX, SI, DI
    215 ;--------------------------------------------------------------------
    216 ALIGN JUMP_ALIGN
    217 DrawScrollbarIfNecessary:
    218     push    cx
    219     call    .DrawSpacesBeforeScrollbarCharacter
     240;       AX, CX, BX, DX, SI, DI
     241;--------------------------------------------------------------------
     242ALIGN JUMP_ALIGN
     243DrawScrollbarCharacterForItemInCXifNecessary:
    220244    call    MenuScrollbars_AreScrollbarsNeeded
    221     pop     cx
    222245    jc      SHORT .DrawScrollbarCharacter
    223246    ret
    224247
    225 ;--------------------------------------------------------------------
    226 ; .DrawSpacesBeforeScrollbarCharacter
    227 ;   Parameters
    228 ;       CX:     Item to refresh
    229 ;       SS:BP:  Ptr to MENU
    230 ;   Returns:
    231 ;       Nothing
    232 ;   Corrupts registers:
    233 ;       AX, CX, DX, DI
    234 ;--------------------------------------------------------------------
    235 ALIGN JUMP_ALIGN
    236 .DrawSpacesBeforeScrollbarCharacter:
    237     CALL_DISPLAY_LIBRARY GetSoftwareCoordinatesToAX
    238     xchg    dx, ax                  ; Current coordinates to DX
    239     mov     ax, cx
    240     call    MenuLocation_GetScrollbarCoordinatesToAXforItemInAX
    241     sub     al, dl
    242     sub     al, MENU_TEXT_COLUMN_OFFSET/2
    243 
    244     eMOVZX  cx, al
    245     jcxz    .NoSpacesNeeded
    246     mov     al, ' '
    247     CALL_DISPLAY_LIBRARY PrintRepeatedCharacterFromALwithCountInCX
    248 ALIGN JUMP_ALIGN, ret
    249 .NoSpacesNeeded:
    250     ret
    251 
    252 ;--------------------------------------------------------------------
    253 ; .DrawScrollbarCharacter
    254 ;   Parameters
    255 ;       CX:     Item to refresh
    256 ;       SS:BP:  Ptr to MENU
    257 ;   Returns:
    258 ;       Nothing
    259 ;   Corrupts registers:
    260 ;       AX, BX, DX, SI, DI
    261 ;--------------------------------------------------------------------
    262248ALIGN JUMP_ALIGN
    263249.DrawScrollbarCharacter:
    264     push    cx
    265 
    266250    call    MenuBorders_AdjustDisplayContextForDrawingBorders
    267 
    268251    mov     ax, cx
    269252    call    MenuLocation_GetScrollbarCoordinatesToAXforItemInAX
     
    273256    sub     di, [bp+MENU.wFirstVisibleItem]     ; Item to line
    274257    call    MenuScrollbars_GetScrollCharacterToALForLineInDI
    275     CALL_DISPLAY_LIBRARY PrintCharacterFromAL
    276 
    277     pop     cx
    278     ret
     258    jmp     MenuBorders_PrintSingleBorderCharacterFromAL
Note: See TracChangeset for help on using the changeset viewer.