Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDPT.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDPT.asm	(revision 398)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDPT.asm	(revision 399)
@@ -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.
-; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html				
-;		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;
 
 ; Section containing code
@@ -34,14 +34,30 @@
 IdeDPT_Finalize:
 
+%ifdef MODULE_FEATURE_SETS
+;--------------------------------------------------------------------
+; .DetectPowerManagementSupport
+;	Parameters:
+;		DS:DI:	Ptr to Disk Parameter Table
+;		ES:SI:	Ptr to 512-byte ATA information read from the drive
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+.DetectPowerManagementSupport:
+	test	BYTE [es:si+ATA6.wSetSup82], A6_wSetSup82_POWERMAN
+	jz		.NoPowerManagementSupport
+	or		BYTE [di+DPT.bFlagsHigh], FLGH_DPT_POWER_MANAGEMENT_SUPPORTED
+.NoPowerManagementSupport:
+%endif ; MODULE_FEATURE_SETS
+
 ;--------------------------------------------------------------------
 ; .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:
-;		AX
+;		Nothing
 ;--------------------------------------------------------------------
 .StoreBlockMode:
@@ -78,5 +94,5 @@
 	mov		[di+DPT_ADVANCED_ATA.wMinPioCycleTime], cx
 	mov		[di+DPT_ADVANCED_ATA.bPioMode], al
-	or		[di+DPT.bFlagsHigh], ah	
+	or		[di+DPT.bFlagsHigh], ah
 
 ;--------------------------------------------------------------------
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm	(revision 398)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm	(revision 399)
@@ -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
@@ -44,5 +44,5 @@
 
 ;--------------------------------------------------------------------
-; Initialized drive to be ready for use.
+; Initialize drive to be ready for use.
 ;
 ; AH9h_InitializeDriveForUse
@@ -57,85 +57,34 @@
 ;--------------------------------------------------------------------
 AH9h_InitializeDriveForUse:
+	xor		ax, ax
+
+	; Clear Initialization Error flags from DPT
+	mov		[di+DPT_ATA.bInitError], al
+
+%ifdef MODULE_SERIAL
+	; No need to do this for serial devices
+	test	BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE	; Clears CF
+	jz		SHORT .ContinueInitialization
+	ret		; With AH and CF cleared
+	.ContinueInitialization:
+%endif
+
 	push	es
 	push	si
 
-%ifdef MODULE_SERIAL
-	; no need to do this for serial devices
-	xor		ah, ah
-	test	byte [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE	; Clears CF
-	jnz		.ReturnWithErrorCodeInAH
-
-%else
-	; Clear Initialization Error flags from DPT
-	mov		BYTE [di+DPT_ATA.bInitError], 0
-%endif
-
+;;;	SelectDrive
 	; Try to select drive and wait until ready
 	call	AccessDPT_GetDriveSelectByteToAL
 	mov		[bp+IDEPACK.bDrvAndHead], al
 	call	Device_SelectDrive
+
 	mov		al, FLG_INITERROR_FAILED_TO_SELECT_DRIVE
-	call	SetErrorFlagFromALwithErrorCodeInAH
-	jc		SHORT .ReturnWithErrorCodeInAH
-
+	call	.SetErrorFlagFromALwithErrorCodeInAH
+	jc		.ReturnWithErrorCodeInAH
+
+;;;	InitializeDeviceParameters
 	; Initialize CHS parameters if LBA is not used
-	call	InitializeDeviceParameters
-	mov		al, FLG_INITERROR_FAILED_TO_INITIALIZE_CHS_PARAMETERS
-	call	SetErrorFlagFromALwithErrorCodeInAH
-
-	; Enable or Disable Write Cache
-	call	SetWriteCache
-	mov		al, FLG_INITERROR_FAILED_TO_SET_WRITE_CACHE
-	call	SetErrorFlagFromALwithErrorCodeInAH
-
-	; Recalibrate drive by seeking to cylinder 0
-.RecalibrateDrive:
-	call	AH11h_RecalibrateDrive
-	mov		al, FLG_INITERROR_FAILED_TO_RECALIBRATE_DRIVE
-	call	SetErrorFlagFromALwithErrorCodeInAH
-
-	; Initialize block mode transfers
-.InitializeBlockMode:
-	call	InitializeBlockMode
-	mov		al, FLG_INITERROR_FAILED_TO_SET_BLOCK_MODE
-	call	SetErrorFlagFromALwithErrorCodeInAH
-
-%ifdef MODULE_ADVANCED_ATA
-; Initialize fastest supported PIO mode
-.InitializePioMode:
-	call	InitializePioMode
-	mov		al, FLG_INITERROR_FAILED_TO_SET_PIO_MODE
-	call	SetErrorFlagFromALwithErrorCodeInAH
-%endif
-
-	; There might have been several errors so just return
-	; one error code for them all
-	cmp		BYTE [di+DPT_ATA.bInitError], 0
-	je		SHORT .ReturnWithErrorCodeInAH
-	mov		ah, RET_HD_RESETFAIL
-	stc
-
-.ReturnWithErrorCodeInAH:
-	pop		si
-	pop		es
-	ret
-
-
-;--------------------------------------------------------------------
-; InitializeDeviceParameters
-;	Parameters:
-;		DS:DI:	Ptr to DPT (in RAMVARS segment)
-;		SS:BP:	Ptr to IDEPACK
-;	Returns:
-;		AH:		BIOS Error code
-;		CF:		Cleared if successful
-;				Set if any error
-;	Corrupts registers:
-;		AL, BX, CX, DX
-;--------------------------------------------------------------------
-InitializeDeviceParameters:
-	; No need to initialize CHS parameters if LBA mode enabled
-	test	BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA	; Clear CF
-	jnz		SHORT ReturnSuccessSinceInitializationNotNeeded
+	test	BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA
+	jnz		SHORT .SkipInitializeDeviceParameters		; No need to initialize CHS parameters if LBA mode enabled
 
 	; Initialize Logical Sectors per Track and Max Head number
@@ -145,75 +94,37 @@
 	mov		al, COMMAND_INITIALIZE_DEVICE_PARAMETERS
 	mov		bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_BSY, FLG_STATUS_BSY)
