Ignore:
Timestamp:
Nov 21, 2021, 2:15:32 PM (2 years ago)
Author:
krille_n_
Message:

Changes:

  • Fixed three different bugs all causing the boot menu to show drives using IRQs even though the BIOS had been built without MODULE_IRQ.
  • Fixed two bugs in XTIDECFG where loading a BIOS from file and then loading the old settings from EEPROM would
    • overwrite ROMVARS.wFlags in the loaded BIOS file (in RAM). The possibly resulting mismatch of module flags could make it impossible to change settings for modules included in the BIOS or allow changing settings for modules not included in the BIOS.
    • not copy the color theme over to the loaded BIOS.
  • Also fixed two very minor bugs in XTIDECFG in BiosFile_LoadFileFromDSSItoRamBuffer and BiosFile_SaveRamBufferToFileInDSSI where the error handling in these routines would close whatever file handle that happened to match the error code returned by DOS in AX.
  • Made significant changes to the new flash ROM programming routines to reduce the size. Also fixed a minor bug that would cause the second verification to be skipped and return success when programming a 64 KB block of data.
  • Changed the custom BIOS build file names to the 8.3 format.
  • Changed some help strings in XTIDECFG to clarify things.
  • Other minor optimizations and fixes.
Location:
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages
Files:
4 edited

