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


Ignore:
Timestamp:
Jun 25, 2018, 10:29:27 PM (6 years ago)
Author:
Krister Nordvall
Message:

Changes:

  • The problem with NASM in the previous revision (r591) has been fixed.
  • The colors used by the boot menu and hotkey bar can now be customized by selecting one of a number of pre-defined color themes. Suggestions for additional themes are more than welcome!
  • Large builds are now 10 KB. Small builds are still 8 KB with the exception of the Tiny build which is now 4 KB. In other words, builds are now as small as possible to make it easier to combine them with other BIOSes.
  • Added code to the library to improve drive error handling. XTIDECFG can now handle "Drive Not Ready" errors.
  • Fixed a couple of potential bugs in AtaID.asm (AtaID_GetMaxPioModeToAXandMinCycleTimeToCX); 1) ATA1.bPioMode was treated as a WORD variable. 2) ATA2.bPIOSupp was assumed to be non-zero which would result in PIO mode 3 being returned if the assumption was wrong.
  • Made the same changes in the equivalent function used by BIOSDRVS (DisplayPioModeInformationUsingAtaInfoFromDSBX in AtaInfo.asm).
  • Fixed a bug from r587 in PDC20x30.asm in PDC20x30_GetMaxPioModeToALandMinPioCycleTimeToBX.
  • Fixed a bug from r523 in XTIDECFG where Auto Configure would only set the IRQ on one IDE interface on AT-builds.
  • XTIDECFG will now restore the default settings for the "Serial port virtual device" when reselecting it in the list of device types. This makes it behave consistently for all device types.
  • The eAAM macro is now used regardless if USE_UNDOC_INTEL is defined or not because it is apparently supported on all processors including the NEC V20/V30 CPUs.
  • Renamed the EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS define to EXCLUDE_FROM_XUB.
  • Added a define to exclude unused library code from BIOSDRVS (EXCLUDE_FROM_BIOSDRVS). This makes it a lot smaller than in previous revisions.
  • All unnecessary CLD-instructions are now under a new define 'CLD_NEEDED' which is only enabled for the BIOS. It is disabled for XTIDECFG and BIOSDRVS but can be enabled if needed by adding this define to the respective makefile. This change was made because these unnecessary instructions are wasteful and should never be needed. In fact, they only serve to hide bugs (in other peoples code) which I strongly believe should be avoided. I recommend people making their own BIOSes from source to not use this define as it's extremely unlikely to be needed.
  • Updated the copyright info in SerDrive and changed an URL to point to the new site.
  • Updated the copyright info and version number in BIOSDRVS.
  • Updated the copyright info in XTIDECFG.
  • Optimizations in general.