-	jmp		Idepack_StoreNonExtParametersAndIssueCommandFromAL
-
-
-;--------------------------------------------------------------------
-; SetWriteCache
-;	Parameters:
-;		DS:DI:	Ptr to DPT (in RAMVARS segment)
-;	Returns:
-;		AH:		BIOS Error code
-;		CF:		Cleared if successful
-;				Set if any error
-;	Corrupts registers:
-;		AL, BX, CX, DX, SI
-;--------------------------------------------------------------------
-SetWriteCache:
+	call	Idepack_StoreNonExtParametersAndIssueCommandFromAL
+
+	mov		al, FLG_INITERROR_FAILED_TO_INITIALIZE_CHS_PARAMETERS
+	call	.SetErrorFlagFromALwithErrorCodeInAH
+.SkipInitializeDeviceParameters:
+
+;;;	SetWriteCache
+	; Enable or Disable Write Cache
 	call	AccessDPT_GetPointerToDRVPARAMStoCSBX
 	mov		bl, [cs:bx+DRVPARAMS.wFlags]
+	push	bx	; Save .wFlags for later use in InitializeBlockMode
 	and		bx, BYTE MASK_DRVPARAMS_WRITECACHE
-	jz		SHORT ReturnSuccessSinceInitializationNotNeeded		; DEFAULT_WRITE_CACHE
+	jz		SHORT .SkipSetWriteCache		; DEFAULT_WRITE_CACHE
 	mov		si, [cs:bx+.rgbWriteCacheCommands]
