Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm	(revision 549)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm	(revision 550)
@@ -68,5 +68,5 @@
 	; must know what the actual block size is.
 	cmp		BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_DMA
-	je		SHORT ProcessXTCFsubcommandFromAL.AH1Eh_LoadInvalidCommandToAHandSetCF
+	je		SHORT .DisableBlockMode
 .NoNeedToLimitBlockSize:
 %endif ; MODULE_8BIT_IDE_ADVANCED
@@ -74,18 +74,28 @@
 	push	bx
 
-	push	ax
+	push	ax			; Store block size for later use
 	xchg	dx, ax		; DL = Block size (Sector Count Register)
 	mov		al, COMMAND_SET_MULTIPLE_MODE
 	mov		bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRDY, FLG_STATUS_DRDY)
 	call	Idepack_StoreNonExtParametersAndIssueCommandFromAL
-	pop		bx
-	jnc		SHORT .StoreBlockSize
 
-	; Drive disabled block mode since we tried unsupported block size.
-	; We must adjust DPT accordingly.
-	mov		bl, 1		; Block size 1 will always work (=Block mode disabled)
-.StoreBlockSize:		; Store new block size to DPT and return
+	; Disable block mode if failure or if called with block size of 1 sector.
+	; Some drives allow block mode commands for 1 sector blocks and some do not.
+	pop		bx			; Pop block size to BL
+	jc		SHORT .DisableBlockMode
+	mov		bh, bl		; BL and BH both have block size we tried to set
+	dec		bh
+	jz		SHORT .DisableBlockMode
+
+	; Enable block mode and store block size
+	or		BYTE [di+DPT.bFlagsHigh], FLGH_DPT_USE_BLOCK_MODE_COMMANDS
+	jmp		SHORT .StoreBlockSizeFromBLandReturn
+
+.DisableBlockMode:
+	and		BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_USE_BLOCK_MODE_COMMANDS
+	mov		bl, 1
+	stc
+.StoreBlockSizeFromBLandReturn:
 	mov		[di+DPT_ATA.bBlockSize], bl
-
 	pop		bx
 	ret
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm	(revision 549)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm	(revision 550)
@@ -163,8 +163,6 @@
 	; Initialize block mode transfers
 	pop		ax	; Restore .wFlags saved in SetWriteCache
-	test	BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
-	jz		SHORT .BlockModeNotSupportedOrDisabled
-	test	al, FLG_DRVPARAMS_BLOCKMODE
-	jz		SHORT .BlockModeNotSupportedOrDisabled
+	test	al, FLG_DRVPARAMS_BLOCKMODE	; Tested here so block mode can be enabled with AH=24h
+	jz		SHORT .BlockModeDisabled
 
 	; Try block sizes until we find largest possible supported by drive
@@ -177,5 +175,5 @@
 	jnc		SHORT .TryNextBlockSize
 	STORE_ERROR_FLAG_TO_DPT		FLG_INITERROR_FAILED_TO_SET_BLOCK_MODE
-.BlockModeNotSupportedOrDisabled:
+.BlockModeDisabled:
 .SupportedBlockSizeFound:
 
@@ -286,4 +284,5 @@
 %endif ; MODULE_8BIT_IDE_ADVANCED
 
+
 %ifdef MODULE_8BIT_IDE
 ;--------------------------------------------------------------------
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm	(revision 549)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm	(revision 550)
@@ -44,10 +44,10 @@
 	mov		WORD [bp+IDEPACK.intpack+INTPACK.bx], 0AA55h
 
-%ifdef CREATE_COMPATIBLE_DPT
+%ifdef MODULE_COMPATIBLE_TABLES
 	call	AH41h_GetSupportBitsToCX
 	mov		[bp+IDEPACK.intpack+INTPACK.cx], cx
 %else
 	mov		WORD [bp+IDEPACK.intpack+INTPACK.cx], ENHANCED_DRIVE_ACCESS_SUPPORT
-%endif
+%endif ; MODULE_COMPATIBLE_TABLES
 
 	and		BYTE [bp+IDEPACK.intpack+INTPACK.flags], ~FLG_FLAGS_CF	; Return with CF cleared
@@ -57,5 +57,5 @@
 
 
-%ifdef CREATE_COMPATIBLE_DPT
+%ifdef MODULE_COMPATIBLE_TABLES
 ;--------------------------------------------------------------------
 ; AH41h_GetSupportBitsToCX
@@ -87,3 +87,3 @@
 	ret
 
