Index: trunk/XTIDE_Universal_BIOS/Inc/DeviceIDE.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/DeviceIDE.inc	(revision 413)
+++ trunk/XTIDE_Universal_BIOS/Inc/DeviceIDE.inc	(revision 414)
@@ -22,6 +22,6 @@
 
 ; Reset delays
-HSR0_RESET_WAIT_US		EQU		5		; Delay at least 5us
-HSR1_RESET_WAIT_US		EQU		2000	; Delay at least 2ms
+HSR0_RESET_WAIT_US		EQU		6		; Delay must be at least 5 us
+HSR1_RESET_WAIT_US		EQU		2100	; Delay must be at least 2 ms
 
 ; Polling timeout delays (system timer ticks, 1 tick = 54.9 ms)
@@ -34,6 +34,6 @@
 TIMEOUT_DRDY			EQU		TIMEOUT_MOTOR_STARTUP
 %else
-TIMEOUT_BSY				EQU		(2500/55)	; 2500 ms
-TIMEOUT_DRDY			EQU		(2500/55)	; 2500 ms
+TIMEOUT_BSY				EQU		(2600/55)	; 2600 ms
+TIMEOUT_DRDY			EQU		(2600/55)	; 2600 ms
 %endif
 
Index: trunk/XTIDE_Universal_BIOS/Inc/RamVars.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/RamVars.inc	(revision 413)
+++ trunk/XTIDE_Universal_BIOS/Inc/RamVars.inc	(revision 414)
@@ -26,22 +26,4 @@
 %endif
 
-
-; Variables for translating drive numbers.
-struc XLATEVARS
-%ifdef MODULE_SERIAL_FLOPPY
-	.bFlopCreateCnt:
-	.bFlopCntAndFirst	resb	1	; Normally, packed starting floppy drive number (high order 7 bits)
-									; and number of drives (low order bit, max 2 drives supported).
-									; During initialization, until the end of DetectDrives_FromAllIDEControllers,
-									; this byte contains the raw number of floppy drives seen (using .bFlopCreateCnt)
-%else
-						resb	1	; alignment
-%endif
-	.bXlatedDrv			resb	1	; Drive number after translation
-	.wFDandHDswap:
-	.bFDSwap			resb	1	; Floppy Drive to swap to 00h and vice versa
-	.bHDSwap			resb	1	; Hard Drive to swap to 80h and vice versa
-endstruc
-
 ; RAM Variables.
 ; Variables should be kept to minimum since they might be located
@@ -60,6 +42,29 @@
 
 	; Variables for drive number translation
-	.xlateVars		resb	XLATEVARS_size
+%ifdef MODULE_HOTKEYS
+	.xlateVars			resb	XLATEVARS_size
+%endif
 endstruc
+
+
+; Variables for translating drive numbers.
+%ifdef MODULE_HOTKEYS
+	struc XLATEVARS
+	%ifdef MODULE_SERIAL_FLOPPY
+		.bFlopCreateCnt:
+		.bFlopCntAndFirst	resb	1	; Normally, packed starting floppy drive number (high order 7 bits)
+										; and number of drives (low order bit, max 2 drives supported).
+										; During initialization, until the end of DetectDrives_FromAllIDEControllers,
+										; this byte contains the raw number of floppy drives seen (using .bFlopCreateCnt)
+	%else
+							resb	1	; alignment
+	%endif
+		.bXlatedDrv			resb	1	; Drive number after translation
+		.wFDandHDswap:
+		.bFDSwap			resb	1	; Floppy Drive to swap to 00h and vice versa
+		.bHDSwap			resb	1	; Hard Drive to swap to 80h and vice versa
+	endstruc
+%endif
+
 
 %ifdef MODULE_SERIAL_FLOPPY
@@ -77,5 +82,5 @@
 ; wire for MODULE_SERIAL, please do not change the order or insert other members.
 ;
-struc IDEPACK
+struc IDEPACK	; PIOVARS and MEMPIOVARS overwrite the first 7 bytes
 	.bFeatures				resb	1
 	.bDrvAndHead			resb	1	; LBA28 27...24
@@ -92,6 +97,6 @@
 
 	.bCommand				resb	1
-	.bDeviceControl			resb	1	; Offset 7 shared with PIOVARS
-							resb	1
+	.bDeviceControl			resb	1	; Offset 7 shared with PIOVARS and MEMPIOVARS
+							resb	1	; Used by PIOVARS and MEMPIOVARS
 
 %ifdef MODULE_EBIOS
@@ -102,4 +107,5 @@
 	.bLbaHighExt			resb	1	; LBA48 47...40
 %endif
+
 	.intpack				resb	INTPACK_size
 endstruc
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm	(revision 413)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm	(revision 414)
@@ -33,15 +33,15 @@
 ;--------------------------------------------------------------------
 IdeIO_OutputALtoIdeControlBlockRegisterInDL:
-%ifdef MODULE_8BIT_IDE
-	mov		dh, [di+DPT_ATA.bDevice]
-%ifdef MODULE_JRIDE
-	test	dh, dh
-	jnz		SHORT .OutputToIoMappedIde
-
-	add		dx, JRIDE_CONTROL_BLOCK_REGISTER_WINDOW_OFFSET
-	jmp		SHORT OutputToJrIdeRegister
-.OutputToIoMappedIde:
-%endif	; MODULE_JRIDE
-%endif	; MODULE_8BIT_IDE
+	%ifdef MODULE_8BIT_IDE
+		mov		dh, [di+DPT_ATA.bDevice]
+		%ifdef MODULE_JRIDE
+			test	dh, dh
+			jnz		SHORT .OutputToIoMappedIde
+		
+			add		dx, JRIDE_CONTROL_BLOCK_REGISTER_WINDOW_OFFSET
+			jmp		SHORT OutputToJrIdeRegister
+		.OutputToIoMappedIde:
+		%endif	; MODULE_JRIDE
+	%endif	; MODULE_8BIT_IDE
 
 	mov		bl, IDEVARS.wPortCtrl
@@ -62,23 +62,23 @@
 ALIGN JUMP_ALIGN
 IdeIO_OutputALtoIdeRegisterInDL:
-%ifdef MODULE_8BIT_IDE
-	mov		dh, [di+DPT_ATA.bDevice]
-%ifdef MODULE_JRIDE
-	test	dh, dh
-	jnz		SHORT OutputALtoIOmappedIdeRegisterInDL
-
-%if JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET & 0FFh = 0
-	mov		dh, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET >> 8
-%else
-	add		dx, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET
-%endif
-OutputToJrIdeRegister:
-	mov		bx, dx
-	mov		[cs:bx], al
-	ret
-ALIGN JUMP_ALIGN
-OutputALtoIOmappedIdeRegisterInDL:
-%endif	; MODULE_JRIDE
-%endif	; MODULE_8BIT_IDE
+	%ifdef MODULE_8BIT_IDE
+		mov		dh, [di+DPT_ATA.bDevice]
+		%ifdef MODULE_JRIDE
+			test	dh, dh
+			jnz		SHORT OutputALtoIOmappedIdeRegisterInDL
+		
+		%if JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET & 0FFh = 0
+			mov		dh, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET >> 8
+		%else
+			add		dx, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET
+		%endif
+		OutputToJrIdeRegister:
+			mov		bx, dx
+			mov		[cs:bx], al
+			ret
+		ALIGN JUMP_ALIGN
+		OutputALtoIOmappedIdeRegisterInDL:
+		%endif	; MODULE_JRIDE
+	%endif	; MODULE_8BIT_IDE
 
 	mov		bl, IDEVARS.wPort
@@ -114,21 +114,21 @@
 ;--------------------------------------------------------------------
 IdeIO_InputToALfromIdeRegisterInDL:
-%ifdef MODULE_8BIT_IDE
-	mov		dh, [di+DPT_ATA.bDevice]
-%ifdef MODULE_JRIDE
-	test	dh, dh
-	jnz		SHORT .InputToALfromIOmappedIdeRegisterInDL
-
-%if JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET & 0FFh = 0
-	mov		dh, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET >> 8
-%else
-	add		dx, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET
-%endif
-	mov		bx, dx
-	mov		al, [cs:bx]
-	ret
-.InputToALfromIOmappedIdeRegisterInDL:
-%endif	; MODULE_JRIDE
-%endif	; MODULE_8BIT_IDE
+	%ifdef MODULE_8BIT_IDE
+		mov		dh, [di+DPT_ATA.bDevice]
+		%ifdef MODULE_JRIDE
+			test	dh, dh
+			jnz		SHORT .InputToALfromIOmappedIdeRegisterInDL
+		
+		%if JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET & 0FFh = 0
+			mov		dh, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET >> 8
+		%else
+			add		dx, JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET
+		%endif
+			mov		bx, dx
+			mov		al, [cs:bx]
+			ret
+		.InputToALfromIOmappedIdeRegisterInDL:
+		%endif	; MODULE_JRIDE
+	%endif	; MODULE_8BIT_IDE
 	mov		bl, IDEVARS.wPort
 	call	GetIdePortToDX
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm	(revision 413)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm	(revision 414)
@@ -20,8 +20,8 @@
 ; Structure containing variables for PIO transfer functions.
 ; This struct must not be larger than IDEPACK without INTPACK.
