Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm	(revision 522)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm	(revision 524)
@@ -80,6 +80,5 @@
 %ifdef MODULE_HOTKEYS
 	call	TimerTicks_ReadFromBdaToAX
-	add		ax, BYTE MIN_TIME_TO_DISPLAY_HOTKEY_BAR
-	mov		[es:BOOTVARS.hotkeyVars+HOTKEYVARS.wTimeToClose], ax
+	mov		[es:BOOTVARS.hotkeyVars+HOTKEYVARS.wTimeWhenDisplayed], ax
 %endif
 
@@ -89,5 +88,6 @@
 .WaitUntilTimeToCloseHotkeyBar:
 	call	TimerTicks_ReadFromBdaToAX
-	cmp		ax, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wTimeToClose]
+	sub		ax, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wTimeWhenDisplayed]
+	cmp		ax, MIN_TIME_TO_DISPLAY_HOTKEY_BAR
 	jb		SHORT .WaitUntilTimeToCloseHotkeyBar
 %endif
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm	(revision 522)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm	(revision 524)
@@ -22,4 +22,5 @@
 SECTION .text
 
+%ifdef COPY_13H_HANDLER_TO_40H
 ;--------------------------------------------------------------------
 ; Checks is floppy drive handler installed to interrupt vector 40h.
@@ -103,4 +104,6 @@
 %endif
 
+%endif ; COPY_13H_HANDLER_TO_40H
+
 
 ;--------------------------------------------------------------------
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm	(revision 522)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm	(revision 524)
@@ -64,9 +64,5 @@
 	mov		[RAMVARS.fpOldI13h], ax				; Store old INT 13h offset
 
-	; NOTE! Installing INT 40h handler is currently uncommented to test
-	; if it is really needed. I suspect that it is not. Many bytes can be
-	; saved if INT 40h related code can be removed.
-%if 0
-
+%ifdef COPY_13H_HANDLER_TO_40H
 	; Only store INT 13h handler to 40h if 40h is not already installed.
 	; At least AMI BIOS for 286 stores 40h handler by itself and calls
@@ -77,5 +73,5 @@
 	mov		[es:BIOS_DISKETTE_INTERRUPT_40h*4+2], dx	; Store old INT 13h segment
 .Int40hAlreadyInstalled:
-%endif ; 0
+%endif ; COPY_13H_HANDLER_TO_40H
 
 	mov		al, BIOS_DISK_INTERRUPT_13h			; INT 13h interrupt vector offset
Index: trunk/XTIDE_Universal_BIOS/Src/Main.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 522)
+++ trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 524)
@@ -91,5 +91,5 @@
 	at	ROMVARS.ideVars0+IDEVARS.wControlBlockPort,	dw	DEVICE_ATA_PRIMARY_PORTCTRL 	; Controller Control Block base port
 	at	ROMVARS.ideVars0+IDEVARS.bDevice,			db	DEVICE_16BIT_ATA
-	at	ROMVARS.ideVars0+IDEVARS.bIRQ,				db	0
+	at	ROMVARS.ideVars0+IDEVARS.bIRQ,				db	14
 	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)
@@ -98,5 +98,5 @@
 	at	ROMVARS.ideVars1+IDEVARS.wControlBlockPort,	dw	DEVICE_ATA_SECONDARY_PORTCTRL
 	at	ROMVARS.ideVars1+IDEVARS.bDevice,			db	DEVICE_16BIT_ATA
-	at	ROMVARS.ideVars1+IDEVARS.bIRQ,				db	0
+	at	ROMVARS.ideVars1+IDEVARS.bIRQ,				db	15
 	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)
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/BootVars.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/BootVars.asm	(revision 522)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/BootVars.asm	(revision 524)
@@ -36,14 +36,8 @@
 %endif
 
-	; Clear to zero
+	; Clear all DRVDETECTINFO structs to zero
 	mov		al, DRVDETECTINFO_size
 	mul		BYTE [cs:ROMVARS.bIdeCnt]
-%ifdef MODULE_HOTKEYS ; We must not initialize anything before this!
-	mov		di, BOOTVARS.hotkeyVars + HOTKEYVARS.clearToZeroFromThisPoint	
-%else
-	mov		di, BOOTVARS.clearToZeroFromThisPoint
-%endif
-	add		ax, BOOTVARS_size
-	sub		ax, di
+	mov		di, BOOTVARS.rgDrvDetectInfo	; We must not initialize anything before this!
 	xchg	cx, ax
 
@@ -51,22 +45,7 @@
 	call	Memory_ZeroESDIwithSizeInCX
 
-	; Store default drives to boot from
+	; Initialize HOTKEYVARS by storing default drives to boot from
+	mov		WORD [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wFddAndHddLetters], DEFAULT_FLOPPY_DRIVE_LETTER | (DEFAULT_HARD_DRIVE_LETTER<<8)
 	mov		dl, [cs:ROMVARS.bBootDrv]
-
-	; fall through to BootVars_StoreHotkeyForDriveNumberInDL
-
-;--------------------------------------------------------------------
-; BootVars_StoreHotkeyForDriveNumberInDL
-;	Parameters:
-;		DL:		Floppy or Hard Drive number
-;		DS:		RAMVARS Segment
-;		ES:		BDA Segment
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, CX, DI
-;--------------------------------------------------------------------
-BootVars_StoreHotkeyForDriveNumberInDL:
-	mov		WORD [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wFddAndHddLetters], DEFAULT_FLOPPY_DRIVE_LETTER | (DEFAULT_HARD_DRIVE_LETTER<<8)
 	call	DriveXlate_ConvertDriveNumberFromDLtoDriveLetter
 	jmp		HotkeyBar_StoreHotkeyToBootvarsForDriveLetterInDL
@@ -74,4 +53,3 @@
 %else
 	jmp		Memory_ZeroESDIwithSizeInCX
-
 %endif ; MODULE_HOTKEYS
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm	(revision 522)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm	(revision 524)
@@ -176,4 +176,5 @@
 ; IterateFindFirstDPTforIdevars
 ;       DL:		Offset to IDEVARS to search from DPTs
+;		SI:		Offset to this callback function
 ;		DS:DI:	Ptr to DPT to examine
 ;	Returns:
@@ -183,10 +184,9 @@
 IterateFindSecondDPTforIdevars:
 	call	IterateFindFirstDPTforIdevars
-	jc		SHORT IterateFindFirstDPTforIdevars.done	; Wrong controller
-
-	; We have found DPT for Master Drive,
-	; next DPT is for slave drive or master for another controller
-	add		di, BYTE LARGEST_DPT_SIZE
-	; Fall to IterateFindFirstDPTforIdevars
+	jc		SHORT .WrongController
+	mov		si, IterateFindFirstDPTforIdevars
+.WrongController:
+	stc
+	ret
 
 IterateFindFirstDPTforIdevars:
