Index: trunk/XTIDE_Universal_BIOS/Inc/Controllers/AdvancedID.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/Controllers/AdvancedID.inc	(revision 587)
+++ trunk/XTIDE_Universal_BIOS/Inc/Controllers/AdvancedID.inc	(revision 588)
@@ -24,5 +24,5 @@
 ; Low byte is controller specific to be used in controller initialization and such
 
-ID_NOT_ADVANCED_CONTROLLER	EQU	0
+ID_NOT_ADVANCED_CONTROLLER	EQU		0
 
 ; Promise
@@ -32,7 +32,7 @@
 ; Vision
 ; QDI Vision Controller Identification nibbles used by hardware so do not modify these
-ID_QD6580_ALTERNATE			EQU	0101b
-ID_QD6580					EQU	1010b
-ID_QD6500					EQU	1100b
+ID_QD6580_ALTERNATE			EQU		5
+ID_QD6580					EQU		10
+ID_QD6500					EQU		12
 
 
Index: trunk/XTIDE_Universal_BIOS/Inc/Controllers/XTCF.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/Controllers/XTCF.inc	(revision 587)
+++ trunk/XTIDE_Universal_BIOS/Inc/Controllers/XTCF.inc	(revision 588)
@@ -54,10 +54,10 @@
 ;
 ; XT-CFv3 cannot be distinguished by software, so user must decide and set
-; the mode via a call to Int 13h function 1Eh accordingly (see AH1E_XTCF.asm).
+; the mode via a call to Int 13h function 1Eh accordingly (see AH1Eh_XTCF.asm).
 ;
-XTCF_8BIT_PIO_MODE					EQU		((DEVICE_8BIT_XTCF_PIO8 >> 1) - XTCF_DEVICE_OFFSET)
-XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD	EQU		(XTCF_8BIT_PIO_MODE + 1)
-XTCF_16BIT_PIO_WITH_BIU_OFFLOAD		EQU		(XTCF_8BIT_PIO_MODE + 2)	; Lo-tech 8-bit IDE Adapter
-XTCF_DMA_MODE						EQU		(XTCF_8BIT_PIO_MODE + 3)
+XTCF_8BIT_PIO_MODE					EQU		0	; XT-CF using 8-bit PIO mode
+XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD	EQU		1	; XT-CF using 8-bit PIO mode, but with 16-bit instructions
+XTCF_16BIT_PIO_WITH_BIU_OFFLOAD		EQU		2	; Lo-tech 8-bit IDE Adapter
+XTCF_DMA_MODE						EQU		3	; XT-CFv3 using DMA
 
 
Index: trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc	(revision 587)
+++ trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc	(revision 588)
@@ -158,6 +158,5 @@
 DEVICE_8BIT_XTIDE_REV2					EQU	((COUNT_OF_STANDARD_IDE_DEVICES+2)<<1)	; Or rev 1 with swapped A0 and A3
 ; IDE Register offsets are SHL 1
-XTCF_DEVICE_OFFSET						EQU	3
-DEVICE_8BIT_XTCF_PIO8					EQU	((COUNT_OF_STANDARD_IDE_DEVICES+XTCF_DEVICE_OFFSET)<<1)	; XT-CF using 8-bit PIO mode
+DEVICE_8BIT_XTCF_PIO8					EQU	((COUNT_OF_STANDARD_IDE_DEVICES+3)<<1)	; XT-CF using 8-bit PIO mode
 DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD	EQU	((COUNT_OF_STANDARD_IDE_DEVICES+4)<<1)	; XT-CF using 8-bit PIO mode, but with 16-bit instructions
 DEVICE_8BIT_XTCF_PIO16_WITH_BIU_OFFLOAD	EQU	((COUNT_OF_STANDARD_IDE_DEVICES+5)<<1)	; Lo-tech 8-bit IDE Adapter
@@ -169,5 +168,7 @@
 DEVICE_SERIAL_PORT						EQU	(COUNT_OF_ALL_IDE_DEVICES<<1)
 
-
+FIRST_XTCF_DEVICE						EQU	DEVICE_8BIT_XTCF_PIO8
+LAST_XTCF_DEVICE						EQU	DEVICE_8BIT_XTCF_DMA
+XTCF_DEVICE_OFFSET						EQU	FIRST_XTCF_DEVICE						; Used for XT-CF device <--> mode conversion
 
 ; Master/Slave drive specific parameters
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeWait.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeWait.asm	(revision 587)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeWait.asm	(revision 588)
@@ -97,6 +97,6 @@
 .PollLoop:
 	call	IdeIO_InputStatusRegisterToAL
