Index: trunk/Assembly_Library/Inc/MenuEvents.inc
===================================================================
--- trunk/Assembly_Library/Inc/MenuEvents.inc	(revision 491)
+++ trunk/Assembly_Library/Inc/MenuEvents.inc	(revision 492)
@@ -50,5 +50,5 @@
 	;	DS:SI:		Ptr to initialized MENUINIT struct
 	.InitializeMenuinitFromDSSI		resb	2
-%define MENUEVENT_InitializeMenuinitFromDSSI MENUEVENT.InitializeMenuinitFromDSSI
+MENUEVENT_InitializeMenuinitFromDSSI 	equ 	MENUEVENT.InitializeMenuinitFromDSSI
 
 	; Parameters:
@@ -58,5 +58,5 @@
 	;				Clear to cancel exit
 	.ExitMenu						resb	2
-%define MENUEVENT_ExitMenu MENUEVENT.ExitMenu
+MENUEVENT_ExitMenu 					equ 	MENUEVENT.ExitMenu
 
 %ifdef MENUEVENT_IDLEPROCESSING_ENABLE
@@ -65,5 +65,5 @@
 	; See the definition of MENUEVENT_IDLEPROCESSING_ENABLE below.
 	.IdleProcessing					resb	2
-%define MENUEVENT_IdleProcessing MENUEVENT.IdleProcessing
+MENUEVENT_IdleProcessing 			equ		MENUEVENT.IdleProcessing
 %endif
 
@@ -72,10 +72,10 @@
 	;	DX:			Index of previously highlighted item or NO_ITEM_HIGHLIGHTED
 	.ItemHighlightedFromCX			resb	2
-%define MENUEVENT_ItemHighlightedFromCX MENUEVENT.ItemHighlightedFromCX
+MENUEVENT_ItemHighlightedFromCX 	equ		MENUEVENT.ItemHighlightedFromCX
 
 	; Parameters:
 	;	CX:			Index of selected item
 	.ItemSelectedFromCX				resb	2
-%define MENUEVENT_ItemSelectedFromCX MENUEVENT.ItemSelectedFromCX
+MENUEVENT_ItemSelectedFromCX 		equ		MENUEVENT.ItemSelectedFromCX
 
 	; Parameters:
@@ -83,5 +83,5 @@
 	;	AH:			Keyboard library scan code for the key
 	.KeyStrokeInAX					resb	2
-%define MENUEVENT_KeyStrokeInAX MENUEVENT.KeyStrokeInAX
+MENUEVENT_KeyStrokeInAX 			equ 	MENUEVENT.KeyStrokeInAX
 
 	; Parameters:
@@ -90,6 +90,6 @@
 	.RefreshTitle					resb	2
 	.RefreshInformation				resb	2
-%define MENUEVENT_RefreshTitle MENUEVENT.RefreshTitle
-%define MENUEVENT_RefreshInformation MENUEVENT.RefreshInformation
+MENUEVENT_RefreshTitle 				equ		MENUEVENT.RefreshTitle
+MENUEVENT_RefreshInformation 		equ		MENUEVENT.RefreshInformation
 
 	; Parameters:
@@ -97,5 +97,5 @@
 	;	Cursor has been positioned to the beginning of item line
 	.RefreshItemFromCX				resb	2
-%define MENUEVENT_RefreshItemFromCX MENUEVENT.RefreshItemFromCX
+MENUEVENT_RefreshItemFromCX 		equ		MENUEVENT.RefreshItemFromCX
 endstruc
 
Index: trunk/Assembly_Library/Src/Display/DisplayPage.asm
===================================================================
--- trunk/Assembly_Library/Src/Display/DisplayPage.asm	(revision 491)
+++ trunk/Assembly_Library/Src/Display/DisplayPage.asm	(revision 492)
@@ -41,4 +41,15 @@
 
 
+%ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
+	%define EXCLUDE
+	%ifdef MODULE_HOTKEYS
+		%undef EXCLUDE
+	%endif
+	%ifdef MODULE_BOOT_MENU
+		%undef EXCLUDE
+	%endif
+%endif
+
+%ifndef EXCLUDE		
 ;--------------------------------------------------------------------
 ; DisplayPage_GetColumnsToALandRowsToAH
@@ -56,5 +67,6 @@
 	mov		ah, 25							; Always 25 rows on standard text modes
 	ret
-
+%endif
+%undef EXCLUDE		
 
 ;--------------------------------------------------------------------
Index: trunk/Assembly_Library/Src/Display/DisplayPrint.asm
===================================================================
--- trunk/Assembly_Library/Src/Display/DisplayPrint.asm	(revision 491)
+++ trunk/Assembly_Library/Src/Display/DisplayPrint.asm	(revision 492)
@@ -296,5 +296,15 @@
 %endif
 
-
+%ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
+	%define EXCLUDE
+	%ifdef MODULE_HOTKEYS
+		%undef EXCLUDE
+	%endif
+	%ifdef MODULE_BOOT_MENU
+		%undef EXCLUDE
+	%endif
+%endif
+
+%ifndef EXCLUDE				
 ;--------------------------------------------------------------------
 ; DisplayPrint_RepeatCharacterFromALwithCountInCX
@@ -324,5 +334,6 @@
 .NothingToRepeat:
 	ret
-
+%endif
+%undef EXCLUDE
 
 ;--------------------------------------------------------------------
Index: trunk/Assembly_Library/Src/Keyboard/Keyboard.asm
===================================================================
--- trunk/Assembly_Library/Src/Keyboard/Keyboard.asm	(revision 491)
+++ trunk/Assembly_Library/Src/Keyboard/Keyboard.asm	(revision 492)
@@ -289,4 +289,17 @@
 ;		Nothing
 ;--------------------------------------------------------------------
+
+%ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
+	%define EXCLUDE
+	%ifdef MODULE_HOTKEYS
+		%undef EXCLUDE
+	%endif
+	%ifdef MODULE_BOOT_MENU
+		%undef EXCLUDE
+	%endif
+%endif
+		
+%ifndef EXCLUDE
+
 ALIGN KEYBOARD_JUMP_ALIGN
 Keyboard_GetKeystrokeToAXandLeaveItToBuffer:
@@ -294,4 +307,5 @@
 	int		BIOS_KEYBOARD_INTERRUPT_16h
 	ret
+		
 ALIGN KEYBOARD_JUMP_ALIGN
 Keyboard_GetKeystrokeToAX:
@@ -306,2 +320,5 @@
 Keyboard_GetKeystrokeToAXReturn:
 	ret
+		
+%endif
+%undef EXCLUDE
Index: trunk/Assembly_Library/Src/Menu/MenuEvent.asm
===================================================================
--- trunk/Assembly_Library/Src/Menu/MenuEvent.asm	(revision 491)
+++ trunk/Assembly_Library/Src/Menu/MenuEvent.asm	(revision 492)
@@ -52,9 +52,11 @@
 ;		AX, BX, DX
 ;--------------------------------------------------------------------
+%ifndef MENU_NO_ESC
 ALIGN MENU_JUMP_ALIGN
 MenuEvent_ExitMenu:
 	mov		bl, MENUEVENT_ExitMenu
 	jmp		SHORT MenuEvent_SendFromBX
-
+%endif
+		
 
 %ifdef MENUEVENT_IDLEPROCESSING_ENABLE
@@ -153,9 +155,10 @@
 ;		AX, BX, DX
 ;--------------------------------------------------------------------
+%ifdef MENUEVENT_KeyStrokInAX
 ALIGN MENU_JUMP_ALIGN
 MenuEvent_KeyStrokeInAX:
 	mov		bl, MENUEVENT_KeyStrokeInAX
 	SKIP2B	dx	; mov dx, <next instruction>
-
+%endif
 
 ;--------------------------------------------------------------------
Index: trunk/Assembly_Library/Src/Menu/MenuLoop.asm
===================================================================
--- trunk/Assembly_Library/Src/Menu/MenuLoop.asm	(revision 491)
+++ trunk/Assembly_Library/Src/Menu/MenuLoop.asm	(revision 492)
@@ -85,7 +85,11 @@
 	xchg	ax, cx
 	call	.ProcessMenuSystemKeystrokeFromAX
+%ifdef MENUEVENT_KeyStrokeInAX
 	jc		SHORT NoKeystrokeToProcess
 	jmp		MenuEvent_KeyStrokeInAX
-
+%else
+	jmp		SHORT NoKeystrokeToProcess
+%endif
+		
 ;--------------------------------------------------------------------
 ; .ProcessMenuSystemKeystrokeFromAX
@@ -104,6 +108,8 @@
 ALIGN MENU_JUMP_ALIGN
 .ProcessMenuSystemKeystrokeFromAX:
+%ifndef MENU_NO_ESC
 	cmp		al, ESC
 	je		SHORT .LeaveMenuWithoutSelectingItem
+%endif
 	cmp		al, CR
 	je		SHORT .SelectItem
@@ -113,4 +119,5 @@
 	ret		; Return with CF cleared since keystroke not processed
 
+%ifndef MENU_NO_ESC		
 ALIGN MENU_JUMP_ALIGN
 .LeaveMenuWithoutSelectingItem:
@@ -122,5 +129,6 @@
 	stc
 	ret
-
+%endif
+		
 ALIGN MENU_JUMP_ALIGN
 .SelectItem:
Index: trunk/Tools/StringsCompress.pl
===================================================================
--- trunk/Tools/StringsCompress.pl	(revision 491)
+++ trunk/Tools/StringsCompress.pl	(revision 492)
@@ -318,5 +318,5 @@
 	# looking ahead as needed for possible space and null optimizations, compiling formats
 	#
-	for( $g = 0; $g < $#v-1; $g++ )    # -1 for the guard byte
+	for( $g = 0; $g < $#v; $g++ )
 	{
 		#
Index: trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc	(revision 492)
@@ -22,4 +22,8 @@
 %define BOOTVARS_INC
 
+; Default drives
+DEFAULT_FLOPPY_DRIVE_LETTER				EQU	'A'
+DEFAULT_HARD_DRIVE_LETTER				EQU	'C'
+
 ; Number of times to retry booting before accepting error
 BOOT_READ_RETRY_TIMES		EQU		3
@@ -43,5 +47,5 @@
 	.clearToZeroFromThisPoint:
 %ifdef MODULE_HOTKEYS
-	.hotkeyVars			resb	HOTKEYVARS_size
+	.hotkeyVars				resb	HOTKEYVARS_size
 %endif
 
@@ -50,19 +54,24 @@
 
 %ifdef MODULE_HOTKEYS
+
 struc HOTKEYVARS
 	.wTimeToClose		resb	2		; Earliest system time when Hotkey Bar can be closed
-	.bScancode			resb	1		; Function hotkey scancode
-	.bFlags				resb	1		; Must be just before .bHddLetter! 
 	.wHddAndFddLetters:
+	.bFddLetter			resb	1		; Floppy Drive letter hotkey (upper case)
 	.bHddLetter			resb	1		; Hard Drive letter hotkey (upper case)
-	.bFddLetter			resb	1		; Floppy Drive letter hotkey (upper case)
+	.bFlags				resb	1		; Must be just after .bHddLetter!  (dependency in Hotkeybar.asm)
+	.bScancode			resb	1		; Function hotkey scancode, must be just after .bFlags!
 endstruc
 
-; Bit defines for HOTKEYVARS.bFlags
+%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
+%if HOTKEYVARS.bFddLetter+1 != HOTKEYVARS.bHddLetter || HOTKEYVARS.bHddLetter+1 != HOTKEYVARS.bFlags || HOTKEYVARS.bFlags+1 != HOTKEYVARS.bScancode 
+%error "HOTKEYVARS: bytes need to come in the order .bFddLetter, then .bHddLetter, then .bFlags, then .bScancode"
+%endif
+%endif
+
+; Bit defines for KEYBOARDVARS.bFlags
 FLG_HOTKEY_HD_FIRST		EQU		(1<<0)	; First try to boot from HDD, then FDD
 
-%endif ; MODULE_HOTKEY
-
-
+%endif ; MODULE_HOTKEYS
 
 struc DRVDETECTINFO
Index: trunk/XTIDE_Universal_BIOS/Inc/HotkeyBar.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/HotkeyBar.inc	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Inc/HotkeyBar.inc	(revision 492)
@@ -23,13 +23,13 @@
 MIN_TIME_TO_DISPLAY_HOTKEY_BAR			EQU	(5000/55)	; 5000 ms
 
-
-; Hotkeys
-BOOT_MENU_HOTKEY_SCANCODE				EQU	3Ch	; F2
 ROM_BOOT_HOTKEY_SCANCODE				EQU	42h	; F8
 
-; Default drives
-DEFAULT_FLOPPY_DRIVE_LETTER				EQU	'A'
-DEFAULT_HARD_DRIVE_LETTER				EQU	'C'
+%ifdef MODULE_BOOT_MENU
+BOOT_MENU_HOTKEY_SCANCODE				EQU	3Ch	; F2
+%endif
 
+%ifdef MODULE_SERIAL
+COM_DETECT_HOTKEY_SCANCODE				EQU	40h	; F6
+%endif
 
 %endif ; HOTKEYBAR_INC
Index: trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc	(revision 492)
@@ -18,11 +18,4 @@
 ;
 
-; Boot Menu requires Hotkey support
-%ifdef MODULE_BOOT_MENU
-	%ifndef MODULE_HOTKEYS
-		%define MODULE_HOTKEYS
-	%endif
-%endif
-
 %ifdef MODULE_SERIAL_FLOPPY
 	%ifndef MODULE_SERIAL
@@ -30,5 +23,4 @@
 	%endif
 %endif
-
 
 ; Include module specific .INC files
@@ -50,7 +42,12 @@
 %ifdef MODULE_HOTKEYS
 	%include "HotkeyBar.inc"		; For Hotkeys
-	%ifdef MODULE_BOOT_MENU
-		%include "BootMenu.inc"		; For Boot Menu
-	%endif
+%endif
+
+%ifdef MODULE_BOOT_MENU
+	%include "BootMenu.inc"			; For Boot Menu
+%endif
+
+%ifdef MODULE_BOOT_MENU OR MODULE_HOTKEYS
+	%define MODULE_DRIVEXLATE
 %endif
 
Index: trunk/XTIDE_Universal_BIOS/Inc/RamVars.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/RamVars.inc	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Inc/RamVars.inc	(revision 492)
@@ -26,4 +26,13 @@
 %endif
 
+%ifdef MODULE_SERIAL_FLOPPY
+	%define NEED_XLATEVARS
+%endif
+
+%ifdef MODULE_DRIVEXLATE
+	%define NEED_XLATEVARS
+%endif
+
+
 ; RAM Variables.
 ; Variables should be kept to minimum since they might be located
@@ -50,5 +59,5 @@
 
 	; Variables for drive number translation
-%ifdef MODULE_HOTKEYS
+%ifdef NEED_XLATEVARS
 	.xlateVars			resb	XLATEVARS_size
 %endif
@@ -60,7 +69,6 @@
 
 
-
+%ifdef NEED_XLATEVARS
 ; Variables for translating drive numbers.
-%ifdef MODULE_HOTKEYS
 	struc XLATEVARS
 	%ifdef MODULE_SERIAL_FLOPPY
@@ -69,15 +77,20 @@
 										; 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)
+										; this byte contains the raw number of floppy drives seen 
+										; (using .bFlopCreateCnt)
 	%else
 							resb	1	; alignment
 	%endif
+
+	%ifdef MODULE_DRIVEXLATE
 		.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
+	%else
+							resb	1	; alignment
+	%endif
 	endstruc
 %endif
-
 
 %ifdef MODULE_SERIAL_FLOPPY
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm	(revision 492)
@@ -104,48 +104,61 @@
 ;--------------------------------------------------------------------
 SelectDriveToBootFrom:
-%ifdef MODULE_HOTKEYS
-	call	HotkeyBar_UpdateDuringDriveDetection
-
+
+; The following macro could be easily inlined below.  Why a macro?  Depending on the combination
+; of MODULE_HOTKEYS or MODULE_BOOT_MENU, this code needs to either come before or after the
+; call to the boot menu.  
+;
+%macro TRY_TO_BOOT_DL_AND_DH_DRIVES 0
+	push	dx									; it's OK if this is left on the stack, if we are
+												; are successful, the following call does not return
+	call	TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot
+	pop		dx
+	mov		dl, dh
+	call	TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot
+%endmacro
+				
+%ifdef MODULE_HOTKEYS
+	call	HotkeyBar_ScanHotkeysFromKeyBufferAndStoreToBootvars		
+	cmp		al, ROM_BOOT_HOTKEY_SCANCODE
+	jz		JumpToBootSector_or_RomBoot			; CF clear so ROM boot
 %ifdef MODULE_BOOT_MENU
-	mov		di, BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode
-	cmp		BYTE [es:di], BOOT_MENU_HOTKEY_SCANCODE
-	jne		SHORT .DoNotDisplayBootMenu
-
-	; Stop blinking the Boot Menu hotkey and display menu
-	mov		BYTE [es:di], 0
-	call	HotkeyBar_DrawToTopOfScreen
-	call	BootMenu_DisplayAndStoreSelectionAsHotkey
-.DoNotDisplayBootMenu:
-%endif
-
-	; Check if ROM boot (INT 18h) wanted
-	cmp		BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode], ROM_BOOT_HOTKEY_SCANCODE
-	je		SHORT JumpToBootSector_or_RomBoot	; CF clear so ROM boot
-
-	; Get Primary boot drive number to DL
-	call	HotkeyBar_GetPrimaryBootDriveNumberToDL
+	cmp		al, BOOT_MENU_HOTKEY_SCANCODE
+	jz		.BootMenu
+%endif
+	call	HotkeyBar_GetBootDriveNumbersToDX
+.TryUsingHotKeysCode:
+	TRY_TO_BOOT_DL_AND_DH_DRIVES
+	;; falls through to boot menu, if it is present.  If not present, falls through to rom boot.
+%endif
+
+%ifdef MODULE_BOOT_MENU
+.BootMenu:		
+	call	BootMenu_DisplayAndReturnDriveInDLRomBootClearCF
+	jnc		JumpToBootSector_or_RomBoot			; CF clear so ROM boot
+
+	mov		dh, dl								; Setup for secondary drive
+	not		dh									; Floppy goes to HD, or vice veras
+	and		dh, 080h							; Go to first drive of the floppy or HD set
+
+%ifdef MODULE_HOTKEYS
+	jmp		.TryUsingHotKeysCode
 %else
+	TRY_TO_BOOT_DL_AND_DH_DRIVES		
+	jmp		.BootMenu
+%endif
+%endif
+
+%ifndef MODULE_HOTKEYS
+%ifndef MODULE_BOOT_MENU
 	xor		dl, dl			; Try to boot from Floppy Drive A
-%endif	; MODULE_HOTKEYS
-
-	; Try to boot from Primary boot drive (00h by default)
-	call	TryToBootFromPrimaryOrSecondaryBootDevice
-	jc		SHORT JumpToBootSector_or_RomBoot
-
-	; Try to boot from Secondary boot device (80h by default)
-%ifdef MODULE_HOTKEYS
-	call	HotkeyBar_GetSecondaryBootDriveNumberToDL
-%else
+	call	TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot
 	mov		dl, 80h			; Try to boot from Hard Drive C
-%endif
-	call	TryToBootFromPrimaryOrSecondaryBootDevice
-
-%ifdef MODULE_BOOT_MENU
-	; Force Boot Menu hotkey to display boot menu
-	mov		BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode], BOOT_MENU_HOTKEY_SCANCODE
-	jnc		SHORT SelectDriveToBootFrom
-%endif
-	; Fall to JumpToBootSector_or_RomBoot
-
+	call	TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot
+%endif
+%endif
+
+%ifndef MODULE_BOOT_MENU
+	clc		;  fall through with flag for ROM boot.  Boot Menu goes back to menu and doesn't fall through.
+%endif		
 
 ;--------------------------------------------------------------------
