Index: trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc	(revision 421)
+++ trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc	(revision 422)
@@ -63,17 +63,11 @@
 
 struc DRVDETECTINFO
+	.StartOfDrvDetectInfo:
 	.szDrvName				resb	MAX_HARD_DISK_NAME_LENGTH
 							resb	2	; Zero word (ensures string terminates)
 	.wInitErrorFlags		resb	2	; Errors during initialization
 
-%if LARGEST_DPT_SIZE == 28
-							resb	22	; padding to make DRVDETECTINFO size an even multiple of DPT size
-%elif LARGEST_DPT_SIZE == 20
-							resb	6
-%elif LARGEST_DPT_SIZE == 18
-							resb	2
-%else	; LARGEST_DPT_SIZE == 10
-							resb	6
-%endif
+	; DRVDETECTINFO's size must be an even multiple of DPT's size
+	.EndOfDriveDetectInfo:	resb	LARGEST_DPT_SIZE - (.EndOfDriveDetectInfo % LARGEST_DPT_SIZE)
 endstruc
 
Index: trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc	(revision 421)
+++ trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc	(revision 422)
@@ -23,5 +23,5 @@
 
 ; Base DPT for all device types
-struc DPT	; 8 or 18 bytes
+struc DPT	; 10 or 18 bytes
 	; General Disk Parameter Table related
 	.wFlags:
@@ -29,16 +29,20 @@
 	.bFlagsHigh				resb	1
 	.bIdevarsOffset			resb	1	; Offset to IDEVARS for this drive
+	.bInitError				resb	1	; Flags for AH=09h initialization errors
 
-	.bPchsHeads				resb	1	; (1...16)
+	; CHS variables
 	.wLchsCylinders			resb	2	; (1...1027, yes 1027)
 	.wLchsHeadsAndSectors:
 	.bLchsHeads				resb	1	; (1...255)
 	.bLchsSectorsPerTrack	resb	1	; (1...63)
+	.bPchsHeads				resb	1	; (1...16)
 
+	; LBA and remaining P-CHS variables
 %ifdef MODULE_EBIOS
+	.bPchsSectorsPerTrack	resb	1
+	.wPchsCylinders			resb	2
 	.twLbaSectors			resb	6	; 48-bit sector count for LBA addressing
-	.wPchsCylinders			resb	2
-	.bPchsSectorsPerTrack	resb	1
-							resb	1
+%else
+							resb	1	; Alignment
 %endif
 endstruc
@@ -46,6 +50,6 @@
 	; Bit definitions for DPT.bFlagsLow
 	MASKL_DPT_CHS_SHIFT_COUNT			EQU	(3<<0)				; Bits 0...1, P-CHS to L-CHS bit shift count (0...3)
-	MASKL_DPT_ADDRESSING_MODE			EQU	(3<<ADDRESSING_MODE_FIELD_POSITION)	; Bits 2...3, NORMAL, LARGE or Assisted LBA addressing mode
-	FLGL_DPT_ASSISTED_LBA				EQU	(1<<(ADDRESSING_MODE_FIELD_POSITION+1))
+	MASKL_DPT_TRANSLATEMODE				EQU	MASK_DRVPARAMS_TRANSLATEMODE	; Bits 2...3, NORMAL, LARGE or Assisted LBA addressing mode
+	FLGL_DPT_ASSISTED_LBA				EQU	(1<<(TRANSLATEMODE_FIELD_POSITION+1))
 	FLGL_DPT_SLAVE						EQU	FLG_DRVNHEAD_DRV	; Bit 4, Drive is a Slave Drive
 %ifdef MODULE_IRQ
@@ -56,10 +60,4 @@
 	FLGL_DPT_LBA48						EQU	(1<<7)				; Bit 7, Drive supports 48-bit LBA (Must be bit 7!)
 %endif
