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/Menuitem.asm

    r567 r592  
    5353    call    Memory_ReserveCXbytesFromStackToDSSI
    5454    call    InitializeDialogInputInDSSIfromMenuitemInESDI
    55     mov     ax, [es:di+MENUITEM.itemValue + ITEM_VALUE.szMultichoice]
     55    mov     ax, [es:di+MENUITEM.itemValue+ITEM_VALUE.szMultichoice]
    5656    mov     [si+DIALOG_INPUT.fszItems], ax
    5757    push    di
     
    5959    pop     di
    6060
    61     cmp     ax, BYTE NO_ITEM_SELECTED
    62     je      SHORT .NothingToChange
     61    inc     ax              ; NO_ITEM_SELECTED ?
     62    jz      SHORT .NothingToChange
     63    dec     ax
    6364    call    Registers_CopyESDItoDSSI
    6465    call    Menuitem_StoreValueFromAXtoMenuitemInDSSI
     
    7071;--------------------------------------------------------------------
    7172; Menuitem_ActivateHexInputForMenuitemInDSSI
    72 ;   Parameters:
    73 ;       DS:SI:  Ptr to MENUITEM
    74 ;   Returns:
    75 ;       Nothing
     73; Menuitem_ActivateUnsignedInputForMenuitemInDSSI
     74;   Parameters:
     75;       DS:SI:  Ptr to MENUITEM
     76;   Returns:
     77;       CF:     Cleared if value inputted
     78;               Set if user cancellation
    7679;   Corrupts registers:
    7780;       AX, BX, CX, SI, DI, ES
    7881;--------------------------------------------------------------------
    79 ALIGN JUMP_ALIGN
    8082Menuitem_ActivateHexInputForMenuitemInDSSI:
     83    mov     bl, 16
     84    SKIP2B  ax
     85Menuitem_ActivateUnsignedInputForMenuitemInDSSI:
     86    mov     bl, 10
     87
    8188    call    Registers_CopyDSSItoESDI
    82 
    8389    mov     cx, WORD_DIALOG_IO_size
    8490    call    Memory_ReserveCXbytesFromStackToDSSI
    8591    call    InitializeDialogInputInDSSIfromMenuitemInESDI
    86     mov     BYTE [si+WORD_DIALOG_IO.bNumericBase], 16
    87     jmp     SHORT ContinueWordInput
    88 
    89 ;--------------------------------------------------------------------
    90 ; Menuitem_ActivateUnsignedInputForMenuitemInDSSI
    91 ;   Parameters:
    92 ;       DS:SI:  Ptr to MENUITEM
    93 ;   Returns:
    94 ;       CF:     Cleared if value inputted
    95 ;               Set if user cancellation
    96 ;   Corrupts registers:
    97 ;       AX, BX, CX, SI, DI, ES
    98 ;--------------------------------------------------------------------
    99 ALIGN JUMP_ALIGN
    100 Menuitem_ActivateUnsignedInputForMenuitemInDSSI:
    101     call    Registers_CopyDSSItoESDI
    102 
    103     mov     cx, WORD_DIALOG_IO_size
    104     call    Memory_ReserveCXbytesFromStackToDSSI
    105     call    InitializeDialogInputInDSSIfromMenuitemInESDI
    106     mov     BYTE [si+WORD_DIALOG_IO.bNumericBase], 10
    107 ContinueWordInput:
    108     mov     ax, [es:di+MENUITEM.itemValue + ITEM_VALUE.wMinValue]
     92    mov     [si+WORD_DIALOG_IO.bNumericBase], bl
     93    mov     ax, [es:di+MENUITEM.itemValue+ITEM_VALUE.wMinValue]
    10994    mov     [si+WORD_DIALOG_IO.wMin], ax
    110     mov     ax, [es:di+MENUITEM.itemValue + ITEM_VALUE.wMaxValue]
     95    mov     ax, [es:di+MENUITEM.itemValue+ITEM_VALUE.wMaxValue]
    11196    mov     [si+WORD_DIALOG_IO.wMax], ax
    11297    push    di
     
    138123ALIGN JUMP_ALIGN
    139124InitializeDialogInputInDSSIfromMenuitemInESDI:
    140     mov     ax, [es:di+MENUITEM.itemValue + ITEM_VALUE.szDialogTitle]
     125    mov     ax, [es:di+MENUITEM.itemValue+ITEM_VALUE.szDialogTitle]
    141126    mov     [si+DIALOG_INPUT.fszTitle], ax
    142127    mov     [si+DIALOG_INPUT.fszTitle+2], cs
     
    162147ALIGN JUMP_ALIGN
    163148Menuitem_StoreValueFromAXtoMenuitemInDSSI:
     149%if 0
     150    ; 3 bytes more but this will always invoke the Writer, even if it's an invalid item type (which might be useful).
    164151    eMOVZX  bx, [si+MENUITEM.bType]
    165152    cmp     bl, TYPE_MENUITEM_HEX
     153%else
     154    ; This will only invoke the Writer for valid item types.
     155    mov     bx, -TYPE_MENUITEM_MULTICHOICE & 0FFh
     156    add     bl, [si+MENUITEM.bType]
     157    jnc     SHORT .InvalidItemType
     158    cmp     bl, TYPE_MENUITEM_HEX - TYPE_MENUITEM_MULTICHOICE
     159%endif
    166160    ja      SHORT .InvalidItemType
    167161
     
    169163    add     di, [si+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
    170164
    171     push    bx
    172     mov     bx,[si+MENUITEM.itemValue+ITEM_VALUE.fnValueWriter]
    173     test    bx,bx
    174     jz      SHORT .NoWriter
    175     call    bx
    176 .NoWriter:
     165    push    WORD [cs:bx+.rgfnJumpToStoreValueBasedOnItemType]
     166    mov     bx, [si+MENUITEM.itemValue+ITEM_VALUE.fnValueWriter]
     167    test    bx, bx
     168    jnz     SHORT .InvokeWriter
     169.InvalidItemType:
    177170    pop     bx
    178 
    179     jmp     [cs:bx+.rgfnJumpToStoreValueBasedOnItemType]
    180 .InvalidItemType:
    181     ret
     171.InvokeWriter:
     172    jmp     bx              ; The Writer can freely corrupt BX
    182173
    183174ALIGN WORD_ALIGN
    184175.rgfnJumpToStoreValueBasedOnItemType:
    185     dw      .InvalidItemType                                    ; TYPE_MENUITEM_PAGEBACK
    186     dw      .InvalidItemType                                    ; TYPE_MENUITEM_PAGENEXT
    187     dw      .InvalidItemType                                    ; TYPE_MENUITEM_ACTION
     176;   dw      .InvalidItemType                                    ; TYPE_MENUITEM_PAGEBACK
     177;   dw      .InvalidItemType                                    ; TYPE_MENUITEM_PAGENEXT
     178;   dw      .InvalidItemType                                    ; TYPE_MENUITEM_ACTION
    188179    dw      .StoreMultichoiceValueFromAXtoESDIwithItemInDSSI    ; TYPE_MENUITEM_MULTICHOICE
    189180    dw      .StoreByteOrWordValueFromAXtoESDIwithItemInDSSI     ; TYPE_MENUITEM_UNSIGNED
     
    237228    jz      .StoreByteOrWordValueFromAXtoESDIwithItemInDSSI
    238229
    239     shl     ax, 1           ; Shift for WORD lookup
     230    eSHL_IM ax, 1           ; Shift for WORD lookup
    240231    add     bx, ax
    241232    mov     ax, [bx]        ; Lookup complete
     
    317308;       AX:     Menuitem value
    318309;   Corrupts registers:
    319 ;       BX
     310;       Nothing
    320311;--------------------------------------------------------------------
    321312ALIGN JUMP_ALIGN
     
    330321    test    BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_BYTEVALUE
    331322    jz      SHORT .NoConvertWordToByteValue
    332     xor     ah, ah              ; conversion needs to happen before call to the reader,
    333                                 ; in case the reader unpacks the byte to a word
     323    xor     ah, ah          ; conversion needs to happen before call to the reader,
     324                            ; in case the reader unpacks the byte to a word
    334325
    335326.NoConvertWordToByteValue:
     
    338329    jz      SHORT .NoReader
    339330
    340     call    bx
     331    call    bx              ; The Reader can freely corrupt BX, DI and ES
    341332
    342333.NoReader:
Note: See TracChangeset for help on using the changeset viewer.