Index: trunk/XTIDE_Universal_BIOS/Inc/BootMenu.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/BootMenu.inc	(revision 395)
+++ trunk/XTIDE_Universal_BIOS/Inc/BootMenu.inc	(revision 397)
@@ -32,39 +32,3 @@
 
 
-; Boot Menu Information Table. These are generated for all XTIDE Universal
-; BIOS drives. Available only until boot is successful.
-MAX_HARD_DISK_NAME_LENGTH				EQU		30		; Bytes reserved for drive name
-
-struc BOOTMENUINFO
-	.szDrvName				resb	MAX_HARD_DISK_NAME_LENGTH
-							resb	2	; Zero word (ensures string terminates)
-	.wInitErrorFlags		resb	2	; Errors during initialization
-	
-%ifdef MODULE_ADVANCED_ATA
-							resb	6	; padding to make BOOTMENUINFO size an even multiple of DPT size
-%else
-							resb	2	; padding to make BOOTMENUINFO size an even multiple of DPT size
-%endif				
-endstruc
-
-
-DPT_BOOTMENUINFO_SIZE_MULTIPLIER  equ	BOOTMENUINFO_size / LARGEST_DPT_SIZE
-
-%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
-
-%if MAX_HARD_DISK_NAME_LENGTH % 2 <> 0
-	%error "MAX_HARD_DISK_NAME_LENGTH needs to be a multiple of 2, memory is moved with word operations."
-%endif
-
-%if BOOTMENUINFO_size % LARGEST_DPT_SIZE <> 0
-	%error "BOOTMENUINFO's size must be an even multiple of DPT's size.  Add or remove padding at the bottom of BOOTMENUINFO to bring the two sizes into alignment.  As BOOTMENUINFO is only used at boot time, with plenty of memory to consume, it is OK to waste some space here."
-%endif
-
-%if BOOTMENUINFO.szDrvName <> 0
-	%error "BOOTMENUINFO.szDrvName is assumed to be the first member of struc BOOTMENUINFO, in BootMenuPrint_RefreshItem"
-%endif
-
-%endif
-
-
 %endif ; BOOTMENU_INC
Index: trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc	(revision 395)
+++ trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc	(revision 397)
@@ -22,5 +22,5 @@
 %define BOOTVARS_INC
 
-
+; Number of times to retry booting before accepting error
 BOOT_READ_RETRY_TIMES		EQU		3
 
@@ -36,8 +36,14 @@
 	.rgbMnuStack:
 	.dwPostStack		resb	4		; POST stack pointer when entering INT 19h
+
+	.clearToZeroFromThisPoint:
+%ifdef MODULE_HOTKEYS
 	.hotkeyVars			resb	HOTKEYVARS_size
-	.rgBootNfo:							; Array containing BOOTNFO structs
+%endif
+	
+	.rgDrvDetectInfo:					; Array containing DRVDETECTINFO structs
 endstruc
 
+%ifdef MODULE_HOTKEYS
 struc HOTKEYVARS
 	.bScancode			resb	1		; Function hotkey scancode
@@ -51,4 +57,41 @@
 FLG_HOTKEY_HD_FIRST		EQU		(1<<0)	; First try to boot from HDD, then FDD
 