-
-	; Addressing modes for DPT.bFlagsLow
-	ADDRESSING_MODE_FIELD_POSITION		EQU		2
-	ADDRESSING_MODE_NORMAL				EQU		0
-	ADDRESSING_MODE_LARGE				EQU		1
-	ADDRESSING_MODE_ASSISTED_LBA		EQU		2	; 28-bit or 48-bit LBA
 
 
@@ -87,7 +85,17 @@
 
 
+	; Flags for DPT_ADVANCED_ATA.bInitError
+	FLG_INITERROR_FAILED_TO_SELECT_DRIVE				EQU (1<<0)
+	FLG_INITERROR_FAILED_TO_INITIALIZE_CHS_PARAMETERS	EQU (1<<1)
+	FLG_INITERROR_FAILED_TO_SET_WRITE_CACHE				EQU (1<<2)
+	FLG_INITERROR_FAILED_TO_RECALIBRATE_DRIVE			EQU (1<<3)
+	FLG_INITERROR_FAILED_TO_SET_BLOCK_MODE				EQU (1<<4)
+	FLG_INITERROR_FAILED_TO_SET_PIO_MODE				EQU (1<<5)
+	FLG_INITERROR_FAILED_TO_INITIALIZE_STANDBY_TIMER	EQU	(1<<6)
+
+
 
 ; DPT for ATA devices
-struc DPT_ATA	; 8/18 bytes + 2 bytes = 10/20 bytes
+struc DPT_ATA	; 10/18 bytes + 2 bytes = 12/20 bytes
 	.dpt					resb	DPT_size
 	.bBlockSize				resb	1	; Current block size in sectors (do not set to zero!)
@@ -100,5 +108,5 @@
 ; EBDA must be reserved for DPTs when using these!
 %ifdef MODULE_ADVANCED_ATA
-struc DPT_ADVANCED_ATA	; 10/20 bytes + 8 bytes = 18/28 bytes
+struc DPT_ADVANCED_ATA	; 12/20 bytes + 8 bytes = 20/28 bytes
 	.dpt_ata				resb	DPT_ATA_size
 	.wControllerID			resb	2	; Controller specific ID WORD (from Advanced Controller detection)
@@ -106,15 +114,6 @@
 	.wMinPioCycleTime		resb	2	; Minimum PIO Cycle Time in ns
 	.bPioMode				resb	1	; Best supported PIO mode
-	.bInitError				resb	1	; Flags for initialization errors
+							resb	1
 endstruc
-
-	; Flags for DPT_ADVANCED_ATA.bInitError
-	FLG_INITERROR_FAILED_TO_SELECT_DRIVE				EQU (1<<0)
-	FLG_INITERROR_FAILED_TO_INITIALIZE_CHS_PARAMETERS	EQU (1<<1)
-	FLG_INITERROR_FAILED_TO_SET_WRITE_CACHE				EQU (1<<2)
-	FLG_INITERROR_FAILED_TO_RECALIBRATE_DRIVE			EQU (1<<3)
-	FLG_INITERROR_FAILED_TO_SET_BLOCK_MODE				EQU (1<<4)
-	FLG_INITERROR_FAILED_TO_SET_PIO_MODE				EQU (1<<5)
-	FLG_INITERROR_FAILED_TO_INITIALIZE_STANDBY_TIMER	EQU	(1<<6)
 %endif
 
Index: trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc	(revision 421)
+++ trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc	(revision 422)
@@ -164,13 +164,23 @@
 
 ; Bit defines for DRVPARAMS.wFlags
-MASK_DRVPARAMS_WRITECACHE	EQU	(3<<0)	; Drive internal write cache settings (must start at bit 0)
-FLG_DRVPARAMS_BLOCKMODE		EQU	(1<<2)	; Enable Block mode transfers
-FLG_DRVPARAMS_USERCHS		EQU	(1<<3)	; User specified P-CHS values
-FLG_DRVPARAMS_USERLBA		EQU	(1<<4)	; User specified LBA values
+MASK_DRVPARAMS_WRITECACHE		EQU	(3<<0)	; Bits 0...1, Drive internal write cache settings (must start at bit 0)
+	DEFAULT_WRITE_CACHE				EQU	0	; Must be 0
+	DISABLE_WRITE_CACHE				EQU	1
+	ENABLE_WRITE_CACHE				EQU	2
+MASK_DRVPARAMS_TRANSLATEMODE	EQU	(3<<TRANSLATEMODE_FIELD_POSITION)	; Bits 2...3, Position shared with DPT
+	TRANSLATEMODE_FIELD_POSITION	EQU	2
+	TRANSLATEMODE_NORMAL			EQU	0
+	TRANSLATEMODE_LARGE				EQU	1
+	TRANSLATEMODE_ASSISTED_LBA		EQU	2	; 28-bit or 48-bit LBA
+	TRANSLATEMODE_AUTO				EQU	3	; Only available in ROMVARS, not in DPTs
+FLG_DRVPARAMS_BLOCKMODE			EQU	(1<<4)	; Enable Block mode transfers
+FLG_DRVPARAMS_USERCHS			EQU	(1<<5)	; User specified P-CHS values
+	MAX_USER_CYLINDERS				EQU	16383
+	MAX_USER_HEADS					EQU	16
+	MAX_USER_SECTORS_PER_TRACK		EQU	63
+FLG_DRVPARAMS_USERLBA			EQU	(1<<6)	; User specified LBA value
+	MIN_USER_LBA_COUNT				EQU	((MAX_USER_CYLINDERS*MAX_USER_HEADS*MAX_USER_SECTORS_PER_TRACK)+1)
+	MAX_USER_LBA_COUNT				EQU	((2^28)-1)
 
-; Drive Write Cache values for DRVPARAMS.wFlags.MASK_DRVPARAMS_WRITECACHE
-DEFAULT_WRITE_CACHE			EQU	0		; Must be 0
-DISABLE_WRITE_CACHE			EQU	1
-ENABLE_WRITE_CACHE			EQU	2
 
 %endif ; ROMVARS_INC
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm	(revision 421)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm	(revision 422)
@@ -35,8 +35,6 @@
 ;--------------------------------------------------------------------
 %macro STORE_ERROR_FLAG_TO_DPT 1
-%ifdef MODULE_ADVANCED_ATA
 	mov		al, %1
 	call	SetErrorFlagFromALwithErrorCodeInAH
-%endif
 %endmacro
 
@@ -82,5 +80,5 @@
 %ifdef MODULE_ADVANCED_ATA
 	; Clear Initialization Error flags from DPT
-	mov		[di+DPT_ADVANCED_ATA.bInitError], al
+	mov		[di+DPT.bInitError], al
 %endif
 
@@ -205,5 +203,5 @@
 .ReturnWithErrorCodeInAH:
 %ifdef MODULE_ADVANCED_ATA
-	mov		ah, [di+DPT_ADVANCED_ATA.bInitError]
+	mov		ah, [di+DPT.bInitError]
 	test	ah, ah	; Clears CF
 	jz		SHORT .ReturnWithSuccess
@@ -225,5 +223,4 @@
 
 
-%ifdef MODULE_ADVANCED_ATA
 ;--------------------------------------------------------------------
 ; SetErrorFlagFromALwithErrorCodeInAH
@@ -247,8 +244,6 @@
 	jbe		SHORT IgnoreInvalidCommandError
 
-	or		[di+DPT_ADVANCED_ATA.bInitError], al
+	or		[di+DPT.bInitError], al
 	stc
 .NoErrorFlagToSet:
 	ret
-
-%endif
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm	(revision 421)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm	(revision 422)
@@ -103,5 +103,5 @@
 Address_OldInt13hAddressToIdeAddress:
 		call	Address_ExtractLCHSparametersFromOldInt13hAddress
