Changeset 588 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm
- Timestamp:
- Jun 3, 2015, 12:30:54 PM (10 years ago)
- google:author:
- krille_n_@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm
r584 r588 65 65 ; IS_THIS_DRIVE_XTCF. We check this for all commands. 66 66 call AccessDPT_IsThisDeviceXTCF 67 j neSHORT .XTCFnotFound67 jc SHORT .XTCFnotFound 68 68 and ax, 0FFh ; Subcommand now in AX (clears AH and CF) 69 69 jz SHORT .XTCFfound ; Sub-function IS_THIS_DRIVE_XTCF (=0) … … 111 111 ; Selected transfer mode is stored in BIOS variable (DPT_ATA.bDevice). 112 112 113 ; Note that when selecting ' DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD' mode,113 ; Note that when selecting 'XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD' mode, 114 114 ; the ATA device (i.e. CompactFlash card) will operate in 8-bit mode, but 115 115 ; data will be transferred from its data register using 16-bit CPU instructions … … 122 122 ; Also note that some machines, noteably the Olivetti M24 (also known as 123 123 ; the AT&T PC6300 and Xerox 6060), have hardware errors in the BIU logic, 124 ; resulting in reversed byte ordering. Therefore, mode DEVICE_8BIT_PIOis124 ; resulting in reversed byte ordering. Therefore, XTCF_8BIT_PIO_MODE is 125 125 ; the default transfer mode for best system compatibility. 126 126 127 128 ; Is requested mode valid? 129 cmp al, 3 ; Valid modes are 0...3 130 ja SHORT ProcessXTCFsubcommandFromAL.AH1Eh_LoadInvalidCommandToAHandSetCF 131 132 ; Convert mode to XT-CF device type (see RomVars.inc and XTCF.inc for full details) 133 eSHL_IM al, 1 ; Shift requested mode 134 add al, XTCF_DEVICE_OFFSET ; Add the device offset (already shifted) 135 mov [di+DPT_ATA.bDevice], al ; Set the new mode (or device actually) 136 137 cmp al, DEVICE_8BIT_XTCF_PIO16_WITH_BIU_OFFLOAD 138 je SHORT AH23h_Disable8bitPioMode 139 140 ; We always need to enable 8-bit mode since 16-bit mode is restored 141 ; when controller is reset (AH=00h or 0Dh) 142 143 cmp al, DEVICE_8BIT_XTCF_DMA 144 jne SHORT AH23h_Enable8bitPioMode 145 146 ; DMA transfers have limited block size 147 mov al, XTCF_DMA_MODE_MAX_BLOCK_SIZE 148 cmp [di+DPT_ATA.bBlockSize], al 149 jbe SHORT AH23h_Enable8bitPioMode ; No need to limit block size 150 call AH24h_SetBlockSize 151 jmp SHORT AH23h_Enable8bitPioMode 152 153 154 %if 0 127 155 ; We always need to enable 8-bit mode since 16-bit mode is restored 128 156 ; when controller is reset (AH=00h or 0Dh) … … 134 162 dec ax ; XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD = 1 135 163 jz SHORT .Set8bitPioModeWithBIUOffload 136 dec ax 164 dec ax ; XTCF_16BIT_PIO_WITH_BIU_OFFLOAD = 2 137 165 jz SHORT .Set16bitPioModeWithBIUOffload 138 166 139 ; XTCF_DMA_MODE = 2 (allow 3 as well for more optimized code)167 ; XTCF_DMA_MODE = 3 140 168 mov BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_DMA 141 169 … … 161 189 mov [di+DPT_ATA.bDevice], al 162 190 ret 191 %endif ; 0 163 192 164 193 … … 168 197 ; DS:DI: Ptr to DPT (in RAMVARS segment) 169 198 ; Returns: 170 ; AX: XT-CF mode (XTCF_8BIT_PIO_MODE, XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD or XTCF_DMA_MODE)199 ; AX: XT-CF mode (XTCF_8BIT_PIO_MODE, XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD, XTCF_16BIT_PIO_WITH_BIU_OFFLOAD or XTCF_DMA_MODE) 171 200 ; CF: Clear 172 201 ; Corrupts registers: … … 174 203 ;-------------------------------------------------------------------- 175 204 AH1Eh_GetCurrentXTCFmodeToAX: 205 mov ax, -XTCF_DEVICE_OFFSET & 0FFh 206 add al, [di+DPT_ATA.bDevice] 207 shr al, 1 208 ret 209 210 %if 0 176 211 mov al, [di+DPT_ATA.bDevice] 177 212 shr al, 1 178 213 cbw 179 sub al, DEVICE_8BIT_XTCF_PIO8 >> 1 180 ret 214 sub al, XTCF_DEVICE_OFFSET >> 1 215 ret 216 %endif ; 0
Note:
See TracChangeset
for help on using the changeset viewer.