-%endif ; CREATE_COMPATIBLE_DPT
+%endif ; MODULE_COMPATIBLE_TABLES
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm	(revision 549)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm	(revision 550)
@@ -81,5 +81,5 @@
 
 	; Create DPTE (hardware information for device drivers)
-%ifdef CREATE_COMPATIBLE_DPT
+%ifdef MODULE_COMPATIBLE_TABLES
 	call	AH41h_GetSupportBitsToCX
 	test	cl, ENHANCED_DISK_DRIVE_SUPPORT
@@ -87,5 +87,5 @@
 	call	CompatibleDPT_CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI
 .DoNotCreateDPTE:
-%endif
+%endif ; MODULE_COMPATIBLE_TABLES
 
 	; Point DS:DI to Extended Drive Information Table to fill
@@ -107,5 +107,5 @@
 	; Store DPTE for standard controllers only,
 	; FFFF:FFFF for non standard controllers
-%ifdef CREATE_COMPATIBLE_DPT
+%ifdef MODULE_COMPATIBLE_TABLES
 	mov		[di+EDRIVE_INFO.fpDPTE], bx
 	mov		[di+EDRIVE_INFO.fpDPTE+2], es
@@ -117,5 +117,5 @@
 	mov		[di+EDRIVE_INFO.fpDPTE], bx
 	mov		[di+EDRIVE_INFO.fpDPTE+2], bx
-%endif
+%endif ; MODULE_COMPATIBLE_TABLES
 
 	; Fill Extended Drive Information Table in DS:DI from DPT in ES:SI
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm	(revision 549)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm	(revision 550)
@@ -81,5 +81,5 @@
 	; Block mode or single sector
 	mov		bl, [di+DPT.bFlagsHigh]
-	and		bx, BYTE FLGH_DPT_BLOCK_MODE_SUPPORTED	; Bit 1
+	and		bx, BYTE FLGH_DPT_USE_BLOCK_MODE_COMMANDS	; Bit 1
 	ret
 
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm	(revision 549)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm	(revision 550)
@@ -151,10 +151,4 @@
 .NoUserDefinedLBA:
 
-	; * Disable Block Mode transfers *
-	test	dl, FLG_DRVPARAMS_BLOCKMODE
-	jnz		SHORT .NoNeedToDisableBlockMode
-	mov		BYTE [si+ATA1.bBlckSize], 1	; sectors
-.NoNeedToDisableBlockMode:
-
 	; * Load P-CHS to L-CHS translate mode to DX *
 	and		dx, BYTE MASK_DRVPARAMS_TRANSLATEMODE
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm	(revision 549)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm	(revision 550)
@@ -83,5 +83,5 @@
 
 
-%ifdef CREATE_COMPATIBLE_DPT
+%ifdef MODULE_COMPATIBLE_TABLES
 ;--------------------------------------------------------------------
 ; .StoreDptPointersToIntVectors
@@ -118,5 +118,5 @@
 .CompatibleDPTsCreated:
 	; Fall to .ResetDetectedDrives
-%endif ; CREATE_COMPATIBLE_DPT
+%endif ; MODULE_COMPATIBLE_TABLES
 
 
Index: trunk/XTIDE_Universal_BIOS/Src/Main.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 549)
+++ trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 550)
@@ -199,4 +199,7 @@
 	%include "DetectDrives.asm"		; For detecting IDE drives
 	%include "DetectPrint.asm"		; For printing drive detection strings
+%ifdef MODULE_COMPATIBLE_TABLES
+	%include "CompatibleDPT.asm"
+%endif
 
 	; Hotkey Bar
@@ -281,6 +284,3 @@
 	%include "AH48h_GetExtendedDriveParameters.asm"
 	%include "AH41h_CheckIfExtensionsPresent.asm"
-%ifdef CREATE_COMPATIBLE_DPT
-	%include "CompatibleDPT.asm"
-%endif
-%endif
+%endif
Index: trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrintCfg.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrintCfg.asm	(revision 549)
+++ trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrintCfg.asm	(revision 550)
@@ -81,5 +81,5 @@
 .PushBlockMode:
 	mov		ax, 1
-	test	BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
+	test	BYTE [di+DPT.bFlagsHigh], FLGH_DPT_USE_BLOCK_MODE_COMMANDS
 	jz		SHORT .PushBlockSizeFromAX
 	mov		al, [di+DPT_ATA.bBlockSize]