-	test	al, FLG_STATUS_BSY					; Controller busy?
-	jnz		SHORT .UpdateTimeout				;  If so, jump to timeout update
+	test	al, al								; Controller busy? (Check for FLG_STATUS_BSY)
+	js		SHORT .UpdateTimeout				;  If so, jump to timeout update
 	test	al, ah								; Test secondary flag
 	jnz		SHORT IdeError_GetBiosErrorCodeToAHfromPolledStatusRegisterInAL
@@ -126,6 +126,6 @@
 .PollLoop:
 	call	IdeIO_InputStatusRegisterToAL
-	test	al, FLG_STATUS_BSY					; Controller busy?
-	jz		SHORT IdeError_GetBiosErrorCodeToAHfromPolledStatusRegisterInAL
+	test	al, al								; Controller busy? (Check for FLG_STATUS_BSY)
+	jns		SHORT IdeError_GetBiosErrorCodeToAHfromPolledStatusRegisterInAL
 	call	Timer_SetCFifTimeout				; Update timeout counter
 	jnc		SHORT .PollLoop						; Loop if time left (sets CF on timeout)
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm	(revision 587)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm	(revision 588)
@@ -65,5 +65,5 @@
 	; IS_THIS_DRIVE_XTCF. We check this for all commands.
 	call	AccessDPT_IsThisDeviceXTCF
-	jne		SHORT .XTCFnotFound
+	jc		SHORT .XTCFnotFound
 	and		ax, 0FFh					; Subcommand now in AX (clears AH and CF)
 	jz		SHORT .XTCFfound			; Sub-function IS_THIS_DRIVE_XTCF (=0)
@@ -111,5 +111,5 @@
 	;       Selected transfer mode is stored in BIOS variable (DPT_ATA.bDevice).
 
-	; Note that when selecting 'DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD' mode,
+	; Note that when selecting 'XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD' mode,
 	; the ATA device (i.e. CompactFlash card) will operate in 8-bit mode, but
 	; data will be transferred from its data register using 16-bit CPU instructions
@@ -122,7 +122,35 @@
 	; Also note that some machines, noteably the Olivetti M24 (also known as
 	; the AT&T PC6300 and Xerox 6060), have hardware errors in the BIU logic,
-	; resulting in reversed byte ordering.  Therefore, mode DEVICE_8BIT_PIO is
+	; resulting in reversed byte ordering.  Therefore, XTCF_8BIT_PIO_MODE is
 	; the default transfer mode for best system compatibility.
 
+
+	; Is requested mode valid?
+	cmp		al, 3						; Valid modes are 0...3
+	ja		SHORT ProcessXTCFsubcommandFromAL.AH1Eh_LoadInvalidCommandToAHandSetCF
+
+	; Convert mode to XT-CF device type (see RomVars.inc and XTCF.inc for full details)
+	eSHL_IM	al, 1						; Shift requested mode
+	add		al, XTCF_DEVICE_OFFSET		; Add the device offset (already shifted)
+	mov		[di+DPT_ATA.bDevice], al	; Set the new mode (or device actually)
+
+	cmp		al, DEVICE_8BIT_XTCF_PIO16_WITH_BIU_OFFLOAD
+	je		SHORT AH23h_Disable8bitPioMode
+
+	; We always need to enable 8-bit mode since 16-bit mode is restored
+	; when controller is reset (AH=00h or 0Dh)
+
+	cmp		al, DEVICE_8BIT_XTCF_DMA
+	jne		SHORT AH23h_Enable8bitPioMode
+
+	; DMA transfers have limited block size
+	mov		al, XTCF_DMA_MODE_MAX_BLOCK_SIZE
+	cmp		[di+DPT_ATA.bBlockSize], al
+	jbe		SHORT AH23h_Enable8bitPioMode	; No need to limit block size
+	call	AH24h_SetBlockSize
+	jmp		SHORT AH23h_Enable8bitPioMode
+
+
+%if 0
 	; We always need to enable 8-bit mode since 16-bit mode is restored
 	; when controller is reset (AH=00h or 0Dh)
