Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/MenuCfg.inc
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/MenuCfg.inc	(revision 58)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/MenuCfg.inc	(revision 59)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Universal BIOS Configurator v2
 ; Created date	:	5.10.2010
-; Last update	:	5.10.2010
+; Last update	:	18.10.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Menu configuration.
@@ -14,4 +14,5 @@
 
 
+KEY_BACK_TO_PREVIOUS_MENU	EQU		ESC
 KEY_DISPLAY_ITEM_HELP		EQU		3Bh		; F1
 
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/MenuStructs.inc
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/MenuStructs.inc	(revision 58)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/MenuStructs.inc	(revision 59)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Universal BIOS Configurator v2
 ; Created date	:	5.10.2010
-; Last update	:	2.11.2010
+; Last update	:	18.11.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Menu page and item structs.
@@ -10,4 +10,5 @@
 struc MENUPAGE
 	.fnEnter			resb	2	; Function to initialize MENUPAGE
+	.fnBack				resb	2	; Function to initialize previous MENUPAGE
 	.wMenuitems			resb	2	; Number of MENUITEM structs
 	.rgMenuitem:					; All MENUITEM structs in this MENUPAGE
@@ -32,4 +33,5 @@
 FLG_MENUITEM_FLAGVALUE		EQU	(1<<2)	; Item value is single bit
 FLG_MENUITEM_BYTEVALUE		EQU	(1<<3)	; Item value is single byte
+FLG_MENUITEM_PROGRAMVAR		EQU	(1<<4)	; Item is for configuring program, not BIOS
 
 ; Values for MENUITEM.bType
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Variables.inc
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Variables.inc	(revision 58)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Variables.inc	(revision 59)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Univeral BIOS Configurator v2
 ; Created date	:	5.10.2010
-; Last update	:	1.11.2010
+; Last update	:	19.11.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Global variables for configuration program.
@@ -22,6 +22,8 @@
 	.wImageSize			resb	2			; Size in bytes for BIOS image to be flashed (0=65536)
 	.wEepromSegment		resb	2			; Segment where EEPROM is located
-	.bPageSize			resb	1			; EEPROM page size in bytes
+	.bEepromType		resb	1			; EEPROM type
+	.bEepromPageSize	resb	1			; EEPROM page size in bytes
 	.bSdpCommand		resb	1			; Command for Software Data Protection
+						resb	1
 	.szOpenedFile		resb	FILENAME_BUFFER_SIZE
 	.flashVars			resb	FLASHVARS_size
@@ -34,14 +36,37 @@
 FLG_CFGVARS_CHECKSUM	EQU		(1<<3)	; Generate checksum byte
 
-; SDP command for CFGVARS.bSdpCommand
-CMD_SDP_NONE			EQU		(0<<1)	; Do not use any SDP command
-CMD_SDP_ENABLE			EQU		(1<<1)	; Flash with SDP enable command
-CMD_SDP_DISABLE			EQU		(2<<1)	; Flash with SDP disable command
+; EEPROM types
+struc EEPROM_TYPE
+	.2816_2kiB			resb	2
+	.2832_4kiB			resb	2
+	.2864_8kiB			resb	2
+	.28128_16kiB		resb	2
+	.28256_32kiB		resb	2
+	.28512_64kiB		resb	2
+endstruc
+
+; Software Data Protection commands
+struc SDP_COMMAND
+	.none				resb	2	; Do not use any SDP command
+	.enable				resb	2	; Flash with SDP enable command
+	.disable			resb	2	; Flash with SDP disable command
+endstruc
+
+; Page sizes
+struc EEPROM_PAGE_SIZE
+	.1_byte				resb	2
+	.2_bytes			resb	2
+	.4_bytes			resb	2
+	.8_bytes			resb	2
+	.16_bytes			resb	2
+	.32_bytes			resb	2
+	.64_bytes			resb	2
+endstruc
 
 ; Default CFGVARS settings
 DEFAULT_CFGVARS_FLAGS	EQU		FLG_CFGVARS_CHECKSUM
 DEFAULT_EEPROM_SEGMENT	EQU		0D000h
-DEFAULT_PAGE_SIZE		EQU		1
-DEFAULT_SDP_COMMAND		EQU		CMD_SDP_ENABLE
+DEFAULT_PAGE_SIZE		EQU		EEPROM_PAGE_SIZE.1_byte
+DEFAULT_SDP_COMMAND		EQU		SDP_COMMAND.enable
 
 
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm	(revision 58)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm	(revision 59)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Universal BIOS Configurator v2
 ; Created date	:	6.10.2010
-; Last update	:	10.10.2010
+; Last update	:	19.11.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Functions for accessing file and flash buffers.
@@ -181,4 +181,27 @@
 
 ;--------------------------------------------------------------------
+; Buffers_SaveChangesIfFileLoaded
+;	Parameters:
+;		Nothing
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, CX, SI, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Buffers_SaveChangesIfFileLoaded:
+	mov		ax, [cs:g_cfgVars+CFGVARS.wFlags]
+	and		ax, BYTE (FLG_CFGVARS_FILELOADED | FLG_CFGVARS_UNSAVED)
+	cmp		ax, BYTE (FLG_CFGVARS_FILELOADED | FLG_CFGVARS_UNSAVED)
+	jne		SHORT .NothingToSave
+	call	Dialogs_DisplaySaveChangesDialog
+	jnz		SHORT .NothingToSave
+	jmp		BiosFile_SaveUnsavedChanges
+ALIGN JUMP_ALIGN
+.NothingToSave:
+	ret
+
+
+;--------------------------------------------------------------------
 ; Buffers_GenerateChecksum
 ;	Parameters:
@@ -210,4 +233,18 @@
 
 ;--------------------------------------------------------------------
+; Buffers_GetRomvarsFlagsToAX
+;	Parameters:
+;		Nothing
+;	Returns:
+;		AX:		ROMVARS.wFlags
+;	Corrupts registers:
+;		BX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Buffers_GetRomvarsFlagsToAX:
+	mov		bx, ROMVARS.wFlags
+	; Fall to Buffers_GetRomvarsValueToAXfromOffsetInBX
+
+;--------------------------------------------------------------------
 ; Buffers_GetRomvarsValueToAXfromOffsetInBX
 ;	Parameters:
@@ -241,4 +278,11 @@
 ALIGN JUMP_ALIGN
 Buffers_GetFileDialogItemBufferToESDI:
+	call	Buffers_GetFileBufferToESDI
+	push	di
+	mov		di, es
+	add		di, 1000h		; Third 64k page
+	mov		es, di
+	pop		di
+	ret
 Buffers_GetFileBufferToESDI:
 	mov		di, cs
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Dialogs.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Dialogs.asm	(revision 58)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Dialogs.asm	(revision 59)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Univeral BIOS Configurator v2
 ; Created date	:	10.10.2010