Index: trunk/XTIDE_Universal_BIOS/Src/Menus/DriveXlate.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Menus/DriveXlate.asm	(revision 549)
+++ trunk/XTIDE_Universal_BIOS/Src/Menus/DriveXlate.asm	(revision 550)
@@ -96,4 +96,5 @@
 	test	dl, ah					; Hard disk?
 	jnz		SHORT .SwapDrive		; If so, jump to swap
+
 	mov		al, [RAMVARS.xlateVars+XLATEVARS.bFDSwap]
 	cbw
@@ -106,7 +107,26 @@
 	jne		SHORT .RestoreAXandReturn
 	mov		al, ah
+
 ALIGN JUMP_ALIGN
 .SwapToXXhInAL:
 	mov		dl, al
+
+%ifdef MODULE_COMPATIBLE_TABLES
+	cmp		al, 81h
+	jne		SHORT .RestoreAXandReturn
+
+	; Since swapping drive 80h <=> 81h, we need to swap
+	; DPT pointers in interrupt vectors 41h and 46h.
+	push	ds
+	LOAD_BDA_SEGMENT_TO	ds, ax
+	mov		ax, [HD0_DPT_POINTER_41h*4]
+	xchg	[HD1_DPT_POINTER_46h*4], ax
+	mov		[HD0_DPT_POINTER_41h*4], ax
+	mov		ax, [HD0_DPT_POINTER_41h*4+2]
+	xchg	[HD1_DPT_POINTER_46h*4+2], ax
+	mov		[HD0_DPT_POINTER_41h*4+2], ax
+	pop		ds
+%endif ; MODULE_COMPATIBLE_TABLES
+
 ALIGN JUMP_ALIGN
 .RestoreAXandReturn:
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CompatibleDPT.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CompatibleDPT.asm	(revision 549)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CompatibleDPT.asm	(revision 550)
@@ -63,8 +63,10 @@
 ;		Nothing
 ;--------------------------------------------------------------------
+%ifdef MODULE_EBIOS
 GetTemporaryBufferForDPTEtoESDI:
 	call	GetBufferForDrive80hToESDI
 	add		di, BYTE TRANSLATED_DPT_size * 2
 	ret
+%endif
 
 GetBufferForDrive80hToESDI:
@@ -73,5 +75,9 @@
 	mov		di, [cs:ROMVARS.bStealSize]	; No harm to read WORD
 	eSHL_IM	di, 10						; DI = RAMVARS size in bytes
+%ifdef MODULE_EBIOS
 	sub		di, BYTE (TRANSLATED_DPT_size * 2) + DPTE_size
+%else
+	sub		di, BYTE TRANSLATED_DPT_size * 2
+%endif
 	ret
 
@@ -174,4 +180,5 @@
 
 
+%ifdef MODULE_EBIOS
 ;--------------------------------------------------------------------
 ; CompatibleDPT_CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI
@@ -248,4 +255,5 @@
 	lea		bx, [di-DPTE_size]
 	ret
+%endif ; MODULE_EBIOS
 
 
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm	(revision 549)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm	(revision 550)
@@ -128,9 +128,11 @@
 	or		[di+DPT.bFlagsLow], cl	; Shift count and addressing mode
 	mov		[di+DPT.wPchsHeadsAndSectors], bx
-
-%ifdef MODULE_EBIOS
+%ifdef MODULE_COMPATIBLE_TABLES OR MODULE_EBIOS
 	; Store P-Cylinders here for Compatible DPTs when FLGL_DPT_LBA is not set
 	; or when drive has over 15,482,880 sectors
 	mov		[di+DPT.wPchsCylinders], ax
+%endif
+
+%ifdef MODULE_EBIOS
 	test	cl, FLGL_DPT_LBA
 	jz		SHORT .NoLbaSoNoEBIOS
@@ -188,22 +190,4 @@
 .NoLbaSoNoEBIOS:
 %endif ; MODULE_EBIOS
-	; Fall to .StoreBlockMode
-
-;--------------------------------------------------------------------
-; .StoreBlockMode
-;	Parameters:
-;		DS:DI:	Ptr to Disk Parameter Table
-;		ES:SI:	Ptr to 512-byte ATA information read from the drive
-;		CS:BP:	Ptr to IDEVARS for the controller
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		Nothing
-;--------------------------------------------------------------------
-.StoreBlockMode:
-	cmp		BYTE [es:si+ATA1.bBlckSize], 1	; Max block size in sectors
-	jbe		SHORT .BlockModeTransfersNotSupported
-	or		BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
-.BlockModeTransfersNotSupported:
 	; Fall to .StoreDeviceSpecificParameters
 