-	jmp		AH23h_SetControllerFeatures
-
-.rgbWriteCacheCommands:
-	db		0								; DEFAULT_WRITE_CACHE
-	db		FEATURE_DISABLE_WRITE_CACHE		; DISABLE_WRITE_CACHE
-	db		FEATURE_ENABLE_WRITE_CACHE		; ENABLE_WRITE_CACHE
-
-
-%ifdef MODULE_ADVANCED_ATA
-;--------------------------------------------------------------------
-; InitializePioMode
-;	Parameters:
-;		DS:DI:	Ptr to DPT (in RAMVARS segment)
-;	Returns:
-;		AH:		BIOS Error code
-;		CF:		Cleared if successful
-;				Set if any error
-;	Corrupts registers:
-;		AL, BX, CX, DX
-;--------------------------------------------------------------------
-InitializePioMode:
-	mov		dl, PIO_DEFAULT_MODE_DISABLE_IORDY
-	test	BYTE [di+DPT.bFlagsHigh], FLGH_DPT_IORDY
-	jz		SHORT .IordyNotSupported
-
-	; Advanced PIO mode 3 and above
-	mov		dl, [di+DPT_ADVANCED_ATA.bPioMode]
-	or		dl, PIO_FLOW_CONTROL_MODE_xxx
-
-.IordyNotSupported:
-	mov		si, FEATURE_SET_TRANSFER_MODE
-	jmp		AH23h_SetControllerFeatures
-%endif
-
-
-;--------------------------------------------------------------------
-; InitializeBlockMode
-;	Parameters:
-;		DS:DI:	Ptr to DPT (in RAMVARS segment)
-;	Returns:
-;		AH:		BIOS Error code
-;		CF:		Cleared if successful
-;				Set if any error
-;	Corrupts registers:
-;		AL, BX, CX, DX
-;--------------------------------------------------------------------
-InitializeBlockMode:
-	test	BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED	; Clear CF
+	call	AH23h_SetControllerFeatures
+
+	mov		al, FLG_INITERROR_FAILED_TO_SET_WRITE_CACHE
+	call	.SetErrorFlagFromALwithErrorCodeInAH
+.SkipSetWriteCache:
+
+;;;	RecalibrateDrive
+	; Recalibrate drive by seeking to cylinder 0
+	call	AH11h_RecalibrateDrive
+
+	mov		al, FLG_INITERROR_FAILED_TO_RECALIBRATE_DRIVE
+	call	.SetErrorFlagFromALwithErrorCodeInAH
+
+;;;	InitializeBlockMode
+	; Initialize block mode transfers
+	pop		ax	; Restore .wFlags saved in SetWriteCache
+	test	BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
 	jz		SHORT .BlockModeNotSupportedOrDisabled
-	call	AccessDPT_GetPointerToDRVPARAMStoCSBX
-	test	BYTE [cs:bx+DRVPARAMS.wFlags], FLG_DRVPARAMS_BLOCKMODE
+	test	al, FLG_DRVPARAMS_BLOCKMODE
 	jz		SHORT .BlockModeNotSupportedOrDisabled
 
@@ -222,17 +133,64 @@
 .TryNextBlockSize:
 	mov		al, bl
-	call	AH24h_SetBlockSize
+	call	AH24h_SetBlockSize	; Stores block size to DPT
 	jnc		SHORT .SupportedBlockSizeFound
-	shr		bl, 1						; Try next size
-	jmp		SHORT .TryNextBlockSize
+	shr		bl, 1
+	jnc		SHORT .TryNextBlockSize
+
+	mov		al, FLG_INITERROR_FAILED_TO_SET_BLOCK_MODE
+	call	.SetErrorFlagFromALwithErrorCodeInAH
+.BlockModeNotSupportedOrDisabled:
 .SupportedBlockSizeFound:
-	mov		[di+DPT_ATA.bBlockSize], bl
-.BlockModeNotSupportedOrDisabled:
-ReturnSuccessSinceInitializationNotNeeded:
+
+%ifdef MODULE_ADVANCED_ATA
+;;;	InitializePioMode
+	; Initialize fastest supported PIO mode
+	mov		dl, PIO_DEFAULT_MODE_DISABLE_IORDY
+	test	BYTE [di+DPT.bFlagsHigh], FLGH_DPT_IORDY
+	jz		SHORT .IordyNotSupported
+
+	; Advanced PIO mode 3 and above
+	mov		dl, [di+DPT_ADVANCED_ATA.bPioMode]
+	or		dl, PIO_FLOW_CONTROL_MODE_xxx
+
+.IordyNotSupported:
+	mov		si, FEATURE_SET_TRANSFER_MODE
+	call	AH23h_SetControllerFeatures
+
+	mov		al, FLG_INITERROR_FAILED_TO_SET_PIO_MODE
+	call	.SetErrorFlagFromALwithErrorCodeInAH
+%endif ; MODULE_ADVANCED_ATA
+
+%ifdef MODULE_FEATURE_SETS
+;;;	InitStandbyTimer
+	; Initialize the standby timer (if supported)
+	test	BYTE [di+DPT.bFlagsHigh], FLGH_DPT_POWER_MANAGEMENT_SUPPORTED
+	jz		.NoPowerManagementSupport
+
+	mov		al, COMMAND_IDLE
+	mov		dl, [cs:ROMVARS.bIdleTimeout]
+	mov		bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_BSY, FLG_STATUS_BSY)
+	call	Idepack_StoreNonExtParametersAndIssueCommandFromAL
+
+	mov		al, FLG_INITERROR_FAILED_TO_INITIALIZE_STANDBY_TIMER
+	call	.SetErrorFlagFromALwithErrorCodeInAH
+.NoPowerManagementSupport:
+%endif ; MODULE_FEATURE_SETS
+
+	; There might have been several errors so just return one error code for them all
+	mov		ah, [di+DPT_ATA.bInitError]
+	test	ah, ah	; Clears CF
+	jz		SHORT .ReturnWithErrorCodeInAH
+	mov		ah, RET_HD_RESETFAIL
+	stc
+
+.ReturnWithErrorCodeInAH:
+	pop		si
+	pop		es
 	ret
 
 
 ;--------------------------------------------------------------------