@@ -203,11 +216,16 @@
 ;		AX, CX, DH, SI, DI, (DL if failed to read boot sector)
 ;--------------------------------------------------------------------
-%ifndef MODULE_HOTKEYS
-TryToBootFromPrimaryOrSecondaryBootDevice	EQU		BootSector_TryToLoadFromDriveDL
+%ifndef MODULE_DRIVEXLATE
+TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot	EQU		BootSector_TryToLoadFromDriveDL_AndBoot
 
 %else
-TryToBootFromPrimaryOrSecondaryBootDevice:
+TryToBootFromPrimaryOrSecondaryBootDevice_AndBoot:
 	call	DriveXlate_SetDriveToSwap
 	call	DriveXlate_ToOrBack
-	jmp		BootSector_TryToLoadFromDriveDL
-%endif
+	; fall through to TryToBoot_FallThroughTo_BootSector_TryToLoadFromDriveDL_AndBoot
+
+TryToBoot_FallThroughTo_BootSector_TryToLoadFromDriveDL_AndBoot:
+; fall through to BootSector_TryToLoadFromDriveDL_AndBoot				
+%endif
+		
+
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm	(revision 492)
@@ -33,5 +33,5 @@
 ;		AX, CX, DH, SI, DI, (DL if failed to read boot sector)
 ;--------------------------------------------------------------------
-BootSector_TryToLoadFromDriveDL:
+BootSector_TryToLoadFromDriveDL_AndBoot:
 	call	DetectPrint_TryToBootFromDL
 	call	LoadFirstSectorFromDriveDL
@@ -44,14 +44,20 @@
 .AlwaysBootFromFloppyDriveForBooterGames:
 	stc
-	ret
+	jmp		SHORT JumpToBootSector_or_RomBoot		
 .FailedToLoadFirstSector:
 	call	DetectPrint_FailedToLoadFirstSector
-	clc
 	ret
 .FirstHardDiskSectorNotBootable:
 	mov		si, g_szBootSectorNotFound
 	call	DetectPrint_NullTerminatedStringFromCSSIandSetCF
-	clc
 	ret
+
+%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS		
+  %ifdef MODULE_DRIVEXLATE
+    %if TryToBoot_FallThroughTo_BootSector_TryToLoadFromDriveDL_AndBoot <> BootSector_TryToLoadFromDriveDL_AndBoot
+	  %error "TryToBoot_FallThroughTo_BootSector_TryToLoadFromDriveDL_AndBoot <> BootSector_TryToLoadFromDriveDL_AndBoot, BootSector must come immediately after int19h.asm"
+    %endif
+  %endif
+%endif
 
 ;--------------------------------------------------------------------
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 492)
@@ -48,4 +48,8 @@
 	call	StartDetectionWithDriveSelectByteInBHandStringInCX
 
+%ifdef MODULE_HOTKEYS
+	call	HotkeyBar_ScanHotkeysFromKeyBufferAndStoreToBootvars		; Done here while CX is still protected
+%endif				
+
 	pop		cx
 
@@ -62,8 +66,13 @@
 ; if serial drive detected, do not scan (avoids duplicate drives and isn't needed - we already have a connection)
 ;
-	call	FindDPT_ToDSDIforSerialDevice
+	call	FindDPT_ToDSDIforSerialDevice   ; does not modify AX
 	jnc		.AddHardDisks
 
 	mov		bp, ROMVARS.ideVarsSerialAuto	; Point to our special IDEVARS structure, just for serial scans
+
+%ifdef MODULE_HOTKEYS
+	cmp		al, COM_DETECT_HOTKEY_SCANCODE  ; Set by last call to HotkeyBar_UpdateDuringDriveDetection above
+	jz		.DriveDetectLoop
+%endif		
 
 	mov		al,[cs:ROMVARS.wFlags]			; Configurator set to always scan?
@@ -192,5 +201,6 @@
 %ifdef MODULE_HOTKEYS
 	call	HotkeyBar_UpdateDuringDriveDetection
-%endif
+%endif				
+		
 %ifdef MODULE_8BIT_IDE
 	pop		dx
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm	(revision 492)
@@ -34,5 +34,6 @@
 	ret
 
-
+		
+%ifdef MODULE_HOTKEYS
 ;--------------------------------------------------------------------
 ; DetectPrint_GetSoftwareCoordinatesToAX
@@ -47,6 +48,7 @@
 	CALL_DISPLAY_LIBRARY	GetSoftwareCoordinatesToAX
 	ret
-
-
+%endif
+
+		
 ;--------------------------------------------------------------------
 ; DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP
@@ -227,5 +229,5 @@
 	mov		bp, sp
 
-%ifdef MODULE_HOTKEYS
+%ifdef MODULE_DRIVEXLATE
 
 	call	DriveXlate_ToOrBack	; DL = Untranslated Drive number
@@ -233,12 +235,12 @@
 	call	DriveXlate_ToOrBack	; DL = Translated Drive number
 
-	call	HotkeyBar_ConvertDriveNumberFromDLtoDriveLetter	; DL = Translated letter
+	call	DriveXlate_ConvertDriveNumberFromDLtoDriveLetter	; DL = Translated letter
 	xchg	dl, dh
-	call	HotkeyBar_ConvertDriveNumberFromDLtoDriveLetter	; DL = Untranslated letter
+	call	DriveXlate_ConvertDriveNumberFromDLtoDriveLetter	; DL = Untranslated letter
 	push	dx
 	xchg	dl, dh
 	push	dx
 
-	call	HotkeyBar_ConvertDriveLetterInDLtoDriveNumber	; Restore DL
+	call	DriveXlate_ConvertDriveLetterInDLtoDriveNumber	; Restore DL
 
 %else
@@ -254,5 +256,5 @@
 	push	ax
 
-%endif ; MODULE_HOTKEYS
+%endif ; MODULE_DRIVEXLATE
 
 	mov		si, g_szTryToBoot
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm	(revision 492)
@@ -41,5 +41,5 @@
 	; If no drives detected, leave system INT 13h and 40h handlers
 	; in place. We need our INT 13h handler to swap drive letters.
-%ifndef MODULE_HOTKEYS
+%ifndef MODULE_DRIVEXLATE
 	cmp		BYTE [RAMVARS.bDrvCnt], 0
 	je		SHORT Interrupts_InstallHandlerToVectorInALFromCSSI.Interrupts_Return
Index: trunk/XTIDE_Universal_BIOS/Src/Main.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 492)
@@ -36,5 +36,5 @@
 	%define MENUEVENT_INLINE_OFFSETS    	; Only one menu required, save space and inline offsets
 	%define INCLUDE_MENU_LIBRARY
-
+	%define MENU_NO_ESC					    ; User cannot 'esc' out of the menu
 %else	; If no boot menu included
 	%define	INCLUDE_DISPLAY_LIBRARY
@@ -197,5 +197,7 @@
 %ifdef MODULE_HOTKEYS
 	%include "HotkeyBar.asm"		; For hotkeys during drive detection and boot menu
-	%include "DriveXlate.asm"		; For swapping drive numbers
+%endif		
+%ifdef MODULE_DRIVEXLATE
+	%include "DriveXlate.asm"		; For swapping drive numbers, must come immediately after HotkeyBar.asm
 %endif
 
@@ -211,6 +213,6 @@
 	; Boot loader
 	%include "Int19h.asm"			; For Int 19h, Boot Loader
+	%include "BootSector.asm"		; For loading boot sector
 	%include "Int19hReset.asm"		; INT 19h handler for proper system reset
-	%include "BootSector.asm"		; For loading boot sector
 
 	; For all device types
Index: trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenu.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenu.asm	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenu.asm	(revision 492)
@@ -24,13 +24,15 @@
 ; Displays Boot Menu and returns Drive or Function number.
 ;
-; BootMenu_DisplayAndReturnSelectionInDX
+; BootMenu_DisplayAndStoreSelection
 ;	Parameters:
 ;		DS:		RAMVARS segment
 ;	Returns:
-;		Nothing, selected drive is converted to hotkey
+;		DL:		Drive number selected
+;		CF:		Set if selected item is an actual drive, DL is valid
+;				Clear if selected item is Rom Boot, DL is invalid
 ;	Corrupts registers:
 ;		All General Purpose Registers
 ;--------------------------------------------------------------------
-BootMenu_DisplayAndStoreSelectionAsHotkey:
+BootMenu_DisplayAndReturnDriveInDLRomBootClearCF:
 	call	DriveXlate_Reset
 
@@ -38,9 +40,11 @@
 	CALL_MENU_LIBRARY	DisplayWithHandlerInBXandUserDataInDXAX
 
+	xchg	cx, ax
+		
 	; Clear Boot Menu from screen
 	mov		ax, ' ' | (MONO_NORMAL<<8)
 	CALL_DISPLAY_LIBRARY	ClearScreenWithCharInALandAttrInAH
-	ret
 
+	; fall through to BootMenu_GetDriveToDXforMenuitemInCX
 
 ;--------------------------------------------------------------------
@@ -52,12 +56,13 @@
 ;		DS:		RAMVARS segment
 ;       CF:     Set: There is a selected menu item, DL is valid
-;               Clear: There is no selected menu item, DL is not valid
+;               Clear: The item selected is Rom Boot, DL is not valid
 ;	Corrupts registers:
-;		AX, DI
+;		AX, BX, DI
+;
+; NOTE: We can't use the menu structure in here, as we are falling through
+; through from BootMenu_DisplayAndReturnDriveInDLRomBootClearCF when the
+; menu structure has already been destroyed.
 ;--------------------------------------------------------------------
 BootMenu_GetDriveToDXforMenuitemInCX:
-	cmp		cl, NO_ITEM_HIGHLIGHTED
-	je		SHORT .ReturnFloppyDriveInDX	; Clear CF if branch taken
-
 	mov		dl, cl							; Copy menuitem index to DX
 	call	FloppyDrive_GetCountToAX
@@ -65,8 +70,10 @@
 	jb		SHORT .ReturnFloppyDriveInDX	; Set CF if branch taken
 	or		al, 80h							; Or 80h into AL before the sub
-											; to cause CF to be set after
-											; and result has high order bit set
+											; shorter instruction than or'ing it in afterward
 	sub		dl, al							; Remove floppy drives from index
-
+	call	RamVars_GetHardDiskCountFromBDAtoAX
+	or		al, 80h							; Or 80h into AL before the sub				
+	cmp		dl, al							; Set CF if hard disk
+											; Clear CF if last item, beyond hard disk list, which indicates ROM boot
 .ReturnFloppyDriveInDX:
 	ret
Index: trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuEvent.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuEvent.asm	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuEvent.asm	(revision 492)
@@ -21,25 +21,4 @@
 SECTION .text
 
-
-;--------------------------------------------------------------------
-; GetDefaultMenuitemToDL
-;	Parameters:
-;		DL:		Drive number
-;		ES:		Ptr to BDA (zero)
-;	Returns:
-;		DL:		Menuitem index (assuming drive is available)
-;	Corrupts registers:
-;		AX, DH
-;--------------------------------------------------------------------
-GetDefaultMenuitemToDX:
-	mov		dx, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wHddAndFddLetters]
-	test	BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bFlags], FLG_HOTKEY_HD_FIRST
-	eCMOVZ	dl, dh
-	call	IsDriveDLinSystem
-	jnc		SHORT BootMenuEvent_Handler.DoNotSetDefaultMenuitem
-	call	DriveXlate_SetDriveToSwap
-	; Fall to GetMenuitemToDXforDriveInDL
-
-
 ;--------------------------------------------------------------------
 ; GetMenuitemToDXforDriveInDL
@@ -63,28 +42,4 @@
 
 ;--------------------------------------------------------------------
-; IsDriveDLinSystem
-;	Parameters:
-;		DL:		Drive number
-;		DS:		RAMVARS segment
-;	Returns:
-;		CF:		Set if drive number is valid
-;				Clear if drive is not present in system
-;	Corrupts registers:
-;		AX, CX
-;--------------------------------------------------------------------
-IsDriveDLinSystem:
-	test	dl, dl								; Floppy drive?
-	jns		SHORT .IsFloppyDriveInSystem
-	call	RamVars_GetHardDiskCountFromBDAtoAX	; Hard Disk count to AX
-	or		al, 80h								; Set Hard Disk bit to AX
-	jmp		SHORT .CompareDriveNumberToDriveCount
-.IsFloppyDriveInSystem:
-	call	FloppyDrive_GetCountToAX
-.CompareDriveNumberToDriveCount:
-	cmp		dl, al								; Set CF when DL is smaller
-	ret
-
-
-;--------------------------------------------------------------------
 ; BootMenuEvent_Handler
 ;	Common parameters for all events:
@@ -115,5 +70,4 @@
 MENUEVENT_ItemHighlightedFromCX equ (EventItemHighlightedFromCX - FirstEvent)
 MENUEVENT_ItemSelectedFromCX equ (EventItemSelectedFromCX - FirstEvent)
-MENUEVENT_KeyStrokeInAX equ (EventKeyStrokeInAX - FirstEvent)
 MENUEVENT_RefreshTitle equ (BootMenuPrint_TitleStrings - FirstEvent)
 MENUEVENT_RefreshInformation equ (BootMenuPrint_RefreshInformation - FirstEvent)
@@ -164,5 +118,5 @@
 EventInitializeMenuinitFromSSBP:
 	; Store default Menuitem (=default drive to boot from)
-	call	GetDefaultMenuitemToDX
+	xor		dx, dx
 	mov		[bp+MENUINIT.wHighlightedItem], dx
 
@@ -172,6 +126,7 @@
 	call	FloppyDrive_GetCountToAX
 	add		ax, cx
+	inc		ax								; extra entry for ROM Boot item
 	mov		[bp+MENUINIT.wItems], ax
-
+				
 	; Store menu size
 	mov		WORD [bp+MENUINIT.wTitleAndInfoLines], BOOT_MENU_TITLE_AND_INFO_LINES
@@ -180,5 +135,4 @@
 	xchg	cx, ax
 	CALL_DISPLAY_LIBRARY	GetColumnsToALandRowsToAH
-	sub		ah, MENU_SCREEN_BOTTOM_LINES*2	; Leave space for Hotkey Bar
 	MIN_U	ah, cl
 	mov		[bp+MENUINIT.bHeight], ah
@@ -207,14 +161,10 @@
 EventItemHighlightedFromCX:
 	push	cx
+	call	DriveXlate_Reset		
 	call	BootMenu_GetDriveToDXforMenuitemInCX		
-	call	DriveXlate_Reset
+	jnc		.noDriveSwap		
 	call	DriveXlate_SetDriveToSwap
-
-	; We need to generate keystroke so selection two drives is possible.
-	; The secondary boot drive is selected by highlighting it using menu keys
-	; and the primary boot drive is selected by pressing drive letter hotkey.
-	call	BootVars_StoreHotkeyForDriveNumberInDL
-	call	RedrawHotkeyBarFromInsideMenuEventHandler
-
+.noDriveSwap:	
+		
 	; Redraw changes in drive numbers
 	xor		ax, ax	; Update first floppy drive (for translated drive number)
@@ -230,29 +180,5 @@
 	ret
 
-
-;--------------------------------------------------------------------
-; EventKeyStrokeInAX
-;	Parameters
-;		AL:		ASCII character for the key
-;		AH:		Keyboard library scan code for the key
-;		DS:		Ptr to RAMVARS
-;		ES:		Ptr to BDA (zero)
-;		SS:BP:	Menu library handle
-;	Returns:
-;		CF:		Set if event processed
-;				Cleared if event not processed
-;	Corrupts registers:
-;		Does not matter
-;--------------------------------------------------------------------
-EventKeyStrokeInAX:
-	cmp		ah, BOOT_MENU_HOTKEY_SCANCODE
-	je		SHORT BootMenuEvent_Completed	; Ignore Boot Menu hotkey
-	call	HotkeyBar_StoreHotkeyToBootvarsIfValidKeystrokeInAX
-	jnc		SHORT BootMenuEvent_Completed
-
-	; Hotkey is now stored to BOOTVARS and menu can be closed
-	jmp		SHORT CloseBootMenu
-
-
+		
 ;--------------------------------------------------------------------
 ; EventItemSelectedFromCX
@@ -269,9 +195,4 @@
 ;--------------------------------------------------------------------
 EventItemSelectedFromCX:
-	call	BootMenu_GetDriveToDXforMenuitemInCX
-	jnc		SHORT BootMenuEvent_Completed	; No menuitem selected
-
-	; Convert selected drive to hotkey keystroke
-	call	HotkeyBar_StoreHotkeyToBootvarsForDriveLetterInDL
 	; Fall to CloseBootMenu
 
@@ -290,28 +211,7 @@
 	call	DriveXlate_Reset
 	CALL_MENU_LIBRARY	Close
-	; Fall to RedrawHotkeyBarFromInsideMenuEventHandler
-
-
-;--------------------------------------------------------------------
-; RedrawHotkeyBarFromInsideMenuEventHandler
-;	Parameters
-;		DS:		RAMVARS segment
-;		ES:		BDA segment (zero)
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, BX, CX, DX, SI, DI
-;--------------------------------------------------------------------
-RedrawHotkeyBarFromInsideMenuEventHandler:
-	mov		al, MONO_NORMAL
-	CALL_DISPLAY_LIBRARY	SetCharacterAttributeFromAL
-
-	mov		bl, ATTRIBUTES_ARE_USED
-	mov		ax, TELETYPE_OUTPUT_WITH_ATTRIBUTE
-	CALL_DISPLAY_LIBRARY	SetCharOutputFunctionFromAXwithAttribFlagInBL
-	call	HotkeyBar_DrawToTopOfScreen
 	; Fall to BootMenuEvent_Completed
 
-
+		
 ;--------------------------------------------------------------------
 ; BootMenuEvent_Completed
Index: trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm	(revision 492)
@@ -33,9 +33,11 @@
 ;--------------------------------------------------------------------
 BootMenuPrint_RefreshItem:
-	call	BootMenu_GetDriveToDXforMenuitemInCX
-	jnc		BootMenuEvent_Completed					; if no menu item selected, out we go
-
 	push	bp
 	mov		bp, sp
+
+	call	BootMenu_GetDriveToDXforMenuitemInCX
+	mov		si, g_szRomBootDash						; Standard "Rom Boot" but with a "-" at the front
+	mov		al, 20h									; The space between "Rom" and "Boot"
+	jnc		.ROMBoot								; display "Rom Boot" option for last entry
 
 	call	FindDPT_ForDriveNumberInDL
@@ -57,8 +59,16 @@
 	mov		ax, dx									; preserve DL for the floppy drive letter addition
 	call	DriveXlate_ToOrBack
+
+	test	dl, 0f0h								; if there is a character in the upper nibble
+	jnz		.noSpace
+	dec		si										; backup a character to a leading space
+.noSpace:
+
 	push	dx										; translated drive number
 	push	bx										; sub string
 	add		al, 'A'									; floppy drive letter (we always push this although
-	push	ax										; the hard disks don't ever use it, but it does no harm)
+													; the hard disks don't ever use it, but it does no harm)
+.ROMBoot:		
+	push	ax										
 
 	jmp		SHORT BootMenuPrint_RefreshInformation.FormatRelay
@@ -95,5 +105,5 @@
 
 	call	BootMenu_GetDriveToDXforMenuitemInCX
-	jnc		BootMenuEvent_Completed						; if no menu selection, abort
+	jnc		BootMenuEvent_Completed						; nothing to display if "Rom Boot" option
 
 	push	bp
Index: trunk/XTIDE_Universal_BIOS/Src/Menus/DriveXlate.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Menus/DriveXlate.asm	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Src/Menus/DriveXlate.asm	(revision 492)
@@ -20,4 +20,81 @@
 ; Section containing code
 SECTION .text
+
+;--------------------------------------------------------------------
+; DriveXlate_ConvertDriveLetterInDLtoDriveNumber
+;	Parameters:
+;		DS:		RAMVARS segment
+;		DL:		Drive letter ('A'...)
+;	Returns:
+;		DL:		Drive number (0xh for Floppy Drives, 8xh for Hard Drives)
+;	Corrupts registers:
+;		AX
+;--------------------------------------------------------------------
+DriveXlate_ConvertDriveLetterInDLtoDriveNumber:
+	call	DriveXlate_GetLetterForFirstHardDriveToAX
+	cmp		dl, al
+	jb		SHORT .ConvertLetterInDLtoFloppyDriveNumber
+
+	; Convert letter in DL to Hard Drive number
+	sub		dl, al
+	or		dl, 80h
+	ret
+
+.ConvertLetterInDLtoFloppyDriveNumber:
+	sub		dl, DEFAULT_FLOPPY_DRIVE_LETTER
+	ret
+
+%ifdef MODULE_HOTKEY
+%if HotkeyBar_FallThroughTo_DriveXlate_ConvertDriveLetterInDLtoDriveNumber <> DriveXlate_ConvertDriveLetterInDLtoDriveNumber
+	%error "DriveXlate_ConvertDriveLetterInDLtoDriveNumber must be at the top of DriveXlate.asm, and that file must immediately follow HotKeys.asm"
+%endif		
+%endif
+		
+;--------------------------------------------------------------------
+; DriveXlate_ConvertDriveNumberFromDLtoDriveLetter
+;	Parameters:
+;		DL:		Drive number (0xh for Floppy Drives, 8xh for Hard Drives)
+;		DS:		RAMVARS Segment
+;	Returns:
+;		DL:		Drive letter ('A'...)
+;		CF:		Set if Hard Drive
+;				Clear if Floppy Drive
+;	Corrupts registers:
+;		AX
+;--------------------------------------------------------------------
+DriveXlate_ConvertDriveNumberFromDLtoDriveLetter:
+	test	dl, dl
+	jns		SHORT .GetDefaultFloppyDrive
+
+	; Store default hard drive to boot from
+	call	DriveXlate_GetLetterForFirstHardDriveToAX
+	sub		dl, 80h
+	add		dl, al
+	stc
+	ret
+
+.GetDefaultFloppyDrive:
+	add		dl, DEFAULT_FLOPPY_DRIVE_LETTER		; Clears CF
+	ret
+
+
+;--------------------------------------------------------------------
+; Returns letter for first hard disk. Usually it will be 'C' but it
+; can be higher if more than two floppy drives are found.
+;
+; DriveXlate_GetLetterForFirstHardDriveToAX
+;	Parameters:
+;		DS:		RAMVARS segment
+;	Returns:
+;		AX:		Upper case letter for first hard disk
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+DriveXlate_GetLetterForFirstHardDriveToAX:
+	call	FloppyDrive_GetCountToAX
+	add		al, DEFAULT_FLOPPY_DRIVE_LETTER
+	MAX_U	al, DEFAULT_HARD_DRIVE_LETTER
+	ret
+				
 
 ;--------------------------------------------------------------------
Index: trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm	(revision 492)
@@ -32,8 +32,8 @@
 ;--------------------------------------------------------------------
 HotkeyBar_UpdateDuringDriveDetection:
-	call	ScanHotkeysFromKeyBufferAndStoreToBootvars
+	call	HotkeyBar_ScanHotkeysFromKeyBufferAndStoreToBootvars
 	; Fall to HotkeyBar_DrawToTopOfScreen
-
-
+		
+		
 ;--------------------------------------------------------------------
 ; HotkeyBar_DrawToTopOfScreen
@@ -66,11 +66,12 @@
 ;--------------------------------------------------------------------
 .PrintFloppyDriveHotkeys:
+	mov		cx, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wHddAndFddLetters]
+		
 	call	FloppyDrive_GetCountToAX
 	test	ax, ax		; Any Floppy Drives?
 	jz		SHORT .SkipFloppyDriveHotkeys
 
-	mov		di, DEFAULT_FLOPPY_DRIVE_LETTER | (ANGLE_QUOTE_RIGHT<<8)
-	mov		cl, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bFddLetter]
-	mov		si, g_szFDD
+	mov		ax, (ANGLE_QUOTE_RIGHT << 8) | DEFAULT_FLOPPY_DRIVE_LETTER
+	mov		di, g_szFDD
 	call	FormatDriveHotkeyString
 
@@ -88,9 +89,8 @@
 ;		AX, CX, DX, SI, DI
 ;--------------------------------------------------------------------
-	call	HotkeyBar_GetLetterForFirstHardDriveToAX
+	call	DriveXlate_GetLetterForFirstHardDriveToAX
 	mov		ah, ANGLE_QUOTE_RIGHT
-	xchg	di, ax
-	mov		cl, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bHddLetter]
-	mov		si, g_szHDD
+	mov		cl, ch
+	mov		di, g_szHDD
 	call	FormatDriveHotkeyString
 	; Fall to .PrintBootMenuHotkey
@@ -107,10 +107,26 @@
 .PrintBootMenuHotkey:
 %ifdef MODULE_BOOT_MENU
-	mov		ah, BOOT_MENU_HOTKEY_SCANCODE
-	mov		di, 'F' | ('2'<<8)		; F2
-	mov		si, g_szBootMenu
+	mov		ax, BOOT_MENU_HOTKEY_SCANCODE | ('2' << 8)
+	mov		di, g_szBootMenu
 	call	FormatFunctionHotkeyString
 %endif
-	; Fall to .PrintRomBootHotkey
+	; Fall to .PrintComDetectHotkey
+
+;--------------------------------------------------------------------
+; .PrintComDetectHotkey
+;	Parameters:
+;		ES:		BDA segment (zero)
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, CX, DX, SI, DI
+;--------------------------------------------------------------------
+.PrintComDetectHotkey:
+%ifdef MODULE_SERIAL
+	mov		ax, COM_DETECT_HOTKEY_SCANCODE | ('6' << 8)
+	mov		di, g_szHotComDetect
+	call	FormatFunctionHotkeyString
+%endif
+	; Fall to .PrintRomBootHotkey		
 
 ;--------------------------------------------------------------------
@@ -124,7 +140,6 @@
 ;--------------------------------------------------------------------
 .PrintRomBootHotkey:
-	mov		ah, ROM_BOOT_HOTKEY_SCANCODE
-	mov		di, 'F' | ('8'<<8)		; F8
-	mov		si, g_szRomBoot
+	mov		ax, ROM_BOOT_HOTKEY_SCANCODE | ('8' << 8)
+	mov		di, g_szRomBoot
 	call	FormatFunctionHotkeyString
 	; Fall to .EndHotkeyBarRendering
@@ -168,6 +183,6 @@
 ;	Parameters:
 ;		CL:			Drive letter hotkey from BOOTVARS
