Index: trunk/XTIDE_Universal_BIOS/Inc/Controllers/XTCF.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/Controllers/XTCF.inc	(revision 488)
+++ trunk/XTIDE_Universal_BIOS/Inc/Controllers/XTCF.inc	(revision 491)
@@ -5,5 +5,5 @@
 
 ;
-; XTIDE Universal BIOS and Associated Tools 
+; XTIDE Universal BIOS and Associated Tools
 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
 ;
@@ -12,9 +12,9 @@
 ; 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.		
+; GNU General Public License for more details.
 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 ;
@@ -34,4 +34,5 @@
 ; Possible base addresses. Note that all XT-CF IDE registers are SHL 1 compared
 ; to standard IDE registers.
+XTCF_BASE_PORT_DETECTION_SEED		EQU		140h	; Not a valid base address but needed for autodetection
 XTCF_BASE_PORT_1					EQU		200h
 XTCF_BASE_PORT_2					EQU		240h
@@ -42,5 +43,5 @@
 ; XT-CF Control Register (do not SHL 1 these!)
 XTCF_CONTROL_REGISTER				EQU		1Fh
-XTCT_CONTROL_REGISTER_INVERTED_in	EQU		1Eh
+XTCF_CONTROL_REGISTER_INVERTED_in	EQU		1Eh
 
 ; Control Register contents:
@@ -48,5 +49,5 @@
 ; 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).
Index: trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc	(revision 488)
+++ trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc	(revision 491)
@@ -45,5 +45,5 @@
 	.twLbaSectors			resb	6	; 48-bit sector count for LBA addressing
 %endif
-							alignb	2	; WORD alignent for DPT_SERIAL or DPT_ATA
+							alignb	2	; WORD alignment for DPT_SERIAL or DPT_ATA
 endstruc
 
@@ -133,9 +133,9 @@
 ; first! DPT_ATA.bDevice uses small values so there will be no problems.
 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
-%if DPT_SERIAL.bSerialPort <> DPT_ATA.bDevice
-	%error "DPT_ATA.bDevice and DPT_SERIAL.bSerialPort must be in same offsets!"
+	%if DPT_SERIAL.bSerialPort <> DPT_ATA.bDevice
+		%error "DPT_ATA.bDevice and DPT_SERIAL.bSerialPort must be in same offsets!"
+	%endif
 %endif
-%endif
-%endif
+%endif ; MODULE_SERIAL
 
 
Index: trunk/XTIDE_Universal_BIOS/Inc/IDE_8bit.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/IDE_8bit.inc	(revision 488)
+++ trunk/XTIDE_Universal_BIOS/Inc/IDE_8bit.inc	(revision 491)
@@ -55,6 +55,9 @@
 	shl		cx, 5
 %else
-	UNROLL_SECTORS_IN_CX_TO_QWORDS
-	shr		cx, 1
+;	UNROLL_SECTORS_IN_CX_TO_QWORDS
+;	shr		cx, 1
+	mov		ch, cl		; 2 bytes shorter but possibly slower
+	mov		cl, 3
+	shr		cx, cl
 %endif
 %endmacro
Index: trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc	(revision 488)
+++ trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc	(revision 491)
@@ -1,8 +1,7 @@
-; /*
 ; Project name	:	XTIDE Universal BIOS
 ; Description	:	Dependencies for optional modules.
 
 ;
-; XTIDE Universal BIOS and Associated Tools 
+; XTIDE Universal BIOS and Associated Tools
 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
 ;
@@ -11,9 +10,9 @@
 ; 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.		
+; GNU General Public License for more details.
 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 ;
@@ -31,5 +30,4 @@
 	%endif
 %endif
-
 
 
@@ -53,5 +51,5 @@
 	%include "HotkeyBar.inc"		; For Hotkeys
 	%ifdef MODULE_BOOT_MENU
-		%include "BootMenu.inc"			; For Boot Menu
+		%include "BootMenu.inc"		; For Boot Menu
 	%endif
 %endif
@@ -60,5 +58,4 @@
 	%include "IntController.inc"
 %endif
-
 
 