Location:
trunk/Assembly_Library/Src/Menu
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm

    r589 r592  
    249249ALIGN JUMP_ALIGN
    250250AppendFileFromDTAinDSSItoOffScreenBuffer:
    251     call    .FilterCurrentDirectory         ; We never want "."
    252     call    .FilterUpDirectoryWhenInRoot    ; No ".." when in root directory
     251    cmp     WORD [si+DTA.szFile], CURRENTDIR_CHARACTERS
     252    je      SHORT .Return                   ; We never want "."
     253    test    dl, dl
     254    jnz     SHORT .NotInRootDirectory
     255    cmp     WORD [si+DTA.szFile], UPDIR_CHARACTERS
     256    je      SHORT .Return                   ; No ".." when in root directory
     257.NotInRootDirectory:
    253258    inc     cx                              ; Nothing filtered so increment files/directories
    254259
     
    262267    pop     si
    263268    pop     bp
    264     ret
    265 
    266 ;--------------------------------------------------------------------
    267 ; .FilterCurrentDirectory
    268 ; .FilterUpDirectoryWhenInRoot
    269 ;   Parameters:
    270 ;       DL:     Zero if root directory selected
    271 ;       DS:SI:  Ptr to DTA containing file information
    272 ;   Returns:
    273 ;       Nothing
    274 ;       Returns from AppendFileToBufferInESDIfromDtaInDSSI when filtering
    275 ;   Corrupts registers:
    276 ;       AX
    277 ;--------------------------------------------------------------------
    278 ALIGN JUMP_ALIGN
    279 .FilterCurrentDirectory:
    280     cmp     WORD [si+DTA.szFile], CURRENTDIR_CHARACTERS
    281     je      SHORT .DoFilter
    282     ret
    283 
    284 ALIGN JUMP_ALIGN
    285 .FilterUpDirectoryWhenInRoot:
    286     test    dl, dl          ; Set ZF if root directory selected
    287     jnz     SHORT .ReturnWithoutFiltering
    288     cmp     WORD [si+DTA.szFile], UPDIR_CHARACTERS
    289     jne     SHORT .ReturnWithoutFiltering
    290 .DoFilter:
    291     add     sp, BYTE 2      ; Remove return address from stack
    292 ALIGN JUMP_ALIGN, ret
    293 .ReturnWithoutFiltering:
     269.Return:
    294270    ret
    295271
     
    473449ALIGN JUMP_ALIGN
    474450GetInfoLinesToCXandDialogFlagsToAX:
    475     xor     ax, ax
    476     call    GetDialogFlagsToAL
    477     jmp     Bit_GetSetCountToCXfromAX
     451    ePUSH_T ax, Bit_GetSetCountToCXfromAX
     452    xor     ah, ah
     453    ; Fall to GetDialogFlagsToAL
    478454
    479455;--------------------------------------------------------------------
     
    696672    call    .ChangeDriveToUserSelectionFromIoInDSSI
    697673    add     sp, BYTE DRIVE_DIALOG_IO_size
     674.UserCancelledDriveChange:
    698675    ret
    699676
     
    729706    jne     SHORT .UserCancelledDriveChange
    730707
     708    ; Install our Custom Critical Error Handler to catch "Drive Not Ready" errors. This handler only works on DOS 3.0+ systems
     709    ; but that should be OK because only DOS 3.1+ will trigger it. Under older DOS versions drives are enumerated using
     710    ; GET_DOS_DRIVE_PARAMETER_BLOCK_FOR_SPECIFIC_DRIVE which will access the drive so we know it is available at this point.
     711    mov     dx, DosCritical_CustomHandler
     712    call    DosCritical_InstallNewHandlerFromCSDX
     713
     714    ; Save the current drive on stack in case the selected drive is not ready and the user decides to cancel the change.
     715    call    Drive_GetDefaultToAL
     716    xchg    dx, ax
     717
     718.RetryDrive:
     719    push    dx                                  ; Save the previous current drive to stack
     720
    731721    mov     dl, [si+DRIVE_DIALOG_IO.bReturnDriveNumber]
    732722    call    Drive_SetDefaultFromDL
     723
     724    ; Now we must try to force a media access to catch "Drive Not Ready".
     725    push    ds
     726    push    ss
     727    pop     ds
     728    ePUSH_T ax, CURRENTDIR_CHARACTERS
     729    mov     cx, FLG_FILEATTR_DIRECTORY
     730    mov     dx, sp
     731    mov     ax, FIND_FIRST_MATCHING_FILE<<8
     732    int     DOS_INTERRUPT_21h
     733    pop     ax
     734    pop     ds
     735
     736    pop     dx                                  ; Restore the previous current drive from stack
     737
     738    xchg    ah, [cs:bLastCriticalError]         ; Zero bLastCriticalError and fetch error code to AH
     739    cmp     ah, ERR_DOS_DRIVE_NOT_READY
     740    jne     SHORT .DriveIsReady
     741
     742    mov     bx, g_szDlgDriveNotReady
     743    call    Dialogs_DisplayYesNoResponseDialogWithTitleStringInBX
     744    jz      SHORT .RetryDrive
     745    ; The user cancelled the drive change. Restore current drive to what it was previously.
     746    call    Drive_SetDefaultFromDL
     747    jmp     DosCritical_RestoreDosHandler
     748
     749.DriveIsReady:
     750    call    DosCritical_RestoreDosHandler
    733751    jmp     RefreshFilesToDisplay
    734 .UserCancelledDriveChange:
    735     ret
    736752
    737753
  • trunk/Assembly_Library/Src/Menu/MenuAttributes.asm

    r526 r592  
    9191
    9292.rgcColorAttributes:
     93; Classic (default theme)
    9394istruc ATTRIBUTE_CHARS
    9495    at  ATTRIBUTE_CHARS.cBordersAndBackground,  db  COLOR_ATTRIBUTE(COLOR_YELLOW, COLOR_BLUE)
     
    100101    at  ATTRIBUTE_CHARS.cNormalTimeout,         db  COLOR_ATTRIBUTE(COLOR_GREEN, COLOR_BLUE)
    101102iend
     103ColorTheme  equ     MenuAttribute_GetToAXfromTypeInSI.rgcColorAttributes
    102104
    103105.rgcBlackAndWhiteAttributes:    ; Only COLOR_WHITE, COLOR_BRIGHT_WHITE and COLOR_BLACK should be used
  • trunk/Assembly_Library/Src/Menu/MenuBorders.asm

    r583 r592  
    8787;       AX, BX, CX, DX, SI, DI
    8888;--------------------------------------------------------------------
    89 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     89%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG
    9090ALIGN MENU_JUMP_ALIGN
    9191MenuBorders_RefreshItemBorders:
  • trunk/Assembly_Library/Src/Menu/MenuInit.asm

    r532 r592  
    114114;       AX, BX, DX
    115115;--------------------------------------------------------------------
    116 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     116%ifndef EXCLUDE_FROM_XUB
    117117ALIGN MENU_JUMP_ALIGN
    118118MenuInit_CloseMenuIfExitEventAllows:
     
    138138
    139139
    140 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     140%ifndef EXCLUDE_FROM_XUB
    141141;--------------------------------------------------------------------
    142142; MenuInit_HighlightItemFromAX
     
    168168    mov     ax, [bp+MENUINIT.wHighlightedItem]
    169169    ret
    170 %endif ; EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     170%endif ; EXCLUDE_FROM_XUB
    171171
    172172
     
    183183;       Nothing
    184184;--------------------------------------------------------------------
    185 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     185%ifndef EXCLUDE_FROM_XUB
     186%ifndef EXCLUDE_FROM_XTIDECFG
    186187ALIGN MENU_JUMP_ALIGN
    187188MenuInit_SetTitleHeightFromAL:
     
    193194    mov     [bp+MENUINIT.bInfoLines], al
    194195    ret
     196%endif ; EXCLUDE_FROM_XTIDECFG
    195197
    196198ALIGN MENU_JUMP_ALIGN
     
    198200    mov     [bp+MENUINIT.wItems], ax
    199201    ret
    200 %endif
     202%endif ; EXCLUDE_FROM_XUB
    201203
    202204
     
    212214;       Nothing
    213215;--------------------------------------------------------------------
    214 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     216%ifndef EXCLUDE_FROM_XUB
     217%ifndef EXCLUDE_FROM_XTIDECFG
    215218ALIGN MENU_JUMP_ALIGN
    216219MenuInit_SetUserDataFromDSSI:
     
    218221    mov     [bp+MENU.dwUserData+2], ds
    219222    ret
     223%endif ; EXCLUDE_FROM_XTIDECFG
    220224
    221225ALIGN MENU_JUMP_ALIGN
     
    223227    lds     si, [bp+MENU.dwUserData]
    224228    ret
    225 %endif
     229%endif ; EXCLUDE_FROM_XUB
  • trunk/Assembly_Library/Src/Menu/MenuLocation.asm

    r583 r592  
    5555;       Nothing
    5656;--------------------------------------------------------------------
    57 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     57%ifndef EXCLUDE_FROM_XUB
    5858MenuLocation_GetItemBordersTopLeftCoordinatesToAX:
    5959%endif
  • trunk/Assembly_Library/Src/Menu/MenuText.asm

    r583 r592  
    3232;       AX, BX, CX, DX, SI, DI
    3333;--------------------------------------------------------------------
    34 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     34%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG
    3535ALIGN MENU_JUMP_ALIGN
    3636MenuText_ClearTitleArea:
Note: See TracChangeset for help on using the changeset viewer.