@@ -134,8 +162,8 @@
 	dec		ax						; XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD = 1
 	jz		SHORT .Set8bitPioModeWithBIUOffload
-	dec		ax
+	dec		ax						; XTCF_16BIT_PIO_WITH_BIU_OFFLOAD = 2
 	jz		SHORT .Set16bitPioModeWithBIUOffload
 
-	; XTCF_DMA_MODE = 2 (allow 3 as well for more optimized code)
+	; XTCF_DMA_MODE = 3
 	mov		BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_DMA
 
@@ -161,4 +189,5 @@
 	mov		[di+DPT_ATA.bDevice], al
 	ret
+%endif ; 0
 
 
@@ -168,5 +197,5 @@
 ;		DS:DI:	Ptr to DPT (in RAMVARS segment)
 ;	Returns:
-;		AX:		XT-CF mode (XTCF_8BIT_PIO_MODE, XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD or XTCF_DMA_MODE)
+;		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)
 ;		CF:		Clear
 ;	Corrupts registers:
@@ -174,7 +203,14 @@
 ;--------------------------------------------------------------------
 AH1Eh_GetCurrentXTCFmodeToAX:
+	mov		ax, -XTCF_DEVICE_OFFSET & 0FFh
+	add		al, [di+DPT_ATA.bDevice]
+	shr		al, 1
+	ret
+
+%if 0
 	mov		al, [di+DPT_ATA.bDevice]
 	shr		al, 1
 	cbw
-	sub		al, DEVICE_8BIT_XTCF_PIO8 >> 1
-	ret
+	sub		al, XTCF_DEVICE_OFFSET >> 1
+	ret
+%endif ; 0
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm	(revision 587)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm	(revision 588)
@@ -68,5 +68,5 @@
 	; must know what the actual block size is.
 	cmp		BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_DMA
-	je		SHORT .DisableBlockMode
+	je		SHORT ProcessXTCFsubcommandFromAL.AH1Eh_LoadInvalidCommandToAHandSetCF
 .NoNeedToLimitBlockSize:
 %endif ; MODULE_8BIT_IDE_ADVANCED
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm	(revision 587)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm	(revision 588)
@@ -234,4 +234,50 @@
 
 
+%ifdef MODULE_8BIT_IDE
+;--------------------------------------------------------------------
+; AH9h_Enable8bitModeForDevice8bitAta
+;	Parameters:
+;		DS:DI:	Ptr to DPT (in RAMVARS segment)
+;		SS:BP:	Ptr to IDEPACK
+;	Returns:
+;		AH:		Int 13h return status
+;		CF:		Clear if successful or device is not DEVICE_8BIT_ATA
+;				Set if failed to set 8-bit mode for DEVICE_8BIT_ATA
+;	Corrupts registers:
+;		AL, BX, CX, DX, SI
+;--------------------------------------------------------------------
+AH9h_Enable8bitModeForDevice8bitAta:
+	cmp		BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_ATA
+%ifdef MODULE_8BIT_IDE_ADVANCED
+	jne		SHORT IgnoreInvalidCommandError
+	jmp		AH23h_Enable8bitPioMode
+%else ; ~MODULE_8BIT_IDE_ADVANCED
+	je		AH23h_Enable8bitPioMode
+	; Fall to IgnoreInvalidCommandError
+%endif ; MODULE_8BIT_IDE_ADVANCED
+%endif ; MODULE_8BIT_IDE
+
+
+%ifdef MODULE_8BIT_IDE_ADVANCED
+;--------------------------------------------------------------------
+; AH9h_SetModeFromALtoXTCF
+;	Parameters:
+;		AL:		XT-CF Mode to set
+;		DS:DI:	Ptr to DPT (in RAMVARS segment)
+;		SS:BP:	Ptr to IDEPACK
+;	Returns:
+;		AH:		Int 13h return status
+;		CF:		Clear if successful or device is not XT-CF
+;				Set if failed to set mode for XT-CF
+;	Corrupts registers:
+;		AL, BX, CX, DX, SI
+;--------------------------------------------------------------------
+AH9h_SetModeFromALtoXTCF:
+	call	AccessDPT_IsThisDeviceXTCF
+	jnc		AH1Eh_ChangeXTCFmodeBasedOnModeInAL
+	; Fall to IgnoreInvalidCommandError
+%endif ; MODULE_8BIT_IDE_ADVANCED
+
+
 ;--------------------------------------------------------------------
 ; SetErrorFlagFromALwithErrorCodeInAH
