Index: trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm	(revision 442)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm	(revision 443)
@@ -89,5 +89,5 @@
 ;		CF:		Cleared if success, Set if error
 ;	Corrupts registers:
-;		AL, BL, CX, DX, SI, DI, ES
+;		AL, BX, CX, DX, SI, DI, ES
 ;--------------------------------------------------------------------
 %ifdef MODULE_SERIAL	; IDE + Serial
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm	(revision 442)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm	(revision 443)
@@ -63,5 +63,5 @@
 ;		CF:		Cleared if success, Set if error
 ;	Corrupts registers:
-;		AL, BL, CX, DX, SI, DI, ES
+;		AL, BX, CX, DX, SI, DI, ES
 ;--------------------------------------------------------------------
 IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH:
@@ -74,5 +74,5 @@
 	call	IdeDPT_StoreDeviceTypeFromIdevarsInCSBPtoDPTinDSDI
 
-	; Wait until drive motors have reached max speed
+	; Wait until drive motors have reached full speed
 	cmp		bp, BYTE ROMVARS.ideVars0		; First controller?
 	jne		SHORT .SkipLongWaitSinceDriveIsNotPrimaryMaster
@@ -88,5 +88,7 @@
 %ifdef MODULE_8BIT_IDE
 	; Enable 8-bit PIO mode for Lo-tech XT-CF
+	push	si
 	call	AH9h_Enable8bitPioModeForXTCF
+	pop		si
 	jc		SHORT .FailedToSet8bitMode
 %endif
@@ -100,5 +102,5 @@
 	; Clean stack and return
 .FailedToSet8bitMode:
-	lea		sp, [bp+EXTRA_BYTES_FOR_INTPACK]	; This assumes BP hasn't changed between Idepack_FakeToSSBP and here
+	lea		sp, [bp+SIZE_OF_IDEPACK_WITHOUT_INTPACK]	; This assumes BP hasn't changed between Idepack_FakeToSSBP and here
 	pop		bp
 	ret
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm	(revision 442)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm	(revision 443)
@@ -163,12 +163,10 @@
 	; Exchange address lines A0 and A3 from DL
 	add		dx, [cs:bx]							; DX now has port address
-	mov		bl, dl
-	mov		bh, MASK_A3_AND_A0_ADDRESS_LINES
-	and		bh, bl								; BH = 0, 1, 8 or 9, we can ignore 0 and 9
-	jz		SHORT .ReturnTranslatedPortInDX		; Jump out since DH is 0
-	xor		bh, MASK_A3_AND_A0_ADDRESS_LINES
-	jz		SHORT .ReturnTranslatedPortInDX		; Jump out since DH was 9
-	and		dl, ~MASK_A3_AND_A0_ADDRESS_LINES
-	or		dl, bh								; Address lines now reversed
+	mov		bl, dl								; Port low byte to BL
+	and		bl, MASK_A3_AND_A0_ADDRESS_LINES	; Clear all bits except A0 and A3
+	jz		SHORT .ReturnTranslatedPortInDX		; A0 and A3 both zeroes, no change needed
+	cmp		bl, MASK_A3_AND_A0_ADDRESS_LINES
+	je		SHORT .ReturnTranslatedPortInDX		; A0 and A3 both ones, no change needed
+	xor		dl, MASK_A3_AND_A0_ADDRESS_LINES	; Invert A0 and A3
 .ReturnTranslatedPortInDX:
 	ret
Index: trunk/XTIDE_Universal_BIOS/Src/Device/Idepack.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/Idepack.asm	(revision 442)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/Idepack.asm	(revision 443)
@@ -32,5 +32,5 @@
 Idepack_FakeToSSBP:
 	pop		ax
-	sub		sp, BYTE EXTRA_BYTES_FOR_INTPACK
+	sub		sp, BYTE SIZE_OF_IDEPACK_WITHOUT_INTPACK
 	mov		bp, sp
 	jmp		ax
@@ -161,7 +161,5 @@
 
 	; Device Control byte with interrupts disabled
-	call	AccessDPT_GetDeviceControlByteToAL
-	or		al, FLG_DEVCONTROL_nIEN		; Disable interrupt
-	mov		[bp+IDEPACK.bDeviceControl], al
+	mov		BYTE [bp+IDEPACK.bDeviceControl], FLG_DEVCONTROL_nIEN
 
 	jmp		Device_OutputCommandWithParameters
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 442)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 443)
@@ -90,5 +90,5 @@
 	sti									; Enable interrupts
 	cld									; String instructions to increment pointers
-	CREATE_FRAME_INTPACK_TO_SSBP	EXTRA_BYTES_FOR_INTPACK
+	CREATE_FRAME_INTPACK_TO_SSBP	SIZE_OF_IDEPACK_WITHOUT_INTPACK
 	call	RamVars_GetSegmentToDS
 
@@ -264,5 +264,5 @@
 	or		BYTE [bp+IDEPACK.intpack+INTPACK.flags+1], (FLG_FLAGS_IF>>8)
 	mov		sp, bp	; This makes possible to exit anytime, no matter what is on stack
-	RESTORE_FRAME_INTPACK_FROM_SSBP		EXTRA_BYTES_FOR_INTPACK
+	RESTORE_FRAME_INTPACK_FROM_SSBP		SIZE_OF_IDEPACK_WITHOUT_INTPACK
 
 
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm	(revision 442)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm	(revision 443)
@@ -262,4 +262,5 @@
 ;	Parameters:
 ;		DS:DI:	Ptr to DPT
+;		SS:BP:	Ptr to IDEPACK
 ;	Returns:
 ;		AH:		Int 13h return status
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm	(revision 442)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm	(revision 443)
@@ -119,4 +119,4 @@
 	call	Idepack_FakeToSSBP
 	call	AH0h_ResetAllOurHardDisksAtTheEndOfDriveInitialization
-	add		sp, BYTE EXTRA_BYTES_FOR_INTPACK
+	add		sp, BYTE SIZE_OF_IDEPACK_WITHOUT_INTPACK
 	ret
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm	(revision 442)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm	(revision 443)
@@ -62,5 +62,5 @@
 ALIGN JUMP_ALIGN
 AccessDPT_GetDriveSelectByteForEbiosToAL:
-	mov		al, [di+DPT.wFlags]
+	mov		al, [di+DPT.bFlagsLow]
 	; Fall to GetDriveSelectByteForAssistedLBAtoAL
 %endif ; MODULE_EBIOS