-;		DI low:		First character for drive key string
-;		DI high:	Second character for drive key string (ANGLE_QUOTE_RIGHT)
+;		AL:			First character for drive key string
+;		AH:			Second character for drive key string (ANGLE_QUOTE_RIGHT)
 ;		SI:			Offset to hotkey description string
 ;		ES:			BDA segment (zero)
@@ -177,16 +192,14 @@
 ;		AX, CX, DX, SI, DI
 ;--------------------------------------------------------------------
-FormatDriveHotkeyString:
-	ePUSH_T	ax, PushHotkeyParamsAndFormat
-	jmp		SHORT GetNonSelectedHotkeyDescriptionAttributeToDX
-
+;; No work to do before going into FormatFunctionHotkeyString
+FormatDriveHotkeyString  equ  GetNonSelectedHotkeyDescriptionAttributeToDX
 
 ;--------------------------------------------------------------------
 ; FormatFunctionHotkeyString
 ;	Parameters:
-;		AH:			Hotkey scancode to compare with BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode
+;		AL:			Scancode of function key, to know which if any to show as selected
+;					Later replaced with an 'F' for the call to the output routine
+;		AH:			Second character for drive key string
 ;		SI:			Offset to hotkey description string
-;		DI low:		First character for drive key string
-;		DI high:	Second character for drive key string
 ;		ES:			BDA segment (zero)
 ;	Returns:
@@ -196,48 +209,32 @@
 ;--------------------------------------------------------------------
 FormatFunctionHotkeyString:
-	ePUSH_T	ax, PushHotkeyParamsAndFormat
-	mov		cx, g_szBoot		; Description parameter string
-	cmp		[es:BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode], ah
-	jne		SHORT GetNonSelectedHotkeyDescriptionAttributeToDX
-	; Fall to GetSelectedHotkeyDescriptionAttributeToDX
-
-
-;--------------------------------------------------------------------
-; GetSelectedHotkeyDescriptionAttributeToDX
-; GetNonSelectedHotkeyDescriptionAttributeToDX
-;	Parameters:
-;		CF:		Set if selected hotkey
-;				Cleared if unselected hotkey
-;		ES:		BDA segment (zero)
-;	Returns:
-;		DX:		Description Attribute
-;	Corrupts registers:
-;		AX
-;--------------------------------------------------------------------
+	xor		cx, cx		; Null character, eaten in output routines
+
+	cmp		[es:BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode], al
+	mov		al, 'F'		; Replace scancode with character for output
+
 %ifdef MODULE_BOOT_MENU
-GetSelectedHotkeyDescriptionAttributeToDX:
-	push	si
+
 	mov		si, ATTRIBUTE_CHARS.cHurryTimeout		; Selected hotkey
-	jmp		SHORT GetDescriptionAttributeToDX
+	jz		SHORT GetDescriptionAttributeToDX		; From compare with bScancode above
 
 GetNonSelectedHotkeyDescriptionAttributeToDX:
-	push	si
 	mov		si, ATTRIBUTE_CHARS.cHighlightedItem	; Unselected hotkey
 
 	; Display Library should not be called like this
 GetDescriptionAttributeToDX:
+	xchg	dx, ax
 	call	MenuAttribute_GetToAXfromTypeInSI
-	pop		si
 	xchg	dx, ax					; DX = Description attribute
-	ret
-
-%else	; No boot menu so use simpler attributes
-
-GetSelectedHotkeyDescriptionAttributeToDX:
+	;;  fall through to PushHotkeyParamsAndFormat 
+
+%else ; MODULE_BOOT_MENU - No boot menu so use simpler attributes
+
 	mov		dx, (COLOR_ATTRIBUTE(COLOR_YELLOW, COLOR_CYAN) << 8) | MONO_REVERSE_BLINK
-	jmp		SHORT SelectAttributeFromDHorDLbasedOnVideoMode
+	jz		SHORT SelectAttributeFromDHorDLbasedOnVideoMode			; From compare with bScancode above
 
 GetNonSelectedHotkeyDescriptionAttributeToDX:
 	mov		dx, (COLOR_ATTRIBUTE(COLOR_BLACK, COLOR_CYAN) << 8) | MONO_REVERSE
+
 SelectAttributeFromDHorDLbasedOnVideoMode:
 	mov		al, [es:BDA.bVidMode]
@@ -248,7 +245,7 @@
 	mov		dl, dh
 .AttributeLoadedToDL:
-	ret
-
-%endif
+	;;  fall through to PushHotkeyParamsAndFormat 		
+
+%endif ; MODULE_BOOT_MENU
 
 
@@ -256,9 +253,9 @@
 ; PushHotkeyParamsAndFormat
 ;	Parameters:
-;		DI low:		First character
-;		DI high:	Second character
+;		BL:			First character
+;		BH:			Second character
 ;		DX:			Description Attribute
 ;		CX:			Description string parameter
-;		CS:SI:		Description string
+;		CS:DI:		Description string
 ;	Returns:
 ;		Nothing
@@ -270,16 +267,17 @@
 	mov		bp, sp
 
-	mov		ax, MONO_BRIGHT
-	push	ax				; Key attribute
-	xchg	ax, di
-	push	ax				; First character
-	xchg	al, ah
-	push	ax				; Second character
+	mov		si, MONO_BRIGHT
+
+	push	si				; Key attribute
+	push	ax				; First Character
+	mov		al, ah
+	push	ax				; Second Character
 
 	push	dx				; Description attribute
-	push	si				; Description string
+	push	di				; Description string
 	push	cx				; Description string parameter
-
-	push	di				; Key attribute for last space
+		
+	push	si				; Key attribute for last space
+
 	mov		si, g_szHotkey
 	jmp		DetectPrint_FormatCSSIfromParamsInSSBP
@@ -332,18 +330,18 @@
 
 ;--------------------------------------------------------------------
-; ScanHotkeysFromKeyBufferAndStoreToBootvars
-;	Parameters:
-;		DS:		RAMVARS segment
-;		ES:		BDA segment (zero)
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, CX
-;--------------------------------------------------------------------
-ScanHotkeysFromKeyBufferAndStoreToBootvars:
+; HotkeyBar_ScanHotkeysFromKeyBufferAndStoreToBootvars
+;	Parameters:
+;		DS:		RAMVARS segment
+;		ES:		BDA segment (zero)
+;	Returns:
+;		AL:		Last scancode value
+;	Corrupts registers:
+;		AH, CX
+;--------------------------------------------------------------------
+HotkeyBar_ScanHotkeysFromKeyBufferAndStoreToBootvars:
 	call	Keyboard_GetKeystrokeToAX
 	jz		SHORT NoHotkeyToProcess
 
-	ePUSH_T	cx, ScanHotkeysFromKeyBufferAndStoreToBootvars
+	ePUSH_T	cx, HotkeyBar_ScanHotkeysFromKeyBufferAndStoreToBootvars
 	; Fall to HotkeyBar_StoreHotkeyToBootvarsIfValidKeystrokeInAX
 
@@ -357,32 +355,28 @@
 ;		ES:		BDA segment (zero)
 ;	Returns:
-;		CF:		Set if valid keystroke
-;				Clear if invalid keystroke
-;	Corrupts registers:
-;		AX, CX, DI
+;       AL:     Last scancode seen
+;	Corrupts registers:
+;		AH, CX, DI
 ;--------------------------------------------------------------------
 HotkeyBar_StoreHotkeyToBootvarsIfValidKeystrokeInAX:
-	; Boot menu
-%ifdef MODULE_BOOT_MENU
-	cmp		ah, BOOT_MENU_HOTKEY_SCANCODE	; Display Boot Menu?
-	je		SHORT .StoreFunctionHotkeyFromAH
-%endif
-
-	; ROM Boot
-	cmp		ah, ROM_BOOT_HOTKEY_SCANCODE	; ROM Boot?
-	je		SHORT .StoreFunctionHotkeyFromAH
-
+	mov		di, BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode
+
+	; All scancodes are saved, even if it wasn't a drive letter,
+	; which also covers our function key case.  Invalid function keys
+	; will not do anything (won't be printed, won't be accepted as input)		
+	mov		[es:di], ah
+		
 	; Drive letter hotkeys remaining, allow 'a' to 'z'
 	call	Char_IsLowerCaseLetterInAL
-	jnc		SHORT .KeystrokeIsNotValidHotkey
+	jnc		SHORT .KeystrokeIsNotValidDriveLetter
 	xor		al, 32					; We want to print upper case letters
 
 	; Clear HD First flag to assume Floppy Drive hotkey
-	mov		di, BOOTVARS.hotkeyVars+HOTKEYVARS.bFlags
+	dec		di
 	and		BYTE [es:di], ~FLG_HOTKEY_HD_FIRST
 
 	; Determine if Floppy or Hard Drive hotkey
 	eMOVZX	cx, al					; Clear CH to clear scancode
-	call	HotkeyBar_GetLetterForFirstHardDriveToAX
+	call	DriveXlate_GetLetterForFirstHardDriveToAX
 	cmp		cl, al
 	jb		SHORT .StoreDriveLetter	; Store Floppy Drive letter
@@ -392,109 +386,33 @@
 
 .StoreDriveLetter:
-	adc		di, BYTE 1			; Add CF if Floppy Drive
+	sbb		di, BYTE 1			; Sub CF if Floppy Drive
 	xchg	ax, cx
 	mov		[es:di], al			; AH = zero to clear function hotkey
 
-.StoreFunctionHotkeyFromAH:
-	mov		[es:BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode], ah
-	stc		; Valid hotkey
-
-.KeystrokeIsNotValidHotkey:
+.KeystrokeIsNotValidDriveLetter:		
 NoHotkeyToProcess:
+	mov		al, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode]
 	ret
 
-
-;--------------------------------------------------------------------
-; HotkeyBar_GetSecondaryBootDriveNumberToDL
-; HotkeyBar_GetPrimaryBootDriveNumberToDL
-;	Parameters:
-;		DS:		RAMVARS segment
-;		ES:		BDA segment (zero)
-;	Returns:
-;		DL:		Drive selected as boot device
-;	Corrupts registers:
-;		AX, DH
-;--------------------------------------------------------------------
-HotkeyBar_GetSecondaryBootDriveNumberToDL:
+;--------------------------------------------------------------------
+; HotkeyBar_GetBootDriveNumbersToDX
+;	Parameters:
+;		DS:		RAMVARS segment
+;		ES:		BDA segment (zero)
+;	Returns:
+;		DX:		Drives selected as boot device, DL is primary
+;	Corrupts registers:
+;		AX
+;--------------------------------------------------------------------
+HotkeyBar_GetBootDriveNumbersToDX:
 	mov		dx, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wHddAndFddLetters]
+	test	BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bFlags], FLG_HOTKEY_HD_FIRST		
+	jnz		.noflip
 	xchg	dl, dh
-	jmp		SHORT GetBootDriveNumberFromLettersInDX
-
-HotkeyBar_GetPrimaryBootDriveNumberToDL:
-	mov		dx, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wHddAndFddLetters]
-GetBootDriveNumberFromLettersInDX:
-	test	BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bFlags], FLG_HOTKEY_HD_FIRST
-	eCMOVZ	dl, dh
-	; Fall to HotkeyBar_ConvertDriveLetterInDLtoDriveNumber
-
-
-;--------------------------------------------------------------------
-; HotkeyBar_ConvertDriveLetterInDLtoDriveNumber
-;	Parameters:
-;		DS:		RAMVARS segment
-;		DL:		Drive letter ('A'...)
-;	Returns:
-;		DL:		Drive number (0xh for Floppy Drives, 8xh for Hard Drives)
-;	Corrupts registers:
-;		AX, DH
-;--------------------------------------------------------------------
-HotkeyBar_ConvertDriveLetterInDLtoDriveNumber:
-	call	HotkeyBar_GetLetterForFirstHardDriveToAX
-	cmp		dl, al
-	jb		SHORT .ConvertLetterInDLtoFloppyDriveNumber
-
-	; Convert letter in DL to Hard Drive number
-	sub		dl, al
-	or		dl, 80h
-	ret
-
-.ConvertLetterInDLtoFloppyDriveNumber:
-	sub		dl, DEFAULT_FLOPPY_DRIVE_LETTER
-	ret
-
-
-;--------------------------------------------------------------------
-; HotkeyBar_ConvertDriveNumberFromDLtoDriveLetter
-;	Parameters:
-;		DL:		Drive number (0xh for Floppy Drives, 8xh for Hard Drives)
-;		DS:		RAMVARS Segment
-;	Returns:
-;		DL:		Drive letter ('A'...)
-;		CF:		Set if Hard Drive
-;				Clear if Floppy Drive
-;	Corrupts registers:
-;		AX
-;--------------------------------------------------------------------
-HotkeyBar_ConvertDriveNumberFromDLtoDriveLetter:
-	test	dl, dl
-	jns		SHORT .GetDefaultFloppyDrive
-
-	; Store default hard drive to boot from
-	call	HotkeyBar_GetLetterForFirstHardDriveToAX
-	sub		dl, 80h
-	add		dl, al
-	stc
-	ret
-
-.GetDefaultFloppyDrive:
-	add		dl, DEFAULT_FLOPPY_DRIVE_LETTER		; Clears CF
-	ret
-
-
-;--------------------------------------------------------------------
-; Returns letter for first hard disk. Usually it will be 'C' but it
-; can be higher if more than two floppy drives are found.
-;
-; HotkeyBar_GetLetterForFirstHardDriveToAX
-;	Parameters:
-;		DS:		RAMVARS segment
-;	Returns:
-;		AX:		Upper case letter for first hard disk
-;	Corrupts registers:
-;		Nothing
-;--------------------------------------------------------------------
-HotkeyBar_GetLetterForFirstHardDriveToAX:
-	call	FloppyDrive_GetCountToAX
-	add		al, DEFAULT_FLOPPY_DRIVE_LETTER
-	MAX_U	al, DEFAULT_HARD_DRIVE_LETTER
-	ret
+.noflip:	
+	call	DriveXlate_ConvertDriveLetterInDLtoDriveNumber
+	xchg	dl, dh
+	; Fall to HotkeyBar_FallThroughTo_DriveXlate_ConvertDriveLetterInDLtoDriveNumber		
+		
+HotkeyBar_FallThroughTo_DriveXlate_ConvertDriveLetterInDLtoDriveNumber:		
+
Index: trunk/XTIDE_Universal_BIOS/Src/Strings.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Strings.asm	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Src/Strings.asm	(revision 492)
@@ -65,5 +65,5 @@
 ; Boot loader strings
 g_szTryToBoot:			db	"Booting %c",ANGLE_QUOTE_RIGHT,"%c",LF,CR,NULL
-g_szBootSectorNotFound:	db	"Boot sector "
+g_szBootSectorNotFound:	db	"Boot sector " 			; String fall through...
 g_szNotFound:			db	"not found",LF,CR,NULL
 g_szReadError:			db	"Error %x!",LF,CR,NULL
@@ -72,11 +72,22 @@
 %ifdef MODULE_HOTKEYS
 ; Hotkey Bar strings
-g_szFDD:		db	"FDD [%c]",NULL			; "FDD [A]"
-g_szHDD:		db	"HDD [%c]",NULL			; "HDD [C]"
-g_szBootMenu:	db	"%sMnu",NULL			; "BootMnu"
-g_szRomBoot:	db	"Rom%s",NULL			; "RomBoot"
-g_szBoot:		db	"Boot",NULL
-g_szHotkey:		db	"%A%c%c%A%s%A ",NULL	; "C»HDD [A] ", "F2BootMnu " or "F8RomBoot "
-
+g_szFDD:				db	"FDD [%c]",NULL			; "FDD [A]"
+g_szHDD:				db	"HDD [%c]",NULL			; "HDD [C]"
+%ifdef MODULE_BOOT_MENU
+g_szBootMenu:			db	"BootMnu%c",NULL		; "BootMnu", location of %c doesn't matter
+%endif ; MODULE_BOOT_MENU
+g_szHotkey:				db	"%A%c%c%A%s%A ",NULL	; "C»HDD [A] ", "F2BootMnu " or "F8RomBoot "
+%ifdef MODULE_SERIAL
+g_szHotComDetect:		db	"ComDtct%c",NULL		; "ComDtct", location of %c doesn't matter
+%endif ; MODULE_SERIAL
+%endif ; MODULE_HOTKEYS
+
+%ifdef MODULE_BOOT_MENU
+g_szRomBootDash:		db	" -  "					; String fall through to g_szRomBoot
+%endif
+%ifdef MODULE_HOTKEYS OR MODULE_BOOT_MENU		
+g_szRomBoot:			db	"Rom%cBoot", NULL		; "RomBoot" or "Rom Boot"
+%endif
+		
 
 %ifdef MODULE_BOOT_MENU
@@ -190,6 +201,10 @@
 ; which is checked at assembly time below.
 ;
+g_szDriveNumSpace:		db	" "							; leading space, used if drive number is less than 0fh
+														; must come immediately before g_szDriveNum!
 g_szBootMenuPrintStart:
 g_szDriveNum:			db	"%x %s",NULL
+g_szDriveNumBNSpace:	db	" "							; leading space, used if drive number is less than 0fh
+														; must come immediately before g_szDriveNumBOOTNFO!
 g_szDriveNumBOOTNFO:	db	"%x %z",NULL
 g_szFloppyDrv:			db	"Floppy Drive %c",NULL
@@ -201,8 +216,10 @@
 		%error "g_szBootMenuPrint* strings must start on the same 256 byte page, required by the BootMenuPrint_* routines.  Please move this block up or down within Strings.asm"
 	%endif
+	%if g_szDriveNumSpace+1 != g_szDriveNum || g_szDriveNumBNSpace+1 != g_szDriveNumBOOTNFO
+		%error "g_szDriveNumSpace or g_szDriveNumBNSpace are out of position"
+	%endif
 %endif
 
 %endif ; MODULE_BOOT_MENU
-%endif ; MODULE_HOTKEYS
 
 
Index: trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm	(revision 492)
@@ -129,5 +129,5 @@
               			  db	 48h,  75h,  75h,  7ah,  6fh,  74h, 0edh,  3ch,  24h,  3ch,  19h                                  ; compressed
 
-g_szBootSectorNotFound:	; db	"Boot sector "
+g_szBootSectorNotFound:	; db	"Boot sector " 			; String fall through...
                        	; db	 42h,  6fh,  6fh,  74h,  20h,  73h,  65h,  63h,  74h,  6fh,  72h,  20h    ; uncompressed
                        	  db	 48h,  75h,  75h, 0fah,  79h,  6bh,  69h,  7ah,  75h, 0f8h                ; compressed
@@ -145,28 +145,42 @@
 %ifdef MODULE_HOTKEYS
 ; Hotkey Bar strings
