Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm	(revision 280)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm	(revision 286)
@@ -178,4 +178,5 @@
 	dw	DEVICE_32BIT_ATA
 	dw	DEVICE_SERIAL_PORT
+	dw	DEVICE_JRIDE_ISA
 g_rgszValueToStringLookupForDevice:
 	dw	g_szValueCfgDeviceDual8b
@@ -185,4 +186,5 @@
 	dw	g_szValueCfgDevice32b
 	dw	g_szValueCfgDeviceSerial
+	dw	g_szValueCfgDeviceJrIdeIsa
 
 g_rgbChoiceToValueLookupForCOM:
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MasterSlaveMenu.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MasterSlaveMenu.asm	(revision 280)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MasterSlaveMenu.asm	(revision 286)
@@ -10,5 +10,5 @@
 	at	MENUPAGE.fnEnter,			dw	MasterSlaveMenu_EnterMenuOrModifyItemVisibility
 	at	MENUPAGE.fnBack,			dw	IdeControllerMenu_EnterMenuOrModifyItemVisibility
-	at	MENUPAGE.wMenuitems,		dw	6
+	at	MENUPAGE.wMenuitems,		dw	9
 iend
 
@@ -39,4 +39,21 @@
 iend
 
+g_MenuitemMasterSlaveWriteCache:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromUnshiftedItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemDrvWriteCache
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoDrvWriteCache
+	at	MENUITEM.szHelp,			dw	g_szHelpDrvWriteCache
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE | FLG_MENUITEM_MASKVALUE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_MULTICHOICE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	NULL
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgDrvWriteCache
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoice,				dw	g_szMultichoiseWrCache
+	at	MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup,		dw	g_rgwChoiceToValueLookupForWriteCache
+	at	MENUITEM.itemValue + ITEM_VALUE.rgszChoiceToStringLookup,	dw	g_rgszChoiceToStringLookupForWriteCache
+	at	MENUITEM.itemValue + ITEM_VALUE.wValueBitmask,				dw	MASK_DRVPARAMS_WRITECACHE
+iend
+
 g_MenuitemMasterSlaveUserCHS:
 istruc MENUITEM
@@ -100,4 +117,48 @@
 iend
 
+g_MenuitemMasterSlaveUserLBA:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemDrvUserLBA
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoDrvUserLBA
+	at	MENUITEM.szHelp,			dw	g_szHelpDrvUserLBA
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE | FLG_MENUITEM_MODIFY_MENU | FLG_MENUITEM_FLAGVALUE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_MULTICHOICE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	NULL
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgDrvUserLBA
+	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_DRVPARAMS_USERLBA
+iend
+
+g_MenuitemMasterSlaveUserLbaValue:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateUnsignedInputForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemDrvLbaSectors
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoDrvLbaSectors
+	at	MENUITEM.szHelp,			dw	g_szNfoDrvLbaSectors
+	at	MENUITEM.bFlags,			db	NULL
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_UNSIGNED
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	NULL
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgDrvLbaSectors
+	at	MENUITEM.itemValue + ITEM_VALUE.wMinValue,					dw	((16383*16*63) / (1024 * 1024)) + 1	; One sector over 8.4 GB
+	at	MENUITEM.itemValue + ITEM_VALUE.wMaxValue,					dw	10000000h / (1024 * 1024)	; Limit to 28-bit LBA
+	at	MENUITEM.itemValue + ITEM_VALUE.fnValueReader,				dw	ValueReaderForUserLbaValue
+	at	MENUITEM.itemValue + ITEM_VALUE.fnValueWriter,				dw	ValueWriterForUserLbaValue
+iend
+
+
+g_rgwChoiceToValueLookupForWriteCache:
+	dw	DEFAULT_WRITE_CACHE
+	dw	DISABLE_WRITE_CACHE
+	dw	ENABLE_WRITE_CACHE
+
+g_rgszChoiceToStringLookupForWriteCache:
+	dw	g_szValueBootDispModeDefault
+	dw	g_szValueDrvWrCaDis
+	dw	g_szValueDrvWrCaEn
+
 
 ; Section containing code
@@ -117,5 +178,7 @@
 	lea		ax, [bx+DRVPARAMS.wFlags]
 	mov		[cs:g_MenuitemMasterSlaveBlockModeTransfers+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+	mov		[cs:g_MenuitemMasterSlaveWriteCache+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
 	mov		[cs:g_MenuitemMasterSlaveUserCHS+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+	mov		[cs:g_MenuitemMasterSlaveUserLBA+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
 
 	lea		ax, [bx+DRVPARAMS.wCylinders]
@@ -127,4 +190,7 @@
 	lea		ax, [bx+DRVPARAMS.bSect]
 	mov		[cs:g_MenuitemMasterSlaveSectors+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+
+	lea		ax, [bx+DRVPARAMS.dwMaximumLBA]
+	mov		[cs:g_MenuitemMasterSlaveUserLbaValue+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
 	ret
 
@@ -143,7 +209,49 @@
 	push	cs
 	pop		ds
+	call	.EnableOrDisableUserCHSandLBA
 	call	.EnableOrDisableCHandS
+	call	.EnableOrDisableUserLbaValue
 	mov		si, g_MenupageForMasterSlaveMenu
 	jmp		Menupage_ChangeToNewMenupageInDSSI
+
+
+;--------------------------------------------------------------------
+; .EnableOrDisableUserCHSandLBA
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableOrDisableUserCHSandLBA:
+	mov		bx, [g_MenuitemMasterSlaveUserLBA+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
+	call	Buffers_GetRomvarsValueToAXfromOffsetInBX
+	test	ax, FLG_DRVPARAMS_USERLBA
+	jnz		SHORT .DisableCHSandEnableLBA
+	test	ax, FLG_DRVPARAMS_USERCHS
+	jnz		SHORT .EnableCHSandDisableLBA
+
+	; Enable both
+	mov		bx, g_MenuitemMasterSlaveUserCHS
+	call	.EnableMenuitemFromCSBX
+	mov		bx, g_MenuitemMasterSlaveUserLBA
+	jmp		.EnableMenuitemFromCSBX	
+
+ALIGN JUMP_ALIGN
+.EnableCHSandDisableLBA:
+	mov		bx, g_MenuitemMasterSlaveUserCHS
+	call	.EnableMenuitemFromCSBX
+	mov		bx, g_MenuitemMasterSlaveUserLBA
+	jmp		.DisableMenuitemFromCSBX	
+
+ALIGN JUMP_ALIGN
+.DisableCHSandEnableLBA:
+	mov		bx, g_MenuitemMasterSlaveUserLBA
+	call	.EnableMenuitemFromCSBX
+	mov		bx, g_MenuitemMasterSlaveUserCHS
+	jmp		.DisableMenuitemFromCSBX	
+
 
 ;--------------------------------------------------------------------
@@ -162,4 +270,6 @@
 	test	ax, FLG_DRVPARAMS_USERCHS
 	jz		SHORT .DisableCHandS
+	test	ax, FLG_DRVPARAMS_USERLBA
+	jnz		SHORT .DisableCHandS
 
 	mov		bx, g_MenuitemMasterSlaveCylinders
@@ -168,6 +278,5 @@
 	call	.EnableMenuitemFromCSBX
 	mov		bx, g_MenuitemMasterSlaveSectors
-	call	.EnableMenuitemFromCSBX
-	ret
+	jmp		SHORT .EnableMenuitemFromCSBX
 
 ALIGN JUMP_ALIGN
@@ -178,6 +287,27 @@
 	call	.DisableMenuitemFromCSBX
 	mov		bx, g_MenuitemMasterSlaveSectors
-	call	.DisableMenuitemFromCSBX
-	ret
+	jmp		SHORT .DisableMenuitemFromCSBX
+
+
+;--------------------------------------------------------------------
+; .EnableOrDisableUserLbaValue
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableOrDisableUserLbaValue:
+	mov		bx, [cs:g_MenuitemMasterSlaveUserLBA+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
+	call	Buffers_GetRomvarsValueToAXfromOffsetInBX
+	mov		bx, g_MenuitemMasterSlaveUserLbaValue
+	test	ax, FLG_DRVPARAMS_USERCHS
+	jnz		SHORT .DisableMenuitemFromCSBX
+	test	ax, FLG_DRVPARAMS_USERLBA
+	jz		SHORT .DisableMenuitemFromCSBX
+	jmp		SHORT .EnableMenuitemFromCSBX
+
 
 ;--------------------------------------------------------------------
@@ -200,2 +330,39 @@
 	and		BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
 	ret
+
+
+;--------------------------------------------------------------------
+; MENUITEM value reader functions
+;	Parameters:
+;		AX:		Value from MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset
+;		DS:SI:	Ptr to MENUITEM
+;		ES:DI:	Ptr to value variable
+;	Returns:
+;		AX:		Value with possible modifications
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+ValueReaderForUserLbaValue:
+	mov		ax, [es:di+2]		; SHR 16
+	eSHIFT_IM ax, 4, shr		; SHR 16 + 4 = 20
+	ret
+
+
+;--------------------------------------------------------------------
+; MENUITEM value writer functions
+;	Parameters:
+;		AX:		Value to be written to MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset
+;		DS:SI:	Ptr to MENUITEM
+;		ES:DI:	Ptr to value variable
+;	Returns:
+;		AX:		Value to be stored
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+ValueWriterForUserLbaValue:
+	eSHIFT_IM ax, 4, shl
+	mov		[es:di+2], ax
+	xor		ax, ax		; Store zero to [es:di]
+	ret