-		ACCESSDPT__GET_UNSHIFTED_ADDRESS_MODE_TO_AXZF
+		ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF
 
 ;;; 0: ADDRESSING_MODE_NORMAL
Index: trunk/XTIDE_Universal_BIOS/Src/Main.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 421)
+++ trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 422)
@@ -92,6 +92,6 @@
 	at	ROMVARS.ideVars0+IDEVARS.bDevice,		db	DEVICE_16BIT_ATA
 	at	ROMVARS.ideVars0+IDEVARS.bIRQ,			db	0
-	at	ROMVARS.ideVars0+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,	db	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE
-	at	ROMVARS.ideVars0+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,	db	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE
+	at	ROMVARS.ideVars0+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
+	at	ROMVARS.ideVars0+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
 
 	at	ROMVARS.ideVars1+IDEVARS.wPort,			dw	DEVICE_ATA_SECONDARY_PORT
@@ -99,6 +99,6 @@
 	at	ROMVARS.ideVars1+IDEVARS.bDevice,		db	DEVICE_16BIT_ATA
 	at	ROMVARS.ideVars1+IDEVARS.bIRQ,			db	0
-	at	ROMVARS.ideVars1+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,	db	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE
-	at	ROMVARS.ideVars1+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,	db	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE
+	at	ROMVARS.ideVars1+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
+	at	ROMVARS.ideVars1+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
 
 	at	ROMVARS.ideVars2+IDEVARS.wPort,			dw	DEVICE_ATA_TERTIARY_PORT
@@ -106,6 +106,6 @@
 	at	ROMVARS.ideVars2+IDEVARS.bDevice,		db	DEVICE_16BIT_ATA
 	at	ROMVARS.ideVars2+IDEVARS.bIRQ,			db	0
-	at	ROMVARS.ideVars2+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,	db	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE
-	at	ROMVARS.ideVars2+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,	db	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE
+	at	ROMVARS.ideVars2+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
+	at	ROMVARS.ideVars2+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
 
 	at	ROMVARS.ideVars3+IDEVARS.wPort,			dw	DEVICE_ATA_QUATERNARY_PORT
@@ -113,6 +113,6 @@
 	at	ROMVARS.ideVars3+IDEVARS.bDevice,		db	DEVICE_16BIT_ATA
 	at	ROMVARS.ideVars3+IDEVARS.bIRQ,			db	0
-	at	ROMVARS.ideVars3+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,	db	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE
-	at	ROMVARS.ideVars3+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,	db	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE
+	at	ROMVARS.ideVars3+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
+	at	ROMVARS.ideVars3+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
 
 %ifdef MODULE_SERIAL
Index: trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrintCfg.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrintCfg.asm	(revision 421)
+++ trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrintCfg.asm	(revision 422)
@@ -56,5 +56,5 @@
 ;--------------------------------------------------------------------
 .PushAddressingMode:
-	ACCESSDPT__GET_UNSHIFTED_ADDRESS_MODE_TO_AXZF
+	ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF
 	;;
 	;; This multiply both shifts the addressing mode bits down to low order bits, and
@@ -62,5 +62,5 @@
 	;; with AL clear, and so we exchange AL and AH after the multiply for the final result.
 	;;
-	mov		cx, g_szAddressingModes_Displacement << (8-ADDRESSING_MODE_FIELD_POSITION)
+	mov		cx, g_szAddressingModes_Displacement << (8-TRANSLATEMODE_FIELD_POSITION)
 	mul		cx
 	xchg	al, ah		; AL = always zero after above multiplication
@@ -132,10 +132,6 @@
 ;--------------------------------------------------------------------
 .PushResetStatus:
-%ifdef MODULE_ADVANCED_ATA
-	mov		al, [di+DPT_ADVANCED_ATA.bInitError]
+	mov		al, [di+DPT.bInitError]
 	push	ax
