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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm

    r596 r621  
    3333ALIGN JUMP_ALIGN
    3434BiosFile_LoadFileFromDSSItoRamBuffer:
    35     push    ds
    36 
    37     call    .OpenFileForLoadingFromDSSIandGetSizeToDXCX
     35    mov     al, FILE_ACCESS.ReadOnly
     36    call    FileIO_OpenWithPathInDSSIandFileAccessInAL
    3837    jc      SHORT .DisplayErrorMessage
     38
     39    call    FileIO_GetFileSizeToDXAXusingHandleFromBXandResetFilePosition
     40    jc      SHORT .CloseUsingHandleFromBXandDisplayErrorMessage
     41
     42    cmp     dx, MAX_EEPROM_SIZE_IN_BYTES >> 16
     43    jb      SHORT .FileNotTooBig
     44    ja      SHORT .FileTooBig
     45%if (MAX_EEPROM_SIZE_IN_BYTES & 0FFFFh) = 0
     46    test    ax, ax
     47    jnz     SHORT .FileTooBig
     48%else
     49    cmp     ax, MAX_EEPROM_SIZE_IN_BYTES & 0FFFFh
     50    ja      SHORT .FileTooBig
     51%endif
     52.FileNotTooBig:
     53    xchg    cx, ax
     54
    3955    call    .LoadFileWithNameInDSSIhandleInBXandSizeInDXCXtoRamBuffer
    40     jc      SHORT .DisplayErrorMessage
     56    jc      SHORT .CloseUsingHandleFromBXandDisplayErrorMessage
    4157
    4258    mov     al, FLG_CFGVARS_FILELOADED
    4359    call    Buffers_NewBiosWithSizeInDXCXandSourceInALhasBeenLoadedForConfiguration
    4460    call    FileIO_CloseUsingHandleFromBX
    45     call    DisplayFileLoadedSuccessfully
    46     pop     ds
    47     ret
    48 
    49 .DisplayErrorMessage:
    50     call    FileIO_CloseUsingHandleFromBX
    51     call    DisplayFailedToLoadFile
    52     pop     ds
    53     ret
    54 
    55 ;--------------------------------------------------------------------
    56 ; .OpenFileForLoadingFromDSSIandGetSizeInBytesToDXCX
    57 ;   Parameters:
    58 ;       DS:SI:  Name of file to open
    59 ;   Returns:
    60 ;       BX:     File handle (if successful)
    61 ;       DX:CX:  File size (if successful)
    62 ;       CF:     Clear if successful
    63 ;               Set if error
    64 ;   Corrupts registers:
    65 ;       AX
    66 ;--------------------------------------------------------------------
    67 ALIGN JUMP_ALIGN
    68 .OpenFileForLoadingFromDSSIandGetSizeToDXCX:
    69     mov     al, FILE_ACCESS.ReadOnly
    70     call    FileIO_OpenWithPathInDSSIandFileAccessInAL
    71     jc      SHORT .FileError
    72     call    FileIO_GetFileSizeToDXAXusingHandleFromBXandResetFilePosition
    73     jc      SHORT .FileError
    74 
    75     cmp     dx, MAX_EEPROM_SIZE_IN_BYTES >> 16
    76     jb      SHORT .FileNotTooBig
    77     ja      SHORT .FileTooBig
    78     cmp     ax, MAX_EEPROM_SIZE_IN_BYTES & 0FFFFh
    79     ja      SHORT .FileTooBig
    80 .FileNotTooBig:
    81     xchg    cx, ax
    82     clc
    83     ret
     61    jmp     SHORT DisplayFileLoadedSuccessfully
     62
    8463.FileTooBig:
    8564    call    DisplayFileTooBig
    86     stc
    87 .FileError:
    88     ret
     65.CloseUsingHandleFromBXandDisplayErrorMessage:
     66    call    FileIO_CloseUsingHandleFromBX
     67.DisplayErrorMessage:
     68    jmp     SHORT DisplayFailedToLoadFile
     69
    8970
    9071;--------------------------------------------------------------------
     
    11293    push    cx
    11394
    114     call    Registers_CopyESDItoDSSI    ; File name in DS:SI
     95    call    Registers_CopyESDItoDSSI                ; File name in DS:SI
    11596    push    cs
    11697    pop     es
     
    119100    cld
    120101%endif
    121     call    String_CopyDSSItoESDIandGetLengthToCX
    122     clc
     102    call    String_CopyDSSItoESDIandGetLengthToCX   ; Returns with CF cleared
    123103
    124104    pop     cx
     
    164144BiosFile_SaveRamBufferToFileInDSSI:
    165145    push    es
    166     push    ds
    167146
    168147    call    Buffers_GenerateChecksum
     
    174153    jc      SHORT .DisplayErrorMessage
    175154
     155    push    ds
    176156    call    Registers_CopyESDItoDSSI
    177157    call    FileIO_WriteDXCXbytesFromDSSIusingHandleFromBX
     158    pop     ds
     159    pushf
     160    call    FileIO_CloseUsingHandleFromBX
     161    popf
    178162    jc      SHORT .DisplayErrorMessage
    179163
    180     call    FileIO_CloseUsingHandleFromBX
    181164    call    Buffers_ClearUnsavedChanges
    182     call    DisplayFileSavedSuccessfully
    183     jmp     SHORT .Return
     165    pop     es
     166    jmp     SHORT DisplayFileSavedSuccessfully
    184167
    185168.DisplayErrorMessage:
    186     call    FileIO_CloseUsingHandleFromBX
    187     call    DisplayFailedToSaveFile
    188 ALIGN JUMP_ALIGN
    189 .Return:
    190     pop     ds
    191     pop     es
    192     ret
     169    pop     es
     170    jmp     SHORT DisplayFailedToSaveFile
    193171
    194172
Note: See TracChangeset for help on using the changeset viewer.