Index: trunk/XTIDE_Universal_BIOS/Src/Main.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 471)
+++ trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 473)
@@ -88,29 +88,31 @@
 	at	ROMVARS.bIdleTimeout,	db	0						; Standby timer disabled by default
 
-	at	ROMVARS.ideVars0+IDEVARS.wPort,			dw	DEVICE_ATA_PRIMARY_PORT 		; Controller Command Block base port
-	at	ROMVARS.ideVars0+IDEVARS.wPortCtrl,		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.wBasePort,			dw	DEVICE_ATA_PRIMARY_PORT 		; Controller Command Block base port
+	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.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)
 
-	at	ROMVARS.ideVars1+IDEVARS.wPort,			dw	DEVICE_ATA_SECONDARY_PORT
-	at	ROMVARS.ideVars1+IDEVARS.wPortCtrl,		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.bXTCFcontrolRegister,	db	0
+	at	ROMVARS.ideVars1+IDEVARS.bDevice,				db	DEVICE_8BIT_XTCF_PIO8
+	;at	ROMVARS.ideVars1+IDEVARS.wBasePort,		dw	DEVICE_ATA_SECONDARY_PORT
+	;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.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)
 
-	at	ROMVARS.ideVars2+IDEVARS.wPort,			dw	DEVICE_ATA_TERTIARY_PORT
-	at	ROMVARS.ideVars2+IDEVARS.wPortCtrl,		dw	DEVICE_ATA_TERTIARY_PORTCTRL
-	at	ROMVARS.ideVars2+IDEVARS.bDevice,		db	DEVICE_16BIT_ATA
-	at	ROMVARS.ideVars2+IDEVARS.bIRQ,			db	0
+	at	ROMVARS.ideVars2+IDEVARS.wBasePort,			dw	DEVICE_ATA_TERTIARY_PORT
+	at	ROMVARS.ideVars2+IDEVARS.wControlBlockPort,	dw	DEVICE_ATA_TERTIARY_PORTCTRL
+	at	ROMVARS.ideVars2+IDEVARS.bDevice,			db	DEVICE_16BIT_ATA
+	at	ROMVARS.ideVars2+IDEVARS.bIRQ,				db	0
 	at	ROMVARS.ideVars2+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
 	at	ROMVARS.ideVars2+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
 
-	at	ROMVARS.ideVars3+IDEVARS.wPort,			dw	DEVICE_ATA_QUATERNARY_PORT
-	at	ROMVARS.ideVars3+IDEVARS.wPortCtrl,		dw	DEVICE_ATA_QUATERNARY_PORTCTRL
-	at	ROMVARS.ideVars3+IDEVARS.bDevice,		db	DEVICE_16BIT_ATA
-	at	ROMVARS.ideVars3+IDEVARS.bIRQ,			db	0
+	at	ROMVARS.ideVars3+IDEVARS.wBasePort,			dw	DEVICE_ATA_QUATERNARY_PORT
+	at	ROMVARS.ideVars3+IDEVARS.wControlBlockPort,	dw	DEVICE_ATA_QUATERNARY_PORTCTRL
+	at	ROMVARS.ideVars3+IDEVARS.bDevice,			db	DEVICE_16BIT_ATA
+	at	ROMVARS.ideVars3+IDEVARS.bIRQ,				db	0
 	at	ROMVARS.ideVars3+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
 	at	ROMVARS.ideVars3+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,	dw	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
@@ -128,5 +130,5 @@
 		at	ROMVARS.wBootTimeout,	dw	BOOT_MENU_DEFAULT_TIMEOUT
 %endif
-	at	ROMVARS.bIdeCnt,		db	1						; Number of supported controllers
+	at	ROMVARS.bIdeCnt,		db	2						; Number of supported controllers
 	at	ROMVARS.bBootDrv,		db	80h						; Boot Menu default drive
 	at	ROMVARS.bMinFddCnt, 	db	0						; Do not force minimum number of floppy drives
@@ -134,10 +136,12 @@
 	at	ROMVARS.bIdleTimeout,	db	0						; Standby timer disabled by default
 
-	at	ROMVARS.ideVars0+IDEVARS.wPort,			dw	DEVICE_XTIDE_DEFAULT_PORT			; Controller Command Block base port
-	at	ROMVARS.ideVars0+IDEVARS.wPortCtrl,		dw	DEVICE_XTIDE_DEFAULT_PORTCTRL		; Controller Control Block base port
-	at	ROMVARS.ideVars0+IDEVARS.bDevice,		db	DEVICE_8BIT_XTIDE_REV1
+	at	ROMVARS.ideVars0+IDEVARS.wBasePort,			dw	DEVICE_XTIDE_DEFAULT_PORT			; Controller Command Block base port
+	at	ROMVARS.ideVars0+IDEVARS.wControlBlockPort,	dw	DEVICE_XTIDE_DEFAULT_PORTCTRL		; Controller Control Block base port
+	at	ROMVARS.ideVars0+IDEVARS.bDevice,			db	DEVICE_8BIT_XTIDE_REV1
 	at	ROMVARS.ideVars0+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,	db	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
 	at	ROMVARS.ideVars0+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,	db	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
 
+	at	ROMVARS.ideVars1+IDEVARS.bXTCFcontrolRegister,	db	0
+	at	ROMVARS.ideVars1+IDEVARS.bDevice,				db	DEVICE_8BIT_XTCF_PIO8
 	at	ROMVARS.ideVars1+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,	db	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
 	at	ROMVARS.ideVars1+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,	db	DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
@@ -223,8 +227,9 @@
 %endif
 	%include "IdeCommand.asm"
-%ifdef MODULE_JRIDE
+%ifdef MODULE_8BIT_IDE
 	%include "JrIdeTransfer.asm"	; Must be included after IdeCommand.asm
 %endif
 	%include "IdeTransfer.asm"
+	%include "IdePioBlock.asm"
 	%include "IdeWait.asm"
 	%include "IdeError.asm"			; Must be included after IdeWait.asm
