Changeset 60 in xtideuniversalbios for trunk/Assembly_Library/Src/Menu/MenuBorders.asm


Ignore:
Timestamp:
Nov 25, 2010, 2:17:45 PM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to Assembly Library:

  • Timeout count down is now stopped when any key pressed.
File:
1 edited

Legend:

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

    r52 r60  
    22; Project name  :   Assembly Library
    33; Created date  :   14.7.2010
    4 ; Last update   :   11.10.2010
     4; Last update   :   25.11.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Functions for drawing menu borders.
     
    3434    call    RefreshInformationBorders
    3535    call    DrawBottomBorderLine
    36     call    DrawBottomShadowLine
    37     jmp     MenuTime_DrawWithoutUpdating
     36    call    DrawTimeoutCounterOverBottomBorderLine
     37    jmp     DrawBottomShadowLine
     38
     39
     40;--------------------------------------------------------------------
     41; MenuBorders_RedrawBottomBorderLine
     42;   Parameters
     43;       SS:BP:  Ptr to MENU
     44;   Returns:
     45;       Nothing
     46;   Corrupts registers:
     47;       AX, BX, DX, SI, DI
     48;--------------------------------------------------------------------
     49ALIGN JUMP_ALIGN
     50MenuBorders_RedrawBottomBorderLine:
     51    call    MenuBorders_AdjustDisplayContextForDrawingBorders
     52    call    MenuLocation_GetBottomBordersTopLeftCoordinatesToAX
     53    CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
     54    call    GetNumberOfMiddleCharactersToDX
     55    jmp     DrawBottomBorderLine
     56
     57
     58;--------------------------------------------------------------------
     59; MenuBorders_RedrawTimeoutValue
     60;   Parameters
     61;       SS:BP:  Ptr to MENU
     62;   Returns:
     63;       Nothing
     64;   Corrupts registers:
     65;       AX, BX, SI, DI
     66;--------------------------------------------------------------------
     67ALIGN JUMP_ALIGN
     68MenuBorders_RedrawTimeoutValue:
     69    call    MenuBorders_AdjustDisplayContextForDrawingBorders
     70    call    MenuLocation_GetBottomBordersTopLeftCoordinatesToAX
     71    inc     ah      ; Increment for shadow border
     72    CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
     73    jmp     DrawTimeoutCounterOverBottomBorderLine
    3874
    3975
     
    174210; DrawSeparationBorderLine
    175211; DrawBottomBorderLine
     212; DrawTimeoutCounterOverBottomBorderLine
    176213; DrawBottomShadowLine
    177214; DrawTextBorderLine
     
    201238
    202239ALIGN JUMP_ALIGN
     240DrawTimeoutCounterOverBottomBorderLine:
     241    test    BYTE [bp+MENU.bFlags], FLG_MENU_TIMEOUT_COUNTDOWN
     242    jz      SHORT .NoNeedToDrawSinceTimeoutDisabled
     243    mov     ax, (-1)<<8 ; Decrement row
     244    call    MenuLocation_MoveCursorByALcolumnsAndAHrows
     245    call    MenuTime_GetTimeoutSecondsLeftToAX
     246    call    PrintTimeoutStringWithSecondsInAX
     247    jmp     SHORT PrintNewlineToEndBorderLine
     248.NoNeedToDrawSinceTimeoutDisabled:
     249    ret
     250
     251ALIGN JUMP_ALIGN
    203252DrawBottomShadowLine:
    204     CALL_DISPLAY_LIBRARY GetSoftwareCoordinatesToAX
    205     inc     ax          ; Increment column
    206     CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
     253    mov     ax, 1       ; Increment column
     254    call    MenuLocation_MoveCursorByALcolumnsAndAHrows
    207255    inc     dx          ; Increment repeat count...
    208256    inc     dx          ; ...for both corner characters
     
    333381
    334382
     383;--------------------------------------------------------------------
     384; PrintTimeoutStringWithSecondsInAX
     385;   Parameters
     386;       AX:     Seconds to print
     387;       SS:BP:  Ptr to MENU
     388;   Returns:
     389;       Nothing
     390;   Corrupts registers:
     391;       AX, SI, DI
     392;--------------------------------------------------------------------
     393ALIGN JUMP_ALIGN
     394PrintTimeoutStringWithSecondsInAX:
     395    push    bp
     396
     397    xchg    di, ax
     398    mov     bp, sp
     399    call    .GetTimeoutAttributeToAXfromSecondsInDI
     400    mov     si, .szSelectionTimeout
     401    push    ax          ; Push attribute
     402    push    di          ; Push seconds
     403    CALL_DISPLAY_LIBRARY FormatNullTerminatedStringFromCSSI
     404    pop     bp
     405
     406    ; Draw right border with normal border color
     407    mov     al, DOUBLE_RIGHT_HORIZONTAL_TO_SINGLE_VERTICAL
     408    jmp     MenuBorders_PrintSingleBorderCharacterFromAL
     409.szSelectionTimeout:
     410    db      DOUBLE_BOTTOM_LEFT_CORNER
     411    db      DOUBLE_LEFT_HORIZONTAL_TO_SINGLE_VERTICAL
     412    db      "%AAutoselection in %2u s",NULL
     413
     414;--------------------------------------------------------------------
     415; .GetTimeoutAttributeToAXfromSecondsInDI
     416;   Parameters
     417;       DI:     Seconds to print
     418;   Returns:
     419;       AX:     Attribute byte for seconds
     420;   Corrupts registers:
     421;       SI
     422;--------------------------------------------------------------------
     423ALIGN JUMP_ALIGN
     424.GetTimeoutAttributeToAXfromSecondsInDI:
     425    mov     si, ATTRIBUTE_CHARS.cNormalTimeout
     426    cmp     di, BYTE 3
     427    eCMOVB  si, ATTRIBUTE_CHARS.cHurryTimeout
     428    jmp     MenuAttribute_GetToAXfromTypeInSI
     429
    335430
    336431; Lookup tables for border characters
Note: See TracChangeset for help on using the changeset viewer.