Changeset 505 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Menus


Ignore:
Timestamp:
Feb 25, 2013, 4:23:09 PM (12 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Reverted the changes to MenuEvents.inc done in r492 since they broke the F1 key function in XTIDECFG.
  • Added a tail-call optimized variant of the CALL_DISPLAY_LIBRARY macro (JMP_DISPLAY_LIBRARY).
  • Put a block size limit in AH1Eh_ChangeXTCFmodeBasedOnControlRegisterInAL. I think it's needed but if not, it's easy to remove.
  • Other optimizations and fixes.
Location:
trunk/XTIDE_Universal_BIOS/Src/Menus
Files:
3 edited

Legend:

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

    r492 r505  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1616; GNU General Public License for more details.
    17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html       
    18 ;       
     17; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     18;
    1919
    2020; Section containing code
     
    2424; Displays Boot Menu and returns Drive or Function number.
    2525;
    26 ; BootMenu_DisplayAndStoreSelection
     26; BootMenu_DisplayAndReturnDriveInDLRomBootClearCF
    2727;   Parameters:
    2828;       DS:     RAMVARS segment
     
    4141
    4242    xchg    cx, ax
    43        
     43
    4444    ; Clear Boot Menu from screen
    4545    mov     ax, ' ' | (MONO_NORMAL<<8)
     
    5252;   Parameters:
    5353;       CX:     Index of menuitem selected from Boot Menu
     54;       DS:     RAMVARS segment
    5455;   Returns:
    5556;       DX:     Drive number to be used for booting
    56 ;       DS:     RAMVARS segment
    5757;       CF:     Set: There is a selected menu item, DL is valid
    5858;               Clear: The item selected is Rom Boot, DL is not valid
    5959;   Corrupts registers:
    60 ;       AX, BX, DI
     60;       AX, BX
    6161;
    6262; NOTE: We can't use the menu structure in here, as we are falling through
    63 ; through from BootMenu_DisplayAndReturnDriveInDLRomBootClearCF when the
     63; from BootMenu_DisplayAndReturnDriveInDLRomBootClearCF when the
    6464; menu structure has already been destroyed.
    6565;--------------------------------------------------------------------
     
    7373    sub     dl, al                          ; Remove floppy drives from index
    7474    call    RamVars_GetHardDiskCountFromBDAtoAX
    75     or      al, 80h                         ; Or 80h into AL before the sub             
     75    or      al, 80h                         ; Or 80h into AL before the sub
    7676    cmp     dl, al                          ; Set CF if hard disk
    7777                                            ; Clear CF if last item, beyond hard disk list, which indicates ROM boot
  • trunk/XTIDE_Universal_BIOS/Src/Menus/DriveXlate.asm

    r493 r505  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    18 ;       
     18;
    1919
    2020; Section containing code
     
    4848%if HotkeyBar_FallThroughTo_DriveXlate_ConvertDriveLetterInDLtoDriveNumber <> DriveXlate_ConvertDriveLetterInDLtoDriveNumber
    4949    %error "DriveXlate_ConvertDriveLetterInDLtoDriveNumber must be at the top of DriveXlate.asm, and that file must immediately follow HotKeys.asm"
    50 %endif     
    5150%endif
    52        
     51%endif
     52
    5353;--------------------------------------------------------------------
    5454; DriveXlate_ConvertDriveNumberFromDLtoDriveLetter
     
    6464;--------------------------------------------------------------------
    6565DriveXlate_ConvertDriveNumberFromDLtoDriveLetter:
    66     test    dl, dl
    67     jns     SHORT .GetDefaultFloppyDrive
     66    xor     dl, 80h
     67    js      SHORT .GetDefaultFloppyDrive
    6868
    6969    ; Store default hard drive to boot from
    7070    call    DriveXlate_GetLetterForFirstHardDriveToAX
    71     sub     dl, 80h
    7271    add     dl, al
    7372    stc
     
    7574
    7675.GetDefaultFloppyDrive:
    77     add     dl, DEFAULT_FLOPPY_DRIVE_LETTER     ; Clears CF
     76    sub     dl, 80h - DEFAULT_FLOPPY_DRIVE_LETTER   ; Clears CF
    7877    ret
    7978
     
    9695    MAX_U   al, DEFAULT_HARD_DRIVE_LETTER
    9796    ret
    98                
     97
    9998
    10099;--------------------------------------------------------------------
     
    168167    mov     al, dl              ; Store floppy translation
    169168    SKIP2B  di
    170 .SetHardDriveToSwap:   
     169.SetHardDriveToSwap:
    171170    mov     ah, dl              ; Store HD translation
    172171    mov     WORD [RAMVARS.xlateVars+XLATEVARS.wFDandHDswap], ax
  • trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm

    r500 r505  
    3434    call    HotkeyBar_ScanHotkeysFromKeyBufferAndStoreToBootvars
    3535    ; Fall to HotkeyBar_DrawToTopOfScreen
    36        
    37        
     36
     37
    3838;--------------------------------------------------------------------
    3939; HotkeyBar_DrawToTopOfScreen
     
    127127    call    FormatFunctionHotkeyString
    128128%endif
    129     ; Fall to .PrintRomBootHotkey       
     129    ; Fall to .PrintRomBootHotkey
    130130
    131131;--------------------------------------------------------------------
     
    169169;--------------------------------------------------------------------
    170170HotkeyBar_ClearRestOfTopRow:
    171     CALL_DISPLAY_LIBRARY    GetColumnsToALandRowsToAH
     171    CALL_DISPLAY_LIBRARY GetColumnsToALandRowsToAH
    172172    eMOVZX  cx, al
    173     CALL_DISPLAY_LIBRARY    GetSoftwareCoordinatesToAX
     173    CALL_DISPLAY_LIBRARY GetSoftwareCoordinatesToAX
    174174    sub     cl, al
    175175    mov     al, ' '
    176     CALL_DISPLAY_LIBRARY    PrintRepeatedCharacterFromALwithCountInCX
    177     ret
     176    JMP_DISPLAY_LIBRARY PrintRepeatedCharacterFromALwithCountInCX
    178177
    179178
     
    216215
    217216    mov     si, ATTRIBUTE_CHARS.cHurryTimeout       ; Selected hotkey
    218     jz      SHORT GetDescriptionAttributeToDX       ; From compare with bScancode above
     217    je      SHORT GetDescriptionAttributeToDX       ; From compare with bScancode above
    219218
    220219GetNonSelectedHotkeyDescriptionAttributeToDX:
     
    226225    call    MenuAttribute_GetToAXfromTypeInSI
    227226    xchg    dx, ax                  ; DX = Description attribute
    228     ;;  fall through to PushHotkeyParamsAndFormat 
     227    ;;  fall through to PushHotkeyParamsAndFormat
    229228
    230229
     
    232231
    233232    mov     dx, (COLOR_ATTRIBUTE(COLOR_YELLOW, COLOR_CYAN) << 8) | MONO_REVERSE_BLINK
    234     jz      SHORT SelectAttributeFromDHorDLbasedOnVideoMode         ; From compare with bScancode above
     233    je      SHORT SelectAttributeFromDHorDLbasedOnVideoMode     ; From compare with bScancode above
    235234
    236235GetNonSelectedHotkeyDescriptionAttributeToDX:
     
    245244    mov     dl, dh
    246245.AttributeLoadedToDL:
    247     ;;  fall through to PushHotkeyParamsAndFormat       
     246    ;;  fall through to PushHotkeyParamsAndFormat
    248247
    249248%endif ; MODULE_BOOT_MENU
     
    277276    push    di              ; Description string
    278277    push    cx              ; Description string parameter
    279        
     278
    280279    push    si              ; Key attribute for last space
    281280
     
    308307;--------------------------------------------------------------------
    309308HotkeyBar_RestoreCursorCoordinatesFromAX:
    310     CALL_DISPLAY_LIBRARY    SetCursorCoordinatesFromAX
    311     ret
     309    JMP_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
    312310
    313311
     
    325323HotkeyBar_StoreHotkeyToBootvarsForDriveLetterInDL:
    326324    eMOVZX  ax, dl
    327     xor     al, 32  ; Upper case drive letter to lower case keystroke
     325    or      al, 32  ; Upper case drive letter to lower case keystroke
    328326    jmp     SHORT HotkeyBar_StoreHotkeyToBootvarsIfValidKeystrokeInAX
    329327
     
    364362    ; All scancodes are saved, even if it wasn't a drive letter,
    365363    ; which also covers our function key case.  Invalid function keys
    366     ; will not do anything (won't be printed, won't be accepted as input)       
     364    ; will not do anything (won't be printed, won't be accepted as input)
    367365    mov     [es:di], ah
    368        
     366
    369367    ; Drive letter hotkeys remaining, allow 'a' to 'z'
    370368    call    Char_IsLowerCaseLetterInAL
    371369    jnc     SHORT .KeystrokeIsNotValidDriveLetter
    372     xor     al, 32                  ; We want to print upper case letters
     370    and     al, ~32                 ; We want to print upper case letters
    373371
    374372    ; Clear HD First flag to assume Floppy Drive hotkey
     
    377375
    378376    ; Determine if Floppy or Hard Drive hotkey
    379     eMOVZX  cx, al                  ; Clear CH to clear scancode
     377    xchg    cx, ax
    380378    call    DriveXlate_GetLetterForFirstHardDriveToAX
    381379    cmp     cl, al
     
    386384
    387385.StoreDriveLetter:
    388     sbb     di, BYTE 1          ; Sub CF if Floppy Drive
     386    sbb     di, BYTE 1              ; Sub CF if Floppy Drive
    389387    xchg    ax, cx
    390     mov     [es:di], al         ; AH = zero to clear function hotkey
    391 
    392 .KeystrokeIsNotValidDriveLetter:       
     388    mov     [es:di], al
     389
     390.KeystrokeIsNotValidDriveLetter:
    393391NoHotkeyToProcess:
    394392    mov     al, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode]
     
    407405HotkeyBar_GetBootDriveNumbersToDX:
    408406    mov     dx, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wFddAndHddLetters]
    409     test    BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bFlags], FLG_HOTKEY_HD_FIRST       
     407    test    BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bFlags], FLG_HOTKEY_HD_FIRST
    410408    jnz     .noflip
    411409    xchg    dl, dh
    412 .noflip:   
     410.noflip:
    413411    call    DriveXlate_ConvertDriveLetterInDLtoDriveNumber
    414412    xchg    dl, dh
    415     ; Fall to HotkeyBar_FallThroughTo_DriveXlate_ConvertDriveLetterInDLtoDriveNumber       
    416        
    417 HotkeyBar_FallThroughTo_DriveXlate_ConvertDriveLetterInDLtoDriveNumber:     
    418 
     413    ; Fall to HotkeyBar_FallThroughTo_DriveXlate_ConvertDriveLetterInDLtoDriveNumber
     414
     415HotkeyBar_FallThroughTo_DriveXlate_ConvertDriveLetterInDLtoDriveNumber:
     416
Note: See TracChangeset for help on using the changeset viewer.