Changeset 45 in xtideuniversalbios for trunk/Assembly_Library/Src/Menu/MenuTime.asm


Ignore:
Timestamp:
Sep 29, 2010, 5:59:07 PM (14 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to assembly library:
Changed SetCharOutputFunctionFromAXwithAttribFlagInDL to SetCharOutputFunctionFromAXwithAttribFlagInBL since DX register gets corrupted by Display_FunctionFromDI.
Implemented quicksort.

File:
1 edited

Legend:

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

    r44 r45  
    22; Project name  :   Assembly Library
    33; Created date  :   25.7.2010
    4 ; Last update   :   27.9.2010
     4; Last update   :   28.9.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Menu timeouts other time related functions.
     
    5656ALIGN JUMP_ALIGN
    5757MenuTime_UpdateSelectionTimeout:
    58     cmp     WORD [bp+MENUINIT.wTimeoutTicks], BYTE 0
    59     je      SHORT .ReturnSinceTimeoutDisabled   ; CF cleared
    6058    push    ds
    6159
    62     call    GetSecondsUntilTimeoutToAXandPtrToTimeoutCounterToDSBX
    63     cmp     al, [bp+MENU.bLastSecondPrinted]
    64     je      SHORT .SetCFifTimeoutAndReturn
    65     mov     [bp+MENU.bLastSecondPrinted], al
    66     call    DrawTimeoutInAXoverMenuBorders
     60    call    MenuTime_DrawWithoutUpdating
     61    jnc     SHORT .TimeoutDisabled
     62    call    PointDSBXtoTimeoutCounter
     63    call    TimerTicks_SetCarryIfTimeoutFromDSBX
    6764
    6865ALIGN JUMP_ALIGN
    69 .SetCFifTimeoutAndReturn:
    70     call    TimerTicks_SetCarryIfTimeoutFromDSBX
     66.TimeoutDisabled:
    7167    pop     ds
    72 .ReturnSinceTimeoutDisabled:
    7368    ret
    74 
    7569
    7670;--------------------------------------------------------------------
     
    7973;       SS:BP:  Ptr to MENU
    8074;   Returns:
    81 ;       Nothing
     75;       CF:     Set if timeout enabled
     76;               Cleared if timeout disabled
    8277;   Corrupts registers:
    8378;       AX, BX, CX, DX, SI, DI
     
    8681MenuTime_DrawWithoutUpdating:
    8782    cmp     WORD [bp+MENUINIT.wTimeoutTicks], BYTE 0
    88     je      SHORT .ReturnSinceTimeoutDisabled
     83    je      SHORT .ReturnSinceTimeoutDisabled   ; Clear CF
    8984
    9085    push    ds
    91     call    GetSecondsUntilTimeoutToAXandPtrToTimeoutCounterToDSBX
     86    call    GetSecondsLeftUntilTimeoutToAXandCounterToDSBX
    9287    call    DrawTimeoutInAXoverMenuBorders
    9388    pop     ds
     89    stc
     90ALIGN JUMP_ALIGN, ret
    9491.ReturnSinceTimeoutDisabled:
    9592    ret
     93
     94
     95;--------------------------------------------------------------------
     96; GetSecondsLeftUntilTimeoutToAXandCounterToDSBX
     97;   Parameters
     98;       SS:BP:  Ptr to MENU
     99;   Returns:
     100;       AX:     Seconds until timeout
     101;       DS:BX:  Ptr to timeout counter
     102;   Corrupts registers:
     103;       AX, CX, DX
     104;--------------------------------------------------------------------
     105ALIGN JUMP_ALIGN
     106GetSecondsLeftUntilTimeoutToAXandCounterToDSBX:
     107    call    PointDSBXtoTimeoutCounter
     108    call    TimerTicks_GetElapsedToAXfromDSBX
     109    neg     ax          ; Negate since DS:BX points to end time
     110    MAX_S   ax, 0       ; Set to zero if overflow
     111    xchg    dx, ax
     112    jmp     TimerTicks_GetSecondsToAXfromTicksInDX
    96113
    97114
     
    111128    lea     bx, [bp+MENU.wTimeoutCounter]
    112129    ret
    113 
    114 
    115 ;--------------------------------------------------------------------
    116 ; GetSecondsUntilTimeoutToAXandPtrToTimeoutCounterToDSBX
    117 ;   Parameters
    118 ;       SS:BP:  Ptr to MENU
    119 ;   Returns:
    120 ;       AX:     Seconds until timeout
    121 ;       DS:BX:  Ptr to timeout counter
    122 ;   Corrupts registers:
    123 ;       AX, CX, DX
    124 ;--------------------------------------------------------------------
    125 ALIGN JUMP_ALIGN
    126 GetSecondsUntilTimeoutToAXandPtrToTimeoutCounterToDSBX:
    127     call    PointDSBXtoTimeoutCounter
    128     call    TimerTicks_GetElapsedToAXfromDSBX
    129     neg     ax          ; Negate since DS:BX points to end time
    130     MAX_S   ax, 0       ; Set to zero if overflow
    131     xchg    dx, ax
    132     jmp     TimerTicks_GetSecondsToAXfromTicksInDX
    133130
    134131
     
    173170    pop     bp
    174171
     172    ; Draw right border with normal border color
    175173    mov     al, DOUBLE_RIGHT_HORIZONTAL_TO_SINGLE_VERTICAL
    176174    jmp     MenuBorders_PrintSingleBorderCharacterFromAL
     
    178176    db      DOUBLE_BOTTOM_LEFT_CORNER
    179177    db      DOUBLE_LEFT_HORIZONTAL_TO_SINGLE_VERTICAL
    180     db      "%AAutoselection in %2-ds",NULL
     178    db      "%AAutoselection in %2-us",NULL
    181179
    182180;--------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.