@@ -259,43 +305,2 @@
 .NoErrorFlagToSet:
 	ret
-
-
-%ifdef MODULE_8BIT_IDE_ADVANCED
-;--------------------------------------------------------------------
-; AH9h_SetModeFromALtoXTCF
-;	Parameters:
-;		AL:		XT-CF Mode to set
-;		DS:DI:	Ptr to DPT (in RAMVARS segment)
-;		SS:BP:	Ptr to IDEPACK
-;	Returns:
-;		AH:		Int 13h return status
-;		CF:		Clear if successful or device is not XT-CF
-;				Set if failed to set mode for XT-CF
-;	Corrupts registers:
-;		AL, BX, CX, DX, SI
-;--------------------------------------------------------------------
-AH9h_SetModeFromALtoXTCF:
-	call	AccessDPT_IsThisDeviceXTCF
-	jne		SHORT IgnoreInvalidCommandError
-	jmp		AH1Eh_ChangeXTCFmodeBasedOnModeInAL
-%endif ; MODULE_8BIT_IDE_ADVANCED
-
-
-%ifdef MODULE_8BIT_IDE
-;--------------------------------------------------------------------
-; AH9h_Enable8bitModeForDevice8bitAta
-;	Parameters:
-;		DS:DI:	Ptr to DPT (in RAMVARS segment)
-;		SS:BP:	Ptr to IDEPACK
-;	Returns:
-;		AH:		Int 13h return status
-;		CF:		Clear if successful or device is not DEVICE_8BIT_ATA
-;				Set if failed to set 8-bit mode for DEVICE_8BIT_ATA
-;	Corrupts registers:
-;		AL, BX, CX, DX, SI
-;--------------------------------------------------------------------
-AH9h_Enable8bitModeForDevice8bitAta:
-	cmp		BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_ATA
-	jne		SHORT IgnoreInvalidCommandError
-	jmp		AH23h_Enable8bitPioMode
-%endif ; MODULE_8BIT_IDE
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/PDC20x30.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/PDC20x30.asm	(revision 587)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/PDC20x30.asm	(revision 588)
@@ -200,6 +200,6 @@
 	add		dx, BYTE SECTOR_NUMBER_REGISTER
 	mov		bh, ~MASK_PDCSCR_DEV1SPEED	; Assume slave
-	test	cx, cx
-	jnz		.setSpeed
+	inc		cx
+	loop	.setSpeed
 	eSHL_IM	bl, POS_PDCSCR_DEV0SPEED
 	mov		bh, ~MASK_PDCSCR_DEV0SPEED
Index: trunk/XTIDE_Universal_BIOS/Src/Main.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 587)
+++ trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 588)
@@ -136,5 +136,5 @@
 %ifdef MODULE_8BIT_IDE_ADVANCED
 	at	ROMVARS.ideVars0+IDEVARS.wBasePort,				dw	DEVICE_XTIDE_DEFAULT_PORT		; Controller Command Block base port
-	at	ROMVARS.ideVars0+IDEVARS.bDevice,				db	XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD
+	at	ROMVARS.ideVars0+IDEVARS.bDevice,				db	DEVICE_8BIT_XTCF_PIO8
 %else
 	at	ROMVARS.ideVars0+IDEVARS.wBasePort,				dw	DEVICE_XTIDE_DEFAULT_PORT		; Controller Command Block base port
Index: trunk/XTIDE_Universal_BIOS/Src/Strings.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Strings.asm	(revision 587)
+++ trunk/XTIDE_Universal_BIOS/Src/Strings.asm	(revision 588)
@@ -135,15 +135,16 @@
 
 g_szDeviceTypeValues:
-g_szDeviceTypeValues_16bit:		db	" 16",NULL
-g_szDeviceTypeValues_32bit:		db	" 32",NULL
-g_szDeviceTypeValues_8bit:		db	"  8",NULL
-g_szDeviceTypeValues_XTIDEr1:	db	"D8 ",NULL	; Dual 8-bit
-g_szDeviceTypeValues_XTIDEr2:	db	"X8 ",NULL	; A0<->A3 swapped 8-bit
-g_szDeviceTypeValues_XTCFpio8:	db	"T8 ",NULL	; True 8-bit
-g_szDeviceTypeValues_XTCFdma:	db	"8MA",NULL	; DMA 8-bit
-g_szDeviceTypeValues_XTCFmem:	db	"M8 ",NULL	; Memory Mapped 8-bit
-g_szDeviceTypeValues_JrIde:		db	"M8 ",NULL
-g_szDeviceTypeValues_ADP50L:	db	"M8 ",NULL
-g_szDeviceTypeValues_Serial:	db	"SER",NULL
+g_szDeviceTypeValues_16bit:			db	" 16",NULL
+g_szDeviceTypeValues_32bit:			db	" 32",NULL
+g_szDeviceTypeValues_8bit:			db	"  8",NULL
+g_szDeviceTypeValues_XTIDEr1:		db	"D8 ",NULL	; Dual 8-bit
+g_szDeviceTypeValues_XTIDEr2:		db	"X8 ",NULL	; A0<->A3 swapped 8-bit
+g_szDeviceTypeValues_XTCFpio8:		db	"T8 ",NULL	; True 8-bit
+g_szDeviceTypeValues_XTCFpio8BIU:	db	"T8B",NULL
+g_szDeviceTypeValues_XTCFpio16BIU:	db	"16B",NULL
+g_szDeviceTypeValues_XTCFdma:		db	"8MA",NULL	; DMA 8-bit
+g_szDeviceTypeValues_JrIde:			db	"M8 ",NULL	; Memory Mapped 8-bit
+g_szDeviceTypeValues_ADP50L:		db	"M8 ",NULL	; Memory Mapped 8-bit
+g_szDeviceTypeValues_Serial:		db	"SER",NULL
 
 g_szDeviceTypeValues_Displacement equ (g_szDeviceTypeValues_32bit - g_szDeviceTypeValues)
@@ -159,29 +160,32 @@
 	%endif
 	%if g_szDeviceTypeValues_8bit <> g_szDeviceTypeValues_32bit + g_szDeviceTypeValues_Displacement
-		%error "g_szDeviceTypeValues Displacement Incorrect 2"
+		%error "g_szDeviceTypeValues Displacement Incorrect 3"
 	%endif
 	%if g_szDeviceTypeValues_XTIDEr1 <> g_szDeviceTypeValues_8bit + g_szDeviceTypeValues_Displacement
-		%error "g_szDeviceTypeValues Displacement Incorrect 3"
+		%error "g_szDeviceTypeValues Displacement Incorrect 4"
 	%endif
 	%if g_szDeviceTypeValues_XTIDEr2 <> g_szDeviceTypeValues_XTIDEr1 + g_szDeviceTypeValues_Displacement
-		%error "g_szDeviceTypeValues Displacement Incorrect 4"
+		%error "g_szDeviceTypeValues Displacement Incorrect 5"
 	%endif
 	%if g_szDeviceTypeValues_XTCFpio8 <> g_szDeviceTypeValues_XTIDEr2 + g_szDeviceTypeValues_Displacement
-		%error "g_szDeviceTypeValues Displacement Incorrect 5"
-	%endif
-	%if g_szDeviceTypeValues_XTCFdma <> g_szDeviceTypeValues_XTCFpio8 + g_szDeviceTypeValues_Displacement
 		%error "g_szDeviceTypeValues Displacement Incorrect 6"
 	%endif
-	%if g_szDeviceTypeValues_XTCFmem <> g_szDeviceTypeValues_XTCFdma + g_szDeviceTypeValues_Displacement
+	%if g_szDeviceTypeValues_XTCFpio8BIU <> g_szDeviceTypeValues_XTCFpio8 + g_szDeviceTypeValues_Displacement
 		%error "g_szDeviceTypeValues Displacement Incorrect 7"
 	%endif
-	%if g_szDeviceTypeValues_JrIde <> g_szDeviceTypeValues_XTCFmem + g_szDeviceTypeValues_Displacement
+	%if g_szDeviceTypeValues_XTCFpio16BIU <> g_szDeviceTypeValues_XTCFpio8BIU + g_szDeviceTypeValues_Displacement
 		%error "g_szDeviceTypeValues Displacement Incorrect 8"
 	%endif
