Index: /trunk/XTIDE_Universal_BIOS/Inc/Controllers/XTCF.inc
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Inc/Controllers/XTCF.inc	(revision 470)
+++ /trunk/XTIDE_Universal_BIOS/Inc/Controllers/XTCF.inc	(revision 471)
@@ -28,5 +28,5 @@
 XTCF_BASE_PORT_2					EQU		240h
 XTCF_BASE_PORT_3					EQU		300h	; Default setting
-XTCF_BASE_PORT_4					EQU		320h
+XTCF_BASE_PORT_4					EQU		340h
 
 
@@ -35,21 +35,52 @@
 XTCT_CONTROL_REGISTER_INVERTED_in	EQU		1Eh
 
+; Control Register contents:
+;
+; Control Register holds high byte from Sector Window segment if >= A0h
+; (First possible segment for Sector Window is A000h)
+; 
+; 8-bit PIO transfers (port I/O) are used if Control Register is zero.
+; Any other value means DMA transfers (using DMA channel 3).
 
-; Bit Definitions for XT-CF Control Register
-MASK_XTCF_BASE_PORT_in				EQU		(3<<0)	; Bits 0...1
-	XTCF_PORT_200h					EQU		0
-	XTCF_PORT_240h					EQU		1
-	XTCF_PORT_300h					EQU		2		; Default
-	XTCF_PORT_320h					EQU		3
-FLG_PIO8_INSTEAD_OF_DMA				EQU		(1<<2)	; Set to enable PIO8, clear to enable DMA (Channel 3)
-FLG_AT_ZERO_WAIT_STATE_in			EQU		(1<<3)
-MASK_SECTOR_WINDOW_SEGMENT_in		EQU		(7<<4)	; Bits 4...6
-	XTCF_SECTOR_WINDOW_AT_C000h		EQU		0
-	XTCF_SECTOR_WINDOW_AT_C800h		EQU		1
-	XTCF_SECTOR_WINDOW_AT_D000h		EQU		2		; Default
-	XTCF_SECTOR_WINDOW_AT_D800h		EQU		3
-	XTCF_SECTOR_WINDOW_AT_E000h		EQU		4
-	XTCF_SECTOR_WINDOW_AT_E800h		EQU		5
-FLG_XTCF_ROM_ENABLE_in				EQU		(1<<7)
+
+; Subcommands for AH=1Eh, Lo-tech XT-CF features.
+; Return values common for all subcommands:
+;		AH:		RET_HD_SUCCESS if drive is XT-CF
+;				RET_HD_INVALID if drive is not XT-CF
+;		CF:		0 if successful, 1 if error
+
+;--------------------------------------------------------------------
+; IS_THIS_DRIVE_XTCF
+;	Parameters:
+;		DL:		Drive Number
+;--------------------------------------------------------------------
+IS_THIS_DRIVE_XTCF					EQU		0
+
+;--------------------------------------------------------------------
+; IS_XTCF_IN_PORT_CX
+;	Parameters:
+;		CX:		Port to search XT-CF from (can be anything)
+;	Returns:
+;		AH:		RET_HD_SUCCESS if XT-CF is found from port
+;				RET_HD_INVALID if XT-CF is not found
+;--------------------------------------------------------------------
+IS_XTCF_IN_PORT_CX					EQU		1
+
+;--------------------------------------------------------------------
+; READ_XTCF_CONTROL_REGISTER_TO_DH
+;	Parameters:
+;		DL:		Drive Number
+;	Returns:
+;		DH:		XT-CF Control Register contents
+;--------------------------------------------------------------------
+READ_XTCF_CONTROL_REGISTER_TO_DH	EQU		2
+
+;--------------------------------------------------------------------
+; WRITE_DH_TO_XTCF_CONTROL_REGISTER
+;	Parameters:
+;		DH:		Byte to write to XT-CF Control Register
+;		DL:		Drive Number
+;--------------------------------------------------------------------
+WRITE_DH_TO_XTCF_CONTROL_REGISTER	EQU		3
 
 
Index: /trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc	(revision 470)
+++ /trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc	(revision 471)
@@ -43,4 +43,5 @@
 %ifdef MODULE_8BIT_IDE
 	%include "IDE_8bit.inc"			; For IDE 8-bit data port macros
