Ignore:
Timestamp:
Mar 22, 2013, 5:43:54 PM (8 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Swapping Floppy and Hard Drives at the same time work again (broke in r492).
  • Hotkeys again work in boot menu (broke in r492).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuEvent.asm

    r526 r528  
    6969MENUEVENT_ExitMenu equ  (BootMenuEvent_Completed - FirstEvent)
    7070MENUEVENT_ItemHighlightedFromCX equ (EventItemHighlightedFromCX - FirstEvent)
     71MENUEVENT_KeyStrokeInAX equ (EventKeyStrokeInAX - FirstEvent)
    7172MENUEVENT_ItemSelectedFromCX equ (EventItemSelectedFromCX - FirstEvent)
    7273MENUEVENT_RefreshTitle equ (BootMenuPrint_TitleStrings - FirstEvent)
     
    9495    dw      EventNotHandled                     ; MENUEVENT.IdleProcessing
    9596    dw      EventItemHighlightedFromCX          ; MENUEVENT.ItemHighlightedFromCX
     97   
    9698    dw      EventItemSelectedFromCX             ; MENUEVENT.ItemSelectedFromCX
    9799    dw      EventKeyStrokeInAX                  ; MENUEVENT.KeyStrokeInAX
     
    161163EventItemHighlightedFromCX:
    162164    push    cx
     165
     166    ; Drive number translations and hotkeys must be reset to defaults so highlighted
     167    ; selections are correctly displayed on Hotkey Bar and on Boot Menu
     168%ifdef MODULE_HOTKEYS
     169    call    BootVars_StoreDefaultDriveLettersToHotkeyVars
     170%endif
     171    call    DriveXlate_Reset
     172
     173    ; Set highlighted item to be drive to boot from for visual purposes only
    163174    call    BootMenu_GetDriveToDXforMenuitemInCX
    164     jnc     .noDriveSwap
     175    jnc     SHORT .noDriveSwapSinceRomBootSelected
    165176    call    DriveXlate_SetDriveToSwap
    166 .noDriveSwap:
     177
     178%ifdef MODULE_HOTKEYS
     179    ; Store highlighted drive as hotkey
     180    call    HotkeyBar_StoreHotkeyToBootvarsForDriveNumberInDL
     181    jmp     SHORT .UpdateHotkeyBar
     182.noDriveSwapSinceRomBootSelected:
     183    mov     ah, ROM_BOOT_HOTKEY_SCANCODE
     184    call    HotkeyBar_StoreHotkeyToBootvarsIfValidKeystrokeInAX
     185
     186.UpdateHotkeyBar:
     187    ; Redraw Hotkey Bar for updated boot drive letters
     188    mov     al, MONO_NORMAL
     189    CALL_DISPLAY_LIBRARY    SetCharacterAttributeFromAL
     190
     191    mov     bl, ATTRIBUTES_ARE_USED
     192    mov     ax, TELETYPE_OUTPUT_WITH_ATTRIBUTE
     193    CALL_DISPLAY_LIBRARY    SetCharOutputFunctionFromAXwithAttribFlagInBL
     194    call    HotkeyBar_DrawToTopOfScreen
     195%else
     196.noDriveSwapSinceRomBootSelected:
     197%endif ; MODULE_HOTKEYS
    167198
    168199    ; Redraw changes in drive numbers
     
    181212
    182213;--------------------------------------------------------------------
     214; EventKeyStrokeInAX
     215;   Parameters
     216;       AL:     ASCII character for the key
     217;       AH:     Keyboard library scan code for the key
     218;       DS:     Ptr to RAMVARS
     219;       ES:     Ptr to BDA (zero)
     220;       SS:BP:  Menu library handle
     221;   Returns:
     222;       CF:     Set if event processed
     223;               Cleared if event not processed
     224;   Corrupts registers:
     225;       Does not matter
     226;--------------------------------------------------------------------
     227%ifdef MODULE_HOTKEYS
     228EventKeyStrokeInAX:
     229    ; Keypress will be the primary boot drive
     230    cmp     ah, BOOT_MENU_HOTKEY_SCANCODE
     231    je      SHORT BootMenuEvent_Completed   ; Ignore Boot Menu hotkey
     232    call    HotkeyBar_StoreHotkeyToBootvarsIfValidKeystrokeInAX
     233    jnc     SHORT BootMenuEvent_Completed
     234    ; Fall to CloseBootMenu through EventItemSelectedFromCX
     235%endif
     236
     237
     238;--------------------------------------------------------------------
    183239; EventItemSelectedFromCX
    184240;   Parameters
     
    223279BootMenuEvent_Completed:
    224280    stc
    225     ret
     281%ifndef MODULE_HOTKEYS
     282EventKeyStrokeInAX:
     283%endif
     284    ret
Note: See TracChangeset for help on using the changeset viewer.