-%else
-	ePUSH_T	ax, 0
-%endif
 
 ;;; fall-out to BootMenuPrint_HardDiskRefreshInformation.
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm	(revision 421)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm	(revision 422)
@@ -144,5 +144,5 @@
 ALIGN JUMP_ALIGN
 AccessDPT_GetPointerToDRVPARAMStoCSBX:
-	eMOVZX	bx, [di+DPT.bIdevarsOffset]			; CS:BX points to IDEVARS
+	eMOVZX	bx, BYTE [di+DPT.bIdevarsOffset]	; CS:BX points to IDEVARS
 	add		bx, BYTE IDEVARS.drvParamsMaster	; CS:BX points to Master Drive DRVPARAMS
 	test	BYTE [di+DPT.bFlagsLow], FLGL_DPT_SLAVE
@@ -154,9 +154,9 @@
 
 ;--------------------------------------------------------------------
-; ACCESSDPT__GET_UNSHIFTED_ADDRESS_MODE_TO_AXZF
+; ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF
 ;	Parameters:
 ;		DS:DI:	Ptr to Disk Parameter Table
 ;	Returns:
-;		AX:		Addressing Mode (ADDRESSING_MODE_NORMAL, ADDRESSING_MODE_LARGE or ADDRESSING_MODE_ASSISTED_LBA)
+;		AX:		Translate Mode (TRANSLATEMODE_NORMAL, TRANSLATEMODE_LARGE or TRANSLATEMODE_ASSISTED_LBA)
 ;               unshifted (still shifted where it is in bFlagsLow)
 ;       ZF:     Set based on value in AL
@@ -168,6 +168,6 @@
 ; is not worth it for these two instructions (4 bytes total)
 ;
-%macro ACCESSDPT__GET_UNSHIFTED_ADDRESS_MODE_TO_AXZF 0
+%macro ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF 0
 	mov		al, [di+DPT.bFlagsLow]
-	and		ax, BYTE MASKL_DPT_ADDRESSING_MODE
+	and		ax, BYTE MASKL_DPT_TRANSLATEMODE
 %endmacro
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm	(revision 421)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm	(revision 422)
@@ -34,5 +34,6 @@
 ;	Returns:
 ;		BX:DX:AX:	48-bit sector count
-;		CL:			FLGL_DPT_LBA48 if LBA48 supported, zero otherwise
+;		CL:			FLGL_DPT_LBA48 if LBA48 supported
+;					Zero if only LBA28 is supported
 ;	Corrupts registers:
 ;		Nothing
@@ -64,6 +65,8 @@
 
 ;--------------------------------------------------------------------
-; AtaGeometry_GetLCHStoAXBLBHfromAtaInfoInESSI:
-;	Parameters:
+; AtaGeometry_GetLCHStoAXBLBHfromAtaInfoInESSIandTranslateModeInDX
+; AtaGeometry_GetLCHStoAXBLBHfromPCHSinAXBLBHandTranslateModeInDX
+;	Parameters:
+;		DX:		Wanted translate mode or TRANSLATEMODE_AUTO to autodetect
 ;		ES:SI:	Ptr to 512-byte ATA information read from the drive
 ;	Returns:
@@ -72,31 +75,43 @@
 ;		BH:		Number of L-CHS sectors per track (1...63)
 ;		CX:		Number of bits shifted (0...3)
-;		DL:		Addressing mode
+;		DL:		CHS Translate Mode
 ;	Corrupts registers:
 ;		DH
 ;--------------------------------------------------------------------
-AtaGeometry_GetLCHStoAXBLBHfromAtaInfoInESSI:
+AtaGeometry_GetLCHStoAXBLBHfromAtaInfoInESSIandTranslateModeInDX:
 	call	AtaGeometry_GetPCHStoAXBLBHfromAtaInfoInESSI
 	; Fall to AtaGeometry_GetLCHStoAXBLBHfromPCHSinAXBLBH
 