-; SetErrorFlagFromALwithErrorCodeInAH
+; .SetErrorFlagFromALwithErrorCodeInAH
 ;	Parameters:
 ;		AH:		BIOS Error Code
@@ -245,5 +203,8 @@
 ;		Nothing
 ;--------------------------------------------------------------------
-SetErrorFlagFromALwithErrorCodeInAH:
+.IgnoreInvalidCommandError:
+	xor		ah, ah	; Clears CF
+
+.SetErrorFlagFromALwithErrorCodeInAH:
 	jnc		SHORT .NoErrorFlagToSet
 	cmp		ah, RET_HD_INVALID
@@ -252,7 +213,11 @@
 	or		[di+DPT_ATA.bInitError], al
 	stc
-	ret
-.IgnoreInvalidCommandError:
-	xor		ah, ah
 .NoErrorFlagToSet:
 	ret
+
+
+.rgbWriteCacheCommands:
+	db		0								; DEFAULT_WRITE_CACHE
+	db		FEATURE_DISABLE_WRITE_CACHE		; DISABLE_WRITE_CACHE
+	db		FEATURE_ENABLE_WRITE_CACHE		; ENABLE_WRITE_CACHE
+
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm	(revision 398)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm	(revision 399)
@@ -4,5 +4,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.
 ;
@@ -11,11 +11,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
@@ -75,7 +75,4 @@
 ;--------------------------------------------------------------------
 AdvAtaInit_InitializeControllerForDPTinDSDI:
-	push	bp
-	push	si
-
 	; Call Controller Specific initialization function
 	mov		ax, [di+DPT_ADVANCED_ATA.wControllerID]
@@ -83,11 +80,15 @@
 	jz		SHORT .NoAdvancedController	; Return with CF cleared
 
+	push	bp
+	push	si
+
 	; We only support Vision at the moment so no need to identify ID
 	call	AdvAtaInit_LoadMasterDPTtoDSSIifSlaveInDSDI
 	call	Vision_InitializeWithIDinAHandConfigInAL
 
-.NoAdvancedController:
 	pop		si
 	pop		bp
+
+.NoAdvancedController:
 	ret
 
Index: trunk/XTIDE_Universal_BIOS/Src/Main.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 398)
+++ trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 399)
@@ -181,5 +181,5 @@
 	%include "Interrupts.asm"		; For Interrupt initialization
 	%include "RamVars.asm"			; For RAMVARS initialization and access
-	%include "BootVars.asm"			; For initializing variabled used during init and boot
+	%include "BootVars.asm"			; For initializing variables used during init and boot
 	%include "FloppyDrive.asm"		; Floppy Drive related functions
 	%include "CreateDPT.asm"		; For creating DPTs
Index: trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm	(revision 398)
+++ trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm	(revision 399)
@@ -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.
-; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html				
-;		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;
 
 ; Section containing code
@@ -145,5 +145,5 @@
 ;   5  3.5" ED on some BIOSes      3 1/2   2.88M
 ;   6  FLOPPY_TYPE_35_ED		   3 1/2   2.88M
-;   >6 Unknwon, handled above
+;   >6 Unknown, handled above
 ;
 ;--------------------------------------------------------------------
