Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm	(revision 596)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm	(revision 597)
@@ -199,9 +199,9 @@
 	call	DriveXlate_Reset					; Clean up any drive mappings before Rom Boot
 %endif
-	clc
-	;; fall through to Int19h_JumpToBootSectorOrRomBoot
-
-;--------------------------------------------------------------------
-; Int19h_JumpToBootSectorOrRomBoot
+	stc
+	;; fall through to Int19h_JumpToBootSectorInESBXOrRomBoot
+
+;--------------------------------------------------------------------
+; Int19h_JumpToBootSectorInESBXOrRomBoot
 ;
 ; Switches back to the POST stack, clears the DS and ES registers,
@@ -211,17 +211,18 @@
 ;	Parameters:
 ;		DL:		Drive to boot from (translated, 00h or 80h)
-;		CF:		Set for Boot Sector Boot
-;				Clear for ROM Boot
-;		ES:BX:	(if CF set) Ptr to boot sector (ES = zero)
+;		CF:		Clear for Boot Sector Boot
+;				Set for ROM Boot
+;		ES:BX:	(if CF clear) Ptr to boot sector (ES = zero)
 ;
 ;	Returns:
 ;		Never returns
 ;--------------------------------------------------------------------
-Int19h_JumpToBootSectorOrRomBoot:
-	mov		ax, es		; Preserve MBR segment (can't push because of stack change)
-						; NOTE: can't use XOR (LOAD_BDA_SEGMENT_TO) as it impacts CF
+Int19h_JumpToBootSectorInESBXOrRomBoot:
+	mov		ax, es		; Clear AX. NOTE: can't use XOR (LOAD_BDA_SEGMENT_TO) as it impacts CF
 	SWITCH_BACK_TO_POST_STACK
 
 ; clear segment registers before boot sector or rom call
+Int19h_JumpToBootSectorInESBXOrRomBootWithoutStackChange:
+	mov		ax, es		; Clear AX and preserve CF
 	mov		ds, ax
 %ifdef USE_386
@@ -229,8 +230,8 @@
 	mov		gs, ax
 %endif
-	jnc		SHORT .RomBoot
+	jc		SHORT .RomBoot
 
 ; jump to boot sector
-	push	ax			; sgment address for MBR
+	push	es			; sgment address for MBR
 	push	bx			; offset address for MBR
 	retf				; NOTE:	DL is set to the drive number
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm	(revision 596)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm	(revision 597)
@@ -59,6 +59,6 @@
 	jne		SHORT .FirstHardDiskSectorNotBootable
 .AlwaysBootFromFloppyDriveForBooterGames:
-	stc		; Boot Sector loaded successfully
-	jmp		SHORT Int19h_JumpToBootSectorOrRomBoot
+	clc		; Boot Sector loaded successfully
+	jmp		SHORT Int19h_JumpToBootSectorInESBXOrRomBoot
 
 .FirstHardDiskSectorNotBootable:
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/Int19hReset.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/Int19hReset.asm	(revision 596)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/Int19hReset.asm	(revision 597)
@@ -38,16 +38,6 @@
 	call	BootSector_LoadFirstSectorFromDriveDL
 	jc		SHORT .Reboot
-
-	xor		ax, ax
-	mov		ds, ax
-%ifdef USE_386
-	mov		fs, ax
-	mov		gs, ax
-%endif
 	cmp		WORD [bx+510], 0AA55h	; Valid boot sector?
-	jne		SHORT .Reboot
-	push	es						; Zero
-	push	bx
-	retf
+	je		SHORT Int19h_JumpToBootSectorInESBXOrRomBootWithoutStackChange
 
 	; Do warm reset since boot from floppy drive failed
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 596)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 597)
@@ -118,7 +118,10 @@
 		jnz		SHORT .ClearBdaDriveCount		; Unsupported BIOS, use plan B
 
-		; Now we can alter CMOS location 12h
+		; Now we can alter CMOS location 12h. Important! We set type for drive 1
+		; (primary slave) and not for drive 0! Award BIOS locks if we set drive 0 type to Fh.
+		; We cannot set it to less either since that will fully set predefined hard drive type to the BIOS.
+		; Windows 95 only cares that the CMOS location 12h is non-zero.
 		mov		dl, HARD_DISK_TYPES
-		mov		al, 0F0h	; Drive 0 type 16...47 but Windows doesn't care as long as this is not zero
+		mov		al, 0Fh	; Drive 1 type 16...47 (defined elsewhere in the CMOS)
 		call	CMOS_WriteALtoIndexInDL
 		call	CMOS_StoreNewChecksumFor10hto2Dh
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/.project
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/.project	(revision 597)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/.project	(revision 597)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>XTIDE_Universal_BIOS_Configurator_v2</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
+			<triggers>full,incremental,</triggers>
+			<arguments>
+				<dictionary>
+					<key>LaunchConfigHandle</key>
+					<value>&lt;project&gt;/.externalToolBuilders/Build Configurator v2.launch</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+	</natures>
+</projectDescription>
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm	(revision 596)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm	(revision 597)
@@ -26,5 +26,5 @@
 	at	MENUPAGE.fnEnter,			dw	BootMenuSettingsMenu_EnterMenuOrModifyItemVisibility
 	at	MENUPAGE.fnBack,			dw	ConfigurationMenu_EnterMenuOrModifyItemVisibility
-	at	MENUPAGE.wMenuitems,		dw	7
+	at	MENUPAGE.wMenuitems,		dw	8
 iend
 
@@ -134,4 +134,21 @@
 	at	MENUITEM.itemValue + ITEM_VALUE.wMaxValue,					dw	1092
 iend
+
+g_MenuitemBootMnuStngsClearBdaDriveCount:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemClearBdaDriveCount
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoClearBdaDriveCount
+	at	MENUITEM.szHelp,			dw	g_szHelpClearBdaDriveCount
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_FLAGVALUE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_MULTICHOICE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	ROMVARS.wFlags
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgClearBdaDriveCount
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoice,				dw	g_szMultichoiceBooleanFlag
+	at	MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup,	dw	g_rgszValueToStringLookupForFlagBooleans
+	at	MENUITEM.itemValue + ITEM_VALUE.wValueBitmask,				dw	FLG_ROMVARS_IGNORE_MOTHERBOARD_DRIVES
+iend
+
 
 g_rgwChoiceToValueLookupForDisplayModes:
@@ -241,4 +258,5 @@
 	call	.EnableOrDisableColorThemeSelection
 	call	.EnableOrDisableBootMenuSelectionTimeout
+	call	.EnableOrDisableClearBdaDriveCount
 	mov		si, g_MenupageForBootMenuSettingsMenu
 	jmp		Menupage_ChangeToNewMenupageInDSSI
@@ -310,4 +328,21 @@
 	mov		bx, g_MenuitemBootMnuStngsSelectionTimeout
 	test	ax, FLG_ROMVARS_MODULE_BOOT_MENU
+	jmp		SHORT .DisableMenuitemFromCSBXifZFset
+
+
+;--------------------------------------------------------------------
+; .EnableOrDisableClearBdaDriveCount
+;	Parameters:
+;		AX:		ROMVARS.wFlags
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		BX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableOrDisableClearBdaDriveCount:
+	mov		bx, g_MenuitemBootMnuStngsClearBdaDriveCount
+	call	Buffers_IsXTbuildLoaded
 .DisableMenuitemFromCSBXifZFset:
 	jz		SHORT .DisableMenuitemFromCSBX
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm	(revision 596)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm	(revision 597)
@@ -426,4 +426,5 @@
 g_szItemBootFloppyDrvs:	db	"Number of Floppy Drives",NULL
 g_szItemSerialDetect:	db	"Scan for Serial Drives",NULL
+g_szItemClearBdaDriveCount:	db  "Remove other hard drives",NULL
 
 g_szDlgBootTimeout:		db	"Enter Boot Menu selection timeout in BIOS timer ticks (2...1092).",NULL
@@ -433,4 +434,5 @@
 g_szDlgBootFloppyDrvs:	db	"Select number of Floppy Drives in system.",NULL
 g_szDlgSerialDetect:	db	"Scan for serial drives?",NULL
+g_szDlgClearBdaDriveCount:	db  "Remove existing INT 13h hard drives during drive detection?",NULL
 
 g_szNfoBootTimeout:		db	"Menu item selection timeout in BIOS timer ticks. 1 tick = 54.9 ms.",NULL
@@ -441,4 +443,5 @@
 g_szNfoSerialDetect:	db	"Scans all standard COM ports for serial drives."
 						db	" This can also be invoked by holding down ALT at the end of normal drive detection.",NULL
+g_szNfoClearBdaDriveCount:	db  "Can be used to remove duplicate hard drives.",NULL
 
 g_szHelpBootTimeout:	db	"Boot Menu selection timeout in BIOS timer ticks (1 second = 18.2 ticks)."
@@ -460,4 +463,6 @@
 						db	" of normal drive detection. Note that if any serial drives are detected during the normal drive detection,"
 						db	" no scan will take place (to avoid finding the same drive twice).",NULL
+g_szHelpClearBdaDriveCount:	db  "Set to NO for normal operation. Set to YES to get Windows 95 drivers to work when "
+							db  "MODULE_WIN95_CMOS_HACK is not included (dummy drive needs to be defined in system BIOS setup).",NULL
 
 g_szMultichoiceBootDispMode:	db	"Default",LF