-AtaGeometry_GetLCHStoAXBLBHfromPCHSinAXBLBH:
+AtaGeometry_GetLCHStoAXBLBHfromPCHSinAXBLBHandTranslateModeInDX:
+	; Check if user defined translate mode
+	test	dx, dx
+	jnz		SHORT .CheckIfLargeTranslationWanted
+	MIN_U	ax, MAX_LCHS_CYLINDERS	; TRANSLATEMODE_NORMAL maximum cylinders
+	inc		dx
+.CheckIfLargeTranslationWanted:
+	dec		dx						; Set ZF if TRANSLATEMODE_LARGE
+	jz		SHORT ConvertPCHfromAXBLtoRevisedEnhancedCHinAXBL
+	dec		dx						; Set ZF if TRANSLATEMODE_ASSISTED_LBA
+	jz		SHORT .UseAssistedLBA
+	; TRANSLATEMODE_AUTO set
+
 	; Generate L-CHS using simple bit shift algorithm (ECHS) if
 	; 8192 or less cylinders.
 	cmp		ax, 8192
-	jbe		SHORT ConvertPCHfromAXBXtoEnhancedCHinAXBX
+	jbe		SHORT ConvertPCHfromAXBLtoEnhancedCHinAXBL
 
 	; We have 8193 or more cylinders so two algorithms are available:
 	; Revised ECHS or Assisted LBA. The Assisted LBA provides larger
 	; capacity but requires LBA support from drive (drives this large
-	; always support LBA but we may have intentionally cleared the LBA
-	; bit to force CHS addressing).
+	; always support LBA but user might have unintentionally set LBA).
+.UseAssistedLBA:
 	test	BYTE [es:si+ATA1.wCaps+1], A1_wCaps_LBA>>8
-	jz		SHORT ConvertPCHfromAXBXtoRevisedEnhancedCHinAXBX
+	jz		SHORT ConvertPCHfromAXBLtoRevisedEnhancedCHinAXBL
 
 	; Drive supports LBA
-	call	AtaGeometry_GetSectorCountToDXAXfromCHSinAXBLBH
+	call	GetSectorCountToDXAXfromCHSinAXBLBH
 	call	ConvertChsSectorCountFromDXAXtoLbaAssistedLCHSinAXBLBH
 	xor		cx, cx		; No bits to shift
-	mov		dl, ADDRESSING_MODE_ASSISTED_LBA
+	mov		dl, TRANSLATEMODE_ASSISTED_LBA
 	ret
 
@@ -121,5 +136,5 @@
 
 ;--------------------------------------------------------------------
-; AtaGeometry_GetSectorCountToDXAXfromCHSinAXBLBH
+; GetSectorCountToDXAXfromCHSinAXBLBH
 ;	Parameters:
 ;		ES:SI:	Ptr to 512-byte ATA information read from the drive
@@ -132,5 +147,5 @@
 ;		BX
 ;--------------------------------------------------------------------
-AtaGeometry_GetSectorCountToDXAXfromCHSinAXBLBH:
+GetSectorCountToDXAXfromCHSinAXBLBH:
 	xchg	ax, bx
 	mul		ah			; AX = Heads * Sectors per track
@@ -157,5 +172,5 @@
 ;  Do a standard ECHS translation
 ;
-; ConvertPCHfromAXBXtoRevisedEnhancedCHinAXBX:
+; ConvertPCHfromAXBLtoRevisedEnhancedCHinAXBL:
 ;	Parameters:
 ;		AX:		Number of P-CHS cylinders (8193...16383)
@@ -169,7 +184,11 @@
 ;		Nothing
 ;--------------------------------------------------------------------
