- Timestamp:
- Nov 21, 2021, 2:15:32 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/File/FileIO.asm
r592 r621 66 66 67 67 ;-------------------------------------------------------------------- 68 ; FileIO_ReadDXCXbytesToDSSIusingHandleFromBX69 ; Parameters:70 ; BX: File handle71 ; DX:CX: Number of bytes to read72 ; DS:SI: Ptr to destination buffer73 ; Returns:74 ; AX: DOS error code if CF set75 ; CF: Clear if successful76 ; Set if error77 ; Corrupts registers:78 ; AX79 ;--------------------------------------------------------------------80 ALIGN JUMP_ALIGN81 FileIO_ReadDXCXbytesToDSSIusingHandleFromBX:82 push bp83 mov bp, FileIO_ReadCXbytesToDSSIusingHandleFromBX84 call SplitLargeReadOrWritesToSmallerBlocks85 pop bp86 ret87 88 89 ;--------------------------------------------------------------------90 ; FileIO_WriteDXCXbytesFromDSSIusingHandleFromBX91 ; Parameters:92 ; BX: File handle93 ; DX:CX: Number of bytes to write94 ; DS:SI: Ptr to source buffer95 ; Returns:96 ; AX: DOS error code if CF set97 ; CF: Clear if successful98 ; Set if error99 ; Corrupts registers:100 ; AX101 ;--------------------------------------------------------------------102 ALIGN JUMP_ALIGN103 FileIO_WriteDXCXbytesFromDSSIusingHandleFromBX:104 push bp105 mov bp, FileIO_WriteCXbytesFromDSSIusingHandleFromBX106 call SplitLargeReadOrWritesToSmallerBlocks107 pop bp108 ret109 110 111 ;--------------------------------------------------------------------112 68 ; File position is updated so next read will start where 113 69 ; previous read stopped. … … 158 114 159 115 ;-------------------------------------------------------------------- 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 ;-------------------------------------------------------------------- 128 ALIGN JUMP_ALIGN 129 FileIO_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 ;-------------------------------------------------------------------- 148 ALIGN JUMP_ALIGN 149 FileIO_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) 162 158 ; BX: File handle 163 159 ; BP: Ptr to transfer function … … 171 167 ; AX 172 168 ;-------------------------------------------------------------------- 173 ALIGN JUMP_ALIGN 174 SplitLargeReadOrWritesToSmallerBlocks: 169 SplitLargeReadOrWriteToSmallerBlocks: 175 170 push ds 176 171 push si … … 199 194 call NormalizeDSSI 200 195 call bp 196 SKIP1B dl 197 .ErrorOccurredDuringTransfer: 198 pop cx ; Remove bytes for last transfer 201 199 .ReturnErrorCodeInAX: 202 200 pop cx … … 204 202 pop si 205 203 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 210 207 211 208 ;-------------------------------------------------------------------- … … 279 276 FileIO_CloseUsingHandleFromBX: 280 277 mov ah, CLOSE_FILE 281 SKIP2B f ; cmp ax, <next instruction>278 SKIP2B f 282 279 ; Fall to FileIO_SeekFromOriginInALtoOffsetInDXAXusingHandleFromBX 283 284 280 285 281 ;-------------------------------------------------------------------- -
trunk/Assembly_Library/Src/String/String.asm
r619 r621 79 79 ; CX: Number of characters copied 80 80 ; SI,DI: Updated by CX characters 81 ; CF: Cleared 81 82 ; Corrupts registers: 82 83 ; Nothing … … 90 91 .CopyNextCharacter: 91 92 lodsb ; Load from DS:SI to AL 92 test al, al ; NULL to end string? 93 jz SHORT .EndOfString93 test al, al ; NULL to end string? (Clears CF) 94 jz SHORT PopAXandReturn 94 95 stosb ; Store from AL to ES:DI 95 96 inc cx ; Increment number of characters written 96 97 jmp SHORT .CopyNextCharacter 97 98 ALIGN STRING_JUMP_ALIGN99 .EndOfString:100 pop ax101 ret102 98 103 99 … … 126 122 stc 127 123 sbb cx, si ; Subtract NULL 124 PopAXandReturn: 128 125 pop ax 129 126 ret -
trunk/Assembly_Library/Src/Util/Memory.asm
r602 r621 160 160 ALIGN JUMP_ALIGN 161 161 Memory_SumCXbytesFromESSItoAL: 162 push si 163 dec si 162 add si, cx 164 163 xor al, al 165 164 ALIGN JUMP_ALIGN 166 165 .AddNextByteToAL: 167 inc si166 dec si 168 167 add al, [es:si] 169 168 loop .AddNextByteToAL 170 pop si171 169 ret 172 170 %endif -
trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm
r617 r621 52 52 jne IdeDPT_Finalize 53 53 jmp SerialDPT_Finalize 54 %else 54 %else ; ~USE_386 55 55 je SHORT .FinalizeDptForSerialPortDevice 56 56 jmp IdeDPT_Finalize … … 100 100 ; AL, BX, CX, DX, SI, DI, ES 101 101 ;-------------------------------------------------------------------- 102 %ifndef NO_ATAID_CORRECTION 102 103 Device_IdentifyToBufferInESSIwithDriveSelectByteInBH: 103 %ifndef NO_ATAID_CORRECTION104 104 cmp cx, XUB_INT13h_SIGNATURE 105 105 je SHORT .DoNotFixAtaInformation … … 108 108 ePUSH_T cx, AtaID_PopESSIandFixIllegalValuesFromESSI ; Here we modify ATA information if necessary 109 109 .DoNotFixAtaInformation: 110 %endif111 110 112 111 %ifdef MODULE_SERIAL ; IDE + Serial … … 115 114 jne IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 116 115 jmp SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 117 %else 116 %else ; ~USE_386 118 117 je SHORT .IdentifyDriveFromSerialPort 119 118 jmp IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH … … 126 125 %endif 127 126 127 %else ; NO_ATAID_CORRECTION 128 %ifdef MODULE_SERIAL ; IDE + Serial 129 cmp BYTE [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT 130 %ifdef USE_386 131 jne IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 132 jmp SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 133 %else ; ~USE_386 134 je SHORT .IdentifyDriveFromSerialPort 135 jmp IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 136 .IdentifyDriveFromSerialPort: 137 jmp SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 138 %endif 139 140 %else ; IDE 141 Device_IdentifyToBufferInESSIwithDriveSelectByteInBH EQU IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 142 %endif 143 %endif ; NO_ATAID_CORRECTION 144 128 145 129 146 ;-------------------------------------------------------------------- … … 149 166 jz IdeCommand_OutputWithParameters 150 167 jmp SerialCommand_OutputWithParameters 151 %else 168 %else ; ~USE_386 152 169 jnz SHORT .OutputCommandToSerialPort 153 170 jmp IdeCommand_OutputWithParameters … … 182 199 ; jz IdeCommand_ReadLBAlowRegisterToAL 183 200 ; jmp SerialCommand_ReadLBAlowRegisterToAL 184 ;%else 201 ;%else ; ~USE_386 185 202 ; jnz SHORT .ReadFromSerialPort 186 203 ; jmp IdeCommand_ReadLBAlowRegisterToAL … … 214 231 jnz SHORT ReturnSuccessForSerialPort 215 232 jmp IdeCommand_SelectDrive 216 %else 233 %else ; USE_386 217 234 jz IdeCommand_SelectDrive 218 235 ; Fall to ReturnSuccessForSerialPort … … 225 242 226 243 %ifdef MODULE_SERIAL 227 ALIGN JUMP_ALIGN228 244 ReturnSuccessForSerialPort: 229 245 xor ax, ax -
trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm
r601 r621 154 154 155 155 push si 156 call FindDPT_ToDSDIforSerialDevice 156 call FindDPT_ToDSDIforSerialDevice ; Preserves AX 157 157 pop si 158 158 %ifdef MODULE_SERIAL_FLOPPY … … 162 162 ; So, if there was a previously found floppy disk, DI will point to that DPT and we use that value for the slave. 163 163 ; 164 cmp BYTE [RAMVARS.xlateVars+XLATEVARS.bFlopCntAndFirst], 0164 cmp [RAMVARS.xlateVars+XLATEVARS.bFlopCntAndFirst], al ; Zero? 165 165 je SHORT .notfounddpt 166 166 .founddpt: -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm
r599 r621 203 203 ;-------------------------------------------------------------------- 204 204 Interrupts_UnmaskInterruptControllerForDriveInDSDI: 205 eMOVZX bx, [di+DPT.bIdevarsOffset] 205 eMOVZX bx, [di+DPT.bIdevarsOffset] ; Clears CF on pre-386 CPUs 206 %ifndef USE_386 207 %ifdef USE_UNDOC_INTEL 208 salc 209 or al, [cs:bx+IDEVARS.bIRQ] 210 %else 206 211 mov al, [cs:bx+IDEVARS.bIRQ] 207 212 test al, al 213 %endif 214 %else ; USE_386 215 mov al, [cs:bx+IDEVARS.bIRQ] 216 test al, al 217 %endif 208 218 jz SHORT .Return ; Interrupts disabled 209 219 cmp al, 8 -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r605 r621 96 96 at ROMVARS.ideVars0+IDEVARS.wControlBlockPort, dw DEVICE_ATA_PRIMARY_PORTCTRL ; Controller Control Block base port 97 97 at ROMVARS.ideVars0+IDEVARS.bDevice, db DEVICE_16BIT_ATA 98 %ifdef MODULE_IRQ 98 99 at ROMVARS.ideVars0+IDEVARS.bIRQ, db 14 100 %endif 99 101 at ROMVARS.ideVars0+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) 100 102 at ROMVARS.ideVars0+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) … … 103 105 at ROMVARS.ideVars1+IDEVARS.wControlBlockPort, dw DEVICE_ATA_SECONDARY_PORTCTRL 104 106 at ROMVARS.ideVars1+IDEVARS.bDevice, db DEVICE_16BIT_ATA 107 %ifdef MODULE_IRQ 105 108 at ROMVARS.ideVars1+IDEVARS.bIRQ, db 15 109 %endif 106 110 at ROMVARS.ideVars1+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) 107 111 at ROMVARS.ideVars1+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) … … 110 114 at ROMVARS.ideVars2+IDEVARS.wControlBlockPort, dw DEVICE_ATA_TERTIARY_PORTCTRL 111 115 at ROMVARS.ideVars2+IDEVARS.bDevice, db DEVICE_16BIT_ATA 116 %ifdef MODULE_IRQ 112 117 at ROMVARS.ideVars2+IDEVARS.bIRQ, db 0 ; Should be 11 on the GSI Inc. Model 2C 118 %endif 113 119 at ROMVARS.ideVars2+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) 114 120 at ROMVARS.ideVars2+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) … … 117 123 at ROMVARS.ideVars3+IDEVARS.wControlBlockPort, dw DEVICE_ATA_QUATERNARY_PORTCTRL 118 124 at ROMVARS.ideVars3+IDEVARS.bDevice, db DEVICE_16BIT_ATA 125 %ifdef MODULE_IRQ 119 126 at ROMVARS.ideVars3+IDEVARS.bIRQ, db 0 ; Should be 10 on the GSI Inc. Model 2C 127 %endif 120 128 at ROMVARS.ideVars3+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) 121 129 at ROMVARS.ideVars3+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) -
trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm
r592 r621 123 123 .around: 124 124 125 mov ax, g_szFddSizeOr ; .PrintXTFloppyType125 mov ax, g_szFddSizeOr 126 126 test bl, bl ; Two possibilities? (FLOPPY_TYPE_525_OR_35_DD) 127 127 jz SHORT .PushAXAndOutput 128 128 129 mov al, (g_szFddUnknown - $$) & 0xff ; .PrintUnknownFloppyType129 mov al, (g_szFddUnknown - $$) & 0xff 130 130 cmp bl, FLOPPY_TYPE_35_ED 131 131 ja SHORT .PushAXAndOutput … … 218 218 219 219 .ConvertSectorCountInBXDXAXtoSizeAndPushForFormat: 220 call Size_ConvertSectorCountInBXDXAXtoKiB 220 221 ePUSH_T cx, g_szCapacityNum ; Push format substring 221 call Size_ConvertSectorCountInBXDXAXtoKiB222 222 mov cx, BYTE_MULTIPLES.kiB 223 223 call Size_GetSizeToAXAndCharToDLfromBXDXAXwithMagnitudeInCX -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm
r567 r621 137 137 ;-------------------------------------------------------------------- 138 138 ; Iteration routines for FindDPT_MasterOrSingleForIdevarsOffsetInDL and 139 ; FindDPT_SlaveForIdevarsOffsetInDL, for use with IterateAllDPTs139 ; FindDPT_SlaveForIdevarsOffsetInDL, for use with FindDPT_IterateAllDPTs 140 140 ; 141 141 ; Returns when DPT is found on the controller with Idevars offset in DL … … 152 152 IterateFindSecondDPTforIdevars: 153 153 call IterateFindFirstDPTforIdevars 154 jc SHORT .WrongController154 jc SHORT WrongController 155 155 mov si, IterateFindFirstDPTforIdevars 156 .WrongController:156 SetCFandReturn: 157 157 stc 158 WrongController: 158 159 ret 159 160 160 161 IterateFindFirstDPTforIdevars: 161 162 cmp dl, [di+DPT.bIdevarsOffset] ; Clears CF if matched 162 je .Done 163 stc ; Set CF for not found 164 .Done: 163 jne SHORT SetCFandReturn 165 164 ret 166 165 … … 221 220 ; Set if DPT not found, or no DPTs present 222 221 ; Corrupts registers: 223 ; SI222 ; BL, SI 224 223 ;-------------------------------------------------------------------- 225 224 %ifdef MODULE_SERIAL … … 315 314 loop .LoopWhileDPTsLeft 316 315 317 ALIGN JUMP_ALIGN318 316 .NotFound: 319 317 stc -
trunk/XTIDE_Universal_BIOS/makefile
r618 r621 231 231 232 232 custom: 233 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_CUSTOM) -l"$(TARGET)_c ustom.lst" -o"$(TARGET)_custom.bin"234 @echo * Custom version "$(TARGET)_c ustom.bin" built.233 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_CUSTOM) -l"$(TARGET)_cstm.lst" -o"$(TARGET)_cstm.bin" 234 @echo * Custom version "$(TARGET)_cstm.bin" built. 235 235 236 236 strings: src\Strings.asm -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Variables.inc
r620 r621 22 22 23 23 ; Equates and defines 24 BOOT_MENU_DEFAULT_TIMEOUT 25 MAX_ALLOWED_IDE_CONTROLLERS 26 MAX_LITE_MODE_CONTROLLERS 27 EEPROM_POLLING_TIMEOUT_TICKS 28 XTIDE_SIGNATURE_LENGTH 29 NUMBER_OF_EEPROM_TYPES 30 MAX_EEPROM_SIZE_IN_BYTES 31 SST_PAGE_SIZE_SHIFT 32 SST_PAGE_SIZE EQU (1 << SST_PAGE_SIZE_SHIFT)24 BOOT_MENU_DEFAULT_TIMEOUT EQU (TICKS_PER_MINUTE / 2) 25 MAX_ALLOWED_IDE_CONTROLLERS EQU 4 ; Maximum number of IDE controllers 26 MAX_LITE_MODE_CONTROLLERS EQU 2 27 EEPROM_POLLING_TIMEOUT_TICKS EQU 3 ; 1 tick = 54.9 ms 28 XTIDE_SIGNATURE_LENGTH EQU 6 ; XTIDE Universal BIOS signature string length (must be even) 29 NUMBER_OF_EEPROM_TYPES EQU 5 30 MAX_EEPROM_SIZE_IN_BYTES EQU 65536 31 SST_PAGE_SIZE_SHIFT EQU 12 ; Minimum we can erase is a 4K sector. 32 SST_PAGE_SIZE EQU (1 << SST_PAGE_SIZE_SHIFT) 33 33 34 34 ; Program global variables … … 98 98 99 99 .wProgressUpdateParam resb 2 100 .wTimeoutCounter resb 2 ; On SSI, this is timeout cal100 .wTimeoutCounter resb 2 101 101 .wLastOffsetWritten resb 2 102 102 .bLastByteWritten resb 1 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/AutoConfigure.asm
r614 r621 118 118 xor dh, al 119 119 mov bl, dh 120 rol bx, 1 121 rol bx, 1 122 rol bx, 1 123 rol bx, 1 120 %ifdef USE_186 121 rol bx, 4 122 %else 123 rol bx, 1 124 rol bx, 1 125 rol bx, 1 126 rol bx, 1 127 %endif 124 128 xor dx, bx 125 129 rol bx, 1 126 130 xchg dh, dl 127 131 xor dx, bx 128 ror bx, 1 129 ror bx, 1 130 ror bx, 1 131 ror bx, 1 132 %ifdef USE_186 133 ror bx, 4 134 %else 135 ror bx, 1 136 ror bx, 1 137 ror bx, 1 138 ror bx, 1 139 %endif 132 140 and bl, ah 133 141 xor dx, bx … … 156 164 inc ch ; Hours changed? 157 165 jz SHORT .ThisIsNotAnOlivettiM24 158 mov BYTE [cs: IsOlivettiM24], 1166 mov BYTE [cs:bIsOlivettiM24], 1 159 167 .ThisIsNotAnOlivettiM24: 160 168 ret 161 169 162 IsOlivettiM24:170 bIsOlivettiM24: 163 171 db 0 164 172 … … 249 257 EnableInterruptsForAllStandardControllers: 250 258 jcxz .NoControllersDetected 259 test BYTE [ROMVARS.wFlags+1], FLG_ROMVARS_MODULE_IRQ >> 8 260 jz SHORT .NoModuleIrq 251 261 call Buffers_IsXTbuildLoaded 252 262 je SHORT .DoNotEnableIRQforXTbuilds … … 285 295 pop di 286 296 .DoNotEnableIRQforXTbuilds: 297 .NoModuleIrq: 287 298 .NoControllersDetected: 288 299 ret -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm
r596 r621 33 33 ALIGN JUMP_ALIGN 34 34 BiosFile_LoadFileFromDSSItoRamBuffer: 35 push ds 36 37 call .OpenFileForLoadingFromDSSIandGetSizeToDXCX 35 mov al, FILE_ACCESS.ReadOnly 36 call FileIO_OpenWithPathInDSSIandFileAccessInAL 38 37 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 39 55 call .LoadFileWithNameInDSSIhandleInBXandSizeInDXCXtoRamBuffer 40 jc SHORT . DisplayErrorMessage56 jc SHORT .CloseUsingHandleFromBXandDisplayErrorMessage 41 57 42 58 mov al, FLG_CFGVARS_FILELOADED 43 59 call Buffers_NewBiosWithSizeInDXCXandSourceInALhasBeenLoadedForConfiguration 44 60 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 84 63 .FileTooBig: 85 64 call DisplayFileTooBig 86 stc 87 .FileError: 88 ret 65 .CloseUsingHandleFromBXandDisplayErrorMessage: 66 call FileIO_CloseUsingHandleFromBX 67 .DisplayErrorMessage: 68 jmp SHORT DisplayFailedToLoadFile 69 89 70 90 71 ;-------------------------------------------------------------------- … … 112 93 push cx 113 94 114 call Registers_CopyESDItoDSSI ; File name in DS:SI95 call Registers_CopyESDItoDSSI ; File name in DS:SI 115 96 push cs 116 97 pop es … … 119 100 cld 120 101 %endif 121 call String_CopyDSSItoESDIandGetLengthToCX 122 clc 102 call String_CopyDSSItoESDIandGetLengthToCX ; Returns with CF cleared 123 103 124 104 pop cx … … 164 144 BiosFile_SaveRamBufferToFileInDSSI: 165 145 push es 166 push ds167 146 168 147 call Buffers_GenerateChecksum … … 174 153 jc SHORT .DisplayErrorMessage 175 154 155 push ds 176 156 call Registers_CopyESDItoDSSI 177 157 call FileIO_WriteDXCXbytesFromDSSIusingHandleFromBX 158 pop ds 159 pushf 160 call FileIO_CloseUsingHandleFromBX 161 popf 178 162 jc SHORT .DisplayErrorMessage 179 163 180 call FileIO_CloseUsingHandleFromBX181 164 call Buffers_ClearUnsavedChanges 182 call DisplayFileSavedSuccessfully183 jmp SHORT .Return165 pop es 166 jmp SHORT DisplayFileSavedSuccessfully 184 167 185 168 .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 193 171 194 172 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm
r620 r621 49 49 ALIGN JUMP_ALIGN 50 50 Buffers_IsXtideUniversalBiosLoaded: 51 test BYTE [ cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED51 test BYTE [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED 52 52 jnz SHORT .FileOrBiosLoaded 53 53 test sp, sp ; Clear ZF … … 120 120 ALIGN JUMP_ALIGN 121 121 Buffers_NewBiosWithSizeInDXCXandSourceInALhasBeenLoadedForConfiguration: 122 and BYTE [ cs:g_cfgVars+CFGVARS.wFlags], ~(FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED | FLG_CFGVARS_UNSAVED)123 or [ cs:g_cfgVars+CFGVARS.wFlags], al122 and BYTE [g_cfgVars+CFGVARS.wFlags], ~(FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED | FLG_CFGVARS_UNSAVED) 123 or [g_cfgVars+CFGVARS.wFlags], al 124 124 shr dx, 1 125 125 rcr cx, 1 126 126 adc cx, BYTE 0 ; Round up to next WORD 127 mov [ cs:g_cfgVars+CFGVARS.wImageSizeInWords], cx127 mov [g_cfgVars+CFGVARS.wImageSizeInWords], cx 128 128 ret 129 129 … … 141 141 ALIGN JUMP_ALIGN 142 142 Buffers_SetUnsavedChanges: 143 or BYTE [ cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_UNSAVED143 or BYTE [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_UNSAVED 144 144 ret 145 145 146 146 ALIGN JUMP_ALIGN 147 147 Buffers_ClearUnsavedChanges: 148 and BYTE [ cs:g_cfgVars+CFGVARS.wFlags], ~FLG_CFGVARS_UNSAVED148 and BYTE [g_cfgVars+CFGVARS.wFlags], ~FLG_CFGVARS_UNSAVED 149 149 ret 150 150 … … 161 161 ALIGN JUMP_ALIGN 162 162 Buffers_SaveChangesIfFileLoaded: 163 mov al, [cs:g_cfgVars+CFGVARS.wFlags] 164 and al, FLG_CFGVARS_FILELOADED | FLG_CFGVARS_UNSAVED 163 test BYTE [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED | FLG_CFGVARS_UNSAVED 165 164 jz SHORT .NothingToSave 166 165 jpo SHORT .NothingToSave … … 184 183 ALIGN JUMP_ALIGN 185 184 Buffers_GetSelectedEepromSizeInWordsToAX: 186 eMOVZX bx, [ cs:g_cfgVars+CFGVARS.bEepromType]187 mov ax, [ cs:bx+g_rgwEepromTypeToSizeInWords]185 eMOVZX bx, [g_cfgVars+CFGVARS.bEepromType] 186 mov ax, [bx+g_rgwEepromTypeToSizeInWords] 188 187 189 188 cmp bl, EEPROM_TYPE.SST_39SF 190 jn zSHORT .HaveEepromSize191 cmp ax, [ cs:g_cfgVars+CFGVARS.wImageSizeInWords]192 jae SHORT .HaveEepromSize 193 shl ax, 1; Auto-double SST size when too small.189 jne SHORT .HaveEepromSize 190 cmp ax, [g_cfgVars+CFGVARS.wImageSizeInWords] 191 jae SHORT .HaveEepromSize 192 eSHL_IM ax, 1 ; Auto-double SST size when too small. 194 193 .HaveEepromSize: 195 194 ret … … 206 205 ALIGN JUMP_ALIGN 207 206 Buffers_AppendZeroesIfNeeded: 207 call Buffers_GetSelectedEepromSizeInWordsToAX 208 mov cx, [g_cfgVars+CFGVARS.wImageSizeInWords] 209 sub ax, cx ; AX = WORDs to append 210 jbe SHORT .NoNeedToAppendZeroes 211 212 eSHL_IM cx, 1 208 213 push es 209 210 call Buffers_GetSelectedEepromSizeInWordsToAX 211 mov cx, ax 212 sub cx, [cs:g_cfgVars+CFGVARS.wImageSizeInWords] ; CX = WORDs to append 213 jbe SHORT .NoNeedToAppendZeroes 214 215 call Buffers_GetFileBufferToESDI 216 mov ax, [cs:g_cfgVars+CFGVARS.wImageSizeInWords] 217 eSHL_IM ax, 1 218 add di, ax ; ES:DI now point first unused image byte 219 xor ax, ax 214 call Buffers_GetFileBufferToESDI 215 add di, cx ; ES:DI now point first unused image byte 216 xor cx, cx 217 xchg cx, ax 220 218 %ifdef CLD_NEEDED 221 219 cld 222 220 %endif 223 221 rep stosw 224 ALIGN JUMP_ALIGN 222 pop es 225 223 .NoNeedToAppendZeroes: 226 pop es227 224 ret 228 225 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Dialogs.asm
r602 r621 29 29 ; SS:BP: Menu handle 30 30 ; Returns: 31 ; Nothing31 ; ZF: Cleared 32 32 ; Corrupts registers: 33 33 ; AX … … 53 53 ; SS:BP: Menu handle 54 54 ; Returns: 55 ; Nothing55 ; ZF: Cleared 56 56 ; Corrupts registers: 57 57 ; AX … … 72 72 CALL_MENU_LIBRARY DisplayMessageWithInputInDSSI 73 73 74 add sp, BYTE DIALOG_INPUT_size 74 add sp, BYTE DIALOG_INPUT_size ; Clears ZF 75 75 pop cx 76 76 pop si -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm
r620 r621 99 99 ALIGN JUMP_ALIGN 100 100 EEPROM_LoadOldSettingsFromRomToRamBuffer: 101 mov cx, ROMVARS_size - ROMVARS.wFlags ; Number of bytes to load102 mov si, ROMVARS.wFlags ; Offset where to start loading101 mov cx, ROMVARS_size - ROMVARS.wFlags - 2 ; Number of bytes to load 102 mov si, ROMVARS.wFlags + 2 ; Offset where to start loading 103 103 ; Fall to LoadBytesFromRomToRamBuffer 104 104 … … 123 123 jc SHORT .XtideUniversalBiosNotFound 124 124 push es 125 pop ds 125 pop ds ; DS:SI points to ROM 126 126 127 127 call Buffers_GetFileBufferToESDI 128 mov di, si 128 mov di, si ; ES:DI points to RAM buffer 129 129 130 130 %ifdef CLD_NEEDED 131 131 cld 132 132 %endif 133 call Memory_CopyCXbytesFromDSSItoESDI 133 call Memory_CopyCXbytesFromDSSItoESDI ; Clears CF 134 134 135 135 .XtideUniversalBiosNotFound: … … 163 163 call Buffers_IsXtideUniversalBiosSignatureInESDI 164 164 je SHORT .RomFound ; If equal, CF=0 165 add bx, 80h ; Increment by 2kB (minimum possible distance from the beginning of one option ROM to the next) 166 jnc SHORT .SegmentLoop ; Loop until segment overflows 165 sub bx, -80h ; Increment by 2kB (minimum possible distance from the beginning of one option ROM to the next) 166 jc SHORT .SegmentLoop ; Loop until segment overflows 167 stc 167 168 .RomFound: 168 169 pop cx … … 185 186 push ds 186 187 187 mov ds, [cs:g_cfgVars+CFGVARS.wEepromSegment] 188 eMOVZX bx, [g_cfgVars+CFGVARS.bEepromType] 189 mov cx, [bx+g_rgwEepromTypeToSizeInWords] 190 mov ds, [g_cfgVars+CFGVARS.wEepromSegment] 188 191 xor si, si 189 192 call Buffers_GetFlashComparisonBufferToESDI 190 eMOVZX bx, [cs:g_cfgVars+CFGVARS.bEepromType]191 193 %ifdef CLD_NEEDED 192 194 cld 193 195 %endif 194 mov cx, [cs:bx+g_rgwEepromTypeToSizeInWords]195 196 rep movsw 196 197 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/FlashSST.asm
r620 r621 3 3 4 4 ; 5 ; Created by Jayeson Lee-Steere 6 ; Hereby placed into the public domain. 5 ; XTIDE Universal BIOS and Associated Tools 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2021 by XTIDE Universal BIOS Team. 7 ; 8 ; This program is free software; you can redistribute it and/or modify 9 ; it under the terms of the GNU General Public License as published by 10 ; the Free Software Foundation; either version 2 of the License, or 11 ; (at your option) any later version. 12 ; 13 ; This program is distributed in the hope that it will be useful, 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ; GNU General Public License for more details. 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 7 18 ; 8 19 … … 27 38 push si 28 39 push bp 29 mov bp, bx ; Flashvars now in SS:BP .40 mov bp, bx ; Flashvars now in SS:BP (Assumes SS=DS) 30 41 31 42 mov BYTE [bp+FLASHVARS.flashResult], FLASH_RESULT.DeviceNotDetected … … 34 45 35 46 call CalibrateSstTimeout 36 47 37 48 mov BYTE [bp+FLASHVARS.flashResult], FLASH_RESULT.PollingTimeoutError 38 49 mov cx, [bp+FLASHVARS.wPagesToFlash] 39 lds si, [bp+FLASHVARS.fpNextSourcePage] 40 les di, [bp+FLASHVARS.fpNextDestinationPage] 50 mov dx, [bp+FLASHVARS.wEepromPageSize] 51 les di, [bp+FLASHVARS.fpNextSourcePage] 52 lds si, [bp+FLASHVARS.fpNextDestinationPage] 41 53 %ifdef CLD_NEEDED 42 54 cld … … 49 61 push di 50 62 push cx 51 mov cx, [bp+FLASHVARS.wEepromPageSize] 52 mov bx, cx 63 mov cx, dx 53 64 repe cmpsb 54 65 pop cx 55 66 pop di 56 67 pop si 57 jn zSHORT .FlashThisPage58 add si, bx59 add di, bx68 jne SHORT .FlashThisPage 69 add si, dx 70 add di, dx 60 71 jmp SHORT .ContinueLoop 61 72 … … 69 80 70 81 ; The write process has already confirmed the results one byte at a time. 71 ; Here we do an additional verify check just in case there was some 82 ; Here we do an additional verify check just in case there was some 72 83 ; kind of oddity with pages / addresses. 73 84 mov BYTE [bp+FLASHVARS.flashResult], FLASH_RESULT.DataVerifyError 85 %ifndef USE_186 74 86 mov ax, [bp+FLASHVARS.wPagesToFlash] 75 mov cl, SST_PAGE_SIZE_SHIFT 87 mov cl, SST_PAGE_SIZE_SHIFT - 1 ; -1 because we compare WORDs (verifying 64 KB won't work otherwise) 76 88 shl ax, cl 77 mov cx, ax 89 xchg cx, ax 90 %else 91 mov cx, [bp+FLASHVARS.wPagesToFlash] 92 shl cx, SST_PAGE_SIZE_SHIFT - 1 93 %endif 78 94 lds si, [bp+FLASHVARS.fpNextSourcePage] 79 95 les di, [bp+FLASHVARS.fpNextDestinationPage] 80 repe cmps b81 jn zSHORT .ExitOnError96 repe cmpsw 97 jne SHORT .ExitOnError 82 98 83 99 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS … … 106 122 ; Set if supported SST device not found 107 123 ; Corrupts registers: 108 ; AX, DI, ES124 ; AX, BX, SI, DS 109 125 ;-------------------------------------------------------------------- 110 126 ALIGN JUMP_ALIGN 111 127 DetectSstDevice: 112 les di, [bp+FLASHVARS.fpNextDestinationPage] 128 lds si, [bp+FLASHVARS.fpNextDestinationPage] 129 mov bx, 5555h 113 130 114 131 cli 115 mov BYTE [es:05555h], 0AAh ; Enter software ID sequence. 116 mov BYTE [es:02AAAh], 055h 117 mov BYTE [es:05555h], 090h 118 mov al, [es:di] ; Extra reads to be sure device 119 mov al, [es:di] ; has time to respond. 120 mov al, [es:di] 121 mov ah, [es:di] ; Vendor ID in AH. 122 mov al, [es:di + 1] ; Device ID in AL. 123 mov BYTE [es:05555h], 0F0h ; Exit software ID. 132 mov BYTE [bx], 0AAh ; Enter software ID sequence. 133 shr bx, 1 ; BX=2AAAh, CF=1 134 mov BYTE [bx], 55h 135 eRCL_IM bx, 1 ; BX=5555h 136 mov BYTE [bx], 90h 137 mov al, [si] ; Extra reads to be sure device 138 mov al, [si] ; has time to respond. 139 mov al, [si] 140 mov ah, [si] ; Vendor ID in AH. 141 mov al, [si+1] ; Device ID in AL. 142 mov BYTE [bx], 0F0h ; Exit software ID. 124 143 sti 125 144 126 cmp a l, 0B4h145 cmp ax, 0BFB4h 127 146 jb SHORT .NotValidDevice 128 cmp al, 0B7h 129 ja SHORT .NotValidDevice 130 cmp ah, 0BFh 131 jne SHORT .NotValidDevice 132 ret 133 147 cmp ax, 0BFB7h+1 148 cmc 134 149 .NotValidDevice: 135 stc 136 ret 137 150 ret 151 138 152 ;-------------------------------------------------------------------- 139 153 ; CalibrateSstTimeout … … 147 161 ALIGN JUMP_ALIGN 148 162 CalibrateSstTimeout: 149 LOAD_BDA_SEGMENT_TO ds, ax150 les di, [bp+FLASHVARS.fpNextDestinationPage]151 xor cx, cx163 LOAD_BDA_SEGMENT_TO es, cx, ! 164 mov ds, [bp+FLASHVARS.fpNextDestinationPage+2] 165 mov bx, BDA.dwTimerTicks 152 166 mov si, cx 153 167 mov di, cx 154 mov al, [ es:di]155 not al ; Forces poll to fail.156 157 mov bx, [BDA.dwTimerTicks] ; Read low word only.158 inc bx168 mov al, [di] 169 inc ax ; Forces poll to fail 170 171 mov ah, [es:bx] ; Read low byte only 172 inc ah 159 173 .WaitForFirstIncrement: 160 cmp bx, [BDA.dwTimerTicks]161 jn zSHORT .WaitForFirstIncrement162 163 inc bx174 cmp ah, [es:bx] 175 jne SHORT .WaitForFirstIncrement 176 177 inc ah 164 178 165 179 .WaitForSecondIncrement: 166 inc ch ; cx now 0x0100 167 .PollLoop: ; Identical to poll loop used 168 cmp [es:di], al ; during programming 169 jz SHORT .PollComplete ; Will never branch in this case 170 loop .PollLoop 171 .PollComplete: 172 add si, 1 ; number of poll loops completed 173 jc SHORT .countOverflow 174 cmp bx, [BDA.dwTimerTicks] 175 jnz SHORT .WaitForSecondIncrement 176 177 .CalComplete: 178 ; SI ~= number of polling loops in 215us. 179 mov [bp+FLASHVARS.wTimeoutCounter], si 180 ret 181 182 .countOverflow: 180 inc ch ; CX now 0x0100 181 .PollLoop: ; Identical to poll loop used 182 cmp [di], al ; during programming 183 loopne .PollLoop ; Will never be equal in this case 184 inc si ; Number of poll loops completed 185 jz SHORT .CountOverflow 186 cmp ah, [es:bx] 187 jne SHORT .WaitForSecondIncrement 188 SKIP1B al 189 .CountOverflow: 183 190 ; Clamp on overflow, although it should not be possible on 184 191 ; real hardware. In principle SI could overflow on a very … … 187 194 ; the device, SI can not overflow. 188 195 dec si 189 jmp SHORT .CalComplete 196 197 ; SI ~= number of polling loops in 215us. 198 mov [bp+FLASHVARS.wTimeoutCounter], si 199 ret 190 200 191 201 ;-------------------------------------------------------------------- 192 202 ; EraseSstPage 193 203 ; Parameters: 194 ; ES:DI: Destination ptr.204 ; DS:SI: Destination ptr 195 205 ; Returns: 196 206 ; CF: Set on error. 197 207 ; Corrupts registers: 198 ; AX 208 ; AX, BX 199 209 ;-------------------------------------------------------------------- 200 210 ALIGN JUMP_ALIGN … … 202 212 push cx 203 213 204 mov BYTE [es:05555h], 0AAh ; Sector erase sequence. 205 mov BYTE [es:02AAAh], 055h 206 mov BYTE [es:05555h], 080h 207 mov BYTE [es:05555h], 0AAh 208 mov BYTE [es:02AAAh], 055h 209 mov BYTE [es:di], 030h 210 214 mov bx, 5555h 215 mov ax, 2AAAh 216 217 ; Sector erase sequence. 218 mov [bx], al ; [5555h] <- AAh 219 xchg bx, ax 220 mov [bx], al ; [2AAAh] <- 55h 221 xchg bx, ax 222 mov BYTE [bx], 80h ; [5555h] <- 80h 223 mov [bx], al ; [5555h] <- AAh 224 xchg bx, ax 225 mov [bx], al ; [2AAAh] <- 55h 226 mov BYTE [si], 30h 227 228 or bl, al ; BL = 0FFh 211 229 mov ax, 1163 ; 1163 x ~215us = 250ms = 10x datasheet max 212 230 .TimeoutOuterLoop: 213 231 mov cx, [bp+FLASHVARS.wTimeoutCounter] 214 232 .TimeoutInnerLoop: 215 cmp BYTE [es:di], 0FFh ; Will return 0FFh when erase complete.216 jz SHORT .Exit217 loop .TimeoutInnerLoop233 cmp [si], bl ; Will return 0FFh when erase complete 234 loopne .TimeoutInnerLoop 235 je SHORT .Return 218 236 dec ax 219 237 jnz SHORT .TimeoutOuterLoop 220 stc ; Timed out.221 . Exit:238 ; Timed out (CF=1) 239 .Return: 222 240 pop cx 223 241 ret … … 226 244 ; WriteSstPage 227 245 ; Parameters: 228 ; DS:SI: Source ptr. 229 ; ES:DI: Destination ptr. 246 ; DX: EEPROM page size 247 ; DS:SI: Destination ptr 248 ; ES:DI: Source ptr 230 249 ; Returns: 231 250 ; SI, DI: Each advanced forward 1 page. 232 251 ; CF: Set on error. 233 252 ; Corrupts registers: 234 ; AL, BX , DX253 ; AL, BX 235 254 ;-------------------------------------------------------------------- 236 255 ALIGN JUMP_ALIGN 237 256 WriteSstPage: 238 257 push cx 258 push dx 239 259 240 260 mov bx, [bp+FLASHVARS.wTimeoutCounter] 241 mov dx, [bp+FLASHVARS.wEepromPageSize]261 xchg si, di 242 262 cli 243 263 244 264 .NextByte: 245 lodsb246 mov BYTE [ es:05555h], 0AAh; Byte program sequence.247 mov BYTE [ es:02AAAh], 055h248 mov BYTE [ es:05555h], 0A0h249 mov [ es:di], al265 es lodsb ; Read byte from ES:SI 266 mov BYTE [5555h], 0AAh ; Byte program sequence. 267 mov BYTE [2AAAh], 55h 268 mov BYTE [5555h], 0A0h 269 mov [di], al ; Write byte to DS:DI 250 270 251 271 mov cx, bx 252 272 .WaitLoop: 253 cmp [es:di], al ; Device won't return actual data until 254 jz SHORT .ByteFinished ; write complete. Timeout ~215us, or 255 loop .WaitLoop ; ~10x 20us max program time from datasheet. 256 257 stc ; Write timeout. 258 jmp SHORT .Exit 259 260 .ByteFinished: 273 cmp [di], al ; Device won't return actual data until write complete. 274 loopne .WaitLoop ; Timeout ~215us, or ~10x 20us max program time from datasheet. 275 jne SHORT .WriteTimeout 276 261 277 inc di 262 278 dec dx 263 279 jnz SHORT .NextByte 264 clc 265 .Exit: 280 SKIP1B al 281 .WriteTimeout: 282 stc 266 283 sti 267 pop cx 268 ret 284 xchg si, di 285 pop dx 286 pop cx 287 ret -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/IdeAutodetect.asm
r618 r621 141 141 jc SHORT .ContinueDetection 142 142 mov al, DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD 143 cmp BYTE [cs: IsOlivettiM24], 1143 cmp BYTE [cs:bIsOlivettiM24], 1 144 144 jne SHORT .IdeDeviceFound 145 145 mov al, DEVICE_8BIT_XTCF_PIO8 … … 172 172 cmp al, DEVICE_8BIT_XTIDE_REV2 173 173 jne SHORT .XtideRev1 174 cmp BYTE [cs: IsOlivettiM24], 1174 cmp BYTE [cs:bIsOlivettiM24], 1 175 175 jne SHORT .IdeDeviceFound 176 176 mov al, DEVICE_8BIT_XTIDE_REV2_OLIVETTI -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm
r605 r621 185 185 186 186 ColorThemeTable: 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. 187 189 ; Classic (default) 188 190 db COLOR_ATTRIBUTE(COLOR_YELLOW, COLOR_BLUE) ; .cBordersAndBackground -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm
r620 r621 205 205 mov si, g_MenupageForFlashMenu 206 206 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 214 217 ; SS:BP: Menu handle 215 218 ; Returns: 216 219 ; Nothing 217 220 ; Corrupts registers: 218 ; AX, BX 219 ;-------------------------------------------------------------------- 220 ALIGN JUMP_ALIGN 221 .EnableMenuitemsUnusedBySstFlash: 221 ; BX 222 ;-------------------------------------------------------------------- 223 .EnableOrDisableMenuitemsUnusedBySstFlash: 222 224 mov bx, g_MenuitemFlashSdpCommand 223 call EnableMenuitemFromCSBX225 call ax 224 226 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 242 228 243 229 ;-------------------------------------------------------------------- … … 254 240 call .MakeSureThatImageFitsInEeprom 255 241 jc SHORT .InvalidFlashingParameters 256 cmp WORD [cs:g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF257 jn zSHORT .SkipAlignmentCheck242 cmp BYTE [g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF 243 jne SHORT .SkipAlignmentCheck 258 244 call .MakeSureAddress32KAligned 259 j cSHORT .InvalidFlashingParameters245 jnz SHORT .InvalidFlashingParameters 260 246 .SkipAlignmentCheck: 261 247 push es … … 267 253 call .InitializeFlashvarsFromDSSI 268 254 mov bx, si ; DS:BX now points to FLASHVARS 269 cmp WORD [cs:g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF270 j zSHORT .FlashWithoutProgressBar255 cmp BYTE [g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF 256 je SHORT .FlashWithoutProgressBar 271 257 add si, BYTE FLASHVARS_size ; DS:SI now points to PROGRESS_DIALOG_IO 272 258 call Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX … … 282 268 .FlashWithoutProgressBar: ; Worst case. SST devices will 283 269 call FlashSst_WithFlashvarsInDSBX ; either complete flashing 284 jmp SHORT .FlashComplete ; or timeout within 2 seconds. 270 jmp SHORT .FlashComplete ; or timeout within 2 seconds. 285 271 286 272 ;-------------------------------------------------------------------- … … 296 282 .MakeSureThatImageFitsInEeprom: 297 283 call Buffers_GetSelectedEepromSizeInWordsToAX 298 cmp ax, [ cs:g_cfgVars+CFGVARS.wImageSizeInWords]284 cmp ax, [g_cfgVars+CFGVARS.wImageSizeInWords] 299 285 jae SHORT .ImageFitsInSelectedEeprom 300 286 mov dx, g_szErrEepromTooSmall … … 312 298 ; SS:BP: Ptr to MENU 313 299 ; Returns: 314 ; CF: Setif EEPROM segment is not 32K aligned315 ; Corrupts registers: 316 ; AX, BX,DX300 ; ZF: Cleared if EEPROM segment is not 32K aligned 301 ; Corrupts registers: 302 ; AX, DX 317 303 ;-------------------------------------------------------------------- 318 304 ALIGN JUMP_ALIGN 319 305 .MakeSureAddress32KAligned: 320 mov ax, [cs:g_cfgVars+CFGVARS.wEepromSegment] 321 and ax, 007FFh 306 test WORD [g_cfgVars+CFGVARS.wEepromSegment], 07FFh 322 307 jz SHORT .AlignmentIs32K 323 308 mov dx, g_szErrAddrNot32KAligned 324 call Dialogs_DisplayErrorFromCSDX 325 stc 326 ret 309 jmp Dialogs_DisplayErrorFromCSDX 327 310 328 311 ;-------------------------------------------------------------------- … … 339 322 call EEPROM_LoadFromRomToRamComparisonBuffer 340 323 call Buffers_AppendZeroesIfNeeded 341 test BYTE [ cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_CHECKSUM324 test BYTE [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_CHECKSUM 342 325 jz SHORT .DoNotGenerateChecksumByte 343 326 jmp Buffers_GenerateChecksum … … 363 346 mov [si+FLASHVARS.fpNextComparisonPage+2], es 364 347 365 mov ax, [ cs:g_cfgVars+CFGVARS.wEepromSegment]348 mov ax, [g_cfgVars+CFGVARS.wEepromSegment] 366 349 mov WORD [si+FLASHVARS.fpNextDestinationPage], 0 367 350 mov [si+FLASHVARS.fpNextDestinationPage+2], ax 368 351 369 mov al, [ cs:g_cfgVars+CFGVARS.bEepromType]352 mov al, [g_cfgVars+CFGVARS.bEepromType] 370 353 mov [si+FLASHVARS.bEepromType], al 371 354 372 mov al, [ cs:g_cfgVars+CFGVARS.bSdpCommand]355 mov al, [g_cfgVars+CFGVARS.bSdpCommand] 373 356 mov [si+FLASHVARS.bEepromSdpCommand], al 374 357 375 358 mov ax, SST_PAGE_SIZE 376 cmp WORD[g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF377 j zSHORT .UseSstPageSize378 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] 381 364 .UseSstPageSize: 382 365 mov [si+FLASHVARS.wEepromPageSize], ax -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm
r614 r621 300 300 IdeControllerMenu_InitializeToIdevarsOffsetInBX: 301 301 lea ax, [bx+IDEVARS.drvParamsMaster] 302 mov [ cs:g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax302 mov [g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 303 303 304 304 lea ax, [bx+IDEVARS.drvParamsSlave] 305 mov [ cs:g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax305 mov [g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 306 306 307 307 lea ax, [bx+IDEVARS.bDevice] 308 mov [ cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax308 mov [g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 309 309 310 310 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 311 311 %if IDEVARS.wBasePort = 0 312 mov [ cs:g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], bx312 mov [g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], bx 313 313 %else 314 314 lea ax, [bx+IDEVARS.wBasePort] 315 mov [ cs:g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax315 mov [g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 316 316 %endif 317 317 318 318 %if IDEVARS.bSerialPort = 0 319 mov [ cs:g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], bx319 mov [g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], bx 320 320 %else 321 321 lea ax, [bx+IDEVARS.bSerialPort] 322 mov [ cs:g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax322 mov [g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 323 323 %endif 324 324 %endif 325 325 326 326 lea ax, [bx+IDEVARS.bSerialBaud] 327 mov [ cs:g_MenuitemIdeControllerSerialBaud+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax327 mov [g_MenuitemIdeControllerSerialBaud+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 328 328 329 329 lea ax, [bx+IDEVARS.wControlBlockPort] 330 mov [ cs:g_MenuitemIdeControllerControlBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax330 mov [g_MenuitemIdeControllerControlBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 331 331 332 332 lea ax, [bx+IDEVARS.bSerialCOMPortChar] 333 mov [ cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax333 mov [g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 334 334 335 335 lea ax, [bx+IDEVARS.bIRQ] 336 mov [ cs:g_MenuitemIdeControllerEnableInterrupt+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax337 mov [ cs:g_MenuitemIdeControllerIdeIRQ+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax336 mov [g_MenuitemIdeControllerEnableInterrupt+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 337 mov [g_MenuitemIdeControllerIdeIRQ+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 338 338 339 339 ret … … 512 512 mov bx, g_MenuitemMasterSlaveDisableDetection 513 513 call DisableMenuitemFromCSBX 514 mov bx, [ cs:g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]514 mov bx, [g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 515 515 jmp SHORT DisplayMasterSlaveMenu 516 516 … … 519 519 mov bx, g_MenuitemMasterSlaveDisableDetection 520 520 call EnableMenuitemFromCSBX 521 mov bx, [ cs:g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]521 mov bx, [g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 522 522 ; Fall to DisplayMasterSlaveMenu 523 523 … … 566 566 ; Standard ATA controllers, including 8-bit mode 567 567 .StandardIdeDevice: 568 ; Enable IRQ for standard ATA 568 ; Enable IRQ for standard ATA, but only if MODULE_IRQ is included 569 569 570 570 lea ax, [di-ROMVARS.ideVars0+IDEVARS.wBasePort] 571 571 mov bl, IDEVARS_size 572 572 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 573 578 push ax 574 mov bx, .rgbDefaultIrqForStdIde ; Enable interrupt for primary and secondary IDE575 579 xlat 576 580 mov [es:di+IDEVARS.bIRQ-IDEVARS.wBasePort], al 577 581 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 580 586 mov ah, 1 ; DEVICE_ATA_*_PORT >> 8 581 587 mov bh, 3 ; DEVICE_ATA_*_PORTCTRL >> 8 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm
r602 r621 285 285 call Dialogs_DisplayNotificationFromCSDX 286 286 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: 288 295 jmp MainMenu_EnterMenuOrModifyItemVisibility 289 296 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm
r620 r621 55 55 g_szFlashTitle: db "Flashing EEPROM, please wait.",NULL 56 56 g_szErrEepromTooSmall: db "Image is too large for selected EEPROM type!",NULL 57 g_szErrAddrNot32KAligned: db "The selected EEPROM type requires the address to be 32 58 db " kiB aligned (C800, D000, D800, E000, etc.)",NULL57 g_szErrAddrNot32KAligned: db "The selected EEPROM type requires the address to be 32" 58 db " kiB aligned (C800, D000, D800, E000, etc.)",NULL 59 59 g_szErrEepromDetection: db "EEPROM of type not found.",LF 60 60 db "EEPROM was not flashed properly!",NULL … … 123 123 db " controllers.",NULL 124 124 g_szDlgBadBiosFound: db "This computer has been identified as being one of the following models:",LF,LF 125 db "Zenith Z-171",LF126 db "Zenith Z-161",LF,LF125 db "Zenith Data Systems Z-171",LF 126 db "Zenith Data Systems Z-161",LF,LF 127 127 db "The Boot settings menu option 'Remove other hard drives' has been set to YES for this reason.",NULL 128 128 g_szDlgCfgFullMode: db "Enable full operating mode?",NULL … … 479 479 db " of normal drive detection. Note that if any serial drives are detected during the normal drive detection," 480 480 db " no scan will take place (to avoid finding the same drive twice).",NULL 481 g_szHelpClearBdaDriveCount: db "Set to NO for normal operation. Set to YES to get Windows 9x protected mode drivers to work when"482 db " MODULE_WIN9X_CMOS_HACK is not included (dummy drive needs to be defined in system BIOS setup). This option must"483 db " also be set to YES on computers where the system BIOS does not initialize RAM properly. Zenith models Z-171 and"484 db " Z -161 are known examples of such machines.",NULL481 g_szHelpClearBdaDriveCount: db "Set to NO for normal operation. Set to YES to get the built-in protected mode driver in Windows 9x to work when a" 482 db " dummy drive has been added in system BIOS setup or when using a BIOS built with MODULE_WIN9X_CMOS_HACK included." 483 db " This option must also be set to YES on computers where the system BIOS does not initialize RAM properly." 484 db " Zenith Data Systems models Z-171 and Z-161 are known examples of such machines.",NULL 485 485 486 486 g_szMultichoiceBootDispMode: db "Default",LF
Note:
See TracChangeset
for help on using the changeset viewer.