+	%if g_szDeviceTypeValues_XTCFdma <> g_szDeviceTypeValues_XTCFpio16BIU + g_szDeviceTypeValues_Displacement
+		%error "g_szDeviceTypeValues Displacement Incorrect 9"
+	%endif
+	%if g_szDeviceTypeValues_JrIde <> g_szDeviceTypeValues_XTCFdma + g_szDeviceTypeValues_Displacement
+		%error "g_szDeviceTypeValues Displacement Incorrect 10"
+	%endif
 	%if g_szDeviceTypeValues_ADP50L <> g_szDeviceTypeValues_JrIde + g_szDeviceTypeValues_Displacement
-		%error "g_szDeviceTypeValues Displacement Incorrect 9"
+		%error "g_szDeviceTypeValues Displacement Incorrect 11"
 	%endif
 	%if g_szDeviceTypeValues_Serial <> g_szDeviceTypeValues_ADP50L + g_szDeviceTypeValues_Displacement
-		%error "g_szDeviceTypeValues Displacement Incorrect 10"
+		%error "g_szDeviceTypeValues Displacement Incorrect 12"
 	%endif
 %endif
Index: trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm	(revision 587)
+++ trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm	(revision 588)
@@ -253,47 +253,51 @@
 
 g_szDeviceTypeValues:
-g_szDeviceTypeValues_16bit:		; db	" 16",NULL
-                           		; db	 20h,  31h,  36h,  00h    ; uncompressed
-                           		  db	 20h,  2bh,  0fh          ; compressed
-
-g_szDeviceTypeValues_32bit:		; db	" 32",NULL
-                           		; db	 20h,  33h,  32h,  00h    ; uncompressed
-                           		  db	 20h,  2dh,  0ch          ; compressed
-
-g_szDeviceTypeValues_8bit:		; db	"  8",NULL
-                          		; db	 20h,  20h,  38h,  00h    ; uncompressed
-                          		  db	 20h,  20h,  10h          ; compressed
-
-g_szDeviceTypeValues_XTIDEr1:	; db	"D8 ",NULL	; Dual 8-bit
-                             	; db	 44h,  38h,  20h,  00h    ; uncompressed
-                             	  db	 4ah,  30h,  00h          ; compressed
-
-g_szDeviceTypeValues_XTIDEr2:	; db	"X8 ",NULL	; A0<->A3 swapped 8-bit
-                             	; db	 58h,  38h,  20h,  00h    ; uncompressed
-                             	  db	 5eh,  30h,  00h          ; compressed
-
-g_szDeviceTypeValues_XTCFpio8:	; db	"T8 ",NULL	; True 8-bit
-                              	; db	 54h,  38h,  20h,  00h    ; uncompressed
-                              	  db	 5ah,  30h,  00h          ; compressed
-
-g_szDeviceTypeValues_XTCFdma:	; db	"8MA",NULL	; DMA 8-bit
-                             	; db	 38h,  4dh,  41h,  00h    ; uncompressed
-                             	  db	 30h,  53h,  87h          ; compressed
-
-g_szDeviceTypeValues_XTCFmem:	; db	"M8 ",NULL	; Memory Mapped 8-bit
-                             	; db	 4dh,  38h,  20h,  00h    ; uncompressed
-                             	  db	 53h,  30h,  00h          ; compressed
-
-g_szDeviceTypeValues_JrIde:		; db	"M8 ",NULL
-                           		; db	 4dh,  38h,  20h,  00h    ; uncompressed
-                           		  db	 53h,  30h,  00h          ; compressed
-
-g_szDeviceTypeValues_ADP50L:	; db	"M8 ",NULL
-                            	; db	 4dh,  38h,  20h,  00h    ; uncompressed
-                            	  db	 53h,  30h,  00h          ; compressed
-
-g_szDeviceTypeValues_Serial:	; db	"SER",NULL
-                            	; db	 53h,  45h,  52h,  00h    ; uncompressed
-                            	  db	 59h,  4bh,  98h          ; compressed
+g_szDeviceTypeValues_16bit:			; db	" 16",NULL
+                           			; db	 20h,  31h,  36h,  00h    ; uncompressed
+                           			  db	 20h,  2bh,  0fh          ; compressed
+
+g_szDeviceTypeValues_32bit:			; db	" 32",NULL
+                           			; db	 20h,  33h,  32h,  00h    ; uncompressed
+                           			  db	 20h,  2dh,  0ch          ; compressed
+
+g_szDeviceTypeValues_8bit:			; db	"  8",NULL
+                          			; db	 20h,  20h,  38h,  00h    ; uncompressed
+                          			  db	 20h,  20h,  10h          ; compressed
+
+g_szDeviceTypeValues_XTIDEr1:		; db	"D8 ",NULL	; Dual 8-bit
+                             		; db	 44h,  38h,  20h,  00h    ; uncompressed
+                             		  db	 4ah,  30h,  00h          ; compressed
+
+g_szDeviceTypeValues_XTIDEr2:		; db	"X8 ",NULL	; A0<->A3 swapped 8-bit
+                             		; db	 58h,  38h,  20h,  00h    ; uncompressed
+                             		  db	 5eh,  30h,  00h          ; compressed
+
+g_szDeviceTypeValues_XTCFpio8:		; db	"T8 ",NULL	; True 8-bit
+                              		; db	 54h,  38h,  20h,  00h    ; uncompressed
+                              		  db	 5ah,  30h,  00h          ; compressed
+
+g_szDeviceTypeValues_XTCFpio8BIU:	; db	"T8B",NULL
+                                 	; db	 54h,  38h,  42h,  00h    ; uncompressed
+                                 	  db	 5ah,  30h,  88h          ; compressed
+
+g_szDeviceTypeValues_XTCFpio16BIU:	; db	"16B",NULL
+                                  	; db	 31h,  36h,  42h,  00h    ; uncompressed
+                                  	  db	 2bh,  2fh,  88h          ; compressed
+
+g_szDeviceTypeValues_XTCFdma:		; db	"8MA",NULL	; DMA 8-bit
+                             		; db	 38h,  4dh,  41h,  00h    ; uncompressed
+                             		  db	 30h,  53h,  87h          ; compressed
+
+g_szDeviceTypeValues_JrIde:			; db	"M8 ",NULL	; Memory Mapped 8-bit
+                           			; db	 4dh,  38h,  20h,  00h    ; uncompressed
+                           			  db	 53h,  30h,  00h          ; compressed
+
+g_szDeviceTypeValues_ADP50L:		; db	"M8 ",NULL	; Memory Mapped 8-bit
+                            		; db	 4dh,  38h,  20h,  00h    ; uncompressed
+                            		  db	 53h,  30h,  00h          ; compressed
+
+g_szDeviceTypeValues_Serial:		; db	"SER",NULL
+                            		; db	 53h,  45h,  52h,  00h    ; uncompressed
+                            		  db	 59h,  4bh,  98h          ; compressed
 
 
@@ -310,29 +314,32 @@
 %endif
 %if g_szDeviceTypeValues_8bit <> g_szDeviceTypeValues_32bit + g_szDeviceTypeValues_Displacement
