Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm	(revision 489)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm	(revision 491)
@@ -3,5 +3,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.
 ;
@@ -10,11 +10,11 @@
 ; 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
-;		
+;
 
 ; Section containing code
@@ -155,5 +155,5 @@
 	mov		dl, ROMVARS.ideVars0						; starting Idevars offset
 
-    ; Get count of ALL Idevars structures, not just the ones that are configured.  This may seem odd, 
+    ; Get count of ALL Idevars structures, not just the ones that are configured.  This may seem odd,
     ; but it catches the .ideVarsSerialAuto structure, which would not be scanned if the count from
 	; RamVars_GetIdeControllerCountToCX was used.  Unused controllers won't make a difference, since no DPT
@@ -174,4 +174,3 @@
 
 .done:
-.NoForeignDrivesToReset:
 	ret
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm	(revision 489)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm	(revision 491)
@@ -3,5 +3,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.
 ;
@@ -10,11 +10,11 @@
 ; 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
-;		
+;
 
 ; Section containing code
@@ -63,5 +63,5 @@
 	call	AccessDPT_IsThisDeviceXTCF
 	jne		SHORT XTCFnotFound
-	and		ax, BYTE 7Fh				; Subcommand now in AX
+	and		ax, BYTE 7Fh				; Subcommand now in AX (clears AH and CF)
 	jz		SHORT .ReturnWithSuccess	; IS_THIS_DRIVE_XTCF
 
@@ -70,12 +70,11 @@
 	jnz		SHORT .SkipReadXtcfControlRegisterToDH
 	mov		dx, [di+DPT.wBasePort]
-	add		dl, XTCF_CONTROL_REGISTER
+	add		dl, XTCF_CONTROL_REGISTER	; Will never overflow (keeps CF cleared)
 	in		al, dx
 	mov		[bp+IDEPACK.intpack+INTPACK.dh], al
 .ReturnWithSuccess:
-	xor		ah, ah
-	ret
+	ret		; With AH and CF cleared
+
 .SkipReadXtcfControlRegisterToDH:
-
 	; WRITE_DH_TO_XTCF_CONTROL_REGISTER
 	dec		ax							; Subcommand
@@ -122,8 +121,8 @@
 	mov		BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_PIO8
 	; Fall to .Enable8bitPioMode
-	
+
 	; We always need to enable 8-bit mode since 16-bit mode is restored
-	; when controller is reset (AH=0h or Dh)
-.Enable8bitPioMode:	
+	; when controller is reset (AH=00h or 0Dh)
+.Enable8bitPioMode:
 	jmp		AH23h_Enable8bitPioMode
 
@@ -143,5 +142,5 @@
 AH1Eh_DetectXTCFwithBasePortInDX:
 	push	dx
-	add		dl, XTCT_CONTROL_REGISTER_INVERTED_in	; set DX to XT-CF config register (inverted)
+	add		dl, XTCF_CONTROL_REGISTER_INVERTED_in	; set DX to XT-CF config register (inverted)
 	in		al, dx		; get value
 	mov		ah, al		; save in ah
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm	(revision 489)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm	(revision 491)
@@ -3,5 +3,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.
 ;
@@ -10,11 +10,11 @@
 ; 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
-;		
+;
 
 ; Section containing code
@@ -59,11 +59,10 @@
 ;--------------------------------------------------------------------
 AH24h_SetBlockSize:
+%ifdef MODULE_8BIT_IDE
 	; XT-CF does not support largest block size in DMA mode.
-%ifdef MODULE_8BIT_IDE
-	call	AccessDPT_IsThisDeviceXTCF
-	cmp		ah, DEVICE_8BIT_XTCF_DMA
-	jne		SHORT .NoNeedToLimitBlockSize
 	cmp		al, XTCF_DMA_MODE_MAX_BLOCK_SIZE
-	ja		SHORT AH1Eh_LoadInvalidCommandToAHandSetCF
+	jbe		SHORT .NoNeedToLimitBlockSize
+	cmp		BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_DMA
+	je		SHORT AH1Eh_LoadInvalidCommandToAHandSetCF
 .NoNeedToLimitBlockSize:
 %endif ; MODULE_8BIT_IDE