-struc PIOVARS
-	.wDataPort				resb	2	; 0, IDE Data Port
-	.fnXfer					resb	2	; 2, Offset to transfer function
-	.wSectorsInBlock		resb	2	; 4, Block size in sectors
+struc PIOVARS	; Must not be larger than 9 bytes! See IDEPACK in RamVars.inc.
+	.wDataPort				resb	2	; 0-1, IDE Data Port
+	.fnXfer					resb	2	; 2-3, Offset to transfer function
+	.wSectorsInBlock		resb	2	; 4-5, Block size in sectors
 	.bSectorsLeft			resb	1	; 6, Sectors left to transfer
 							resb	1	; 7, IDEPACK.bDeviceControl
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/JrIdeTransfer.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/JrIdeTransfer.asm	(revision 413)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/JrIdeTransfer.asm	(revision 414)
@@ -20,11 +20,10 @@
 ; Structure containing variables for PIO transfer functions.
 ; This struct must not be larger than IDEPACK without INTPACK.
-struc MEMPIOVARS
-	.wSectorsInBlock		resb	2	; 0, Block size in sectors
-	.bSectorsLeft			resb	1	; 2, Sectors left to transfer
-	.bSectorsDone			resb	1	; 3, Number of sectors xferred
-							resb	3	; 4, 5, 6
+struc MEMPIOVARS	; Must not be larger than 9 bytes! See IDEPACK in RamVars.inc.
+	.wSectorsInBlock		resb	2	; 0-1, Block size in sectors
+	.fpDPT					resb	4	; 2-5, Far pointer to DPT
+	.bSectorsLeft			resb	1	; 6, Sectors left to transfer
 							resb	1	; 7, IDEPACK.bDeviceControl
-	.fpDPT					resb	4	; 8, Far pointer to DPT
+	.bSectorsDone			resb	1	; 8, Number of sectors xferred
 endstruc
 
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 413)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 414)
@@ -45,6 +45,6 @@
 %ifdef MODULE_HOTKEYS
 	call	DriveXlate_ToOrBack
-%endif
 	mov		[RAMVARS.xlateVars+XLATEVARS.bXlatedDrv], dl
+%endif
 
 	call	FindDPT_ForDriveNumberInDL	; DS:DI points to our DPT, or NULL if not our drive
@@ -129,5 +129,9 @@
 	mov		[bp+IDEPACK.intpack+INTPACK.si], si
 	mov		[bp+IDEPACK.intpack+INTPACK.bx], bx
+%ifdef MODULE_HOTKEYS
 	mov		[bp+IDEPACK.intpack+INTPACK.dh], dh
+%else
+	mov		[bp+IDEPACK.intpack+INTPACK.dx], dx
+%endif
 	mov		[bp+IDEPACK.intpack+INTPACK.cx], cx
 	mov		[bp+IDEPACK.intpack+INTPACK.ax], ax
@@ -135,9 +139,13 @@
 	pop		WORD [bp+IDEPACK.intpack+INTPACK.flags]
 	call	RamVars_GetSegmentToDS
-	cmp		dl, [RAMVARS.xlateVars+XLATEVARS.bXlatedDrv]
+
+%ifdef MODULE_HOTKEYS
+	cmp		dl, [RAMVARS.xlateVars+XLATEVARS.bXlatedDrv]	; DL is still drive number?
 	je		SHORT .ExchangeInt13hHandlers
-	mov		[bp+IDEPACK.intpack+INTPACK.dl], dl		; Something is returned in DL
+	mov		[bp+IDEPACK.intpack+INTPACK.dl], dl	; Something is returned in DL
 ALIGN JUMP_ALIGN
 .ExchangeInt13hHandlers:
+%endif
+
 %ifdef USE_186
 	push	Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
@@ -192,7 +200,9 @@
 Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH_ALHasDriveNumber:
 	call	Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH_ALHasDriveNumber
+
 %else
 	call	Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH
 %endif
+
 Int13h_ReturnFromHandlerWithoutStoringErrorCode:
 	or		WORD [bp+IDEPACK.intpack+INTPACK.flags], FLG_FLAGS_IF	; Return with interrupts enabled
@@ -265,5 +275,5 @@
 	mov		bx, BDA.bHDLastSt
 	test	al, al
-	js		.HardDisk
+	js		SHORT .HardDisk
 	mov		bl, BDA.bFDRetST & 0xff
 .HardDisk:
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm	(revision 413)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm	(revision 414)
@@ -29,6 +29,7 @@
 ;--------------------------------------------------------------------
 Int19h_BootLoaderHandler:
-	sti											; Allow timer interrupts
-	LOAD_BDA_SEGMENT_TO	es, ax					; Load BDA segment (zero) to ES
+	sti									; Enable interrupts
+	cld									; String instructions to increment pointers
+	LOAD_BDA_SEGMENT_TO	es, ax			; Load BDA segment (zero) to ES
 	; Fall to .PrepareBootLoaderStack
 