+	%include "XTCF.inc"				; For Lo-tech XT-CF
 %endif
 
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 470)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 471)
@@ -395,5 +395,9 @@
 	dw	UnsupportedFunction							; 1Ch, ESDI Special Functions (PS/2)
 	dw	UnsupportedFunction							; 1Dh,
-	dw	UnsupportedFunction							; 1Eh,
+%ifdef MODULE_8BIT_IDE
+	dw	AH1Eh_HandlerForXTCFfeatures				; 1Eh, Lo-tech XT-CF features (XTIDE Universal BIOS)
+%else
+	dw	UnsupportedFunction							; 1Eh, 
+%endif
 	dw	UnsupportedFunction							; 1Fh,
 	dw	UnsupportedFunction							; 20h,
Index: /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm	(revision 471)
+++ /trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm	(revision 471)
@@ -0,0 +1,62 @@
+; Project name	:	XTIDE Universal BIOS
+; Description	:	Int 13h function AH=1Eh, Lo-tech XT-CF features.
+
+;
+; XTIDE Universal BIOS and Associated Tools 
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+; 
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;		
+
+; Section containing code
+SECTION .text
+
+;--------------------------------------------------------------------
+; Int 13h function AH=1Eh, Lo-tech XT-CF features.
+; This function is supported only by XTIDE Universal BIOS.
+;
+; AH1Eh_HandlerForXTCFfeatures
+;	Parameters:
+;		AL, CX:	Same as in INTPACK
+;		DL:		Translated Drive number
+;		DS:DI:	Ptr to DPT (in RAMVARS segment)
+;		SS:BP:	Ptr to IDEPACK
+;	Parameters on INTPACK:
+;		AL:		XT-CF subcommand (see XTCF.inc for more info)
+;	Returns with INTPACK:
+;		AH:		Int 13h return status
+;		CF:		0 if successful, 1 if error
+;--------------------------------------------------------------------
+AH1Eh_HandlerForXTCFfeatures:
+	eMOVZX	bx, al	; Subcommand to BX
+%ifndef USE_186
+	call	AH1Eh_ProcessXTCFsubcommandFromBX
+	jmp		Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
+%else
+	push	Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
+	; Fall to AH1Eh_ProcessXTCFsubcommandFromBX
+%endif
+
+
+;--------------------------------------------------------------------
+; AH1Eh_ProcessXTCFsubcommandFromBX
+;	Parameters:
+;		BX:		XT-CF subcommand (see XTCF.inc for more info)
+;		DS:DI:	Ptr to DPT (in RAMVARS segment)
+;		SS:BP:	Ptr to IDEPACK
+;	Returns:
+;		AH:		Int 13h return status
+;		CF:		0 if successful, 1 if error
+;	Corrupts registers:
+;		AL, BX, CX, DX
+;--------------------------------------------------------------------
+AH1Eh_ProcessXTCFsubcommandFromBX:
Index: /trunk/XTIDE_Universal_BIOS/Src/Main.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 470)
+++ /trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 471)
@@ -255,4 +255,7 @@
 	%include "AH11h_HRecal.asm"		; Required by Int13h_Jump.asm
 	%include "AH15h_HSize.asm"		; Required by Int13h_Jump.asm
+%ifdef MODULE_8BIT_IDE
+	%include "AH1Eh_XTCF.asm"
+%endif
 	%include "AH23h_HFeatures.asm"	; Required by Int13h_Jump.asm
 	%include "AH24h_HSetBlocks.asm"	; Required by Int13h_Jump.asm
