Ignore:
Timestamp:
Jun 25, 2018, 10:29:27 PM (6 years ago)
Author:
krille_n_
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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm

    r580 r592  
    11; Project name  :   XTIDE Universal BIOS Configurator v2
    2 ; Description   :   "Boot Menu Settings" menu structs and functions.
     2; Description   :   "Boot settings" menu structs and functions.
    33
    44;
     
    2626    at  MENUPAGE.fnEnter,           dw  BootMenuSettingsMenu_EnterMenuOrModifyItemVisibility
    2727    at  MENUPAGE.fnBack,            dw  ConfigurationMenu_EnterMenuOrModifyItemVisibility
    28     at  MENUPAGE.wMenuitems,        dw  6
     28    at  MENUPAGE.wMenuitems,        dw  7
    2929iend
    3030
     
    5555iend
    5656
     57g_MenuitemBootMnuStngsColorTheme:
     58istruc MENUITEM
     59    at  MENUITEM.fnActivate,        dw  Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
     60    at  MENUITEM.fnFormatValue,     dw  MenuitemPrint_WriteLookupValueStringToBufferInESDIfromUnshiftedItemInDSSI
     61    at  MENUITEM.szName,            dw  g_szItemColorTheme
     62    at  MENUITEM.szQuickInfo,       dw  g_szNfoColorTheme
     63    at  MENUITEM.szHelp,            dw  g_szHelpColorTheme
     64    at  MENUITEM.bFlags,            db  FLG_MENUITEM_VISIBLE | FLG_MENUITEM_MODIFY_MENU
     65    at  MENUITEM.bType,             db  TYPE_MENUITEM_MULTICHOICE
     66    at  MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,        dw  ROMVARS.pColorTheme     ; Only ever read - never modified
     67    at  MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,              dw  g_szDlgColorTheme
     68    at  MENUITEM.itemValue + ITEM_VALUE.szMultichoice,              dw  g_szMultichoiceColorTheme
     69    at  MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup,     dw  NULL
     70    at  MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup,    dw  g_rgszValueToStringLookupForColorTheme
     71    at  MENUITEM.itemValue + ITEM_VALUE.fnValueReader,              dw  ReadColorTheme
     72    at  MENUITEM.itemValue + ITEM_VALUE.fnValueWriter,              dw  WriteColorTheme
     73iend
     74
    5775g_MenuitemBootMnuStngsFloppyDrives:
    5876istruc MENUITEM
     
    116134    at  MENUITEM.itemValue + ITEM_VALUE.wMaxValue,                  dw  1092
    117135iend
    118 
    119 
    120 g_rgwChoiceToValueLookupForEnableBootMenu:
    121     dw  FALSE
    122     dw  BOOT_MENU_DEFAULT_TIMEOUT
    123136
    124137g_rgwChoiceToValueLookupForDisplayModes:
     
    146159    dw  g_szValueBootFloppyDrvs4
    147160
     161g_rgszValueToStringLookupForColorTheme:
     162    dw  g_szValueColorTheme0
     163    dw  g_szValueColorTheme1
     164    dw  g_szValueColorTheme2
     165    dw  g_szValueColorTheme3
     166    dw  g_szValueColorTheme4
     167    dw  g_szValueColorTheme5
     168
     169ColorThemeTable:
     170    ; Classic (default)
     171    db  COLOR_ATTRIBUTE(COLOR_YELLOW, COLOR_BLUE)                           ; .cBordersAndBackground
     172    db  COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK)                            ; .cShadow
     173    db  COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLUE)                     ; .cTitle
     174    db  COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLUE)                            ; .cItem
     175    db  COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_CYAN)                     ; .cHighlightedItem
     176    db  COLOR_ATTRIBUTE(COLOR_RED, COLOR_BLUE) | FLG_COLOR_BLINK            ; .cHurryTimeout
     177    db  COLOR_ATTRIBUTE(COLOR_GREEN, COLOR_BLUE)                            ; .cNormalTimeout
     178    ; Argon Blue
     179    db  COLOR_ATTRIBUTE(COLOR_LIGHT_BLUE, COLOR_BLACK)                      ; .cBordersAndBackground
     180    db  COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK)                            ; .cShadow
     181    db  COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLACK)                    ; .cTitle
     182    db  COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLACK)                           ; .cItem
     183    db  COLOR_ATTRIBUTE(COLOR_LIGHT_BLUE, COLOR_BLACK)                      ; .cHighlightedItem
     184    db  COLOR_ATTRIBUTE(COLOR_LIGHT_BLUE, COLOR_BLACK) | FLG_COLOR_BLINK    ; .cHurryTimeout
     185    db  COLOR_ATTRIBUTE(COLOR_LIGHT_BLUE, COLOR_BLACK)                      ; .cNormalTimeout
     186    ; Neon Red
     187    db  COLOR_ATTRIBUTE(COLOR_LIGHT_RED, COLOR_BLACK)                       ; .cBordersAndBackground
     188    db  COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK)                            ; .cShadow
     189    db  COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLACK)                    ; .cTitle
     190    db  COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLACK)                           ; .cItem
     191    db  COLOR_ATTRIBUTE(COLOR_LIGHT_RED, COLOR_BLACK)                       ; .cHighlightedItem
     192    db  COLOR_ATTRIBUTE(COLOR_LIGHT_RED, COLOR_BLACK) | FLG_COLOR_BLINK     ; .cHurryTimeout
     193    db  COLOR_ATTRIBUTE(COLOR_LIGHT_RED, COLOR_BLACK)                       ; .cNormalTimeout
     194    ; Phosphor Green
     195    db  COLOR_ATTRIBUTE(COLOR_LIGHT_GREEN, COLOR_BLACK)                     ; .cBordersAndBackground
     196    db  COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK)                            ; .cShadow
     197    db  COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLACK)                    ; .cTitle
     198    db  COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLACK)                           ; .cItem
     199    db  COLOR_ATTRIBUTE(COLOR_LIGHT_GREEN, COLOR_BLACK)                     ; .cHighlightedItem
     200    db  COLOR_ATTRIBUTE(COLOR_LIGHT_GREEN, COLOR_BLACK) | FLG_COLOR_BLINK   ; .cHurryTimeout
     201    db  COLOR_ATTRIBUTE(COLOR_LIGHT_GREEN, COLOR_BLACK)                     ; .cNormalTimeout
     202    ; Moon Surface
     203    db  COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK)                            ; .cBordersAndBackground
     204    db  COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK)                            ; .cShadow
     205    db  COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLACK)                    ; .cTitle
     206    db  COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLACK)                           ; .cItem
     207    db  COLOR_ATTRIBUTE(COLOR_BROWN, COLOR_BLACK)                           ; .cHighlightedItem
     208    db  COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLACK) | FLG_COLOR_BLINK  ; .cHurryTimeout
     209    db  COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLACK)                           ; .cNormalTimeout
     210    ; Toxic Waste
     211    db  COLOR_ATTRIBUTE(COLOR_LIGHT_GREEN, COLOR_BLACK)                     ; .cBordersAndBackground
     212    db  COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK)                            ; .cShadow
     213    db  COLOR_ATTRIBUTE(COLOR_LIGHT_GREEN, COLOR_BLACK)                     ; .cTitle
     214    db  COLOR_ATTRIBUTE(COLOR_LIGHT_CYAN, COLOR_BLACK)                      ; .cItem
     215    db  COLOR_ATTRIBUTE(COLOR_LIGHT_CYAN, COLOR_BLUE)                       ; .cHighlightedItem
     216    db  COLOR_ATTRIBUTE(COLOR_LIGHT_RED, COLOR_BLACK) | FLG_COLOR_BLINK     ; .cHurryTimeout
     217    db  COLOR_ATTRIBUTE(COLOR_LIGHT_RED, COLOR_BLACK)                       ; .cNormalTimeout
     218EndOfColorThemeTable:
     219CountOfThemes   equ     (EndOfColorThemeTable-ColorThemeTable) / ATTRIBUTE_CHARS_size
     220
    148221
    149222; Section containing code
     
    166239    call    .EnableOrDisableScanForSerialDrives
    167240    call    .EnableOrDisableDefaultBootDrive
     241    call    .EnableOrDisableColorThemeSelection
    168242    call    .EnableOrDisableBootMenuSelectionTimeout
    169243    mov     si, g_MenupageForBootMenuSettingsMenu
     
    202276    mov     bx, g_MenuitemBootMnuStngsDefaultBootDrive
    203277    test    ax, FLG_ROMVARS_MODULE_HOTKEYS | FLG_ROMVARS_MODULE_BOOT_MENU
     278    jmp     SHORT .DisableMenuitemFromCSBXifZFset
     279
     280
     281;--------------------------------------------------------------------
     282; .EnableOrDisableColorThemeSelection
     283;   Parameters:
     284;       AX:     ROMVARS.wFlags
     285;       SS:BP:  Menu handle
     286;   Returns:
     287;       Nothing
     288;   Corrupts registers:
     289;       BX
     290;--------------------------------------------------------------------
     291ALIGN JUMP_ALIGN
     292.EnableOrDisableColorThemeSelection:
     293    mov     bx, g_MenuitemBootMnuStngsColorTheme
     294    test    ax, FLG_ROMVARS_MODULE_BOOT_MENU
    204295    jmp     SHORT .DisableMenuitemFromCSBXifZFset
    205296
     
    244335
    245336;--------------------------------------------------------------------
    246 ; MENUITEM value reader functions
    247 ;   Parameters:
    248 ;       AX:     Value from MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset
    249 ;       DS:SI:  Ptr to MENUITEM
    250 ;       ES:DI:  Ptr to value variable
    251 ;   Returns:
    252 ;       AX:     Value with possible modifications
    253 ;   Corrupts registers:
    254 ;       Nothing
    255 ;--------------------------------------------------------------------
    256 ALIGN JUMP_ALIGN
    257 ValueReaderForEnableBootMenu:
    258     test    ax, ax
    259     jz      SHORT .NoNeedToModify
    260     mov     ax, TRUE<<1
    261 .NoNeedToModify:
     337; ReadColorTheme
     338;   Parameters:
     339;       AX:     Value read from the ROMVARS location
     340;       ES:DI:  ROMVARS location where the value was just read from
     341;       DS:SI:  MENUITEM pointer
     342;   Returns:
     343;       AX:     Value that the MENUITEM system will interact with and display
     344;   Corrupts registers:
     345;       BX, DI, ES
     346;--------------------------------------------------------------------
     347ALIGN JUMP_ALIGN
     348ReadColorTheme:
     349    push    ds
     350
     351    push    es                          ; ES -> DS
     352    pop     ds
     353    push    cs                          ; CS -> ES
     354    pop     es
     355
     356    mov     di, EndOfColorThemeTable-1  ; ES:DI now points to the end of the last theme in the table of available themes in XTIDECFG
     357    xor     bx, bx
     358
     359    push    si
     360    push    cx
     361    mov     cx, CountOfThemes
     362    std
     363.NextTheme:
     364    push    cx
     365    mov     cl, ATTRIBUTE_CHARS_size
     366    mov     si, ax                      ; [ROMVARS.pColorTheme] to SI
     367    dec     si
     368    add     si, cx                      ; DS:SI now points to the end of the ColorTheme in the loaded BIOS
     369    sub     di, bx                      ; Update the pointer to the end of the next theme in the table
     370
     371    ; We verify that the theme in the loaded BIOS exists in our table. If it doesn't exist then that most likely means
     372    ; the loaded BIOS doesn't contain MODULE_BOOT_MENU and the theme actually isn't a theme - it's code. Either way,
     373    ; we don't trust it enough to copy it over as corrupt/invalid settings could render the UI in XTIDECFG unreadable.
     374    repe    cmpsb
     375    mov     bx, cx
     376    pop     cx
     377    loopne  .NextTheme
     378    cld
     379    mov     ax, cx
     380    jne     SHORT .SkipCopy
     381
     382    ; Copy the color theme fron the loaded BIOS overwriting XTIDECFG's own theme
     383    inc     si
     384    mov     di, ColorTheme              ; ES:DI now points to ColorTheme in XTIDECFG
     385
     386    mov     cl, ATTRIBUTE_CHARS_size
     387    call    Memory_CopyCXbytesFromDSSItoESDI
     388
     389.SkipCopy:
     390    pop     cx
     391    pop     si
     392    pop     ds
    262393    ret
     394
     395
     396;--------------------------------------------------------------------
     397; WriteColorTheme
     398;   Parameters:
     399;       AX:     Value that the MENUITEM system was interacting with
     400;       ES:DI:  ROMVARS location where the value is to be stored
     401;       DS:SI:  MENUITEM pointer
     402;   Returns:
     403;       AX:     Value to actually write to ROMVARS
     404;   Corrupts registers:
     405;       Nothing
     406;--------------------------------------------------------------------
     407ALIGN JUMP_ALIGN
     408WriteColorTheme:
     409    push    cx
     410    push    si
     411    push    di
     412
     413    mov     cx, ATTRIBUTE_CHARS_size
     414    mul     cl                          ; Multiply with the menu choice index
     415    mov     si, ColorThemeTable
     416    add     si, ax
     417    mov     ax, [es:di]                 ; Fetch the ptr to ColorTheme
     418    mov     di, ax
     419
     420    call    Memory_CopyCXbytesFromDSSItoESDI
     421
     422    pop     di
     423    pop     si
     424    pop     cx
     425    ret
     426
Note: See TracChangeset for help on using the changeset viewer.