+%endif ; MODULE_HOTKEY
+
+
+
+struc DRVDETECTINFO
+	.szDrvName				resb	MAX_HARD_DISK_NAME_LENGTH
+							resb	2	; Zero word (ensures string terminates)
+	.wInitErrorFlags		resb	2	; Errors during initialization
+	
+%ifdef MODULE_ADVANCED_ATA
+							resb	6	; padding to make DRVDETECTINFO size an even multiple of DPT size
+%else
+							resb	2	; padding to make DRVDETECTINFO size an even multiple of DPT size
+%endif				
+endstruc
+
+; Boot Menu Information Table. These are generated for all XTIDE Universal
+; BIOS drives. Available only until boot is successful.
+MAX_HARD_DISK_NAME_LENGTH			EQU		30		; Bytes reserved for drive name
+DPT_DRVDETECTINFO_SIZE_MULTIPLIER	EQU		DRVDETECTINFO_size / LARGEST_DPT_SIZE
+
+
+%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
+
+%if MAX_HARD_DISK_NAME_LENGTH % 2 <> 0
+	%error "MAX_HARD_DISK_NAME_LENGTH needs to be a multiple of 2, memory is moved with word operations."
+%endif
+
+%if DRVDETECTINFO_size % LARGEST_DPT_SIZE <> 0
+	%error "DRVDETECTINFO's size must be an even multiple of DPT's size.  Add or remove padding at the bottom of DRVDETECTINFO to bring the two sizes into alignment.  As DRVDETECTINFO is only used at boot time, with plenty of memory to consume, it is OK to waste some space here."
+%endif
+
+%if DRVDETECTINFO.szDrvName <> 0
+	%error "DRVDETECTINFO.szDrvName is assumed to be the first member of struc DRVDETECTINFO, in BootMenuPrint_RefreshItem"
+%endif
+
+%endif
 
 
Index: trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc	(revision 395)
+++ trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc	(revision 397)
@@ -81,5 +81,5 @@
 endstruc
 
-; Flags for BOOTMENUINFO.wInitErrorFlags
+; Flags for DPT_ATA.bInitError
 FLG_INITERROR_FAILED_TO_SELECT_DRIVE				EQU		(1<<0)
 FLG_INITERROR_FAILED_TO_INITIALIZE_CHS_PARAMETERS	EQU		(1<<1)
Index: trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc	(revision 395)
+++ trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc	(revision 397)
@@ -25,2 +25,72 @@
 	%endif
 %endif
+
+
+
+; Include module specific .INC files
+%ifdef MODULE_EBIOS
+	%include "EBIOS.inc"			; Equates for EBIOS functions
+%endif
+
+%ifdef MODULE_HOTKEYS
+	%include "HotkeyBar.inc"		; For Hotkeys
+	%ifdef MODULE_BOOT_MENU
+		%include "BootMenu.inc"			; For Boot Menu
+	%endif
+%endif
+
+%ifdef MODULE_ADVANCED_ATA
+	%include "Vision.inc"			; For QDI Vision QD65xx VLB IDE Controllers
+%endif
+
+
+; Included modules for ROMVARS.wFlags
+%ifdef MODULE_ADVANCED_ATA
+	MAIN_FLG_MODULE_ADVANCED_ATA	EQU	FLG_ROMVARS_MODULE_ADVANCED_ATA
+%else
+	MAIN_FLG_MODULE_ADVANCED_ATA	EQU	0
+%endif
+
+%ifdef MODULE_BOOT_MENU
+	MAIN_FLG_MODULE_BOOT_MENU	EQU	FLG_ROMVARS_MODULE_BOOT_MENU
+%else
+	MAIN_FLG_MODULE_BOOT_MENU	EQU	0
+%endif
+
+%ifdef MODULE_EBIOS
+	MAIN_FLG_MODULE_EBIOS	EQU	FLG_ROMVARS_MODULE_EBIOS
+%else
+	MAIN_FLG_MODULE_EBIOS	EQU	0
+%endif
+
+%ifdef MODULE_HOTKEYS
+	MAIN_FLG_MODULE_HOTKEYS	EQU	FLG_ROMVARS_MODULE_HOTKEYS
+%else
+	MAIN_FLG_MODULE_HOTKEYS	EQU	0
+%endif
+
+%ifdef MODULE_JRIDE
+	MAIN_FLG_MODULE_JRIDE	EQU	FLG_ROMVARS_MODULE_JRIDE
+%else
+	MAIN_FLG_MODULE_JRIDE	EQU	0
+%endif
+
+%ifdef MODULE_SERIAL
+	MAIN_FLG_MODULE_SERIAL	EQU	FLG_ROMVARS_MODULE_SERIAL
+%else
+	MAIN_FLG_MODULE_SERIAL	EQU	0
+%endif
+
+%ifdef MODULE_SERIAL_FLOPPY
+	MAIN_FLG_MODULE_SERIAL_FLOPPY	EQU	FLG_ROMVARS_MODULE_SERIAL_FLOPPY
+%else
+	MAIN_FLG_MODULE_SERIAL_FLOPPY	EQU	0
+%endif
+
+%ifdef MODULE_STRINGS_COMPRESSED
+	MAIN_FLG_MODULE_STRINGS_COMPRESSED	EQU	FLG_ROMVARS_MODULE_STRINGS_COMPRESSED
+%else
+	MAIN_FLG_MODULE_STRINGS_COMPRESSED	EQU	0
+%endif
+
+MASK_ROMVARS_INCLUDED_MODULES	EQU	MAIN_FLG_MODULE_ADVANCED_ATA | MAIN_FLG_MODULE_BOOT_MENU | MAIN_FLG_MODULE_EBIOS | MAIN_FLG_MODULE_HOTKEYS | MAIN_FLG_MODULE_JRIDE | MAIN_FLG_MODULE_SERIAL | MAIN_FLG_MODULE_SERIAL_FLOPPY | MAIN_FLG_MODULE_STRINGS_COMPRESSED
Index: trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc	(revision 395)
+++ trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc	(revision 397)
@@ -66,12 +66,17 @@
 ; Bit defines for ROMVARS.wFlags
 FLG_ROMVARS_FULLMODE				EQU	(1<<0)	; Full operating mode (steals base RAM, supports EBIOS etc.)
