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


Ignore:
Timestamp:
Nov 30, 2010, 8:06:44 AM (14 years ago)
Author:
Tomi Tilli
google:author:
aitotat
Message:

Changes to Assembly Library:

  • Small improvements to timeout counter drawing.
Location:
trunk/Assembly_Library/Src/Menu
Files:
2 edited

Legend:

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

    r60 r62  
    22; Project name  :   Assembly Library
    33; Created date  :   14.7.2010
    4 ; Last update   :   25.11.2010
     4; Last update   :   30.11.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Functions for drawing menu borders.
     
    3434    call    RefreshInformationBorders
    3535    call    DrawBottomBorderLine
    36     call    DrawTimeoutCounterOverBottomBorderLine
    3736    jmp     DrawBottomShadowLine
    3837
     
    5352    CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
    5453    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 ;--------------------------------------------------------------------
    67 ALIGN JUMP_ALIGN
    68 MenuBorders_RedrawTimeoutValue:
    69     call    MenuBorders_AdjustDisplayContextForDrawingBorders
    70     call    MenuLocation_GetBottomBordersTopLeftCoordinatesToAX
    71     inc     ah      ; Increment for shadow border
    72     CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
    73     jmp     DrawTimeoutCounterOverBottomBorderLine
     54    jmp     SHORT DrawBottomBorderLine
    7455
    7556
     
    235216DrawBottomBorderLine:
    236217    mov     si, g_rgbBottomBorderCharacters
    237     jmp     SHORT PrintBorderCharactersFromCSSIandShadowCharacter
    238 
    239 ALIGN JUMP_ALIGN
    240 DrawTimeoutCounterOverBottomBorderLine:
    241218    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:
     219    jz      SHORT PrintBorderCharactersFromCSSIandShadowCharacter
     220
     221    call    DrawTimeoutCounterString
     222    sub     dx, BYTE MENU_TIMEOUT_STRING_CHARACTERS
     223    mov     si, g_BottomBorderWithTimeoutCharacters
     224    call    PrintBorderCharactersFromCSSIandShadowCharacter
     225    add     dx, BYTE MENU_TIMEOUT_STRING_CHARACTERS
    249226    ret
    250227
     
    382359
    383360;--------------------------------------------------------------------
    384 ; PrintTimeoutStringWithSecondsInAX
     361; DrawTimeoutCounterString
     362;   Parameters
     363;       SS:BP:  Ptr to MENU
     364;   Returns:
     365;       Nothing
     366;   Corrupts registers:
     367;       AX, SI, DI
     368;--------------------------------------------------------------------
     369ALIGN JUMP_ALIGN
     370DrawTimeoutCounterString:
     371    call    MenuTime_GetTimeoutSecondsLeftToAX
     372    ; Fall to .PrintTimeoutStringWithSecondsInAX
     373
     374;--------------------------------------------------------------------
     375; .PrintTimeoutStringWithSecondsInAX
    385376;   Parameters
    386377;       AX:     Seconds to print
     
    391382;       AX, SI, DI
    392383;--------------------------------------------------------------------
    393 ALIGN JUMP_ALIGN
    394 PrintTimeoutStringWithSecondsInAX:
     384;ALIGN JUMP_ALIGN
     385.PrintTimeoutStringWithSecondsInAX:
    395386    push    bp
    396387
     
    403394    CALL_DISPLAY_LIBRARY FormatNullTerminatedStringFromCSSI
    404395    pop     bp
    405 
    406     ; Draw right border with normal border color
    407     mov     al, DOUBLE_RIGHT_HORIZONTAL_TO_SINGLE_VERTICAL
    408     jmp     MenuBorders_PrintSingleBorderCharacterFromAL
     396    ret
    409397.szSelectionTimeout:
    410398    db      DOUBLE_BOTTOM_LEFT_CORNER
     
    424412.GetTimeoutAttributeToAXfromSecondsInDI:
    425413    mov     si, ATTRIBUTE_CHARS.cNormalTimeout
    426     cmp     di, BYTE 3
     414    cmp     di, BYTE MENU_TIMEOUT_SECONDS_FOR_HURRY
    427415    eCMOVB  si, ATTRIBUTE_CHARS.cHurryTimeout
    428416    jmp     MenuAttribute_GetToAXfromTypeInSI
     
    451439iend
    452440
     441g_BottomBorderWithTimeoutCharacters:
     442istruc BORDER_CHARS
     443    at  BORDER_CHARS.cLeft,     db  DOUBLE_RIGHT_HORIZONTAL_TO_SINGLE_VERTICAL
     444    at  BORDER_CHARS.cMiddle,   db  DOUBLE_HORIZONTAL
     445    at  BORDER_CHARS.cRight,    db  DOUBLE_BOTTOM_RIGHT_CORNER
     446iend
     447
    453448g_rgbTextBorderCharacters:
    454449istruc BORDER_CHARS
  • trunk/Assembly_Library/Src/Menu/MenuTime.asm

    r60 r62  
    22; Project name  :   Assembly Library
    33; Created date  :   25.7.2010
    4 ; Last update   :   25.11.2010
     4; Last update   :   30.11.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Menu timeouts other time related functions.
     
    7575ALIGN JUMP_ALIGN
    7676.RedrawSinceNoTimeout:
    77     call    MenuBorders_RedrawTimeoutValue
     77    call    MenuBorders_RedrawBottomBorderLine
    7878    clc
    7979ALIGN JUMP_ALIGN
     
    100100    call    PointDSBXtoTimeoutCounter
    101101    call    TimerTicks_GetTimeoutTicksLeftToAXfromDSBX
    102     jc      SHORT .TimeoutHasOccurred
     102    jc      SHORT .TimeoutHasOccurredSoMakeSureTicksAreNotBelowZero
    103103
    104104    xchg    dx, ax
    105105    call    TimerTicks_GetSecondsToAXfromTicksInDX
    106     clc
    107106    jmp     SHORT .PopRegistersAndReturn
    108 .TimeoutHasOccurred:
     107.TimeoutHasOccurredSoMakeSureTicksAreNotBelowZero:
    109108    xor     ax, ax
    110     stc
    111109.PopRegistersAndReturn:
    112110    pop     bx
Note: See TracChangeset for help on using the changeset viewer.