Changeset 621 in xtideuniversalbios for trunk/Assembly_Library/Src/File/FileIO.asm


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/Assembly_Library/Src/File/FileIO.asm

    r592 r621  
    6666
    6767;--------------------------------------------------------------------
    68 ; FileIO_ReadDXCXbytesToDSSIusingHandleFromBX
    69 ;   Parameters:
    70 ;       BX:     File handle
    71 ;       DX:CX:  Number of bytes to read
    72 ;       DS:SI:  Ptr to destination buffer
    73 ;   Returns:
    74 ;       AX:     DOS error code if CF set
    75 ;       CF:     Clear if successful
    76 ;               Set if error
    77 ;   Corrupts registers:
    78 ;       AX
    79 ;--------------------------------------------------------------------
    80 ALIGN JUMP_ALIGN
    81 FileIO_ReadDXCXbytesToDSSIusingHandleFromBX:
    82     push    bp
    83     mov     bp, FileIO_ReadCXbytesToDSSIusingHandleFromBX
    84     call    SplitLargeReadOrWritesToSmallerBlocks
    85     pop     bp
    86     ret
    87 
    88 
    89 ;--------------------------------------------------------------------
    90 ; FileIO_WriteDXCXbytesFromDSSIusingHandleFromBX
    91 ;   Parameters:
    92 ;       BX:     File handle
    93 ;       DX:CX:  Number of bytes to write
    94 ;       DS:SI:  Ptr to source buffer
    95 ;   Returns:
    96 ;       AX:     DOS error code if CF set
    97 ;       CF:     Clear if successful
    98 ;               Set if error
    99 ;   Corrupts registers:
    100 ;       AX
    101 ;--------------------------------------------------------------------
    102 ALIGN JUMP_ALIGN
    103 FileIO_WriteDXCXbytesFromDSSIusingHandleFromBX:
    104     push    bp
    105     mov     bp, FileIO_WriteCXbytesFromDSSIusingHandleFromBX
    106     call    SplitLargeReadOrWritesToSmallerBlocks
    107     pop     bp
    108     ret
    109 
    110 
    111 ;--------------------------------------------------------------------
    11268; File position is updated so next read will start where
    11369; previous read stopped.
     
    158114
    159115;--------------------------------------------------------------------
    160 ; SplitLargeReadOrWritesToSmallerBlocks
    161 ;   Parameters:
     116; FileIO_ReadDXCXbytesToDSSIusingHandleFromBX
     117;   Parameters:
     118;       BX:     File handle
     119;       DX:CX:  Number of bytes to read
     120;       DS:SI:  Ptr to destination buffer
     121;   Returns:
     122;       AX:     DOS error code if CF set
     123;       CF:     Clear if successful
     124;               Set if error
     125;   Corrupts registers:
     126;       AX
     127;--------------------------------------------------------------------
     128ALIGN JUMP_ALIGN
     129FileIO_ReadDXCXbytesToDSSIusingHandleFromBX:
     130    push    bp
     131    mov     bp, FileIO_ReadCXbytesToDSSIusingHandleFromBX
     132    jmp     SHORT SplitLargeReadOrWriteToSmallerBlocks
     133
     134
     135;--------------------------------------------------------------------
     136; FileIO_WriteDXCXbytesFromDSSIusingHandleFromBX
     137;   Parameters:
     138;       BX:     File handle
     139;       DX:CX:  Number of bytes to write
     140;       DS:SI:  Ptr to source buffer
     141;   Returns:
     142;       AX:     DOS error code if CF set
     143;       CF:     Clear if successful
     144;               Set if error
     145;   Corrupts registers:
     146;       AX
     147;--------------------------------------------------------------------
     148ALIGN JUMP_ALIGN
     149FileIO_WriteDXCXbytesFromDSSIusingHandleFromBX:
     150    push    bp
     151    mov     bp, FileIO_WriteCXbytesFromDSSIusingHandleFromBX
     152    ; Fall to SplitLargeReadOrWriteToSmallerBlocks
     153
     154;--------------------------------------------------------------------
     155; SplitLargeReadOrWriteToSmallerBlocks
     156;   Parameters:
     157;       [SP]:   Saved BP (restored on return)
    162158;       BX:     File handle
    163159;       BP:     Ptr to transfer function
     
    171167;       AX
    172168;--------------------------------------------------------------------
    173 ALIGN JUMP_ALIGN
    174 SplitLargeReadOrWritesToSmallerBlocks:
     169SplitLargeReadOrWriteToSmallerBlocks:
    175170    push    ds
    176171    push    si
     
    199194    call    NormalizeDSSI
    200195    call    bp
     196    SKIP1B  dl
     197.ErrorOccurredDuringTransfer:
     198    pop     cx                      ; Remove bytes for last transfer
    201199.ReturnErrorCodeInAX:
    202200    pop     cx
     
    204202    pop     si
    205203    pop     ds
    206     ret
    207 .ErrorOccurredDuringTransfer:
    208     pop     cx                      ; Remove bytes for last transfer
    209     jmp     SHORT .ReturnErrorCodeInAX
     204    pop     bp                      ; Restore BP saved to stack by "caller"
     205    ret
     206
    210207
    211208;--------------------------------------------------------------------
     
    279276FileIO_CloseUsingHandleFromBX:
    280277    mov     ah, CLOSE_FILE
    281     SKIP2B  f   ; cmp ax, <next instruction>
     278    SKIP2B  f
    282279    ; Fall to FileIO_SeekFromOriginInALtoOffsetInDXAXusingHandleFromBX
    283 
    284280
    285281;--------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.