-%error "g_szDeviceTypeValues Displacement Incorrect 2"
+%error "g_szDeviceTypeValues Displacement Incorrect 3"
 %endif
 %if g_szDeviceTypeValues_XTIDEr1 <> g_szDeviceTypeValues_8bit + g_szDeviceTypeValues_Displacement
-%error "g_szDeviceTypeValues Displacement Incorrect 3"
+%error "g_szDeviceTypeValues Displacement Incorrect 4"
 %endif
 %if g_szDeviceTypeValues_XTIDEr2 <> g_szDeviceTypeValues_XTIDEr1 + g_szDeviceTypeValues_Displacement
-%error "g_szDeviceTypeValues Displacement Incorrect 4"
+%error "g_szDeviceTypeValues Displacement Incorrect 5"
 %endif
 %if g_szDeviceTypeValues_XTCFpio8 <> g_szDeviceTypeValues_XTIDEr2 + g_szDeviceTypeValues_Displacement
-%error "g_szDeviceTypeValues Displacement Incorrect 5"
-%endif
-%if g_szDeviceTypeValues_XTCFdma <> g_szDeviceTypeValues_XTCFpio8 + g_szDeviceTypeValues_Displacement
 %error "g_szDeviceTypeValues Displacement Incorrect 6"
 %endif
-%if g_szDeviceTypeValues_XTCFmem <> g_szDeviceTypeValues_XTCFdma + g_szDeviceTypeValues_Displacement
+%if g_szDeviceTypeValues_XTCFpio8BIU <> g_szDeviceTypeValues_XTCFpio8 + g_szDeviceTypeValues_Displacement
 %error "g_szDeviceTypeValues Displacement Incorrect 7"
 %endif