-g_szFDD:		; db	"FDD [%c]",NULL			; "FDD [A]"
-        		; db	 46h,  44h,  44h,  20h,  5bh,  25h,  63h,  5dh,  00h    ; uncompressed
-        		  db	 4ch,  4ah, 0cah,  61h,  3ch, 0a3h                      ; compressed
-
-g_szHDD:		; db	"HDD [%c]",NULL			; "HDD [C]"
-        		; db	 48h,  44h,  44h,  20h,  5bh,  25h,  63h,  5dh,  00h    ; uncompressed
-        		  db	 4eh,  4ah, 0cah,  61h,  3ch, 0a3h                      ; compressed
-
-g_szBootMenu:	; db	"%sMnu",NULL			; "BootMnu"
-             	; db	 25h,  73h,  4dh,  6eh,  75h,  00h    ; uncompressed
-             	  db	 3dh,  53h,  74h, 0bbh                ; compressed
-
-g_szRomBoot:	; db	"Rom%s",NULL			; "RomBoot"
-            	; db	 52h,  6fh,  6dh,  25h,  73h,  00h    ; uncompressed
-            	  db	 58h,  75h,  73h,  1dh                ; compressed
-
-g_szBoot:		; db	"Boot",NULL
-         		; db	 42h,  6fh,  6fh,  74h,  00h    ; uncompressed
-         		  db	 48h,  75h,  75h, 0bah          ; compressed
-
-g_szHotkey:		; db	"%A%c%c%A%s%A ",NULL	; "C»HDD [A] ", "F2BootMnu " or "F8RomBoot "
-           		; db	 25h,  41h,  25h,  63h,  25h,  63h,  25h,  41h,  25h,  73h,  25h,  41h,  20h,  00h    ; uncompressed
-           		  db	 3bh,  3ch,  3ch,  3bh,  3dh,  3bh,  00h                                              ; compressed
-
+g_szFDD:				; db	"FDD [%c]",NULL			; "FDD [A]"
+        				; db	 46h,  44h,  44h,  20h,  5bh,  25h,  63h,  5dh,  00h    ; uncompressed
+        				  db	 4ch,  4ah, 0cah,  61h,  3ch, 0a3h                      ; compressed
+
+g_szHDD:				; db	"HDD [%c]",NULL			; "HDD [C]"
+        				; db	 48h,  44h,  44h,  20h,  5bh,  25h,  63h,  5dh,  00h    ; uncompressed
+        				  db	 4eh,  4ah, 0cah,  61h,  3ch, 0a3h                      ; compressed
+
+%ifdef MODULE_BOOT_MENU
+g_szBootMenu:			; db	"BootMnu%c",NULL		; "BootMnu", location of %c doesn't matter
+             			; db	 42h,  6fh,  6fh,  74h,  4dh,  6eh,  75h,  25h,  63h,  00h    ; uncompressed
+             			  db	 48h,  75h,  75h,  7ah,  53h,  74h,  7bh,  1ch                ; compressed
+
+%endif ; MODULE_BOOT_MENU
+g_szHotkey:				; db	"%A%c%c%A%s%A ",NULL	; "C»HDD [A] ", "F2BootMnu " or "F8RomBoot "
+           				; db	 25h,  41h,  25h,  63h,  25h,  63h,  25h,  41h,  25h,  73h,  25h,  41h,  20h,  00h    ; uncompressed
+           				  db	 3bh,  3ch,  3ch,  3bh,  3dh,  3bh,  00h                                              ; compressed
+
+%ifdef MODULE_SERIAL
+g_szHotComDetect:		; db	"ComDtct%c",NULL		; "ComDtct", location of %c doesn't matter
+                 		; db	 43h,  6fh,  6dh,  44h,  74h,  63h,  74h,  25h,  63h,  00h    ; uncompressed
+                 		  db	 49h,  75h,  73h,  4ah,  7ah,  69h,  7ah,  1ch                ; compressed
+
+%endif ; MODULE_SERIAL
+%endif ; MODULE_HOTKEYS
+
+%ifdef MODULE_BOOT_MENU
+g_szRomBootDash:		; db	" -  "					; String fall through to g_szRomBoot
+                		; db	 20h,  2dh,  20h,  20h    ; uncompressed
+                		  db	 20h,  28h,  20h,  20h    ; compressed
+
+%endif
+%ifdef MODULE_HOTKEYS OR MODULE_BOOT_MENU		
+g_szRomBoot:			; db	"Rom%cBoot", NULL		; "RomBoot" or "Rom Boot"
+            			; db	 52h,  6fh,  6dh,  25h,  63h,  42h,  6fh,  6fh,  74h,  00h    ; uncompressed
+            			  db	 58h,  75h,  73h,  3ch,  48h,  75h,  75h, 0bah                ; compressed
+
+%endif
 
 
@@ -353,4 +367,9 @@
 ; which is checked at assembly time below.
 ;
+g_szDriveNumSpace:		; db	" "							; leading space, used if drive number is less than 0fh
+                  		; db	 20h    ; uncompressed
+                  		  db	 20h    ; compressed
+
+; must come immediately before g_szDriveNum!
 g_szBootMenuPrintStart:
 g_szDriveNum:			; db	"%x %s",NULL
@@ -358,4 +377,9 @@
              			  db	 37h,  20h,  1dh                      ; compressed
 
+g_szDriveNumBNSpace:	; db	" "							; leading space, used if drive number is less than 0fh
+                    	; db	 20h    ; uncompressed
+                    	  db	 20h    ; compressed
+
+; must come immediately before g_szDriveNumBOOTNFO!
 g_szDriveNumBOOTNFO:	; db	"%x %z",NULL
                     	; db	 25h,  78h,  20h,  25h,  7ah,  00h    ; uncompressed
@@ -376,8 +400,10 @@
 %error "g_szBootMenuPrint* strings must start on the same 256 byte page, required by the BootMenuPrint_* routines.  Please move this block up or down within Strings.asm"
 %endif
+%if g_szDriveNumSpace+1 != g_szDriveNum || g_szDriveNumBNSpace+1 != g_szDriveNumBOOTNFO
+%error "g_szDriveNumSpace or g_szDriveNumBNSpace are out of position"
+%endif
 %endif
 
 %endif ; MODULE_BOOT_MENU
-%endif ; MODULE_HOTKEYS
 
 
@@ -528,5 +554,5 @@
 ;; translated usage stats
 ;; 33:1
-;; 32:29
+;; 32:34
 ;; 181:1
 ;; 53:2
@@ -543,5 +569,5 @@
 ;; 49:1
 ;; 56:7
-;; 45:1
+;; 45:2
 ;; 175:1
 ;; 171:2
@@ -554,10 +580,10 @@
 ;; 5-u:2
 ;; x:5
-;; s:16
+;; s:14
 ;; 5-x:1
 ;; nl:12
 ;; 2-I:1
 ;; u:6
-;; c:10
+;; c:13
 ;; z:2
 ;; total format: 11
@@ -572,7 +598,7 @@
 ;; 64,@:1
 ;; 65,A:5
-;; 66,B:8
-;; 67,C:2
-;; 68,D:10
+;; 66,B:9
+;; 67,C:3
+;; 68,D:11
 ;; 69,E:3
 ;; 70,F:3
@@ -605,5 +631,5 @@
 ;; 97,a:7
 ;; 98,b:
-;; 99,c:5
+;; 99,c:6
 ;; 100,d:6
 ;; 101,e:15
@@ -615,12 +641,12 @@
 ;; 107,k:4
 ;; 108,l:5
-;; 109,m:1
+;; 109,m:2
 ;; 110,n:11
-;; 111,o:17
+;; 111,o:20
 ;; 112,p:3
 ;; 113,q:
 ;; 114,r:11
 ;; 115,s:7
-;; 116,t:12
+;; 116,t:15
 ;; 117,u:4
 ;; 118,v:3
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/BootVars.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/BootVars.asm	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/BootVars.asm	(revision 492)
@@ -64,6 +64,6 @@
 ;--------------------------------------------------------------------
 BootVars_StoreHotkeyForDriveNumberInDL:
-	mov		WORD [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wHddAndFddLetters], DEFAULT_HARD_DRIVE_LETTER | (DEFAULT_FLOPPY_DRIVE_LETTER<<8)
-	call	HotkeyBar_ConvertDriveNumberFromDLtoDriveLetter
+	mov		WORD [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wHddAndFddLetters], DEFAULT_FLOPPY_DRIVE_LETTER | (DEFAULT_HARD_DRIVE_LETTER<<8)
+	call	DriveXlate_ConvertDriveNumberFromDLtoDriveLetter
 	jmp		HotkeyBar_StoreHotkeyToBootvarsForDriveLetterInDL
 
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm	(revision 491)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm	(revision 492)
@@ -107,5 +107,5 @@
 .InitializeDriveTranslationAndReturn:
 	pop		es
-%ifdef MODULE_HOTKEYS
+%ifdef MODULE_DRIVEXLATE
 	jmp		DriveXlate_Reset
 %else
@@ -164,5 +164,5 @@
 ;		AX:		Total hard disk count
 ;	Corrupts registers:
-;		CX
+;		BX
 ;--------------------------------------------------------------------
 %ifdef MODULE_BOOT_MENU
@@ -171,6 +171,6 @@
 	push	ds
 	LOAD_BDA_SEGMENT_TO	ds, cx
-	mov		cl, [BDA.bHDCount]
-	MAX_U	al, cl
+	mov		bl, [BDA.bHDCount]
+	MAX_U	al, bl
 	pop		ds
 	ret
