Changeset 600 in xtideuniversalbios for trunk


Ignore:
Timestamp:
Jul 22, 2018, 6:12:12 AM (6 years ago)
Author:
Tomi Tilli
Message:

Hotkeybar timer tick handler now keeps interrupts disabled and updates on every fourth call.

Location:
trunk/XTIDE_Universal_BIOS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc

    r599 r600  
    5858; Bit defines for HOTKEYVARS.bFlags
    5959FLG_HOTKEY_HD_FIRST         EQU     (1<<0)  ; First try to boot from HDD, then FDD
    60 FLG_HOTKEY_UPDATING         EQU     (1<<1)  ; Hotkeybar update in progress
    6160
    6261%endif ; MODULE_HOTKEYS
  • trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm

    r599 r600  
    4747    push    ax
    4848%endif
    49     sti         ; Enable interrupts (is this really necessary? Do we lose key inputs if we keep interrupts disabled?)
    50                 ; There would be no need for FLG_HOTKEY_UPDATING if we can keep interrupts disabled during whole update.
     49
     50    ;!!! Keep interrupts disabled so there won't be another
     51    ; timer tick call before we are ready
    5152
    5253    LOAD_BDA_SEGMENT_TO es, ax
     
    5758    call far [es:BOOTVARS.hotkeyVars+HOTKEYVARS.fpPrevTimerHandler]
    5859
    59     ; Do not start updating if update is already in progress (do we need this on AT systems?)
    60     test    BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bFlags], FLG_HOTKEY_UPDATING
     60    ; Update Hotkeybar (process key input and draw) every fourth tick
     61    test    BYTE [es:BDA.dwTimerTicks], 11b
    6162    jnz     SHORT .ReturnFromHandler
    62 
    63     ; Update Hotkeybar (process key input and draw)
    64 %ifndef USE_AT  ; Ease XT systems a bit by updating every other timer tick
    65     call    TimerTicks_ReadFromBdaToAX
    66     shr     ax, 1
    67     jnc     SHORT .ReturnFromHandler
    68 %endif
    69     or      BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bFlags], FLG_HOTKEY_UPDATING
    7063    call    UpdateDuringDriveDetection
    71     and     BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bFlags], ~FLG_HOTKEY_UPDATING
    7264
    7365.ReturnFromHandler:
     
    150142    ; Clear CH if floppy drive is selected for boot
    151143    mov     ch, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bFlags]
    152     and     ch, FLG_HOTKEY_HD_FIRST
     144    ;and        ch, FLG_HOTKEY_HD_FIRST; Not needed until more flags added
    153145    call    FormatDriveHotkeyString
    154146
     
    169161    mov     ah, ANGLE_QUOTE_RIGHT
    170162    mov     cx, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wHddLetterAndFlags]  ; Letter to CL, flags to CH
    171     and     ch, FLG_HOTKEY_HD_FIRST
     163    ;and        ch, FLG_HOTKEY_HD_FIRST ; Not needed until more flags added
    172164    xor     ch, FLG_HOTKEY_HD_FIRST     ; Clear CH if HD is selected for boot, set otherwise
    173165    mov     di, g_szHDD
     
    573565HotkeyBar_GetBootDriveNumbersToDX:
    574566    mov     dx, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wFddAndHddLetters]
     567
     568    ; HotkeyBar_GetBootDriveNumbersToDX is called when all drives are detected and
     569    ; drive letters are known.
     570    ; Replace unavailable hard drive letter with first hard drive.
     571    ; If we have boot menu, it will be displayed instead.
     572%ifndef MODULE_BOOT_MENU
     573    call    BootVars_GetLetterForFirstHardDriveToAX
     574    mov     ah, al
     575    add     al, [es:BDA.bHDCount]   ; AL now contains first unavailable HD letter
     576    cmp     dh, al                  ; Unavailable drive?
     577    jb      SHORT .ValidHardDriveLetterInDH
     578    mov     dh, ah                  ; Replace unavailable drive with first drive
     579.ValidHardDriveLetterInDH:
     580%endif
     581
    575582    test    BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bFlags], FLG_HOTKEY_HD_FIRST
    576     jnz     .noflip
     583    jnz     SHORT .noflip
    577584    xchg    dl, dh
    578585.noflip:
Note: See TracChangeset for help on using the changeset viewer.