-ConvertPCHfromAXBXtoRevisedEnhancedCHinAXBX:
+ConvertPCHfromAXBLtoRevisedEnhancedCHinAXBL:
+	; Generate L-CHS using simple bit shift algorithm (ECHS) if
+	; 8192 or less cylinders
+	cmp		ax, 8192
+	jbe		SHORT ConvertPCHfromAXBLtoEnhancedCHinAXBL
 	cmp		bl, 16	; Drives with 8193 or more cylinders can report 15 heads
-	jb		SHORT ConvertPCHfromAXBXtoEnhancedCHinAXBX
+	jb		SHORT ConvertPCHfromAXBLtoEnhancedCHinAXBL
 
 	eMOVZX	cx, bl	; CX = 16
@@ -201,5 +220,5 @@
 ;  Use the multiplier on the Cylinder and Head values to obtain the translated values.
 ;
-; ConvertPCHfromAXBXtoEnhancedCHinAXBX:
+; ConvertPCHfromAXBLtoEnhancedCHinAXBL:
 ;	Parameters:
 ;		AX:		Number of P-CHS cylinders (1...8192)
@@ -209,18 +228,18 @@
 ;		BL:		Number of L-CHS heads (?...128)
 ;		CX:		Number of bits shifted (0...3)
-;		DL:		ADDRESSING_MODE_NORMAL or ADDRESSING_MODE_LARGE
+;		DL:		TRANSLATEMODE_NORMAL or TRANSLATEMODE_LARGE
 ;	Corrupts registers:
 ;		Nothing
 ;--------------------------------------------------------------------
-ConvertPCHfromAXBXtoEnhancedCHinAXBX:
+ConvertPCHfromAXBLtoEnhancedCHinAXBL:
 	xor		cx, cx		; No bits to shift initially
-	xor		dl, dl		; Assume ADDRESSING_MODE_NORMAL
+	xor		dl, dl		; Assume TRANSLATEMODE_NORMAL
 .ShiftIfMoreThan1024Cylinder:
 	cmp		ax, MAX_LCHS_CYLINDERS
 	jbe		SHORT ReturnLCHSinAXBLBH
-	shr		ax, 1
-	shl		bl, 1
+	shr		ax, 1		; Halve cylinders
+	shl		bl, 1		; Double heads
 	inc		cx			; Increment bit shift count
-	mov		dl, ADDRESSING_MODE_LARGE
+	mov		dl, TRANSLATEMODE_LARGE
 	jmp		SHORT .ShiftIfMoreThan1024Cylinder
 
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm	(revision 421)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm	(revision 422)
@@ -55,5 +55,5 @@
 ;--------------------------------------------------------------------
 .InitializeDPT:
-	mov		[di+DPT.bIdevarsOffset], bp	; IDEVARS must start in first 256 bytes of ROM
+	mov		[di+DPT.bIdevarsOffset], bp		; IDEVARS must start in first 256 bytes of ROM
 	; Fall to .StoreDriveSelectAndDriveControlByte
 
@@ -95,20 +95,16 @@
 .StoreCHSparametersAndAddressingMode:
 	; Check if CHS defined in ROMVARS
-	call	AccessDPT_GetPointerToDRVPARAMStoCSBX
-	test	byte [cs:bx+DRVPARAMS.wFlags], FLG_DRVPARAMS_USERCHS    ; User specified P-CHS?
+	call	GetUserDefinedCapacityToBXAXandFlagsToCXandModeToDXfromROMVARS
+	test	cl, FLG_DRVPARAMS_USERCHS
 	jz		SHORT .AutodetectPCHSvalues
 
-	; Use DRVPARAMS P-CHS values instead of autodetected
-	mov		ax, [cs:bx+DRVPARAMS.wCylinders]
-	mov		bx, [cs:bx+DRVPARAMS.wHeadsAndSectors]
-	call	AtaGeometry_GetLCHStoAXBLBHfromPCHSinAXBLBH
+	; Translate P-CHS to L-CHS
+	call	AtaGeometry_GetLCHStoAXBLBHfromPCHSinAXBLBHandTranslateModeInDX
 	jmp		SHORT .StoreLCHStoDPT