-%if g_szDeviceTypeValues_JrIde <> g_szDeviceTypeValues_XTCFmem + g_szDeviceTypeValues_Displacement
+%if g_szDeviceTypeValues_XTCFpio16BIU <> g_szDeviceTypeValues_XTCFpio8BIU + g_szDeviceTypeValues_Displacement
 %error "g_szDeviceTypeValues Displacement Incorrect 8"
 %endif
+%if g_szDeviceTypeValues_XTCFdma <> g_szDeviceTypeValues_XTCFpio16BIU + g_szDeviceTypeValues_Displacement
+%error "g_szDeviceTypeValues Displacement Incorrect 9"
+%endif
+%if g_szDeviceTypeValues_JrIde <> g_szDeviceTypeValues_XTCFdma + g_szDeviceTypeValues_Displacement
+%error "g_szDeviceTypeValues Displacement Incorrect 10"
+%endif
 %if g_szDeviceTypeValues_ADP50L <> g_szDeviceTypeValues_JrIde + g_szDeviceTypeValues_Displacement
-%error "g_szDeviceTypeValues Displacement Incorrect 9"
+%error "g_szDeviceTypeValues Displacement Incorrect 11"
 %endif
 %if g_szDeviceTypeValues_Serial <> g_szDeviceTypeValues_ADP50L + g_szDeviceTypeValues_Displacement
-%error "g_szDeviceTypeValues Displacement Incorrect 10"
+%error "g_szDeviceTypeValues Displacement Incorrect 12"
 %endif
 %endif
@@ -560,38 +567,38 @@
 
 ;; translated usage stats
-;; 54:1
+;; 172:2
 ;; 47:2
-;; 175:1
-;; 49:1
-;; 44:1
-;; 50:2
+;; 171:2
+;; 46:3
+;; 48:2
+;; 181:1
 ;; 200:1
-;; 181:1
-;; 172:2
+;; 54:2
 ;; 45:2
+;; 49:2
+;; 34:3
+;; 179:8
 ;; 56:8
 ;; 33:1
 ;; 53:2
-;; 179:8
-;; 171:2
+;; 32:34
+;; 175:1
+;; 44:1
+;; 50:2
 ;; 51:3
-;; 34:3
-;; 48:2
-;; 46:3
-;; 32:35
 ;; total translated: 20
 
 ;; format usage stats
+;; z:2
 ;; nl:12
+;; u:6
+;; 5-x:1
+;; c:13
+;; A:4
+;; s:14
+;; 5-u:2
 ;; x:5
-;; A:4
-;; 5-x:1
 ;; 2-u:1
-;; z:2
-;; 5-u:2
-;; s:14
 ;; 2-I:1
-;; u:6
-;; c:13
 ;; total format: 11
 
@@ -605,5 +612,5 @@
 ;; 64,@:1
 ;; 65,A:5
-;; 66,B:9
+;; 66,B:11
 ;; 67,C:3
 ;; 68,D:11
@@ -616,5 +623,5 @@
 ;; 75,K:1
 ;; 76,L:4
-;; 77,M:8
+;; 77,M:7
 ;; 78,N:2
 ;; 79,O:2
@@ -623,5 +630,5 @@
 ;; 82,R:7
 ;; 83,S:3
-;; 84,T:1
+;; 84,T:2
 ;; 85,U:2
 ;; 86,V:
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm	(revision 587)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm	(revision 588)
@@ -94,6 +94,6 @@
 ;	Returns:
 ;		AH:		Device Type
-;		ZF:		Set if XTCF
-;				Cleared if some other device
+;		CF:		Cleared if XTCF
+;				Set if some other device
 ;	Corrupts registers:
 ;		Nothing
@@ -101,10 +101,9 @@
 AccessDPT_IsThisDeviceXTCF:
 	mov		ah, [di+DPT_ATA.bDevice]
-	cmp		ah, DEVICE_8BIT_XTCF_PIO8
-	je		SHORT .DeviceIsXTCF
-	cmp		ah, DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD
-	je		SHORT .DeviceIsXTCF
-	cmp		ah, DEVICE_8BIT_XTCF_DMA
-.DeviceIsXTCF:
+	cmp		ah, FIRST_XTCF_DEVICE
+	jb		SHORT .DeviceIsNotXTCF
+	cmp		ah, LAST_XTCF_DEVICE+1
+	cmc
+.DeviceIsNotXTCF:
 	ret
 %endif ; MODULE_8BIT_IDE_ADVANCED