-; Last update	:	10.10.2010
+; Last update	:	19.11.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Functions for displaying dialogs.
@@ -80,21 +80,4 @@
 	ret
 
-;--------------------------------------------------------------------
-; InitializeDialogInputFromDSSI
-;	Parameters:
-;		DS:SI:	Ptr to DIALOG_INPUT
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		Nothing
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-InitializeDialogInputFromDSSI:
-	mov		[si+DIALOG_INPUT.fszTitle+2], cs
-	mov		[si+DIALOG_INPUT.fszItems+2], cs
-	mov		WORD [si+DIALOG_INPUT.fszInfo], g_szGenericDialogInfo
-	mov		[si+DIALOG_INPUT.fszInfo+2], cs
-	ret
-
 
 ;--------------------------------------------------------------------
@@ -124,2 +107,65 @@
 	pop		es
 	ret
+
+
+;--------------------------------------------------------------------
+; Dialogs_DisplayQuitDialog
+; Dialogs_DisplaySaveChangesDialog
+;	Parameters:
+;		Nothing
+;	Returns:
+;		ZF:		Set if user wants to do the action
+;				Cleared if user wants to cancel
+;	Corrupts registers:
+;		AX, CX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Dialogs_DisplayQuitDialog:
+	push	ds
+
+	mov		cx, DIALOG_INPUT_size
+	call	Memory_ReserveCXbytesFromStackToDSSI
+	call	InitializeDialogInputFromDSSI
+	mov		WORD [si+DIALOG_INPUT.fszTitle], g_szDlgExitToDos
+	mov		WORD [si+DIALOG_INPUT.fszItems], g_szMultichoiseBooleanFlag
+	CALL_MENU_LIBRARY GetSelectionToAXwithInputInDSSI
+	add		sp, BYTE DIALOG_INPUT_size
+	cmp		ax, BYTE 1		; 1 = YES
+
+	pop		ds
+	ret
+
+
+ALIGN JUMP_ALIGN
+Dialogs_DisplaySaveChangesDialog:
+	push	ds
+
+	mov		cx, DIALOG_INPUT_size
+	call	Memory_ReserveCXbytesFromStackToDSSI
+	call	InitializeDialogInputFromDSSI
+	mov		WORD [si+DIALOG_INPUT.fszTitle], g_szDlgSaveChanges
+	mov		WORD [si+DIALOG_INPUT.fszItems], g_szMultichoiseBooleanFlag
+	CALL_MENU_LIBRARY GetSelectionToAXwithInputInDSSI
+	add		sp, BYTE DIALOG_INPUT_size
+	cmp		ax, BYTE 1		; 1 = YES
+
+	pop		ds
+	ret
+
+
+;--------------------------------------------------------------------
+; InitializeDialogInputFromDSSI
+;	Parameters:
+;		DS:SI:	Ptr to DIALOG_INPUT
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+InitializeDialogInputFromDSSI:
+	mov		[si+DIALOG_INPUT.fszTitle+2], cs
+	mov		[si+DIALOG_INPUT.fszItems+2], cs
+	mov		WORD [si+DIALOG_INPUT.fszInfo], g_szGenericDialogInfo
+	mov		[si+DIALOG_INPUT.fszInfo+2], cs
+	ret
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm	(revision 58)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm	(revision 59)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Univeral BIOS Configurator v2
 ; Created date	:	5.10.2010
-; Last update	:	3.11.2010
+; Last update	:	19.11.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Program start and exit.			
@@ -39,5 +39,7 @@
 %include "Strings.asm"
 
+%include "BootMenuSettingsMenu.asm"
 %include "ConfigurationMenu.asm"
+%include "FlashMenu.asm"
 %include "IdeControllerMenu.asm"
 %include "MainMenu.asm"
@@ -91,9 +93,9 @@
 g_cfgVars:
 istruc CFGVARS
-	at	CFGVARS.pMenupage,		dw	g_MenupageForMainMenu
-	at	CFGVARS.wFlags,			dw	DEFAULT_CFGVARS_FLAGS
-	at	CFGVARS.wEepromSegment,	dw	DEFAULT_EEPROM_SEGMENT
-	at	CFGVARS.bPageSize,		db	DEFAULT_PAGE_SIZE
-	at	CFGVARS.bSdpCommand,	db	DEFAULT_SDP_COMMAND
+	at	CFGVARS.pMenupage,			dw	g_MenupageForMainMenu
+	at	CFGVARS.wFlags,				dw	DEFAULT_CFGVARS_FLAGS
+	at	CFGVARS.wEepromSegment,		dw	DEFAULT_EEPROM_SEGMENT
+	at	CFGVARS.bEepromPageSize,	db	DEFAULT_PAGE_SIZE
+	at	CFGVARS.bSdpCommand,		db	DEFAULT_SDP_COMMAND
 iend
 
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuEvents.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuEvents.asm	(revision 58)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuEvents.asm	(revision 59)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Universal BIOS Configurator v2
 ; Created date	:	5.10.2010
-; Last update	:	6.10.2010
+; Last update	:	18.10.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Menu event handling.
@@ -20,6 +20,4 @@
 ALIGN JUMP_ALIGN
 MenuEvents_DisplayMenu:
-	mov		ax, g_MenupageForMainMenu
-	mov		dx, ds
 	mov		bx, MenuEventHandler
 	CALL_MENU_LIBRARY DisplayWithHandlerInBXandUserDataInDXAX
@@ -88,6 +86,25 @@
 ; Parameters:
 ;	None
+; Returns:
+;	CF:		Set to exit menu
+;			Clear to cancel exit
 ALIGN JUMP_ALIGN
 .ExitMenu:
+	call	Menupage_GetActiveMenupageToDSDI
+	mov		si, [di+MENUPAGE.fnBack]
+	cmp		si, ExitToDos
+	je		SHORT .QuitProgram
+	call	si					; Back to previous menu
+	clc
+	ret
+
+ALIGN JUMP_ALIGN
+.QuitProgram:
+	call	Dialogs_DisplayQuitDialog
+	jz		SHORT .ExitToDOS
+	clc
+	ret
+.ExitToDOS:
+	call	Buffers_SaveChangesIfFileLoaded
 	stc
 	ret
@@ -122,6 +139,9 @@
 .KeyStrokeInAX:
 	cmp		ah, KEY_DISPLAY_ITEM_HELP