-FLG_ROMVARS_DRVXLAT					EQU	(1<<2)	; Enable drive number translation
 FLG_ROMVARS_SERIAL_SCANDETECT 		EQU	(1<<3)	; Scan COM ports at the end of drive detection.  Can also be invoked
 												; by holding down the ALT key at the end of drive detection.
 												; (Conveniently, this is 8, a fact we exploit when testing the bit)
-FLG_ROMVARS_MODULE_ADVATA			EQU	(1<<4)	; Here in case the configuration needs to know functionality is present
-FLG_ROMVARS_MODULE_JRIDE			EQU	(1<<5)	; Here in case the configuration needs to know functionality is present
-FLG_ROMVARS_MODULE_SERIAL			EQU (1<<6)	; Here in case the configuration needs to know functionality is present
-FLG_ROMVARS_MODULE_EBIOS			EQU (1<<7)	; Here in case the configuration needs to know functionality is present
+
+FLG_ROMVARS_MODULE_ADVANCED_ATA			EQU	(1<<8)	; Here in case the configuration needs to know functionality is present
+FLG_ROMVARS_MODULE_BOOT_MENU			EQU	(1<<9)	; Here in case the configuration needs to know functionality is present
+FLG_ROMVARS_MODULE_EBIOS				EQU	(1<<10)	; Here in case the configuration needs to know functionality is present
+FLG_ROMVARS_MODULE_HOTKEYS				EQU	(1<<11)	; Here in case the configuration needs to know functionality is present
+FLG_ROMVARS_MODULE_JRIDE				EQU (1<<12)	; Here in case the configuration needs to know functionality is present
+FLG_ROMVARS_MODULE_SERIAL				EQU (1<<13)	; Here in case the configuration needs to know functionality is present
+FLG_ROMVARS_MODULE_SERIAL_FLOPPY		EQU (1<<14)	; Here in case the configuration needs to know functionality is present
+FLG_ROMVARS_MODULE_STRINGS_COMPRESSED	EQU (1<<15)	; Here in case the configuration needs to know functionality is present
+
 
 ; Boot Menu Display Modes (see Assembly Library Display.inc for standard modes)