@@ -159,7 +159,7 @@
 	push	ax											; "5 1/4" or "3 1/2"
 
+	xor		bh, bh
 	mov		al,FloppyTypes.rgbCapacityMultiplier
-	mov		bh, 0
-	mul		byte [cs:bx+FloppyTypes.rgbCapacity - 1]    ; -1 since 0 is handled above and not in the table
+	mul		BYTE [cs:bx+FloppyTypes.rgbCapacity - 1]    ; -1 since 0 is handled above and not in the table
 
 .PushAXAndOutput:
@@ -202,5 +202,5 @@
 	push	dx						; Magnitude character
 
-	test	di,di
+	test	di, di
 	jz		SHORT BootMenuPrint_RefreshInformation.FormatRelay
 
Index: trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrintCfg.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrintCfg.asm	(revision 398)
+++ trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrintCfg.asm	(revision 399)
@@ -2,5 +2,5 @@
 ; Description	:	Functions for printing drive configuration
 ;					information on Boot Menu.
-; 
+;
 ; Included by BootMenuPrint.asm, this routine is to be inserted into
 ; BootMenuPrint_HardDiskRefreshInformation.
@@ -8,5 +8,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.
 ;
@@ -15,12 +15,12 @@
 ; 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				
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 ;
-				
+
 ; Section containing code
 SECTION .text
@@ -131,11 +131,5 @@
 ;--------------------------------------------------------------------
 .PushResetStatus:
-	xor		ax, ax
-%ifdef MODULE_SERIAL
-	test	BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE
-	jnz		SHORT .AlwaysSuccess
 	mov		al, [di+DPT_ATA.bInitError]
-.AlwaysSuccess:
-%endif
 	push	ax
 
Index: trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm	(revision 398)
+++ trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm	(revision 399)
@@ -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.
-; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html		
-;		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;
 
 ; Section containing code
@@ -382,7 +382,7 @@
 
 .StoreDriveLetter:
-	adc		di, BYTE 0			; Add 1 if Floppy Drive
+	adc		di, BYTE 1			; Add CF if Floppy Drive
 	xchg	ax, cx
-	mov		[es:di+1], al		; AH = zero to clear function hotkey
+	mov		[es:di], al			; AH = zero to clear function hotkey
 
 .StoreFunctionHotkeyFromAH:
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/DrvDetectInfo.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/DrvDetectInfo.asm	(revision 398)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/DrvDetectInfo.asm	(revision 399)
@@ -4,5 +4,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.
 ;
@@ -11,12 +11,12 @@
 ; 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				
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 ;
-				
+
 ; Section containing code
 SECTION .text
@@ -45,6 +45,6 @@
 	pop		ds
 
-	add		si, BYTE ATA1.strModel				; DS:SI now points drive name
-	lea		di, [bx+DRVDETECTINFO.szDrvName]		; ES:DI now points to name destination
+	add		si, BYTE ATA1.strModel				; DS:SI now points drive name (Clears CF)
+	lea		di, [bx+DRVDETECTINFO.szDrvName]	; ES:DI now points to name destination
 	mov		cx, MAX_HARD_DISK_NAME_LENGTH / 2	; Max number of WORDs allowed
 .CopyNextWord:
@@ -53,10 +53,10 @@
 	stosw
 	loop	.CopyNextWord
-	xor		ax, ax								; Zero AX and clear CF
+	xchg	cx, ax								; Zero AX (CF already cleared from the ADD above)
 	stosw										; Terminate with NULL
 
 	pop		si
 	pop		ds
-		
+
 	ret
 
@@ -74,9 +74,8 @@
 ;--------------------------------------------------------------------
 DriveDetectInfo_ConvertDPTtoBX:
-	mov		ax, di
-	sub		ax, BYTE RAMVARS_size					; subtract off base of DPTs
+	lea		ax, [di-RAMVARS_size]					; subtract off base of DPTs
 	mov		bl, DPT_DRVDETECTINFO_SIZE_MULTIPLIER	; DRVDETECTINFO are a whole number multiple of DPT size
-	mul		bl								
+	mul		bl
 	add		ax, BOOTVARS.rgDrvDetectInfo			; add base of DRVDETECTINFO
-	xchg	ax, bx
-	ret	
+	xchg	bx, ax
+	ret