-
-	; Get L-CHS parameters and addressing mode
 .AutodetectPCHSvalues:
-	call	AtaGeometry_GetLCHStoAXBLBHfromAtaInfoInESSI
+	call	AtaGeometry_GetLCHStoAXBLBHfromAtaInfoInESSIandTranslateModeInDX
 
 .StoreLCHStoDPT:
-	eSHL_IM	dl, ADDRESSING_MODE_FIELD_POSITION
+	eSHL_IM	dl, TRANSLATEMODE_FIELD_POSITION
 	or		cl, dl
 	or		[di+DPT.bFlagsLow], cl		; Shift count and addressing mode
@@ -144,12 +140,11 @@
 
 	; Load user defined LBA
-	call	AccessDPT_GetPointerToDRVPARAMStoCSBX
-	test	BYTE [cs:bx+DRVPARAMS.wFlags], FLG_DRVPARAMS_USERLBA
+	call	GetUserDefinedCapacityToBXAXandFlagsToCXandModeToDXfromROMVARS
+	test	cl, FLG_DRVPARAMS_USERLBA
 	jz		SHORT .KeepTotalSectorsFromAtaID
-	mov		ax, [cs:bx+DRVPARAMS.dwMaximumLBA]
-	mov		dx, [cs:bx+DRVPARAMS.dwMaximumLBA+2]
-	xor		bx, bx
 
 	; Compare user defined and ATA-ID sector count and select smaller
+	xor		dx, dx
+	xchg	bx, dx		; User defined LBA now in BX:DX:AX
 	cmp		bx, [di+DPT.twLbaSectors+4]
 	jb		SHORT .StoreUserDefinedSectorCountToDPT
@@ -160,5 +155,5 @@
 	jae		SHORT .KeepTotalSectorsFromAtaID
 .StoreUserDefinedSectorCountToDPT:
-	xor		cx, cx		; Always LBA28 for user defined values
+	; CL bit FLGL_DPT_LBA48 is clear at this point
 	call	StoreLba48AddressingFromCLandTotalSectorCountFromBXDXAX
 
@@ -234,4 +229,34 @@
 
 
+;--------------------------------------------------------------------
+; GetUserDefinedCapacityToBXAXandFlagsToCXandModeToDXfromROMVARS
+;	Parameters:
+;		DS:DI:		Ptr to Disk Parameter Table
+;	Returns:
+;		AX:			User defined P-CHS Cylinders or LBA low word
+;		BX:			User defined P-CHS Heads and Sectors or LBA high word
+;		DX:			Translate mode or TRANSLATEMODE_AUTO
+;		CX:			FLG_DRVPARAMS_USERCHS if user defined CHS in BX:AX
+;					FLG_DRVPARAMS_USERLBA if user defined LBA in BX:AX
+;					Zero if user has not defined capacity
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+GetUserDefinedCapacityToBXAXandFlagsToCXandModeToDXfromROMVARS:
+	call	AccessDPT_GetPointerToDRVPARAMStoCSBX
+
+	; Get settings
+	mov		cx, [cs:bx+DRVPARAMS.wFlags]
+	mov		dx, cx
+	and		cx, BYTE FLG_DRVPARAMS_USERCHS | FLG_DRVPARAMS_USERLBA
+	and		dx, BYTE MASK_DRVPARAMS_TRANSLATEMODE
+	eSHR_IM	dx, TRANSLATEMODE_FIELD_POSITION
+
+	; Get capacity
+	mov		ax, [cs:bx+DRVPARAMS.wCylinders]		; Or .dwMaximumLBA
+	mov		bx, [cs:bx+DRVPARAMS.wHeadsAndSectors]	; Or .dwMaximumLBA+2
+	ret
+
+
 %ifdef MODULE_EBIOS
 ;--------------------------------------------------------------------