-	jne		SHORT .EventNotHandled
-
+	je		SHORT .DisplayHelp
+	jmp		SHORT .EventNotHandled
+
+ALIGN JUMP_ALIGN
+.DisplayHelp:
 	call	Menupage_GetActiveMenupageToDSDI
 	CALL_MENU_LIBRARY GetHighlightedItemToAX
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menuitem.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menuitem.asm	(revision 58)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menuitem.asm	(revision 59)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Universal BIOS Configurator v2
 ; Created date	:	5.10.2010
-; Last update	:	2.11.2010
+; Last update	:	19.11.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Functions for accessing MENUITEM structs.
@@ -8,26 +8,4 @@
 ; Section containing code
 SECTION .text
-
-;--------------------------------------------------------------------
-; Menuitem_SetVisibleFromDSSI
-; Menuitem_SetInvisibleFromDSSI
-;	Parameters:
-;		DS:SI:	Ptr to MENUITEM
-;	Returns: (Menuitem_IsVisibleFromDSSI only)
-;		ZF:		Clear if visible
-;				Set if not visible
-;	Corrupts registers:
-;		Nothing
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-Menuitem_SetVisibleFromDSSI:
-	or		BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
-	ret
-
-ALIGN JUMP_ALIGN
-Menuitem_SetInvisibleFromDSSI:
-	and		BYTE [si+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
-	ret
-
 
 ;--------------------------------------------------------------------
@@ -173,5 +151,5 @@
 	ja		SHORT .InvalidItemType
 
-	call	Buffers_GetFileBufferToESDI
+	call	GetConfigurationBufferToESDIforMenuitemInDSSI
 	add		di, [si+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
 	jmp		[cs:bx+.rgfnJumpToStoreValueBasedOnItemType]
@@ -259,5 +237,8 @@
 ALIGN JUMP_ALIGN
 .SetUnsavedChanges:
+	test	BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_PROGRAMVAR
+	jnz		SHORT .NoUnsavedChangesForProgramVariables
 	call	Buffers_SetUnsavedChanges
+.NoUnsavedChangesForProgramVariables:
 	test	BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_MODIFY_MENU
 	jnz		SHORT .ModifyItemVisibility
@@ -291,6 +272,5 @@
 ALIGN JUMP_ALIGN
 Menuitem_GetValueToAXfromMenuitemInDSSI:
-	mov		bx, [si+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
-	call	Buffers_GetRomvarsValueToAXfromOffsetInBX
+	call	.GetMenuitemValueToAX
 	test	BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_BYTEVALUE
 	jnz		SHORT .ConvertWordToByteValue
@@ -300,4 +280,15 @@
 
 ALIGN JUMP_ALIGN
+.GetMenuitemValueToAX:
+	push	es
+	push	di
+	call	GetConfigurationBufferToESDIforMenuitemInDSSI
+	add		di, [si+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
+	mov		ax, [es:di]
+	pop		di
+	pop		es
+	ret
+
+ALIGN JUMP_ALIGN
 .ConvertWordToByteValue:
 	xor		ah, ah
@@ -314,2 +305,24 @@
 	mov		ax, TRUE<<1		; Shift for lookup
 	ret
+
+
+;--------------------------------------------------------------------
+; GetConfigurationBufferToESDIforMenuitemInDSSI
+;	Parameters:
+;		DS:SI:	Ptr to MENUITEM
+;	Returns:
+;		ES:DI:	Ptr to configuration buffer
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+GetConfigurationBufferToESDIforMenuitemInDSSI:
+	test	BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_PROGRAMVAR
+	jnz		SHORT .ReturnCfgvarsInESDI
+	jmp		Buffers_GetFileBufferToESDI
+ALIGN JUMP_ALIGN
+.ReturnCfgvarsInESDI:
+	push	cs
+	pop		es
+	mov		di, g_cfgVars
+	ret
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuitemPrint.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuitemPrint.asm	(revision 58)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuitemPrint.asm	(revision 59)
@@ -139,26 +139,46 @@
 	pop		si
 	ret
-	
+
+
+;--------------------------------------------------------------------
+; MenuitemPrint_WriteLookupValueStringToBufferInESDIfromUnshiftedItemInDSSI
+; MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
+;	Parameters:
+;		DS:SI:	Ptr to MENUITEM
+;		ES:DI:	Ptr to destination buffer
+;	Returns:
+;		DI:		Updated
+;	Corrupts registers:
+;		AX, BX, CX
+;--------------------------------------------------------------------	
+ALIGN JUMP_ALIGN
+MenuitemPrint_WriteLookupValueStringToBufferInESDIfromUnshiftedItemInDSSI:
+	call	Menuitem_GetValueToAXfromMenuitemInDSSI
+	shl		ax, 1
+	jmp		SHORT PrintLookupValueFromAXtoBufferInESDI
+
+ALIGN JUMP_ALIGN
+MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI:
+	call	Menuitem_GetValueToAXfromMenuitemInDSSI
+	; Fall to PrintLookupValueFromAXtoBufferInESDI
 
 ;--------------------------------------------------------------------
 ; MenuitemPrint_WriteLookupValueStringToBufferInESDIfromItemInDSSI
 ;	Parameters:
-;		DS:SI:	Ptr to MENUITEM
-;		ES:DI:	Ptr to destination buffer
-;	Returns:
-;		DI:		Updated
-;	Corrupts registers:
-;		AX, BX, CX
-;--------------------------------------------------------------------	
-ALIGN JUMP_ALIGN
-MenuitemPrint_WriteLookupValueStringToBufferInESDIfromItemInDSSI:
-	push	si
-
-	call	Menuitem_GetValueToAXfromMenuitemInDSSI
+;		AX:		Value to print
+;		DS:SI:	Ptr to MENUITEM
+;		ES:DI:	Ptr to destination buffer
+;	Returns:
+;		DI:		Updated
+;	Corrupts registers:
+;		AX, BX, CX
+;--------------------------------------------------------------------	
+ALIGN JUMP_ALIGN
+PrintLookupValueFromAXtoBufferInESDI:
+	push	si
 	add		ax, [si+MENUITEM.itemValue+ITEM_VALUE.rgszValueToStringLookup]
 	xchg	bx, ax
 	mov		si, [bx]
 	call	String_CopyDSSItoESDIandGetLengthToCX
-
 	pop		si
 	ret
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm	(revision 59)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm	(revision 59)
@@ -0,0 +1,138 @@
+; File name		:	BootMenuSettingsMenu.asm
+; Project name	:	XTIDE Universal BIOS Configurator v2
+; Created date	:	18.11.2010
+; Last update	:	18.11.2010
+; Author		:	Tomi Tilli
+; Description	:	"Boot Menu Settings" menu structs and functions.
+
+; Section containing initialized data
+SECTION .data
+
+ALIGN WORD_ALIGN
+g_MenupageForBootMenuSettingsMenu:
+istruc MENUPAGE
+	at	MENUPAGE.fnEnter,			dw	BootMenuSettingsMenu_EnterMenuOrModifyItemVisibility
+	at	MENUPAGE.fnBack,			dw	ConfigurationMenu_EnterMenuOrModifyItemVisibility
+	at	MENUPAGE.wMenuitems,		dw	6
+iend
+
+g_MenuitemBootMnuStngsBackToConfigurationMenu:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	ConfigurationMenu_EnterMenuOrModifyItemVisibility
+	at	MENUITEM.szName,			dw	g_szItemBackToCfgMenu
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoIdeBackToCfgMenu
+	at	MENUITEM.szHelp,			dw	g_szNfoIdeBackToCfgMenu
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_PAGEBACK
+iend
+
+g_MenuitemBootMnuStngsDefaultBootDrive:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateHexInputForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteHexValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemBootDrive
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoBootDrive
+	at	MENUITEM.szHelp,			dw	g_szHelpBootDrive
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE | FLG_MENUITEM_BYTEVALUE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_HEX
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	ROMVARS.bBootDrv
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgBootDrive
+	at	MENUITEM.itemValue + ITEM_VALUE.wMinValue,					dw	0
+	at	MENUITEM.itemValue + ITEM_VALUE.wMaxValue,					dw	0FFh
+iend
+
+g_MenuitemBootMnuStngsDisplayRomBoot:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemBootRomBoot
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoBootRomBoot
+	at	MENUITEM.szHelp,			dw	g_szHelpBootRomBoot
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE | FLG_MENUITEM_FLAGVALUE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_MULTICHOISE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	ROMVARS.wFlags
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgBootRomBoot
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoise,				dw	g_szMultichoiseBooleanFlag
+	at	MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup,	dw	g_rgszValueToStringLookupForFlagBooleans
+	at	MENUITEM.itemValue + ITEM_VALUE.wValueBitmask,				dw	FLG_ROMVARS_ROMBOOT
+iend
+
+g_MenuitemBootMnuStngsFloppyDrives:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromUnshiftedItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemBootFloppyDrvs
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoBootFloppyDrvs
+	at	MENUITEM.szHelp,			dw	g_szHelpBootFloppyDrvs
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE | FLG_MENUITEM_BYTEVALUE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_MULTICHOISE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	ROMVARS.bMinFddCnt
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgBootFloppyDrvs
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoise,				dw	g_szMultichoiseBootFloppyDrvs
+	at	MENUITEM.itemValue + ITEM_VALUE.rgwChoiseToValueLookup,		dw	g_rgwChoiseToValueLookupForFloppyDrives
+	at	MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup,	dw	g_rgszValueToStringLookupForFloppyDrives
+iend
+
+g_MenuitemBootMnuStngsSelectionTimeout:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateUnsignedInputForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemBootTimeout
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoBootTimeout
+	at	MENUITEM.szHelp,			dw	g_szHelpBootTimeout
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE | FLG_MENUITEM_BYTEVALUE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_UNSIGNED
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	ROMVARS.bBootDelay
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgBootTimeout
+	at	MENUITEM.itemValue + ITEM_VALUE.wMinValue,					dw	0
+	at	MENUITEM.itemValue + ITEM_VALUE.wMaxValue,					dw	60
+iend
+
+g_MenuitemBootMnuStngsSwapBootDriveNumbers:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemBootSwap
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoBootSwap
+	at	MENUITEM.szHelp,			dw	g_szHelpBootSwap
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE | FLG_MENUITEM_FLAGVALUE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_MULTICHOISE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	ROMVARS.wFlags
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgBootSwap
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoise,				dw	g_szMultichoiseBooleanFlag
+	at	MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup,	dw	g_rgszValueToStringLookupForFlagBooleans
+	at	MENUITEM.itemValue + ITEM_VALUE.wValueBitmask,				dw	FLG_ROMVARS_DRVXLAT
+iend
+
+g_rgwChoiseToValueLookupForFloppyDrives:	; (No translation)
+	dw	0
+	dw	1
+	dw	2
+	dw	3
+	dw	4
+g_rgszValueToStringLookupForFloppyDrives:
+	dw	g_szValueBootFloppyDrvsAuto
+	dw	g_szValueBootFloppyDrvs1
+	dw	g_szValueBootFloppyDrvs2
+	dw	g_szValueBootFloppyDrvs3
+	dw	g_szValueBootFloppyDrvs4
+
+
+; Section containing code
+SECTION .text
+
+;--------------------------------------------------------------------
+; BootMenuSettingsMenu_EnterMenuOrModifyItemVisibility
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		All, except BP
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+BootMenuSettingsMenu_EnterMenuOrModifyItemVisibility:
+	push	cs
+	pop		ds
+	mov		si, g_MenupageForBootMenuSettingsMenu
+	jmp		Menupage_ChangeToNewMenupageInDSSI
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/ConfigurationMenu.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/ConfigurationMenu.asm	(revision 58)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/ConfigurationMenu.asm	(revision 59)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Universal BIOS Configurator v2
 ; Created date	:	24.10.2010
-; Last update	:	3.11.2010
+; Last update	:	18.11.2010
 ; Author		:	Tomi Tilli
 ; Description	:	"Configure XTIDE Universal BIOS" menu structs and functions.
@@ -13,4 +13,5 @@
 istruc MENUPAGE
 	at	MENUPAGE.fnEnter,			dw	ConfigurationMenu_EnterMenuOrModifyItemVisibility
+	at	MENUPAGE.fnBack,			dw	MainMenu_EnterMenuOrModifyItemVisibility
 	at	MENUPAGE.wMenuitems,		dw	11
 iend
@@ -78,5 +79,5 @@
 g_MenuitemConfigurationBootMenuSettings:
 istruc MENUITEM
-	at	MENUITEM.fnActivate,		dw	BootMenuSettings
+	at	MENUITEM.fnActivate,		dw	BootMenuSettingsMenu_EnterMenuOrModifyItemVisibility
 	at	MENUITEM.szName,			dw	g_szItemCfgBootMenu
 	at	MENUITEM.szQuickInfo,		dw	g_szNfoCfgBootMenu
@@ -89,9 +90,9 @@
 istruc MENUITEM
 	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
-	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
 	at	MENUITEM.szName,			dw	g_szItemCfgBootLoader
 	at	MENUITEM.szQuickInfo,		dw	g_szNfoCfgBootLoader
 	at	MENUITEM.szHelp,			dw	g_szNfoCfgBootLoader
-	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE | FLG_MENUITEM_BYTEVALUE
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE | FLG_MENUITEM_MODIFY_MENU | FLG_MENUITEM_BYTEVALUE
 	at	MENUITEM.bType,				db	TYPE_MENUITEM_MULTICHOISE
 	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	ROMVARS.bBootLdrType
@@ -105,5 +106,5 @@
 istruc MENUITEM
 	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
-	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
 	at	MENUITEM.szName,			dw	g_szItemCfgFullMode
 	at	MENUITEM.szQuickInfo,		dw	g_szNfoCfgFullMode
@@ -178,4 +179,5 @@
 	call	.DisableAllIdeControllerMenuitems
 	call	.EnableIdeControllerMenuitemsBasedOnConfiguration
+	call	.EnableOrDisableBootMenuSettings
 	call	.EnableOrDisableKiBtoStealFromRAM
 	call	.EnableOrDisableIdeControllerCount
@@ -229,6 +231,5 @@
 ALIGN JUMP_ALIGN
 .GetIdeControllerCountToCX:
-	mov		bx, ROMVARS.wFlags
-	call	Buffers_GetRomvarsValueToAXfromOffsetInBX
+	call	Buffers_GetRomvarsFlagsToAX
 	test	ax, FLG_ROMVARS_FULLMODE
 	jz		SHORT .AllowOnlyOneIdeControllerInLiteMode
@@ -243,4 +244,24 @@
 	ret
 
+
+;--------------------------------------------------------------------
+; .EnableOrDisableBootMenuSettings
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, CX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableOrDisableBootMenuSettings:
+	mov		bx, ROMVARS.bBootLdrType
+	call	Buffers_GetRomvarsValueToAXfromOffsetInBX
+	mov		bx, g_MenuitemConfigurationBootMenuSettings
+	cmp		ax, BYTE BOOTLOADER_TYPE_MENU
+	jne		SHORT .DisableMenuitemFromCSBX
+	jmp		SHORT .EnableMenuitemFromCSBX
+
+
 ;--------------------------------------------------------------------
 ; .EnableOrDisableKiBtoStealFromRAM
@@ -254,6 +275,5 @@
 ALIGN JUMP_ALIGN
 .EnableOrDisableKiBtoStealFromRAM:
-	mov		bx, ROMVARS.wFlags
-	call	Buffers_GetRomvarsValueToAXfromOffsetInBX
+	call	Buffers_GetRomvarsFlagsToAX
 	mov		bx, g_MenuitemConfigurationKiBtoStealFromRAM
 	test	ax, FLG_ROMVARS_FULLMODE
@@ -272,6 +292,5 @@
 ALIGN JUMP_ALIGN
 .EnableOrDisableIdeControllerCount:
-	mov		bx, ROMVARS.wFlags
-	call	Buffers_GetRomvarsValueToAXfromOffsetInBX
+	call	Buffers_GetRomvarsFlagsToAX
 	mov		bx, g_MenuitemConfigurationIdeControllers
 	test	ax, FLG_ROMVARS_FULLMODE
@@ -339,7 +358,2 @@
 	call	IdeControllerMenu_InitializeToIdevarsOffsetInBX
 	jmp		IdeControllerMenu_EnterMenuOrModifyItemVisibility
-
-
-ALIGN JUMP_ALIGN
-BootMenuSettings:
-	ret
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm	(revision 59)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm	(revision 59)
@@ -0,0 +1,191 @@
+; File name		:	FlashMenu.asm
+; Project name	:	XTIDE Universal BIOS Configurator v2
+; Created date	:	19.11.2010
+; Last update	:	19.11.2010
+; Author		:	Tomi Tilli
+; Description	:	"Flash EEPROM" menu structs and functions.
+
+; Section containing initialized data
+SECTION .data
+
+ALIGN WORD_ALIGN
+g_MenupageForFlashMenu:
+istruc MENUPAGE
+	at	MENUPAGE.fnEnter,			dw	FlashMenu_EnterMenuOrModifyItemVisibility
+	at	MENUPAGE.fnBack,			dw	MainMenu_EnterMenuOrModifyItemVisibility
+	at	MENUPAGE.wMenuitems,		dw	7
+iend
+
+g_MenuitemFlashBackToMainMenu:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	MainMenu_EnterMenuOrModifyItemVisibility
+	at	MENUITEM.szName,			dw	g_szItemCfgBackToMain
+	at	MENUITEM.szQuickInfo,		dw	g_szItemCfgBackToMain
+	at	MENUITEM.szHelp,			dw	g_szItemCfgBackToMain
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_PAGEBACK
+iend
+
+g_MenuitemFlashStartFlashing:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	StartFlashing
+	at	MENUITEM.szName,			dw	g_szItemFlashStart
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoFlashStart
+	at	MENUITEM.szHelp,			dw	g_szNfoFlashStart
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_ACTION
+iend
+
+g_MenuitemFlashEepromType:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemFlashEepromType
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoFlashEepromType
+	at	MENUITEM.szHelp,			dw	g_szNfoFlashEepromType
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_VISIBLE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_MULTICHOISE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	CFGVARS.bEepromType
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgFlashEepromType
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoise,				dw	g_szMultichoiseEepromType
+	at	MENUITEM.itemValue + ITEM_VALUE.rgwChoiseToValueLookup,		dw	g_rgwChoiseToValueLookupForEepromType
+	at	MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup,	dw	g_rgszValueToStringLookupForEepromType
+iend
+
+g_MenuitemFlashSdpCommand:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemFlashSDP
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoFlashSDP
+	at	MENUITEM.szHelp,			dw	g_szHelpFlashSDP
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_VISIBLE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_MULTICHOISE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	CFGVARS.bSdpCommand
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgFlashSDP
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoise,				dw	g_szMultichoiseSdpCommand
+	at	MENUITEM.itemValue + ITEM_VALUE.rgwChoiseToValueLookup,		dw	g_rgwChoiseToValueLookupForSdpCommand
+	at	MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup,	dw	g_rgszValueToStringLookupForSdpCommand
+iend
+
+g_MenuitemFlashPageSize:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemFlashPageSize
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoFlashPageSize
+	at	MENUITEM.szHelp,			dw	g_szHelpFlashPageSize
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_VISIBLE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_MULTICHOISE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	CFGVARS.bEepromPageSize
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgFlashPageSize
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoise,				dw	g_szMultichoisePageSize
+	at	MENUITEM.itemValue + ITEM_VALUE.rgwChoiseToValueLookup,		dw	g_rgwChoiseToValueLookupForPageSize
+	at	MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup,	dw	g_rgszValueToStringLookupForPageSize
+iend
+
+g_MenuitemFlashEepromAddress:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateHexInputForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteHexValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemFlashAddr
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoFlashAddr
+	at	MENUITEM.szHelp,			dw	g_szNfoFlashAddr
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_VISIBLE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_HEX
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	CFGVARS.wEepromSegment
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgFlashAddr
+	at	MENUITEM.itemValue + ITEM_VALUE.wMinValue,					dw	0C000h
+	at	MENUITEM.itemValue + ITEM_VALUE.wMaxValue,					dw	0F800h
+iend
+
+g_MenuitemFlashGenerateChecksum:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemFlashChecksum
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoFlashChecksum
+	at	MENUITEM.szHelp,			dw	g_szHelpFlashChecksum
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_VISIBLE | FLG_MENUITEM_FLAGVALUE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_MULTICHOISE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	CFGVARS.wFlags
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgFlashChecksum
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoise,				dw	g_szMultichoiseBooleanFlag
+	at	MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup,	dw	g_rgszValueToStringLookupForFlagBooleans
+	at	MENUITEM.itemValue + ITEM_VALUE.wValueBitmask,				dw	FLG_CFGVARS_CHECKSUM
+iend
+
+g_rgwChoiseToValueLookupForEepromType:
+	dw	EEPROM_TYPE.2816_2kiB
+	dw	EEPROM_TYPE.2832_4kiB
+	dw	EEPROM_TYPE.2864_8kiB
+	dw	EEPROM_TYPE.28128_16kiB
+	dw	EEPROM_TYPE.28256_32kiB
+	dw	EEPROM_TYPE.28512_64kiB
+g_rgszValueToStringLookupForEepromType:
+	dw	g_szValueFlash2816
+	dw	g_szValueFlash2832
+	dw	g_szValueFlash2864
+	dw	g_szValueFlash28128
+	dw	g_szValueFlash28256
+	dw	g_szValueFlash28512
+
+g_rgwChoiseToValueLookupForSdpCommand:
+	dw	SDP_COMMAND.none
+	dw	SDP_COMMAND.enable
+	dw	SDP_COMMAND.disable
+g_rgszValueToStringLookupForSdpCommand:
+	dw	g_szValueFlashNone
+	dw	g_szValueFlashEnable
+	dw	g_szValueFlashDisable
+
+g_rgwChoiseToValueLookupForPageSize:
+	dw	EEPROM_PAGE_SIZE.1_byte
+	dw	EEPROM_PAGE_SIZE.2_bytes
+	dw	EEPROM_PAGE_SIZE.4_bytes
+	dw	EEPROM_PAGE_SIZE.8_bytes
+	dw	EEPROM_PAGE_SIZE.16_bytes
+	dw	EEPROM_PAGE_SIZE.32_bytes
+	dw	EEPROM_PAGE_SIZE.64_bytes
+g_rgszValueToStringLookupForPageSize:
+	dw	g_szValueFlash1byte
+	dw	g_szValueFlash2bytes
+	dw	g_szValueFlash4bytes
+	dw	g_szValueFlash8bytes
+	dw	g_szValueFlash16bytes
+	dw	g_szValueFlash32bytes
+	dw	g_szValueFlash64bytes
+
+
+; Section containing code
+SECTION .text
+
+;--------------------------------------------------------------------
+; MainMenu_EnterMenuOrModifyItemVisibility
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		All, except BP
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+FlashMenu_EnterMenuOrModifyItemVisibility:
+	push	cs
+	pop		ds
+	mov		si, g_MenupageForFlashMenu
+	jmp		Menupage_ChangeToNewMenupageInDSSI
+
+
+;--------------------------------------------------------------------
+; MENUITEM activation functions (.fnActivate)
+;	Parameters:
+;		SS:BP:	Ptr to MENU
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		All, except segments
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+StartFlashing:
+	ret
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm	(revision 58)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm	(revision 59)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Universal BIOS Configurator v2
 ; Created date	:	2.11.2010
-; Last update	:	3.11.2010
+; Last update	:	18.11.2010
 ; Author		:	Tomi Tilli
 ; Description	:	"IDE Controller" menu structs and functions.
@@ -13,4 +13,5 @@
 istruc MENUPAGE
 	at	MENUPAGE.fnEnter,			dw	IdeControllerMenu_EnterMenuOrModifyItemVisibility
+	at	MENUPAGE.fnBack,			dw	ConfigurationMenu_EnterMenuOrModifyItemVisibility
 	at	MENUPAGE.wMenuitems,		dw	8
 iend
@@ -49,5 +50,5 @@
 istruc MENUITEM
 	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
-	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
 	at	MENUITEM.szName,			dw	g_szItemIdeBusType
 	at	MENUITEM.szQuickInfo,		dw	g_szNfoIdeBusType
@@ -95,5 +96,5 @@
 istruc MENUITEM
 	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
-	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
 	at	MENUITEM.szName,			dw	g_szItemIdeEnIRQ
 	at	MENUITEM.szQuickInfo,		dw	g_szNfoIdeEnIRQ
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm	(revision 58)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm	(revision 59)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Universal BIOS Configurator v2
 ; Created date	:	6.10.2010
-; Last update	:	2.11.2010
+; Last update	:	19.11.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Main menu structs and functions.
@@ -13,4 +13,5 @@
 istruc MENUPAGE
 	at	MENUPAGE.fnEnter,			dw	MainMenu_EnterMenuOrModifyItemVisibility
+	at	MENUPAGE.fnBack,			dw	ExitToDos
 	at	MENUPAGE.wMenuitems,		dw	6
 iend
@@ -58,5 +59,5 @@
 g_MenuitemMainMenuConfigureXtideUniversalBios:
 istruc MENUITEM
-	at	MENUITEM.fnActivate,		dw	ConfigureXtideUniversalBios
+	at	MENUITEM.fnActivate,		dw	ConfigurationMenu_EnterMenuOrModifyItemVisibility
 	at	MENUITEM.szName,			dw	g_szItemMainConfigure
 	at	MENUITEM.szQuickInfo,		dw	g_szNfoMainConfigure
@@ -68,5 +69,5 @@
 g_MenuitemMainMenuFlashEeprom:
 istruc MENUITEM
-	at	MENUITEM.fnActivate,		dw	FlashEeprom
+	at	MENUITEM.fnActivate,		dw	FlashMenu_EnterMenuOrModifyItemVisibility
 	at	MENUITEM.szName,			dw	g_szItemMainFlash
 	at	MENUITEM.szQuickInfo,		dw	g_szNfoMainFlash
@@ -207,4 +208,5 @@
 ALIGN JUMP_ALIGN
 LoadBiosFromFile:
+	call	Buffers_SaveChangesIfFileLoaded
 	mov		cx, FILE_DIALOG_IO_size
 	call	Memory_ReserveCXbytesFromStackToDSSI
@@ -223,4 +225,5 @@
 ALIGN JUMP_ALIGN
 LoadXtideUniversalBiosFromRom:
+	call	Buffers_SaveChangesIfFileLoaded
 	call	EEPROM_LoadXtideUniversalBiosFromRomToRamBuffer
 	mov		ax, FLG_CFGVARS_ROMLOADED
@@ -235,4 +238,5 @@
 ALIGN JUMP_ALIGN
 LoadOldSettingsFromEeprom:
+	call	Buffers_SaveChangesIfFileLoaded
 	call	EEPROM_LoadOldSettingsFromRomToRamBuffer
 	and		WORD [g_cfgVars+CFGVARS.wFlags], ~FLG_CFGVARS_UNSAVED
@@ -242,12 +246,2 @@
 	CALL_MENU_LIBRARY DisplayMessageWithInputInDSSI
 	ret
-
-
-ALIGN JUMP_ALIGN
-ConfigureXtideUniversalBios:
-	jmp		ConfigurationMenu_EnterMenuOrModifyItemVisibility
-
-
-ALIGN JUMP_ALIGN
-FlashEeprom:
-	ret
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MasterSlaveMenu.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MasterSlaveMenu.asm	(revision 58)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MasterSlaveMenu.asm	(revision 59)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Universal BIOS Configurator v2
 ; Created date	:	3.11.2010
-; Last update	:	3.11.2010
+; Last update	:	18.11.2010
 ; Author		:	Tomi Tilli
 ; Description	:	"Master/Slave Drive" menu structs and functions.
@@ -13,4 +13,5 @@
 istruc MENUPAGE
 	at	MENUPAGE.fnEnter,			dw	MasterSlaveMenu_EnterMenuOrModifyItemVisibility
+	at	MENUPAGE.fnBack,			dw	IdeControllerMenu_EnterMenuOrModifyItemVisibility
 	at	MENUPAGE.wMenuitems,		dw	6
 iend
@@ -29,5 +30,5 @@
 istruc MENUITEM
 	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
-	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
 	at	MENUITEM.szName,			dw	g_szItemDrvBlockMode
 	at	MENUITEM.szQuickInfo,		dw	g_szNfoDrvBlockMode
@@ -45,5 +46,5 @@
 istruc MENUITEM
 	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
-	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
 	at	MENUITEM.szName,			dw	g_szItemDrvUserCHS
 	at	MENUITEM.szQuickInfo,		dw	g_szNfoDrvUserCHS
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm	(revision 58)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm	(revision 59)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Universal BIOS Configurator v2
 ; Created date	:	5.10.2010
-; Last update	:	2.11.2010
+; Last update	:	19.11.2010
 ; Author		:	Tomi Tilli
 ; Description	:	All strings.
@@ -23,5 +23,5 @@
 ; Item formatting
 g_szFormatItemWithoutValue:			db	"%c%s",NULL
-g_szFormatItemNameWithValue:		db	"%26s%-9S",NULL
+g_szFormatItemNameWithValue:		db	"%25s%-10S",NULL
 
 
@@ -31,4 +31,8 @@
 									db	"No",LF
 									db	"Yes",NULL
+
+; Exit messages
+g_szDlgExitToDos:		db	"Exit to DOS?",NULL
+g_szDlgSaveChanges:		db	"Do you want to save changes to XTIDE Universal BIOS image file?",NULL
 
 
@@ -76,5 +80,5 @@
 g_szItemCfgFullMode:	db	"Full operating mode",NULL
 g_szItemCfgStealSize:	db	"kiB to steal from RAM",NULL
-g_szItemCfgIdeCnt:		db	"Number of IDE controllers",NULL
+g_szItemCfgIdeCnt:		db	"IDE controllers",NULL
 
 g_szDlgCfgFullMode:		db	"Enable full operating mode?",NULL
@@ -86,5 +90,5 @@
 g_szNfoCfgBootLoader:	db	"Boot loader selection for INT 19h.",NULL
 g_szNfoCfgFullMode:		db	"Full mode supports multiple controllers and has more features.",NULL
-g_szNfoCfgStealSize:	db	"Number of kiB of base memory to steal for BIOS variables.",NULL
+g_szNfoCfgStealSize:	db	"How many kiB's to steal from Conventional memory for XTIDE Universal BIOS variables.",NULL
 g_szNfoCfgIdeCnt:		db	"Number of IDE controllers to manage.",NULL
 
@@ -159,5 +163,5 @@
 
 g_szNfoDrvBlockMode:	db	"Transfer multiple sectors per data request.",NULL
-g_szNfoDrvUserCHS:		db	"Specify (P-)CHS manually instead of autodetect.",NULL
+g_szNfoDrvUserCHS:		db	"Specify (P-)CHS parameters manually instead of autodetecting them.",NULL
 g_szNfoDrvCyls:			db	"Number of user specified P-CHS cylinders.",NULL
 g_szNfoDrvHeads:		db	"Number of user specified P-CHS heads.",NULL
@@ -169,38 +173,45 @@
 
 ; Strings for boot menu settings menu
-g_szItemBootHeight:		db	"Maximum height",NULL
 g_szItemBootTimeout:	db	"Selection timeout",NULL
 g_szItemBootDrive:		db	"Default boot drive",NULL
-g_szItemBootMinFDD:		db	"Min floppy drive count",NULL
+g_szItemBootFloppyDrvs:	db	"Number of Floppy Drives",NULL
 g_szItemBootSwap:		db	"Swap boot drive numbers",NULL
 g_szItemBootRomBoot:	db	"Display ROM boot",NULL
-g_szItemBootInfo:		db	"Display drive info",NULL
-
-g_szDlgBootHeight:		db	"Enter boot menu maximum height in characters (8...25).",NULL
+
 g_szDlgBootTimeout:		db	"Enter Boot Menu selection timeout in seconds (1...60, 0 disables timeout).",NULL
 g_szDlgBootDrive:		db	"Enter default drive number (0xh for Floppy Drives, 8xh for Hard Disks, FFh for ROM boot).",NULL
-g_szDlgBootMinFDD:		db	"Enter minimum number of floppy drives.",NULL
+g_szDlgBootFloppyDrvs:	db	"Enter number of Floppy Drives to display on boot menu.",NULL
 g_szDlgBootSwap:		db	"Enable drive number translation?",NULL
 g_szDlgBootRomBoot:		db	"Show ROM Boot option on boot menu?",NULL
-g_szDlgBootInfo:		db	"Show drive information on boot menu?",NULL
-
-g_szNfoBootHeight:		db	"Boot Menu maximum height in characters.",NULL
+
 g_szNfoBootTimeout:		db	"Menu item selection timeout in seconds.",NULL
 g_szNfoBootDrive:		db	"Default drive on boot menu.",NULL
-g_szNfoBootMinFDD:		db	"Minimum number of floppy drives to display.",NULL
+g_szNfoBootFloppyDrvs:	db	"Number of Floppy Drives to display on boot menu.",NULL
 g_szNfoBootSwap:		db	"Drive Number Translation (swap first drive with selected).",NULL
 g_szNfoBootRomBoot:		db	"Show ROM Basic or ROM DOS boot option.",NULL
-g_szNfoBootInfo:		db	"Show detailed drive information on boot menu.",NULL
 
 g_szHelpBootTimeout:	db	"incbin goes here.",NULL
 g_szHelpBootDrive:		db	"incbin goes here.",NULL
-g_szHelpBootMinFDD:		db	"incbin goes here.",NULL
+g_szHelpBootFloppyDrvs:	db	"incbin goes here.",NULL
 g_szHelpBootSwap:		db	"incbin goes here.",NULL
 g_szHelpBootRomBoot:	db	"incbin goes here.",NULL
-g_szHelpBootInfo:		db	"incbin goes here.",NULL
+
+g_szMultichoiseBootFloppyDrvs:
+						db	"Autodetect",LF
+						db	"1",LF
+						db	"2",LF
+						db	"3",LF
+						db	"4",NULL
+
+g_szValueBootFloppyDrvsAuto:	db	"Auto",NULL
+g_szValueBootFloppyDrvs1:		db	"1",NULL
+g_szValueBootFloppyDrvs2:		db	"2",NULL
+g_szValueBootFloppyDrvs3:		db	"3",NULL
+g_szValueBootFloppyDrvs4:		db	"4",NULL
 
 
 ; Strings for Flash menu
 g_szItemFlashStart:		db	"Start flashing",NULL
+g_szItemFlashEepromType:db	"EEPROM type",NULL
 g_szItemFlashSDP:		db	"SDP command",NULL
 g_szItemFlashAddr:		db	"EEPROM address",NULL
@@ -208,8 +219,11 @@
 g_szItemFlashChecksum:	db	"Generate checksum byte",NULL
 
+g_szDlgFlashEepromType:	db	"Select EEPROM type.",NULL
+g_szDlgFlashSDP:		db	"Select Software Data Protection command.",NULL
 g_szDlgFlashAddr:		db	"Enter segment address where EEPROM is located.",NULL
-g_szDlgFlashPageSize:	db	"Enter write page size (1, 2, 4, 8, 16, 32 or 64 bytes).",NULL
+g_szDlgFlashPageSize:	db	"Select write page size.",NULL
 g_szDlgFlashChecksum:	db	"Generate checksum byte to the end of BIOS image?",NULL
 
+g_szNfoFlashEepromType:	db	"EEPROM type.",NULL
 g_szNfoFlashStart:		db	"Writes BIOS to EEPROM.",NULL
 g_szNfoFlashSDP:		db	"Software Data Protection command.",NULL
@@ -222,14 +236,39 @@
 g_szHelpFlashChecksum:	db	"incbin goes here.",NULL
 
-
-; Strings for SDP command menu
-g_szValueSdpNone:
-g_szItemSdpNone:		db	"None",NULL
-g_szValueSdpEnable:
-g_szItemSdpEnable:		db	"Enable",NULL
-g_szValueSdpDisable:
-g_szItemSdpDisable:		db	"Disable",NULL
-
-g_szNfoSdpNone:			db	"Do not use Software Data Protection.",NULL
-g_szNfoSdpEnable:		db	"Enable Software Data Protection after flashing.",NULL
-g_szNfoSdpDisable:		db	"Disable Software Data Protection after flashing.",NULL
+g_szMultichoiseEepromType:
+						db	"2816 (2 kiB)",LF
+						db	"2832 (4 kiB)",LF
+						db	"2864 (8 kiB)",LF
+						db	"28128 (16 kiB)",LF
+						db	"28256 (32 kiB)",LF
+						db	"28512 (64 kiB)",NULL
+g_szValueFlash2816:		db	"2816",NULL
+g_szValueFlash2832:		db	"2832",NULL
+g_szValueFlash2864:		db	"2864",NULL
+g_szValueFlash28128:	db	"28128",NULL
+g_szValueFlash28256:	db	"28256",NULL
+g_szValueFlash28512:	db	"28512",NULL
+
+g_szMultichoiseSdpCommand:
+						db	"None",LF
+						db	"Enable",LF
+						db	"Disable",NULL
+g_szValueFlashNone:		db	"None",NULL
+g_szValueFlashEnable:	db	"Enable",NULL
+g_szValueFlashDisable:	db	"Disable",NULL
+
+g_szMultichoisePageSize:
+						db	"1 byte",LF
+						db	"2 bytes",LF
+						db	"4 bytes",LF
+						db	"8 bytes",LF
+						db	"16 bytes",LF
+						db	"32 bytes",LF
+						db	"64 bytes",NULL
+g_szValueFlash1byte:	db	"None",NULL
+g_szValueFlash2bytes:	db	"2 bytes",NULL
+g_szValueFlash4bytes:	db	"4 bytes",NULL
+g_szValueFlash8bytes:	db	"8 bytes",NULL
+g_szValueFlash16bytes:	db	"16 bytes",NULL
+g_szValueFlash32bytes:	db	"32 bytes",NULL
+g_szValueFlash64bytes:	db	"64 bytes",NULL
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/makefile
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/makefile	(revision 58)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/makefile	(revision 59)
@@ -39,14 +39,14 @@
 
 # Subdirectories where library files are:
-LIBS = ../AssemblyLibrary/Inc/
-LIBS += ../AssemblyLibrary/Src/
-LIBS += ../AssemblyLibrary/Src/Display/
-LIBS += ../AssemblyLibrary/Src/File/
-LIBS += ../AssemblyLibrary/Src/Keyboard/
-LIBS += ../AssemblyLibrary/Src/Menu/
-LIBS += ../AssemblyLibrary/Src/Menu/Dialog/
-LIBS += ../AssemblyLibrary/Src/String/
-LIBS += ../AssemblyLibrary/Src/Time/
-LIBS += ../AssemblyLibrary/Src/Util/
+LIBS = ../Assembly_Library/Inc/
+LIBS += ../Assembly_Library/Src/
+LIBS += ../Assembly_Library/Src/Display/
+LIBS += ../Assembly_Library/Src/File/
+LIBS += ../Assembly_Library/Src/Keyboard/
+LIBS += ../Assembly_Library/Src/Menu/
+LIBS += ../Assembly_Library/Src/Menu/Dialog/
+LIBS += ../Assembly_Library/Src/String/
+LIBS += ../Assembly_Library/Src/Time/
+LIBS += ../Assembly_Library/Src/Util/
 LIBS += ../XTIDE_Universal_BIOS/Inc/
 HEADERS += $(LIBS)