Legend:

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

    r605 r621  
    185185
    186186ColorThemeTable:
     187; Note! If there's ever a need to remove a theme or change a theme or reorder the themes then the ROMVARS version must be incremented.
     188; This is for backwards compatibility. Adding new themes (at the bottom) however should work with no change to the ROMVARS version.
    187189    ; Classic (default)
    188190    db  COLOR_ATTRIBUTE(COLOR_YELLOW, COLOR_BLUE)                           ; .cBordersAndBackground
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm

    r620 r621  
    205205    mov     si, g_MenupageForFlashMenu
    206206    ePUSH_T bx, Menupage_ChangeToNewMenupageInDSSI
    207     cmp     WORD [g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
    208     jz      SHORT .DisableMenuitemsUnusedBySstFlash
    209     ; Fall to .EnableMenuitemsUnusedBySstFlash
    210 
    211 ;--------------------------------------------------------------------
    212 ; .EnableMenuitemsUnusedBySstFlash
    213 ;   Parameters:
     207    cmp     BYTE [g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
     208    mov     ax, DisableMenuitemFromCSBX
     209    je      SHORT .EnableOrDisableMenuitemsUnusedBySstFlash
     210    mov     ax, EnableMenuitemFromCSBX
     211    ; Fall to .EnableOrDisableMenuitemsUnusedBySstFlash
     212
     213;--------------------------------------------------------------------
     214; .EnableOrDisableMenuitemsUnusedBySstFlash
     215;   Parameters:
     216;       AX:     Offset to EnableMenuitemFromCSBX / DisableMenuitemFromCSBX
    214217;       SS:BP:  Menu handle
    215218;   Returns:
    216219;       Nothing
    217220;   Corrupts registers:
    218 ;       AX, BX
    219 ;--------------------------------------------------------------------
    220 ALIGN JUMP_ALIGN
    221 .EnableMenuitemsUnusedBySstFlash:
     221;       BX
     222;--------------------------------------------------------------------
     223.EnableOrDisableMenuitemsUnusedBySstFlash:
    222224    mov     bx, g_MenuitemFlashSdpCommand
    223     call    EnableMenuitemFromCSBX
     225    call    ax
    224226    mov     bx, g_MenuitemFlashPageSize
    225     jmp     EnableMenuitemFromCSBX
    226 
    227 ;--------------------------------------------------------------------
    228 ; .DisableMenuitemsUnusedBySstFlash
    229 ;   Parameters:
    230 ;       SS:BP:  Menu handle
    231 ;   Returns:
    232 ;       Nothing
    233 ;   Corrupts registers:
    234 ;       AX, BX
    235 ;--------------------------------------------------------------------
    236 ALIGN JUMP_ALIGN
    237 .DisableMenuitemsUnusedBySstFlash:
    238     mov     bx, g_MenuitemFlashSdpCommand
    239     call    DisableMenuitemFromCSBX
    240     mov     bx, g_MenuitemFlashPageSize
    241     jmp     DisableMenuitemFromCSBX
     227    jmp     ax
    242228
    243229;--------------------------------------------------------------------
     
    254240    call    .MakeSureThatImageFitsInEeprom
    255241    jc      SHORT .InvalidFlashingParameters
    256     cmp     WORD [cs:g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
    257     jnz     SHORT .SkipAlignmentCheck
     242    cmp     BYTE [g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
     243    jne     SHORT .SkipAlignmentCheck
    258244    call    .MakeSureAddress32KAligned
    259     jc      SHORT .InvalidFlashingParameters
     245    jnz     SHORT .InvalidFlashingParameters
    260246.SkipAlignmentCheck:
    261247    push    es
     
    267253    call    .InitializeFlashvarsFromDSSI
    268254    mov     bx, si                          ; DS:BX now points to FLASHVARS
    269     cmp     WORD [cs:g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
    270     jz      SHORT .FlashWithoutProgressBar
     255    cmp     BYTE [g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
     256    je      SHORT .FlashWithoutProgressBar
    271257    add     si, BYTE FLASHVARS_size         ; DS:SI now points to PROGRESS_DIALOG_IO
    272258    call    Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX
     
    282268.FlashWithoutProgressBar:                   ; Worst case. SST devices will
    283269    call    FlashSst_WithFlashvarsInDSBX    ; either complete flashing
    284     jmp     SHORT .FlashComplete            ; or timeout within 2 seconds. 
     270    jmp     SHORT .FlashComplete            ; or timeout within 2 seconds.
    285271
    286272;--------------------------------------------------------------------
     
    296282.MakeSureThatImageFitsInEeprom:
    297283    call    Buffers_GetSelectedEepromSizeInWordsToAX
    298     cmp     ax, [cs:g_cfgVars+CFGVARS.wImageSizeInWords]
     284    cmp     ax, [g_cfgVars+CFGVARS.wImageSizeInWords]
    299285    jae     SHORT .ImageFitsInSelectedEeprom
    300286    mov     dx, g_szErrEepromTooSmall
     
    312298;       SS:BP:  Ptr to MENU
    313299;   Returns:
    314 ;       CF:     Set if EEPROM segment is not 32K aligned
    315 ;   Corrupts registers:
    316 ;       AX, BX, DX
     300;       ZF:     Cleared if EEPROM segment is not 32K aligned
     301;   Corrupts registers:
     302;       AX, DX
    317303;--------------------------------------------------------------------
    318304ALIGN JUMP_ALIGN
    319305.MakeSureAddress32KAligned:
    320     mov     ax, [cs:g_cfgVars+CFGVARS.wEepromSegment]
    321     and     ax, 007FFh
     306    test    WORD [g_cfgVars+CFGVARS.wEepromSegment], 07FFh
    322307    jz      SHORT .AlignmentIs32K
    323308    mov     dx, g_szErrAddrNot32KAligned
    324     call    Dialogs_DisplayErrorFromCSDX
    325     stc
    326     ret
     309    jmp     Dialogs_DisplayErrorFromCSDX
    327310
    328311;--------------------------------------------------------------------
     
    339322    call    EEPROM_LoadFromRomToRamComparisonBuffer
    340323    call    Buffers_AppendZeroesIfNeeded
    341     test    BYTE [cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_CHECKSUM
     324    test    BYTE [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_CHECKSUM
    342325    jz      SHORT .DoNotGenerateChecksumByte
    343326    jmp     Buffers_GenerateChecksum
     
    363346    mov     [si+FLASHVARS.fpNextComparisonPage+2], es
    364347
    365     mov     ax, [cs:g_cfgVars+CFGVARS.wEepromSegment]
     348    mov     ax, [g_cfgVars+CFGVARS.wEepromSegment]
    366349    mov     WORD [si+FLASHVARS.fpNextDestinationPage], 0
    367350    mov     [si+FLASHVARS.fpNextDestinationPage+2], ax
    368351
    369     mov     al, [cs:g_cfgVars+CFGVARS.bEepromType]
     352    mov     al, [g_cfgVars+CFGVARS.bEepromType]
    370353    mov     [si+FLASHVARS.bEepromType], al
    371354
    372     mov     al, [cs:g_cfgVars+CFGVARS.bSdpCommand]
     355    mov     al, [g_cfgVars+CFGVARS.bSdpCommand]
    373356    mov     [si+FLASHVARS.bEepromSdpCommand], al
    374357
    375358    mov     ax, SST_PAGE_SIZE
    376     cmp     WORD [g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
    377     jz      SHORT .UseSstPageSize
    378 
    379     eMOVZX  bx, [cs:g_cfgVars+CFGVARS.bEepromPage]
    380     mov     ax, [cs:bx+g_rgwEepromPageToSizeInBytes]
     359    cmp     BYTE [g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
     360    je      SHORT .UseSstPageSize
     361
     362    eMOVZX  bx, [g_cfgVars+CFGVARS.bEepromPage]
     363    mov     ax, [bx+g_rgwEepromPageToSizeInBytes]
    381364.UseSstPageSize:
    382365    mov     [si+FLASHVARS.wEepromPageSize], ax
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm

    r614 r621  
    300300IdeControllerMenu_InitializeToIdevarsOffsetInBX:
    301301    lea     ax, [bx+IDEVARS.drvParamsMaster]
    302     mov     [cs:g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
     302    mov     [g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
    303303
    304304    lea     ax, [bx+IDEVARS.drvParamsSlave]
    305     mov     [cs:g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
     305    mov     [g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
    306306
    307307    lea     ax, [bx+IDEVARS.bDevice]
    308     mov     [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
     308    mov     [g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
    309309
    310310%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
    311311%if IDEVARS.wBasePort = 0
    312     mov     [cs:g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], bx
     312    mov     [g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], bx
    313313%else
    314314    lea     ax, [bx+IDEVARS.wBasePort]
    315     mov     [cs:g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
     315    mov     [g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
    316316%endif
    317317
    318318%if IDEVARS.bSerialPort = 0
    319     mov     [cs:g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], bx
     319    mov     [g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], bx
    320320%else
    321321    lea     ax, [bx+IDEVARS.bSerialPort]
    322     mov     [cs:g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
     322    mov     [g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
    323323%endif
    324324%endif
    325325
    326326    lea     ax, [bx+IDEVARS.bSerialBaud]
    327     mov     [cs:g_MenuitemIdeControllerSerialBaud+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
     327    mov     [g_MenuitemIdeControllerSerialBaud+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
    328328
    329329    lea     ax, [bx+IDEVARS.wControlBlockPort]
    330     mov     [cs:g_MenuitemIdeControllerControlBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
     330    mov     [g_MenuitemIdeControllerControlBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
    331331
    332332    lea     ax, [bx+IDEVARS.bSerialCOMPortChar]
    333     mov     [cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
     333    mov     [g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
    334334
    335335    lea     ax, [bx+IDEVARS.bIRQ]
    336     mov     [cs:g_MenuitemIdeControllerEnableInterrupt+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
    337     mov     [cs:g_MenuitemIdeControllerIdeIRQ+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
     336    mov     [g_MenuitemIdeControllerEnableInterrupt+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
     337    mov     [g_MenuitemIdeControllerIdeIRQ+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
    338338
    339339    ret
     
    512512    mov     bx, g_MenuitemMasterSlaveDisableDetection
    513513    call    DisableMenuitemFromCSBX
    514     mov     bx, [cs:g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
     514    mov     bx, [g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
    515515    jmp     SHORT DisplayMasterSlaveMenu
    516516
     
    519519    mov     bx, g_MenuitemMasterSlaveDisableDetection
    520520    call    EnableMenuitemFromCSBX
    521     mov     bx, [cs:g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
     521    mov     bx, [g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
    522522    ; Fall to DisplayMasterSlaveMenu
    523523
     
    566566    ; Standard ATA controllers, including 8-bit mode
    567567.StandardIdeDevice:
    568     ; Enable IRQ for standard ATA
     568    ; Enable IRQ for standard ATA, but only if MODULE_IRQ is included
    569569
    570570    lea     ax, [di-ROMVARS.ideVars0+IDEVARS.wBasePort]
    571571    mov     bl, IDEVARS_size
    572572    div     bl
     573
     574    test    BYTE [es:ROMVARS.wFlags+1], FLG_ROMVARS_MODULE_IRQ >> 8
     575    jz      SHORT .DoNotEnableIrq
     576
     577    mov     bx, .rgbDefaultIrqForStdIde         ; Enable interrupt for primary and secondary IDE
    573578    push    ax
    574     mov     bx, .rgbDefaultIrqForStdIde         ; Enable interrupt for primary and secondary IDE
    575579    xlat
    576580    mov     [es:di+IDEVARS.bIRQ-IDEVARS.wBasePort], al
    577581    pop     ax
    578     sub     bx, BYTE .rgbDefaultIrqForStdIde - .rgbLowByteOfStdIdeInterfacePorts
    579     xlat                                        ; DS=CS so no segment override needed
     582
     583.DoNotEnableIrq:
     584    mov     bx, .rgbLowByteOfStdIdeInterfacePorts
     585    xlat
    580586    mov     ah, 1                               ; DEVICE_ATA_*_PORT >> 8
    581587    mov     bh, 3                               ; DEVICE_ATA_*_PORTCTRL >> 8
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm

    r602 r621  
    285285    call    Dialogs_DisplayNotificationFromCSDX
    286286    call    EEPROM_FindXtideUniversalBiosROMtoESDI
    287     call    LoadColorTheme.FromROM
     287    call    LoadColorTheme.FromROM          ; Returns the color theme index in AX
     288    test    BYTE [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED
     289    jz      SHORT .FileNotLoaded
     290    ; A file has been loaded so we need to copy the theme to that as well
     291    call    Buffers_GetFileBufferToESDI
     292    add     di, ROMVARS.pColorTheme
     293    call    WriteColorTheme
     294.FileNotLoaded:
    288295    jmp     MainMenu_EnterMenuOrModifyItemVisibility
    289296
Note: See TracChangeset for help on using the changeset viewer.