Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_DefaultDrive.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_DefaultDrive.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_DefaultDrive.txt	(revision 467)
@@ -0,0 +1,1 @@
+Drive to be set selected by default when Boot Menu is displayed.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_FloppyDrives.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_FloppyDrives.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_FloppyDrives.txt	(revision 467)
@@ -0,0 +1,1 @@
+Detecting correct number of floppy drives might fail when using floppy controller with it's own BIOS. Minimum number of floppy drives can be specified to force non-detected drives to appear on boot menu.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_SerialDetect.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_SerialDetect.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_SerialDetect.txt	(revision 467)
@@ -0,0 +1,1 @@
+Set to Yes, at the end of normal drive detection, COM ports 1-7 (in reverse order) will be scanned for a connection to a serial drive server. This option provides flexibility with the COM port and baud rate to be used, it need not be configured ahead of time, but at the expense of a slower boot process. Even when this option is set to No, this functionality can still be invoked by holding down the ALT key at the end of normal drive detection. Note that if any serial drives are detected during the normal drive detection, no scan will take place (to avoid finding the same drive twice).
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_Timeout.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_Timeout.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_Timeout.txt	(revision 467)
@@ -0,0 +1,1 @@
+Boot Menu selection timeout in BIOS timer ticks (1 second = 18.2 ticks). When time goes to zero, currently selected drive will be booted automatically. Timeout can be disabled by setting this to 0.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Configuration_FullMode.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Configuration_FullMode.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Configuration_FullMode.txt	(revision 467)
@@ -0,0 +1,5 @@
+Full mode supports up to 4 IDE controllers (8 drives). Full mode reserves a bit of RAM from the top of Conventional memory. This makes it possible to use ROM BASIC and other software that requires the interrupt vectors where XTIDE Universal BIOS parameters would be stored in Lite mode.
+
+Lite mode supports only one IDE controller (2 drives) and stores parameters to the top of the interrupt vectors (30:0h) so no Conventional memory needs to be reserved. Lite mode cannot be used if some software requires the top of interrupt vectors. Usually this is not a problem since only IBM ROM BASIC uses them.
+
+Tandy 1000 models with 640 kiB or less memory need to use Lite mode since the top of Conventional memory gets dynamically reserved by video hardware. This happens only with Tandy integrated video controller and not when using expansion graphics cards. It is possible to use Full mode if reserving RAM for video memory + what is required for XTIDE Universal BIOS. This would mean 129 kiB but most software should work with 65 kiB reserved.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Configuration_StealSize.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Configuration_StealSize.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Configuration_StealSize.txt	(revision 467)
@@ -0,0 +1,1 @@
+Parameters for detected hard disks must be stored somewhere. In Full mode they are stored to top of Conventional memory. At the moment 1 kiB is always enough but you might want to reserve more if you want to use Full mode on Tandy 1000.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Drive_BlockMode.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Drive_BlockMode.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Drive_BlockMode.txt	(revision 467)
@@ -0,0 +1,1 @@
+Block Mode will speed up transfers since multiple sectors can be transferred before waiting next data request. Normally Block Mode should always be kept enabled but there is at least one drive with buggy Block Mode implementation.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Drive_UserCHS.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Drive_UserCHS.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Drive_UserCHS.txt	(revision 467)
@@ -0,0 +1,1 @@
+Specify (P-)CHS parameters manually instead of autodetecting them. This can be used to limit drive size for old operating systems that do not support large hard disks. Some early IDE drives have buggy autodetecing so they require CHS to be specified manually. Limiting Cylinders will work for all drives but drives may not accept all values for Heads and Sectors per Track.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Drive_UserLBA.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Drive_UserLBA.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Drive_UserLBA.txt	(revision 467)
@@ -0,0 +1,1 @@
+Limit drive size to X million sectors for EBIOS functions. This option is useful to prevent large drive compatibility problems with MS-DOS 7.x (Windows 95 and 98).
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Drive_WriteCache.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Drive_WriteCache.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Drive_WriteCache.txt	(revision 467)
@@ -0,0 +1,1 @@
+Modern Hard Drives have large internal write cache. The cache will speed up writes since the drive can free the bus right after data has been written in cache. The drive then starts to write the data from cache by itself. That can be dangerous since all unwritten data in cache is lost if power is turned off or the system is reset. Modern operating systems will flush the cache when user shuts down the system. DOS does not have that sort of protection so it is up to the user to make sure cache is flushed. WARNING!!! Write cache should be left disabled.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Flash_Checksum.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Flash_Checksum.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Flash_Checksum.txt	(revision 467)
@@ -0,0 +1,1 @@
+PC BIOSes require checksum byte to the end of expansion card BIOS ROMs. You might not want to generate checksum byte when flashing some other images than XTIDE Universal BIOS.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Flash_PageSize.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Flash_PageSize.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Flash_PageSize.txt	(revision 467)
@@ -0,0 +1,1 @@
+Larger page size will improve write performance but not all EEPROMs support large pages or page writing at all. Byte writing mode will be used when page size is set to 1. Byte writing mode is supported by every EEPROM. Large pages cannot be flashed with slow CPUs.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Flash_SdpCommand.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Flash_SdpCommand.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Flash_SdpCommand.txt	(revision 467)
@@ -0,0 +1,6 @@
+Software Data Protection Command:
+None    = Do not use Software Data Protection. Meant for EEPROMs that do not support SDP.
+
+Enable  = Write protects the EEPROM after flashing. Software Data Protection should always be enabled if EEPROM supports it.
+
+Disable = Disables Software Data Protection after flashing.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_CommandPort.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_CommandPort.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_CommandPort.txt	(revision 467)
@@ -0,0 +1,1 @@
+IDE controller command block address is the usual address mentioned for IDE controllers. By default the primary IDE controller uses port 1F0h and secondary controller uses port 170h. XTIDE card uses port 300h by default.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_ControlPort.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_ControlPort.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_ControlPort.txt	(revision 467)
@@ -0,0 +1,1 @@
+IDE controller Control Block address is normally Command Block address + 200h. For XTIDE card the Control Block registers are mapped right after Command Block registers so use Command Block address + 8h for XTIDE card.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_EnableInterrupt.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_EnableInterrupt.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_EnableInterrupt.txt	(revision 467)
@@ -0,0 +1,1 @@
+IDE controller can use interrupts to signal when it is ready to transfer data. This makes possible to do other tasks while waiting drive to be ready. That is usually not useful in MS-DOS but using interrupts frees the bus for any DMA transfers. Polling mode is used when interrupts are disabled. Polling usually gives a little better access times since interrupt handling requires extra processing. There can be some compatibility issues with some old drives when polling is used with Block Mode transfers.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_IRQ.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_IRQ.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_IRQ.txt	(revision 467)
@@ -0,0 +1,1 @@
+IRQ channel to use. All controllers managed by XTIDE Universal BIOS can use the same IRQ when MS-DOS is used. Other operating systems are likely to require different interrupts for each controller.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_SerialBaud.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_SerialBaud.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_SerialBaud.txt	(revision 467)
@@ -0,0 +1,1 @@
+Supported baud rates are 2400, 4800, 9600, 19.2K, 28.8K, 38.4K, 57.6K, and 115.2K. The server must also be set to this same speed. Older UARTs may only support up to 9600 baud, but sometimes can be pushed to 38.4K. 115.2K will likely only be possible with a newer UART that inclues a FIFO. Some high speed serial ports include UART clock multipliers, allowing for speeds at 230.4K (2x multiplier) and 460.8K (4x multiplier) above 115.2K. These high speeds are supported by these BIOS, even on original 4.77MHz 8088 systems. Note that UART clock multipliers are not detectable by the software and 115.2K will still be used during configuration for high speeds; but if a multiplier is used, the actual speed (including the multiplier) will need to be used by the server.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_SerialCOM.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_SerialCOM.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_SerialCOM.txt	(revision 467)
@@ -0,0 +1,1 @@
+Select a serial port by COM port number. COM1 through COM4 have well established I/O port assignments, COM5 and onward are less well established. "COMA" represents COM10, "COMB" represents COM11, and "COMC" represents COM12. Selecting "COMx" enables the manual selection of an I/O port address.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_SerialPort.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_SerialPort.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_SerialPort.txt	(revision 467)
@@ -0,0 +1,1 @@
+Select a serial port by I/O address. Any port address is supported up to 3f8h, but must be on an 8-byte boundary. If the entered value corresponds to one of the established COM port numbers, then the selection will snap to that COM port and "COMx" must be selected again for custom I/O address entry.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Main_License.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Main_License.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Main_License.txt	(revision 467)
@@ -0,0 +1,1 @@
+XTIDE Universal BIOS and XTIDECFG Configuration program are Copyright 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. Released under GNU GPL v2. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the LICENSE.TXT file that was included with this distribution, visit http://www.gnu.org/licenses/ gpl-2.0.html, or visit http://code.coogle.com/p/ xtideuniversalbios.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/MenuCfg.inc
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/MenuCfg.inc	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/MenuCfg.inc	(revision 467)
@@ -0,0 +1,33 @@
+; Project name	:	XTIDE Universal BIOS Configurator v2
+; Description	:	Menu configuration.
+
+;
+; XTIDE Universal BIOS and Associated Tools 
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+; 
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;
+
+%ifndef MENUCFG_INC
+%define MENUCFG_INC
+
+TITLE_LINES_IN_MENU			EQU		3
+INFO_LINES_IN_MENU			EQU		6
+MENU_WIDTH					EQU		40
+MAX_VALUE_STRING_LENGTH		EQU		12
+
+
+KEY_BACK_TO_PREVIOUS_MENU	EQU		ESC
+KEY_DISPLAY_ITEM_HELP		EQU		3Bh		; F1
+
+
+%endif ; MENUCFG_INC
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/MenuStructs.inc
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/MenuStructs.inc	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/MenuStructs.inc	(revision 467)
@@ -0,0 +1,80 @@
+; Project name	:	XTIDE Universal BIOS Configurator v2
+; Description	:	Menu page and item structs.
+
+;
+; XTIDE Universal BIOS and Associated Tools 
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+; 
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;
+
+%ifndef MENU_STRUCTS_INC
+%define MENU_STRUCTS_INC
+
+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
+endstruc
+
+struc MENUITEM
+	.fnActivate			resb	2	; Offset to item activation function
+	.fnFormatValue		resb	2	; Offset to item value formatting function
+
+	.szName				resb	2	; Offset to item name string
+	.szQuickInfo		resb	2	; Offset to item quick information string
+	.szHelp				resb	2	; Offset to item help string
+
+	.bFlags				resb	1	; Item flags
+	.bType				resb	1	; Item type
+	.itemValue			resb	ITEM_VALUE_size		; ITEM_VALUE for automated item handling
+endstruc
+
+; Bit defines for MENUITEM.bFlags
+FLG_MENUITEM_VISIBLE		EQU	(1<<0)	; Item is visible
+FLG_MENUITEM_MODIFY_MENU	EQU	(1<<1)	; Item modifies visibility of other items
+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
+FLG_MENUITEM_CHOICESTRINGS  EQU (1<<5)  ; ChoiceToStringLookup table is 1-1 with ChoiceToValueLookup table,
+										; ChoiceToStringLookup table must also be NULL terminated
+FLG_MENUITEM_MASKVALUE		EQU	(1<<6)	; Item value is more than one bit among other bits
+
+
+; Values for MENUITEM.bType
+TYPE_MENUITEM_PAGEBACK		EQU	(0<<1)	; Item returns to previous MENUPAGE
+TYPE_MENUITEM_PAGENEXT		EQU	(1<<1)	; Item changes to next MENUPAGE
+TYPE_MENUITEM_ACTION		EQU	(2<<1)	; Non-configurable item
+TYPE_MENUITEM_MULTICHOICE	EQU	(3<<1)	; Item with multiple predefined choices
+TYPE_MENUITEM_UNSIGNED		EQU	(4<<1)	; Menuitem with user inputted unsigned decimal value
+TYPE_MENUITEM_HEX			EQU	(5<<1)	; Menuitem with user inputted hexadecimal value
+
+
+struc ITEM_VALUE
+	.wRomvarsValueOffset	resb	2	; ROMVARS offset to actual value to be configured
+	.szDialogTitle			resb	2	; Dialog title string
+
+	.szMultichoice			resb	2	; Multiple choices in one string
+	.rgwChoiceToValueLookup	resb	2	; Ptr to lookup table for translating selected choice to actual value
+	.rgszValueToStringLookup:			; Ptr to lookup table for translating value to string
+	.rgszChoiceToStringLookup:
+	.wMinValue				resb	2	; Minimum allowed integer value
+	.wMaxValue:
+	.wValueBitmask			resb	2	; Bitmask for item value flag or field
+	.fnValueReader			resb	2	; Called just after ROMVARS is read, providing a hook for further action
+	.fnValueWriter			resb	2	; Called just before ROMVARS is written, providing a hook for further action
+	.bFieldPosition			resb	1	; Bit field position
+endstruc
+
+
+%endif ; MENU_STRUCTS_INC
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Variables.inc
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Variables.inc	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Inc/Variables.inc	(revision 467)
@@ -0,0 +1,112 @@
+; Project name	:	XTIDE Univeral BIOS Configurator v2
+; Description	:	Global variables for configuration program.
+
+;
+; XTIDE Universal BIOS and Associated Tools 
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+; 
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;
+
+%ifndef VARIABLES_INC
+%define VARIABLES_INC
+
+; Equates and defines
+BOOT_MENU_DEFAULT_TIMEOUT			EQU	(30 * TICKS_PER_SECOND)
+MAX_ALLOWED_IDE_CONTROLLERS			EQU		4	; Maximum number of IDE controllers
+MAX_LITE_MODE_CONTROLLERS			EQU		2
+EEPROM_POLLING_TIMEOUT_TICKS		EQU		3	; 1 tick = 54.9 ms
+XTIDE_SIGNATURE_LENGTH				EQU		8	; XTIDE Universal BIOS signature string length
+NUMBER_OF_EEPROM_TYPES				EQU		5
+MAX_EEPROM_SIZE_IN_BYTES			EQU		65536
+
+
+; Program global variables
+struc CFGVARS
+	.pMenupage			resb	2			; Offset to MENUPAGE to display
+	.wFlags				resb	2			; Program flags
+	.wImageSizeInWords	resb	2			; Size in words for loaded ROM or FILE
+	.wEepromSegment		resb	2			; Segment where EEPROM is located
+	.bEepromType		resb	1			; EEPROM type
+	.bEepromPage		resb	1			; EEPROM page size (EEPROM_PAGE)
+	.bSdpCommand		resb	1			; Command for Software Data Protection
+						resb	1
+	.szOpenedFile		resb	FILENAME_BUFFER_SIZE
+endstruc
+
+; Bit defines for CFGVARS.wFlags
+FLG_CFGVARS_FILELOADED	EQU		(1<<0)	; BIOS is loaded from file
+FLG_CFGVARS_ROMLOADED	EQU		(1<<1)	; BIOS is loaded from EEPROM
+FLG_CFGVARS_UNSAVED		EQU		(1<<2)	; BIOS has unsaved changes
+FLG_CFGVARS_CHECKSUM	EQU		(1<<3)	; Generate checksum byte
+
+; EEPROM types
+struc EEPROM_TYPE
+	.2816_2kiB			resb	2
+	.2864_8kiB			resb	2
+	.2864_8kiB_MOD		resb	2	; Reversed A0 and A3 address lines
+	.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
+	.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_EEPROM_TYPE		EQU		EEPROM_TYPE.2864_8kiB
+DEFAULT_PAGE_SIZE		EQU		EEPROM_PAGE.1_byte
+DEFAULT_SDP_COMMAND		EQU		SDP_COMMAND.enable
+
+
+; Variables required for flashing
+struc FLASHVARS
+	.fpNextSourcePage			resb	4
+	.fpNextComparisonPage		resb	4
+	.fpNextDestinationPage		resb	4
+	.wPagesToFlash				resb	2	; 0 = 65536
+	.wEepromPageSize			resb	2	; 1, 2, 4, 8, 16, 32 or 64
+	.bEepromSdpCommand			resb	1
+	.bEepromType				resb	1
+
+	.wProgressUpdateParam		resb	2
+	.wTimeoutCounter			resb	2
+	.wLastOffsetWritten			resb	2
+	.bLastByteWritten			resb	1
+	.flashResult				resb	1
+endstruc
+
+; Flashing results
+struc FLASH_RESULT
+	.success					resb	2
+	.PollingTimeoutError		resb	2
+	.DataVerifyError			resb	2
+endstruc
+
+
+%endif ; VARIABLES_INC
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm	(revision 467)
@@ -0,0 +1,231 @@
+; Project name	:	XTIDE Univeral BIOS Configurator v2
+; Description	:	Functions for loading and saving BIOS image file.
+
+;
+; XTIDE Universal BIOS and Associated Tools 
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+; 
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;		
+
+; Section containing code
+SECTION .text
+
+;--------------------------------------------------------------------
+; BiosFile_LoadFileFromDSSItoRamBuffer
+;	Parameters:
+;		DS:SI:	Name of file to open
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, CX, DX, SI, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+BiosFile_LoadFileFromDSSItoRamBuffer:
+	push	ds
+
+	call	.OpenFileForLoadingFromDSSIandGetSizeToDXCX
+	jc		SHORT .DisplayErrorMessage
+	call	.LoadFileWithNameInDSSIhandleInBXandSizeInDXCXtoRamBuffer
+	jc		SHORT .DisplayErrorMessage
+
+	mov		ax, FLG_CFGVARS_FILELOADED
+	call	Buffers_NewBiosWithSizeInDXCXandSourceInAXhasBeenLoadedForConfiguration
+	call	FileIO_CloseUsingHandleFromBX
+	call	DisplayFileLoadedSuccessfully
+	jmp		SHORT .Return
+
+.DisplayErrorMessage:
+	call	FileIO_CloseUsingHandleFromBX
+	call	DisplayFailedToLoadFile
+ALIGN JUMP_ALIGN
+.Return:
+	pop		ds
+	ret
+
+;--------------------------------------------------------------------
+; .OpenFileForLoadingFromDSSIandGetSizeInBytesToDXCX
+;	Parameters:
+;		DS:SI:	Name of file to open
+;	Returns:
+;		BX:		File handle (if successful)
+;		DX:CX:	File size (if successful)
+;		CF:		Clear if successful
+;				Set if error
+;	Corrupts registers:
+;		AX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.OpenFileForLoadingFromDSSIandGetSizeToDXCX:
+	mov		al, FILE_ACCESS.ReadOnly
+	call	FileIO_OpenWithPathInDSSIandFileAccessInAL
+	jc		SHORT .FileError
+	call	FileIO_GetFileSizeToDXAXusingHandleFromBXandResetFilePosition
+	jc		SHORT .FileError
+
+	cmp		dx, MAX_EEPROM_SIZE_IN_BYTES >> 16
+	ja		SHORT .FileTooBig
+	jb		SHORT .FileNotTooBig
+	cmp		ax, MAX_EEPROM_SIZE_IN_BYTES & 0FFFFh
+	ja		SHORT .FileTooBig
+.FileNotTooBig:
+	xchg	cx, ax
+	clc
+	ret
+.FileTooBig:
+	call	DisplayFileTooBig
+	stc
+.FileError:
+	ret
+
+;--------------------------------------------------------------------
+; .LoadFileWithNameInDSSIhandleInBXandSizeInDXCXtoRamBuffer
+;	Parameters:
+;		BX:		File Handle
+;		DX:CX:	File size
+;		DS:SI:	File name
+;	Returns:
+;		CF:		Clear if successful
+;				Set if error
+;	Corrupts registers:
+;		AX, SI, DI, DS
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.LoadFileWithNameInDSSIhandleInBXandSizeInDXCXtoRamBuffer:
+	push	es
+
+	call	Buffers_GetFileBufferToESDI
+	call	Registers_ExchangeDSSIwithESDI
+	call	FileIO_ReadDXCXbytesToDSSIusingHandleFromBX
+	jc		SHORT .ReturnError
+
+	; Store filename to Cfgvars from ESDI
+	push	cx
+
+	call	Registers_CopyESDItoDSSI	; File name in DS:SI
+	push	cs
+	pop		es
+	mov		di, g_cfgVars+CFGVARS.szOpenedFile
+	cld
+	call	String_CopyDSSItoESDIandGetLengthToCX
+	clc
+
+	pop		cx
+ALIGN JUMP_ALIGN
+.ReturnError:
+	pop		es
+	ret
+
+
+;--------------------------------------------------------------------
+; BiosFile_SaveUnsavedChanges
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, CX, SI, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+BiosFile_SaveUnsavedChanges:
+	push	ds
+
+	push	cs
+	pop		ds
+	mov		si, g_cfgVars+CFGVARS.szOpenedFile
+	call	BiosFile_SaveRamBufferToFileInDSSI
+
+	pop		ds
+	ret
+
+
+;--------------------------------------------------------------------
+; BiosFile_SaveRamBufferToFileInDSSI
+;	Parameters:
+;		DS:SI:	Name of file to save
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, CX, SI, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+BiosFile_SaveRamBufferToFileInDSSI:
+	push	es
+	push	ds
+
+	call	Buffers_GenerateChecksum
+	call	Buffers_GetFileBufferToESDI
+	mov		ax, [cs:g_cfgVars+CFGVARS.wImageSizeInWords]
+	call	EEPROM_GetSmallestEepromSizeInWordsToCXforImageWithWordSizeInAX
+	xor		dx, dx
+	shl		cx, 1
+	rcl		dx, 1			; WORDs to BYTEs
+
+	mov		al, FILE_ACCESS.WriteOnly
+	call	FileIO_OpenWithPathInDSSIandFileAccessInAL
+	jc		SHORT .DisplayErrorMessage
+
+	call	Registers_CopyESDItoDSSI
+	call	FileIO_WriteDXCXbytesFromDSSIusingHandleFromBX
+	jc		SHORT .DisplayErrorMessage
+
+	call	FileIO_CloseUsingHandleFromBX
+	call	Buffers_ClearUnsavedChanges
+	call	DisplayFileSavedSuccessfully
+	jmp		SHORT .Return
+
+.DisplayErrorMessage:
+	call	FileIO_CloseUsingHandleFromBX
+	call	DisplayFailedToSaveFile
+ALIGN JUMP_ALIGN
+.Return:
+	pop		ds
+	pop		es
+	ret
+
+
+;--------------------------------------------------------------------
+; DisplayFileLoadedSuccessfully
+; DisplayFileSavedSuccessfully
+; DisplayFailedToLoadFile
+; DisplayFailedToSaveFile
+; DisplayFileTooBig
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+DisplayFileLoadedSuccessfully:
+	mov		dx, g_szDlgMainLoadFile
+	jmp		Dialogs_DisplayNotificationFromCSDX
+
+ALIGN JUMP_ALIGN
+DisplayFileSavedSuccessfully:
+	mov		dx, g_szDlgMainSaveFile
+	jmp		Dialogs_DisplayNotificationFromCSDX
+
+DisplayFailedToLoadFile:
+	mov		dx, g_szDlgMainLoadErr
+	jmp		Dialogs_DisplayErrorFromCSDX
+
+DisplayFailedToSaveFile:
+	mov		dx, g_szDlgMainSaveErr
+	jmp		Dialogs_DisplayErrorFromCSDX
+
+DisplayFileTooBig:
+	mov		dx, g_szDlgMainFileTooBig
+	jmp		Dialogs_DisplayErrorFromCSDX
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm	(revision 467)
@@ -0,0 +1,318 @@
+; Project name	:	XTIDE Universal BIOS Configurator v2
+; Description	:	Functions for accessing file and flash buffers.
+
+;
+; XTIDE Universal BIOS and Associated Tools 
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+; 
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;		
+
+; Section containing code
+SECTION .text
+
+;--------------------------------------------------------------------
+; Buffers_Clear
+;	Parameters:
+;		Nothing
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, CX, DI, ES
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Buffers_Clear:
+	call	Buffers_GetFileBufferToESDI
+	mov		cx, ROMVARS_size
+	jmp		Memory_ZeroESDIwithSizeInCX
+
+
+;--------------------------------------------------------------------
+; Buffers_IsXtideUniversalBiosLoaded
+;	Parameters:
+;		Nothing
+;	Returns:
+;		ZF:		Set if supported version of XTIDE Universal BIOS is loaded
+;				Cleared no file or some other file is loaded
+;	Corrupts registers:
+;		CX, SI, DI, ES
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Buffers_IsXtideUniversalBiosLoaded:
+	test	WORD [cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED
+	jz		SHORT .NoFileOrBiosLoaded
+
+	call	Buffers_GetFileBufferToESDI
+	jmp		SHORT Buffers_IsXtideUniversalBiosSignatureInESDI
+.NoFileOrBiosLoaded:
+	or		cl, 1		; Clear ZF
+	ret
+
+
+;--------------------------------------------------------------------
+; Buffers_IsXtideUniversalBiosSignatureInESDI
+;	Parameters:
+;		ES:DI:	Ptr to possible XTIDE Universal BIOS location
+;	Returns:
+;		ZF:		Set if supported version of XTIDE Universal BIOS is loaded
+;				Cleared no file or some other file is loaded
+;	Corrupts registers:
+;		CX, SI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Buffers_IsXtideUniversalBiosSignatureInESDI:
+	push	di
+
+	mov		si, g_szXtideUniversalBiosSignature
+	add		di, BYTE ROMVARS.rgbSign
+	mov		cx, XTIDE_SIGNATURE_LENGTH / 2
+	cld
+	eSEG_STR repe, cs, cmpsw
+
+	pop		di
+	ret
+
+
+;--------------------------------------------------------------------
+; Buffers_IsXTbuildLoaded
+;	Parameters:
+;		Nothing
+;	Returns:
+;		ZF:		Set if XT or XT+ build is loaded
+;				Cleared if some other (AT, 386) build is loaded
+;	Corrupts registers:
+;		DI, ES
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Buffers_IsXTbuildLoaded:
+%strlen BUILD_TYPE_OFFSET	TITLE_STRING_START
+	call	Buffers_GetFileBufferToESDI
+	cmp		WORD [es:di+ROMVARS.szTitle+BUILD_TYPE_OFFSET+1], 'XT'	; +1 is for '('
+	ret
+%undef BUILD_TYPE_OFFSET
+
+
+;--------------------------------------------------------------------
+; Buffers_NewBiosWithSizeInDXCXandSourceInAXhasBeenLoadedForConfiguration
+;	Parameters:
+;		AX:		EEPROM source (FLG_CFGVARS_FILELOADED or FLG_CFGVARS_ROMLOADED)
+;		DX:CX:	EEPROM size in bytes
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, CX, DX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Buffers_NewBiosWithSizeInDXCXandSourceInAXhasBeenLoadedForConfiguration:
+	and		WORD [cs:g_cfgVars+CFGVARS.wFlags], ~(FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED | FLG_CFGVARS_UNSAVED)
+	or		WORD [cs:g_cfgVars+CFGVARS.wFlags], ax
+	shr		dx, 1
+	rcr		cx, 1
+	adc		cx, BYTE 0		; Round up to next WORD
+	mov		[cs:g_cfgVars+CFGVARS.wImageSizeInWords], cx
+	ret
+
+
+;--------------------------------------------------------------------
+; Buffers_SetUnsavedChanges
+; Buffers_ClearUnsavedChanges
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Buffers_SetUnsavedChanges:
+	or		WORD [cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_UNSAVED
+	ret
+
+ALIGN JUMP_ALIGN
+Buffers_ClearUnsavedChanges:
+	and		WORD [cs:g_cfgVars+CFGVARS.wFlags], ~FLG_CFGVARS_UNSAVED
+	ret
+
+
+;--------------------------------------------------------------------
+; 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_AppendZeroesIfNeeded
+;	Parameters:
+;		Nothing
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, CX, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Buffers_AppendZeroesIfNeeded:
+	push	es
+
+	eMOVZX	di, [cs:g_cfgVars+CFGVARS.bEepromType]
+	mov		cx, [cs:di+g_rgwEepromTypeToSizeInWords]
+	sub		cx, [cs:g_cfgVars+CFGVARS.wImageSizeInWords]	; CX = WORDs to append
+	jle		SHORT .NoNeedToAppendZeroes
+
+	call	Buffers_GetFileBufferToESDI
+	mov		ax, [cs:g_cfgVars+CFGVARS.wImageSizeInWords]
+	shl		ax, 1
+	add		di, ax			; ES:DI now point first unused image byte
+	xor		ax, ax
+	cld
+	rep stosw
+ALIGN JUMP_ALIGN
+.NoNeedToAppendZeroes:
+	pop		es
+	ret
+
+
+;--------------------------------------------------------------------
+; Buffers_GenerateChecksum
+;	Parameters:
+;		Nothing
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, CX, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Buffers_GenerateChecksum:
+	push	es
+
+	call	Buffers_GetFileBufferToESDI
+	mov		ax, [cs:g_cfgVars+CFGVARS.wImageSizeInWords]
+	call	EEPROM_GetSmallestEepromSizeInWordsToCXforImageWithWordSizeInAX
+	shl		cx, 1			; Words to bytes
+	dec		cx				; Leave space for checksum byte
+	xor		ax, ax
+ALIGN JUMP_ALIGN
+.SumNextByte:
+	add		al, [es:di]
+	inc		di
+	loop	.SumNextByte
+	neg		al
+	mov		[es:di], al
+
+	pop		es
+	ret
+
+
+;--------------------------------------------------------------------
+; 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:
+;		BX:		ROMVARS offset
+;	Returns:
+;		AX:		Value
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Buffers_GetRomvarsValueToAXfromOffsetInBX:
+	push	es
+	push	di
+	call	Buffers_GetFileBufferToESDI
+	mov		ax, [es:bx+di]
+	pop		di
+	pop		es
+	ret
+
+
+;--------------------------------------------------------------------
+; Buffers_GetIdeControllerCountToCX
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		CX:		Number of IDE controllers to configure
+;		ES:DI:	Ptr to file buffer
+;	Corrupts registers:
+;		AX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Buffers_GetIdeControllerCountToCX:
+	call	Buffers_GetFileBufferToESDI
+	mov		al, [es:di+ROMVARS.bIdeCnt]
+
+	; Limit controller count for lite mode
+	test	BYTE [es:di+ROMVARS.wFlags], FLG_ROMVARS_FULLMODE
+	jnz		SHORT .ReturnControllerCountInCX
+	MIN_U	al, MAX_LITE_MODE_CONTROLLERS
+
+.ReturnControllerCountInCX:
+	cbw		; A maximum of 127 controllers should be sufficient
+	xchg	cx, ax
+	ret
+
+
+;--------------------------------------------------------------------
+; Buffers_GetFileBufferToESDI
+; Buffers_GetFlashComparisonBufferToESDI
+; Buffers_GetFileDialogItemBufferToESDI
+;	Parameters:
+;		Nothing
+;	Returns:
+;		ES:DI:	Ptr to file buffer
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Buffers_GetFlashComparisonBufferToESDI:
+Buffers_GetFileDialogItemBufferToESDI:
+	call	Buffers_GetFileBufferToESDI
+	push	di
+	mov		di, es
+	add		di, 1000h		; Third 64k page
+	mov		es, di
+	pop		di
+	ret
+ALIGN JUMP_ALIGN
+Buffers_GetFileBufferToESDI:
+	mov		di, cs
+	add		di, 1000h		; Change to next 64k page
+	mov		es, di
+	xor		di, di			; Ptr now in ES:DI
+	ret
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Dialogs.asm
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Dialogs.asm	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Dialogs.asm	(revision 467)
@@ -0,0 +1,211 @@
+; Project name	:	XTIDE Univeral BIOS Configurator v2
+; Description	:	Functions for displaying dialogs.
+
+;
+; XTIDE Universal BIOS and Associated Tools 
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+; 
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;		
+
+; Section containing code
+SECTION .text
+
+;--------------------------------------------------------------------
+; Dialogs_DisplayHelpFromCSDXwithTitleInCSDI
+;	Parameters:
+;		CS:DX:	Ptr to help string to display
+;		CS:DI:	Ptr to title string for help dialog
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Dialogs_DisplayHelpFromCSDXwithTitleInCSDI:
+	push	ds
+	push	si
+	push	di
+	push	cx
+
+	mov		cx, DIALOG_INPUT_size
+	call	Memory_ReserveCXbytesFromStackToDSSI
+	call	InitializeDialogInputFromDSSI
+	mov		[si+DIALOG_INPUT.fszTitle], di
+	jmp		SHORT DisplayMessageDialogWithMessageInCSDXandDialogInputInDSSI
+
+;--------------------------------------------------------------------
+; Dialogs_DisplayNotificationFromCSDX
+; Dialogs_DisplayErrorFromCSDX
+;	Parameters:
+;		CS:DX:	Ptr to notification string to display
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Dialogs_DisplayNotificationFromCSDX:
+	push	ds
+	push	si
+	push	di
+	push	cx
+
+	mov		cx, DIALOG_INPUT_size
+	call	Memory_ReserveCXbytesFromStackToDSSI
+	call	InitializeDialogInputFromDSSI
+	mov		WORD [si+DIALOG_INPUT.fszTitle], g_szNotificationDialog
+	jmp		SHORT DisplayMessageDialogWithMessageInCSDXandDialogInputInDSSI
+
+ALIGN JUMP_ALIGN
+Dialogs_DisplayErrorFromCSDX:
+	push	ds
+	push	si
+	push	di
+	push	cx
+
+	mov		cx, DIALOG_INPUT_size
+	call	Memory_ReserveCXbytesFromStackToDSSI
+	mov		WORD [si+DIALOG_INPUT.fszTitle], g_szErrorDialog
+ALIGN JUMP_ALIGN
+DisplayMessageDialogWithMessageInCSDXandDialogInputInDSSI:
+	call	InitializeDialogInputFromDSSI
+	mov		[si+DIALOG_INPUT.fszItems], dx
+	CALL_MENU_LIBRARY DisplayMessageWithInputInDSSI
+
+	add		sp, BYTE DIALOG_INPUT_size
+	pop		cx
+	pop		di
+	pop		si
+	pop		ds
+	ret
+
+
+;--------------------------------------------------------------------
+; Dialogs_DisplayFileDialogWithDialogIoInDSSI
+;	Parameters:
+;		DS:SI:	Ptr to FILE_DIALOG_IO
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Dialogs_DisplayFileDialogWithDialogIoInDSSI:
+	push	es
+
+	call	Buffers_GetFileDialogItemBufferToESDI
+	mov		WORD [si+FILE_DIALOG_IO.fszTitle], g_szDlgFileTitle
+	mov		[si+FILE_DIALOG_IO.fszTitle+2], cs
+	mov		[si+FILE_DIALOG_IO.fszItemBuffer], di
+	mov		[si+FILE_DIALOG_IO.fszItemBuffer+2], es
+	mov		BYTE [si+FILE_DIALOG_IO.bDialogFlags], FLG_FILEDIALOG_DRIVES
+	mov		BYTE [si+FILE_DIALOG_IO.bFileAttributes], FLG_FILEATTR_DIRECTORY | FLG_FILEATTR_ARCHIVE
+	mov		WORD [si+FILE_DIALOG_IO.fpFileFilterString], g_szDlgFileFilter
+	mov		[si+FILE_DIALOG_IO.fpFileFilterString+2], cs
+	CALL_MENU_LIBRARY GetFileNameWithIoInDSSI
+
+	pop		es
+	ret
+
+
+;--------------------------------------------------------------------
+; Dialogs_DisplayQuitDialog
+; Dialogs_DisplaySaveChangesDialog
+;	Parameters:
+;		SS:BP:	Menu handle
+;	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
+	jmp		Dialogs_DisplayQuitAndSaveChangesDialogsSharedEnding
+
+
+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
+Dialogs_DisplayQuitAndSaveChangesDialogsSharedEnding:
+	mov		WORD [si+DIALOG_INPUT.fszItems], g_szMultichoiceBooleanFlag
+	CALL_MENU_LIBRARY GetSelectionToAXwithInputInDSSI
+	add		sp, BYTE DIALOG_INPUT_size
+	cmp		ax, BYTE 1		; 1 = YES
+
+	pop		ds
+	ret
+
+
+;--------------------------------------------------------------------
+; Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX
+;	Parameters:
+;		DS:BX:	Ptr to FLASHVARS
+;		DS:SI:	Ptr to PROGRESS_DIALOG_IO
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DX, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX:
+	; Initialize progress dialog I/O in DS:SI with flashvars in DS:BX
+	call	InitializeDialogInputFromDSSI
+	mov		WORD [si+DIALOG_INPUT.fszTitle], g_szFlashTitle
+
+	xor		ax, ax
+	mov		[si+PROGRESS_DIALOG_IO.wCurrentProgressValue], ax
+	mov		dx, [bx+FLASHVARS.wPagesToFlash]
+	mov		[si+PROGRESS_DIALOG_IO.wMaxProgressValue], dx
+	mov		[si+PROGRESS_DIALOG_IO.wMinProgressValue], ax
+	mov		WORD [si+PROGRESS_DIALOG_IO.fnTaskWithParamInDSSI], Flash_EepromWithFlashvarsInDSSI
+	mov		[si+PROGRESS_DIALOG_IO.fnTaskWithParamInDSSI+2], cs
+	; Init done
+
+	mov		dx, ds
+	mov		ax, bx
+	CALL_MENU_LIBRARY StartProgressTaskWithIoInDSSIandParamInDXAX
+	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: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm	(revision 467)
@@ -0,0 +1,224 @@
+; Project name	:	XTIDE Univeral BIOS Configurator v2
+; Description	:	Functions for managing EEPROM contents.
+
+;
+; XTIDE Universal BIOS and Associated Tools 
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+; 
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;		
+
+; Section containing initialized data
+SECTION .data
+
+ALIGN WORD_ALIGN
+g_rgwEepromTypeToSizeInWords:
+	dw		(2<<10) / 2		; EEPROM_TYPE.2816_2kiB
+	dw		(8<<10) / 2
+	dw		(8<<10) / 2		; EEPROM_TYPE.2864_8kiB_MOD
+	dw		(32<<10) / 2
+	dw		(64<<10) / 2
+
+g_rgwEepromPageToSizeInBytes:
+	dw		1				; EEPROM_PAGE.1_byte
+	dw		2
+	dw		4
+	dw		8
+	dw		16
+	dw		32
+	dw		64
+
+
+
+; Section containing code
+SECTION .text
+
+;--------------------------------------------------------------------
+; EEPROM_GetSmallestEepromSizeInWordsToCXforImageWithWordSizeInAX
+;	Parameters:
+;		AX:		Image size in WORDs
+;	Returns:
+;		CX:		Required EEPROM size in WORDs
+;		CF:		Set if EEPROM size found
+;				Cleared if no valid EEPROM found
+;	Corrupts registers:
+;		BX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+EEPROM_GetSmallestEepromSizeInWordsToCXforImageWithWordSizeInAX:
+	mov		bx, g_rgwEepromTypeToSizeInWords
+	mov		cx, NUMBER_OF_EEPROM_TYPES
+ALIGN JUMP_ALIGN
+.CheckNextEepromSize:
+	cmp		ax, [cs:bx]
+	jbe		SHORT .ReturnEepromSizeInCX
+	inc		bx
+	inc		bx
+	loop	.CheckNextEepromSize
+	ret		; Return with CF cleared (none of the supported EEPROMs are large enough)
+ALIGN JUMP_ALIGN
+.ReturnEepromSizeInCX:
+	mov		cx, [cs:bx]
+	stc
+	ret
+
+
+;--------------------------------------------------------------------
+; EEPROM_LoadXtideUniversalBiosFromRomToRamBufferAndReturnSizeInDXCX
+;	Parameters:
+;		Nothing
+;	Returns:
+;		DX:CX:	BIOS size in bytes
+;	Corrupts registers:
+;		AX, BX, SI, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+EEPROM_LoadXtideUniversalBiosFromRomToRamBufferAndReturnSizeInDXCX:
+	push	es
+
+	call	EEPROM_FindXtideUniversalBiosROMtoESDI
+	call	.GetXtideUniversalBiosSizeFromEStoDXCX
+	xor		si, si				; Load from beginning of ROM
+	call	LoadBytesFromRomToRamBuffer
+
+	call	.GetXtideUniversalBiosSizeFromEStoDXCX
+	pop		es
+	ret
+
+;--------------------------------------------------------------------
+; .GetXtideUniversalBiosSizeFromEStoDXCX
+;	Parameters:
+;		Nothing
+;	Returns:
+;		DX:CX:	Bios size in bytes
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.GetXtideUniversalBiosSizeFromEStoDXCX:
+	xor		dx, dx
+	eMOVZX	cx, [es:ROMVARS.bRomSize]
+	eSHL_IM	cx, 9				; *= 512 for byte count
+	ret
+
+
+;--------------------------------------------------------------------
+; EEPROM_LoadOldSettingsFromRomToRamBuffer
+;	Parameters:
+;		Nothing
+;	Returns:
+;		CF:		Set if EEPROM was found
+;				Cleared if EEPROM not found
+;	Corrupts registers:
+;		AX, BX, CX, SI, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+EEPROM_LoadOldSettingsFromRomToRamBuffer:
+	mov		cx, ROMVARS_size - ROMVARS.wFlags	; Number of bytes to load
+	mov		si, ROMVARS.wFlags					; Offset where to start loading
+	; Fall to LoadBytesFromRomToRamBuffer
+
+;--------------------------------------------------------------------
+; LoadBytesFromRomToRamBuffer
+;	Parameters:
+;		CX:		Number of bytes to load from ROM
+;		SI:		Offset to first byte to load
+;	Returns:
+;		CF:		Set if EEPROM was found
+;				Cleared if EEPROM not found
+;	Corrupts registers:
+;		AX, BX, CX, SI, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+LoadBytesFromRomToRamBuffer:
+	push	es
+	push	ds
+
+	call	EEPROM_FindXtideUniversalBiosROMtoESDI
+	jnc		SHORT .XtideUniversalBiosNotFound
+	push	es
+	pop		ds											; DS:SI points to ROM
+
+	call	Buffers_GetFileBufferToESDI
+	mov		di, si										; ES:DI points to RAM buffer
+
+	cld
+	call	Memory_CopyCXbytesFromDSSItoESDI
+	stc
+
+.XtideUniversalBiosNotFound:
+	pop		ds
+	pop		es
+	ret
+
+
+;--------------------------------------------------------------------
+; EEPROM_FindXtideUniversalBiosROMtoESDI
+;	Parameters:
+;		Nothing
+;	Returns:
+;		ES:DI:	EEPROM segment
+;		CF:		Set if EEPROM was found
+;				Cleared if EEPROM not found
+;	Corrupts registers:
+;		AX, BX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+EEPROM_FindXtideUniversalBiosROMtoESDI:
+	push	si
+	push	cx
+
+	xor		di, di					; Zero DI (offset)
+	mov		bx, 0C000h				; First possible ROM segment
+ALIGN JUMP_ALIGN
+.SegmentLoop:
+	mov		es, bx					; Possible ROM segment to ES
+	call	Buffers_IsXtideUniversalBiosSignatureInESDI
+	je		SHORT .RomFound
+	add		bh, 2					; Increment by 8kB
+	jnc		SHORT .SegmentLoop		; Loop until segment overflows
+	clc
+	jmp		SHORT .ReturnWithoutUpdatingCF
+ALIGN JUMP_ALIGN
+.RomFound:
+	stc
+.ReturnWithoutUpdatingCF:
+	pop		cx
+	pop		si
+	ret
+
+
+;--------------------------------------------------------------------
+; EEPROM_LoadFromRomToRamComparisonBuffer
+;	Parameters:
+;		Nothing
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		BX, CX, SI, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+EEPROM_LoadFromRomToRamComparisonBuffer:
+	push	es
+	push	ds
+
+	mov		ds, [cs:g_cfgVars+CFGVARS.wEepromSegment]
+	xor		si, si
+	call	Buffers_GetFlashComparisonBufferToESDI
+	eMOVZX	bx, [cs:g_cfgVars+CFGVARS.bEepromType]
+	mov		cx, [cs:bx+g_rgwEepromTypeToSizeInWords]
+	cld
+	rep movsw
+
+	pop		ds
+	pop		es
+	ret
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Flash.asm
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Flash.asm	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Flash.asm	(revision 467)
@@ -0,0 +1,374 @@
+; Project name	:	XTIDE Universal BIOS Configurator v2
+; Description	:	Functions for flashing the EEPROM.
+
+;
+; XTIDE Universal BIOS and Associated Tools 
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+; 
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;		
+
+; Section containing code
+SECTION .text
+
+;--------------------------------------------------------------------
+; Flash_EepromWithFlashvarsInDSSI
+;	Parameters:
+;		DS:SI:	Ptr to FLASHVARS
+;	Returns:
+;		FLASHVARS.flashResult
+;	Corrupts registers:
+;		All, including segments
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Flash_EepromWithFlashvarsInDSSI:
+	mov		[si+FLASHVARS.wProgressUpdateParam], bp	; Store handle to progress DIALOG
+	mov		bp, si									; Flashvars now in SS:BP
+	mov		cx, [bp+FLASHVARS.wPagesToFlash]
+ALIGN JUMP_ALIGN
+.FlashNextPage:
+	call	DisplayFlashProgressWithPagesLeftInCXandFlashvarsInSSBP
+	call	Flash_SinglePageWithFlashvarsInSSBP
+	jc		SHORT .PollingError
+	call	AreSourceAndDestinationPagesEqualFromFlashvarsInSSBP
+	jne		SHORT .DataVerifyError
+
+	mov		ax, [bp+FLASHVARS.wEepromPageSize]
+	add		[bp+FLASHVARS.fpNextSourcePage], ax
+	add		[bp+FLASHVARS.fpNextComparisonPage], ax
+	add		[bp+FLASHVARS.fpNextDestinationPage], ax
+
+	loop	.FlashNextPage
+%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
+%if FLASH_RESULT.success = 0	; Just in case this should ever change
+	mov		[bp+FLASHVARS.flashResult], cl
+%else
+	mov		BYTE [bp+FLASHVARS.flashResult], FLASH_RESULT.success
+%endif
+%endif
+	ret
+
+.PollingError:
+	mov		BYTE [bp+FLASHVARS.flashResult], FLASH_RESULT.PollingTimeoutError
+	ret
+.DataVerifyError:
+	mov		BYTE [bp+FLASHVARS.flashResult], FLASH_RESULT.DataVerifyError
+	ret
+
+
+;--------------------------------------------------------------------
+; Flash_SinglePageWithFlashvarsInSSBP
+;	Parameters:
+;		SS:BP:	Ptr to FLASHVARS
+;	Returns:
+;		CF:		Set if polling timeout error
+;				Cleared if page written successfully
+;	Corrupts registers:
+;		AX, BX, DX, SI, DI, DS, ES
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Flash_SinglePageWithFlashvarsInSSBP:
+	cld
+	call	AreSourceAndDestinationPagesEqualFromFlashvarsInSSBP
+	je		SHORT .NoNeedToFlashThePage	; CF cleared
+
+	push	cx
+	call	.GetSdpCommandFunctionToDXwithFlashvarsInSSBP
+	mov		cx, [bp+FLASHVARS.wEepromPageSize]
+	mov		si, [bp+FLASHVARS.fpNextSourcePage]
+	les		di, [bp+FLASHVARS.fpNextComparisonPage]
+	mov		bx, [bp+FLASHVARS.fpNextDestinationPage]
+	call	WriteAllChangedBytesFromPageToEeprom
+	pop		cx
+.NoNeedToFlashThePage:
+	ret
+
+;--------------------------------------------------------------------
+; .GetSdpCommandFunctionToDXwithFlashvarsInSSBP
+;	Parameters:
+;		SS:BP:	Ptr to FLASHVARS
+;	Returns:
+;		DX:		Ptr to SDP Command function
+;	Corrupts registers:
+;		BX, SI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.GetSdpCommandFunctionToDXwithFlashvarsInSSBP:
+	eMOVZX	bx, [bp+FLASHVARS.bEepromSdpCommand]
+	mov		si, [cs:bx+.rgpSdpCommandToEepromTypeLookupTable]
+	mov		bl, [bp+FLASHVARS.bEepromType]
+	mov		dx, [cs:bx+si]
+	ret
+
+ALIGN WORD_ALIGN
+.rgpSdpCommandToEepromTypeLookupTable:
+	dw		.rgfnFlashWithoutSDP					; SDP_COMMAND.none
+	dw		.rgfnEnableSdpAndFlash					; SDP_COMMAND.enable
+	dw		.rgfnDisableSdpAndFlash					; SDP_COMMAND.disable
+.rgfnFlashWithoutSDP:		; SDP_COMMAND.none
+	dw		DoNotWriteAnySdpCommand					; EEPROM_TYPE.2816_2kiB
+	dw		DoNotWriteAnySdpCommand					; EEPROM_TYPE.2864_8kiB
+	dw		DoNotWriteAnySdpCommand					; EEPROM_TYPE.2864_8kiB_MOD
+	dw		DoNotWriteAnySdpCommand					; EEPROM_TYPE.28256_32kiB
+	dw		DoNotWriteAnySdpCommand					; EEPROM_TYPE.28512_64kiB
+.rgfnEnableSdpAndFlash:		; SDP_COMMAND.enable
+	dw		WriteSdpEnableCommandFor2816			; EEPROM_TYPE.2816_2kiB
+	dw		WriteSdpEnableCommandFor2864			; EEPROM_TYPE.2864_8kiB
+	dw		WriteSdpEnableCommandFor2864mod			; EEPROM_TYPE.2864_8kiB_MOD
+	dw		WriteSdpEnableCommandFor28256or28512	; EEPROM_TYPE.28256_32kiB
+	dw		WriteSdpEnableCommandFor28256or28512	; EEPROM_TYPE.28512_64kiB
+.rgfnDisableSdpAndFlash:	; SDP_COMMAND.disable
+	dw		WriteSdpDisableCommandFor2816			; EEPROM_TYPE.2816_2kiB
+	dw		WriteSdpDisableCommandFor2864			; EEPROM_TYPE.2864_8kiB
+	dw		WriteSdpDisableCommandFor2864mod		; EEPROM_TYPE.2864_8kiB_MOD
+	dw		WriteSdpDisableCommandFor28256or28512	; EEPROM_TYPE.28256_32kiB
+	dw		WriteSdpDisableCommandFor28256or28512	; EEPROM_TYPE.28512_64kiB
+
+
+;--------------------------------------------------------------------
+; AreSourceAndDestinationPagesEqualFromFlashvarsInSSBP
+;	Parameters:
+;		SS:BP:	Ptr to FLASHVARS
+;	Returns:
+;		ZF:		Set if pages are equal
+;				Cleared if pages are not equal
+;	Corrupts registers:
+;		SI, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+AreSourceAndDestinationPagesEqualFromFlashvarsInSSBP:
+	push	cx
+	mov		cx, [bp+FLASHVARS.wEepromPageSize]
+	lds		si, [bp+FLASHVARS.fpNextSourcePage]
+	les		di, [bp+FLASHVARS.fpNextDestinationPage]
+	repe cmpsb
+	pop		cx
+	ret
+
+
+;--------------------------------------------------------------------
+; ENABLE_SDP
+;	Parameters:
+;		%1:		Offset for first command byte
+;		%2:		Offset for second command byte
+;		DS:		Segment to beginning of EEPROM
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+%macro ENABLE_SDP 2
+	mov		BYTE [%1], 0AAh
+	mov		BYTE [%2], 55h
+	mov		BYTE [%1], 0A0h
+%endmacro
+
+;--------------------------------------------------------------------
+; DISABLE_SDP
+;	Parameters:
+;		%1:		Offset for first command byte
+;		%2:		Offset for second command byte
+;		DS:		Segment to beginning of EEPROM
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+%macro DISABLE_SDP 2
+	mov		BYTE [%1], 0AAh
+	mov		BYTE [%2], 55h
+	mov		BYTE [%1], 80h
+	mov		BYTE [%1], 0AAh
+	mov		BYTE [%2], 55h
+	mov		BYTE [%1], 20h
+%endmacro
+
+;--------------------------------------------------------------------
+; SDP Command Functions
+;	Parameters:
+;		DS:		Segment to beginning of EEPROM
+;	Returns:
+;		Nothing but jumps to WriteActualDataByteAfterSdpCommand
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+WriteSdpEnableCommandFor2816:
+	ENABLE_SDP 555h, 2AAh
+	jmp		ReturnFromSdpCommand
+
+ALIGN JUMP_ALIGN
+WriteSdpEnableCommandFor2864:
+	ENABLE_SDP 1555h, 0AAAh
+	jmp		ReturnFromSdpCommand
+
+ALIGN JUMP_ALIGN
+WriteSdpEnableCommandFor2864mod:
+	ENABLE_SDP 155Ch, 0AA3h
+	jmp		ReturnFromSdpCommand
+
+ALIGN JUMP_ALIGN
+WriteSdpEnableCommandFor28256or28512:
+	ENABLE_SDP 5555h, 2AAAh
+	jmp		ReturnFromSdpCommand
+
+
+ALIGN JUMP_ALIGN
+WriteSdpDisableCommandFor2816:
+	DISABLE_SDP 555h, 2AAh
+	jmp		SHORT ReturnFromSdpCommand
+
+ALIGN JUMP_ALIGN
+WriteSdpDisableCommandFor2864:
+	DISABLE_SDP 1555h, 0AAAh
+	jmp		SHORT ReturnFromSdpCommand
+
+ALIGN JUMP_ALIGN
+WriteSdpDisableCommandFor2864mod:
+	DISABLE_SDP 155Ch, 0AA3h
+	jmp		SHORT ReturnFromSdpCommand
+
+ALIGN JUMP_ALIGN
+WriteSdpDisableCommandFor28256or28512:
+	DISABLE_SDP 5555h, 2AAAh
+DoNotWriteAnySdpCommand:
+	jmp		SHORT ReturnFromSdpCommand
+
+
+;--------------------------------------------------------------------
+; WriteNextChangedByteFromPageToEeprom
+;	Parameters:
+;		CX:		Number of bytes left to write
+;		DX:		Offset to SDP command function
+;		BX:		Offset to next destination byte
+;		SI:		Offset to next source byte
+;		ES:DI:	Ptr to next comparison byte
+;		SS:BP:	Ptr to FLASHVARS
+;	Returns:
+;		CF:		Set if polling timeout error
+;				Cleared if page written successfully
+;	Corrupts registers:
+;		AX, BX, CX, SI, DI, DS, ES
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+WriteAllChangedBytesFromPageToEeprom:
+	mov		ax, [bp+FLASHVARS.fpNextSourcePage+2]		; AX = Source segment
+	mov		ds, [bp+FLASHVARS.fpNextDestinationPage+2]	; DS = EEPROM segment
+	cli						; Disable interrupts
+	jmp		dx				; Write SDP command (once to the beginning of page)
+ALIGN JUMP_ALIGN
+ReturnFromSdpCommand:
+	mov		ds, ax			; DS:SI now points to source byte
+
+ALIGN JUMP_ALIGN
+.WriteActualDataByteAfterSdpCommand:
+	lodsb					; Load source byte to AL
+	scasb					; Compare source byte to comparison byte
+	je		SHORT .NoChangesForThisByte
+
+	mov		ds, [bp+FLASHVARS.fpNextDestinationPage+2]	; DS:BX now points to EEPROM
+	mov		[bx], al		; Write byte to EEPROM
+	mov		ds, [bp+FLASHVARS.fpNextSourcePage+2]		; Restore DS
+	mov		[bp+FLASHVARS.wLastOffsetWritten], bx
+	mov		[bp+FLASHVARS.bLastByteWritten], al
+
+ALIGN JUMP_ALIGN
+.NoChangesForThisByte:
+	inc		bx				; Increment destination offset
+	loop	.WriteActualDataByteAfterSdpCommand
+	sti						; Enable interrupts
+	; Fall to WaitUntilEepromPageWriteHasCompleted
+
+
+;--------------------------------------------------------------------
+; WaitUntilEepromPageWriteHasCompleted
+;	Parameters:
+;		SS:BP:	Ptr to FLASHVARS
+;	Returns:
+;		CF:		Set if polling timeout error
+;				Cleared if page written successfully
+;	Corrupts registers:
+;		AX, BX, DI, DS, ES
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+WaitUntilEepromPageWriteHasCompleted:
+	call	.InitializeTimeoutCounterForEepromPollingWithFlashvarsInSSBP
+	mov		es, [bp+FLASHVARS.fpNextDestinationPage+2]
+	mov		di, [bp+FLASHVARS.wLastOffsetWritten]
+ALIGN JUMP_ALIGN
+.PollEeprom:
+	call	.HasWriteCycleCompleted
+	je		SHORT .PageWriteCompleted	; CF cleared
+	call	TimerTicks_GetTimeoutTicksLeftToAXfromDSBX
+	jnc		SHORT .PollEeprom
+ALIGN JUMP_ALIGN
+.PageWriteCompleted:
+	ret
+
+;--------------------------------------------------------------------
+; .InitializeTimeoutCounterForEepromPollingWithFlashvarsInSSBP
+;	Parameters:
+;		SS:BP:	Ptr to FLASHVARS
+;	Returns:
+;		DS:BX:	Ptr to timeout counter variable
+;	Corrupts registers:
+;		AX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.InitializeTimeoutCounterForEepromPollingWithFlashvarsInSSBP:
+	push	ss
+	pop		ds
+	lea		bx, [bp+FLASHVARS.wTimeoutCounter]
+	mov		ax, EEPROM_POLLING_TIMEOUT_TICKS
+	jmp		TimerTicks_InitializeTimeoutFromAX
+
+;--------------------------------------------------------------------
+; .HasWriteCycleCompleted
+;	Parameters:
+;		ES:DI:	Ptr to last written byte in EEPROM
+;		SS:BP:	Ptr to FLASHVARS
+;	Returns:
+;		ZF:		Set if write cycle has completed
+;				Cleared if write cycle in progress
+;	Corrupts registers:
+;		AX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.HasWriteCycleCompleted:
+	mov		ah, [es:di]		; Load byte from EEPROM
+	mov		al, [bp+FLASHVARS.bLastByteWritten]
+	and		ax, 8080h		; Clear all but bit 7 from both bytes
+	cmp		al, ah			; Set ZF if high bits are the same
+	ret
+
+
+;--------------------------------------------------------------------
+; DisplayFlashProgressWithPagesLeftInCXandFlashvarsInSSBP
+;	Parameters:
+;		CX:		Number of pages left to flash
+;		SS:BP:	Ptr to FLASHVARS
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+DisplayFlashProgressWithPagesLeftInCXandFlashvarsInSSBP:
+	push	bp
+
+	mov		ax, [bp+FLASHVARS.wPagesToFlash]
+	sub		ax, cx
+	mov		bp, [bp+FLASHVARS.wProgressUpdateParam]	; BP now has MENU handle
+	CALL_MENU_LIBRARY SetProgressValueFromAX
+
+	pop		bp
+	ret
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm	(revision 467)
@@ -0,0 +1,142 @@
+; Project name	:	XTIDE Univeral BIOS Configurator v2
+; Description	:	Program start and exit.
+
+;
+; XTIDE Universal BIOS and Associated Tools 
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+; 
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;		
+
+; Include .inc files
+		
+%define INCLUDE_MENU_DIALOGS
+%define INCLUDE_SERIAL_LIBRARY
+		
+%include "AssemblyLibrary.inc"	; Assembly Library. Must be included first!
+%include "Romvars.inc"			; XTIDE Universal BIOS variables
+
+%include "Version.inc"
+%include "MenuCfg.inc"
+%include "MenuStructs.inc"
+%include "Variables.inc"
+
+
+; Section containing code
+SECTION .text
+
+
+; Program first instruction.
+ORG	100h						; Code starts at offset 100h (DOS .COM)
+Start:
+	jmp		Main_Start
+
+; Include library sources
+%include "AssemblyLibrary.asm"
+
+; Include sources for this program
+%include "BiosFile.asm"
+%include "Buffers.asm"
+%include "Dialogs.asm"
+%include "EEPROM.asm"
+%include "Flash.asm"
+%include "MenuEvents.asm"
+%include "Menuitem.asm"
+%include "MenuitemPrint.asm"
+%include "Menupage.asm"
+%include "Strings.asm"
+
+%include "BootMenuSettingsMenu.asm"
+%include "ConfigurationMenu.asm"
+%include "FlashMenu.asm"
+%include "IdeControllerMenu.asm"
+%include "MainMenu.asm"
+%include "MasterSlaveMenu.asm"
+
+
+
+;--------------------------------------------------------------------
+; Program start
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Main_Start:
+	mov		ax, SCREEN_BACKGROUND_CHARACTER_AND_ATTRIBUTE
+	call	InitializeScreenWithBackgroudCharAndAttrInAX
+
+	call	Main_InitializeCfgVars
+	call	MenuEvents_DisplayMenu
+	mov		ax, DOS_BACKGROUND_CHARACTER_AND_ATTRIBUTE
+	call	InitializeScreenWithBackgroudCharAndAttrInAX
+
+	; Exit to DOS
+	mov 	ax, 4C00h			; Exit to DOS
+	int 	21h
+
+
+;--------------------------------------------------------------------
+; InitializeScreenWithBackgroudCharAndAttrInAX
+;	Parameters:
+;		AL:		Background character
+;		AH:		Background attribute
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DX, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+InitializeScreenWithBackgroudCharAndAttrInAX:
+	xchg	dx, ax
+	CALL_DISPLAY_LIBRARY InitializeDisplayContext	; Reset cursor etc
+	xchg	ax, dx
+	CALL_DISPLAY_LIBRARY ClearScreenWithCharInALandAttrInAH
+	ret
+
+
+;--------------------------------------------------------------------
+; Main_InitializeCfgVars
+;	Parameters:
+;		DS:		Segment to CFGVARS
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, CX, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Main_InitializeCfgVars:
+	push	es
+
+	call	Buffers_Clear
+	call	EEPROM_FindXtideUniversalBiosROMtoESDI
+	jnc		SHORT .InitializationCompleted
+	mov		[CFGVARS.wEepromSegment], es
+.InitializationCompleted:
+	pop		es
+	ret
+
+
+; Section containing initialized data
+SECTION .data
+
+ALIGN WORD_ALIGN
+g_cfgVars:
+istruc CFGVARS
+	at	CFGVARS.pMenupage,			dw	g_MenupageForMainMenu
+	at	CFGVARS.wFlags,				dw	DEFAULT_CFGVARS_FLAGS
+	at	CFGVARS.wEepromSegment,		dw	0
+	at	CFGVARS.bEepromType,		db	DEFAULT_EEPROM_TYPE
+	at	CFGVARS.bEepromPage,		db	DEFAULT_PAGE_SIZE
+	at	CFGVARS.bSdpCommand,		db	DEFAULT_SDP_COMMAND
+iend
+
+
+; Section containing uninitialized data
+SECTION .bss
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuEvents.asm
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuEvents.asm	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuEvents.asm	(revision 467)
@@ -0,0 +1,266 @@
+; Project name	:	XTIDE Universal BIOS Configurator v2
+; Description	:	Menu event handling.
+
+;
+; XTIDE Universal BIOS and Associated Tools 
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+; 
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;		
+
+; Section containing code
+SECTION .text
+
+;--------------------------------------------------------------------
+; MenuEvents_DisplayMenu
+;	Parameters:
+;		Nothing
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		All, except segments
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+MenuEvents_DisplayMenu:
+	mov		bx, MenuEventHandler
+	CALL_MENU_LIBRARY DisplayWithHandlerInBXandUserDataInDXAX
+	ret
+
+
+;--------------------------------------------------------------------
+; MenuEventHandler
+;	Common parameters for all events:
+;		BX:			Menu event (anything from MENUEVENT struct)
+;		SS:BP:		Menu library handle
+;	Common return values for all events:
+;		CF:			Set if event processed
+;					Cleared if event not processed
+;	Corrupts registers:
+;		All
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+MenuEventHandler:
+	cmp		bx, MENUEVENT.RefreshItemFromCX	; Above last supported item?
+	ja		SHORT .EventNotHandled
+	jmp		[cs:bx+.rgfnEventSpecificHandlers]
+.EventNotHandled:
+.IdleProcessing:
+	clc
+	ret
+
+ALIGN WORD_ALIGN
+.rgfnEventSpecificHandlers:
+	dw		.InitializeMenuinitFromDSSI
+	dw		.ExitMenu
+	dw		.IdleProcessing
+	dw		.ItemHighlightedFromCX
+	dw		.ItemSelectedFromCX
+	dw		.KeyStrokeInAX
+	dw		.RefreshTitle
+	dw		.RefreshInformation
+	dw		.RefreshItemFromCX
+
+
+; Parameters:
+;	DS:SI:		Ptr to MENUINIT struct to initialize
+; Returns:
+;	DS:SI:		Ptr to initialized MENUINIT struct
+ALIGN JUMP_ALIGN
+.InitializeMenuinitFromDSSI:
+	push	ds
+	push	cs
+	pop		ds
+	mov		di, g_MenupageForMainMenu
+	call	Menupage_SetActiveMenupageFromDSDI
+	call	Menupage_GetVisibleMenuitemsToAXfromDSDI
+	pop		ds
+
+	mov		WORD [si+MENUINIT.wItems], ax
+	mov		WORD [si+MENUINIT.bTitleLines], TITLE_LINES_IN_MENU
+	mov		WORD [si+MENUINIT.bInfoLines], INFO_LINES_IN_MENU
+	mov		BYTE [si+MENUINIT.bWidth], MENU_WIDTH
+	CALL_DISPLAY_LIBRARY GetColumnsToALandRowsToAH
+	mov		[si+MENUINIT.bHeight], ah
+	call	MainMenu_EnterMenuOrModifyItemVisibility
+	stc
+	ret
+
+
+; 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, ExitToDosFromBackButton
+	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
+	CALL_MENU_LIBRARY Close
+	stc
+	ret
+
+
+; Parameters:
+;	CX:			Index of new highlighted item
+;	DX:			Index of previously highlighted item or NO_ITEM_HIGHLIGHTED
+ALIGN JUMP_ALIGN
+.ItemHighlightedFromCX:
+	CALL_MENU_LIBRARY ClearInformationArea
+	CALL_MENU_LIBRARY RefreshInformation
+	stc
+	ret
+
+
+; Parameters:
+;	CX:			Index of selected item
+ALIGN JUMP_ALIGN
+.ItemSelectedFromCX:
+	call	Menupage_GetActiveMenupageToDSDI
+	call	Menupage_GetCXthVisibleMenuitemToDSSIfromDSDI
+	call	[si+MENUITEM.fnActivate]
+	stc
+	ret
+
+
+; Parameters:
+;	AL:			ASCII character for the key
+;	AH:			Keyboard library scan code for the key
+ALIGN JUMP_ALIGN
+.KeyStrokeInAX:
+	cmp		ah, KEY_DISPLAY_ITEM_HELP
+	jne		SHORT .EventNotHandled
+
+;ALIGN JUMP_ALIGN
+;.DisplayHelp:
+	call	Menupage_GetActiveMenupageToDSDI
+	CALL_MENU_LIBRARY GetHighlightedItemToAX
+	xchg	cx, ax
+	call	Menupage_GetCXthVisibleMenuitemToDSSIfromDSDI
+	call	Menuitem_DisplayHelpMessageFromDSSI
+	stc
+	ret
+
+
+; Parameters:
+;	CX:			Index of item to refresh
+;	Cursor has been positioned to the beginning of item line
+ALIGN JUMP_ALIGN
+.RefreshItemFromCX:
+	cmp		cx, NO_ITEM_HIGHLIGHTED
+	je		SHORT .NothingToRefresh
+	call	Menupage_GetActiveMenupageToDSDI
+	call	Menupage_GetCXthVisibleMenuitemToDSSIfromDSDI
+	jnc		SHORT .NothingToRefresh
+	call	MenuitemPrint_NameWithPossibleValueFromDSSI
+.NothingToRefresh:
+	stc
+	ret
+
+
+; Parameters:
+;	CX:			Index of highlighted item
+;	Cursor has been positioned to the beginning of first line
+ALIGN JUMP_ALIGN
+.RefreshInformation:
+	cmp		cx, NO_ITEM_HIGHLIGHTED
+	je		SHORT .NothingToRefresh
+	call	Menupage_GetActiveMenupageToDSDI
+	call	Menupage_GetCXthVisibleMenuitemToDSSIfromDSDI
+	call	MenuitemPrint_PrintQuickInfoFromDSSI
+	stc
+	ret
+
+
+; Parameters:
+;	CX:			Index of highlighted item
+;	Cursor has been positioned to the beginning of first line
+ALIGN JUMP_ALIGN
+.RefreshTitle:
+	call	.PrintProgramName
+	call	.PrintLoadStatus
+	call	.PrintStatusOfUnsavedChanges
+	stc
+	ret
+
+ALIGN JUMP_ALIGN
+.PrintProgramName:
+	mov		si, g_szProgramTitle
+	CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI
+	ret
+
+ALIGN JUMP_ALIGN
+.PrintLoadStatus:
+	mov		ax, [g_cfgVars+CFGVARS.wFlags]
+	test	ax, FLG_CFGVARS_FILELOADED
+	jnz		SHORT .PrintNameOfLoadedFile
+	test	ax, FLG_CFGVARS_ROMLOADED
+	jnz		SHORT .PrintLoadedEeprom
+	; Fall to .PrintNothingLoaded
+
+.PrintNothingLoaded:
+	mov		si, g_szBiosIsNotLoaded
+	CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI
+	ret
+
+ALIGN JUMP_ALIGN
+.PrintNameOfLoadedFile:
+	mov		si, g_cfgVars+CFGVARS.szOpenedFile
+	CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI
+	jmp		SHORT .PrintTypeOfLoadedBios
+
+ALIGN JUMP_ALIGN
+.PrintLoadedEeprom:
+	mov		si, g_szEEPROM
+	CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI
+	; Fall to .PrintTypeOfLoadedBios
+
+ALIGN JUMP_ALIGN
+.PrintTypeOfLoadedBios:
+	mov		si, g_szSourceAndTypeSeparator
+	CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI
+	call	Buffers_IsXtideUniversalBiosLoaded
+	jne		SHORT .PrintUnidentifiedType
+
+	call	Buffers_GetFileBufferToESDI
+	mov		bx, es
+	lea		si, [di+ROMVARS.szVersion]
+	CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromBXSI
+	ret
+
+ALIGN JUMP_ALIGN
+.PrintUnidentifiedType:
+	mov		si, g_szUnidentified
+	CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI
+	ret
+
+ALIGN JUMP_ALIGN
+.PrintStatusOfUnsavedChanges:
+	test	WORD [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_UNSAVED
+	jz		SHORT .ReturnSinceNothingToPrint
+	mov		si, g_szUnsaved
+	CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI
+.ReturnSinceNothingToPrint:
+	ret
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menuitem.asm
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menuitem.asm	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menuitem.asm	(revision 467)
@@ -0,0 +1,391 @@
+; Project name	:	XTIDE Universal BIOS Configurator v2
+; Description	:	Functions for accessing MENUITEM structs.
+
+;
+; XTIDE Universal BIOS and Associated Tools 
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+; 
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;		
+
+; Section containing code
+SECTION .text
+
+;--------------------------------------------------------------------
+; Menuitem_DisplayHelpMessageFromDSSI
+;	Parameters:
+;		DS:SI:	Ptr to MENUITEM
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DX, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Menuitem_DisplayHelpMessageFromDSSI:
+	mov		di, [si+MENUITEM.szName]
+	mov		dx, [si+MENUITEM.szHelp]
+	jmp		Dialogs_DisplayHelpFromCSDXwithTitleInCSDI
+
+
+;--------------------------------------------------------------------
+; Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
+;	Parameters:
+;		DS:SI:	Ptr to MENUITEM
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, CX, SI, DI, ES
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI:
+	call	Registers_CopyDSSItoESDI
+
+	mov		cx, DIALOG_INPUT_size
+	call	Memory_ReserveCXbytesFromStackToDSSI
+	call	InitializeDialogInputInDSSIfromMenuitemInESDI
+	mov		ax, [es:di+MENUITEM.itemValue + ITEM_VALUE.szMultichoice]
+	mov		[si+DIALOG_INPUT.fszItems], ax
+	push	di
+	CALL_MENU_LIBRARY GetSelectionToAXwithInputInDSSI
+	pop		di
+
+	cmp		ax, BYTE NO_ITEM_SELECTED
+	je		SHORT .NothingToChange
+	call	Registers_CopyESDItoDSSI
+	call	Menuitem_StoreValueFromAXtoMenuitemInDSSI
+.NothingToChange:
+	add		sp, BYTE DIALOG_INPUT_size
+	ret
+
+
+;--------------------------------------------------------------------
+; Menuitem_ActivateHexInputForMenuitemInDSSI
+;	Parameters:
+;		DS:SI:	Ptr to MENUITEM
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, CX, SI, DI, ES
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Menuitem_ActivateHexInputForMenuitemInDSSI:
+	call	Registers_CopyDSSItoESDI
+
+	mov		cx, WORD_DIALOG_IO_size
+	call	Memory_ReserveCXbytesFromStackToDSSI
+	call	InitializeDialogInputInDSSIfromMenuitemInESDI
+	mov		BYTE [si+WORD_DIALOG_IO.bNumericBase], 16
+	jmp		SHORT ContinueWordInput
+
+;--------------------------------------------------------------------
+; Menuitem_ActivateUnsignedInputForMenuitemInDSSI
+;	Parameters:
+;		DS:SI:	Ptr to MENUITEM
+;	Returns:
+;		CF:		Cleared if value inputted
+;				Set if user cancellation
+;	Corrupts registers:
+;		AX, BX, CX, SI, DI, ES
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Menuitem_ActivateUnsignedInputForMenuitemInDSSI:
+	call	Registers_CopyDSSItoESDI
+
+	mov		cx, WORD_DIALOG_IO_size
+	call	Memory_ReserveCXbytesFromStackToDSSI
+	call	InitializeDialogInputInDSSIfromMenuitemInESDI
+	mov		BYTE [si+WORD_DIALOG_IO.bNumericBase], 10
+ContinueWordInput:
+	mov		ax, [es:di+MENUITEM.itemValue + ITEM_VALUE.wMinValue]
+	mov		[si+WORD_DIALOG_IO.wMin], ax
+	mov		ax, [es:di+MENUITEM.itemValue + ITEM_VALUE.wMaxValue]
+	mov		[si+WORD_DIALOG_IO.wMax], ax
+	push	di
+	CALL_MENU_LIBRARY GetWordWithIoInDSSI
+	pop		di
+
+	mov		cl, [si+WORD_DIALOG_IO.bUserCancellation]
+	cmp		cl, TRUE
+	je		SHORT .NothingToChange
+	mov		ax, [si+WORD_DIALOG_IO.wReturnWord]
+	call	Registers_CopyESDItoDSSI
+	call	Menuitem_StoreValueFromAXtoMenuitemInDSSI
+.NothingToChange:
+	add		sp, BYTE WORD_DIALOG_IO_size
+	shr		cl, 1
+	ret
+
+
+;--------------------------------------------------------------------
+; InitializeDialogInputInDSSIfromMenuitemInESDI
+;	Parameters:
+;		DS:SI:	Ptr to DIALOG_INPUT
+;		ES:DI:	Ptr to MENUITEM
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+InitializeDialogInputInDSSIfromMenuitemInESDI:
+	mov		ax, [es:di+MENUITEM.itemValue + ITEM_VALUE.szDialogTitle]
+	mov		[si+DIALOG_INPUT.fszTitle], ax
+	mov		[si+DIALOG_INPUT.fszTitle+2], cs
+
+	mov		[si+DIALOG_INPUT.fszItems+2], cs
+
+	mov		ax, [es:di+MENUITEM.szQuickInfo]
+	mov		[si+DIALOG_INPUT.fszInfo], ax
+	mov		[si+DIALOG_INPUT.fszInfo+2], cs
+	ret
+
+;--------------------------------------------------------------------
+; Menuitem_StoreValueFromAXtoMenuitemInDSSI
+;	Parameters:
+;		AX:		Value or multichoice selection to store
+;		DS:SI:	Ptr to MENUITEM
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, DI, ES
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Menuitem_StoreValueFromAXtoMenuitemInDSSI:
+	eMOVZX	bx, [si+MENUITEM.bType]
+	cmp		bl, TYPE_MENUITEM_HEX
+	ja		SHORT .InvalidItemType
+
+	call	GetConfigurationBufferToESDIforMenuitemInDSSI
+	add		di, [si+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
+		
+	push	bx
+	mov		bx,[si+MENUITEM.itemValue+ITEM_VALUE.fnValueWriter]
+	test	bx,bx
+	jz		SHORT .NoWriter
+	call	bx
+.NoWriter:
+	pop		bx
+		
+	jmp		[cs:bx+.rgfnJumpToStoreValueBasedOnItemType]
+.InvalidItemType:
+	ret
+
+ALIGN WORD_ALIGN
+.rgfnJumpToStoreValueBasedOnItemType:
+	dw		.InvalidItemType									; TYPE_MENUITEM_PAGEBACK
+	dw		.InvalidItemType									; TYPE_MENUITEM_PAGENEXT
+	dw		.InvalidItemType									; TYPE_MENUITEM_ACTION
+	dw		.StoreMultichoiceValueFromAXtoESDIwithItemInDSSI	; TYPE_MENUITEM_MULTICHOICE
+	dw		.StoreByteOrWordValueFromAXtoESDIwithItemInDSSI		; TYPE_MENUITEM_UNSIGNED
+	dw		.StoreByteOrWordValueFromAXtoESDIwithItemInDSSI		; TYPE_MENUITEM_HEX
+
+;--------------------------------------------------------------------
+; .StoreMultichoiceValueFromAXtoESDIwithItemInDSSI
+;	Parameters:
+;		AX:		Multichoice selection (index)
+;		DS:SI:	Ptr to MENUITEM
+;		ES:DI:	Ptr to value variable
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.StoreMultichoiceValueFromAXtoESDIwithItemInDSSI:
+	test	BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_MASKVALUE
+	jnz		SHORT .ClearBitsUsingMask
+	test	BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_FLAGVALUE
+	jz		SHORT .TranslateChoiceToValueUsingLookupTable
+
+	test	ax, ax			; Setting item flag?
+	mov		ax, [si+MENUITEM.itemValue+ITEM_VALUE.wValueBitmask]
+	jnz		SHORT .SetFlagFromAX
+	not		ax
+	and		[es:di], ax		; Clear flag
+	jmp		SHORT .SetUnsavedChanges
+ALIGN JUMP_ALIGN
+.SetFlagFromAX:
+	or		[es:di], ax
+	jmp		SHORT .SetUnsavedChanges
+
+ALIGN JUMP_ALIGN
+.ClearBitsUsingMask:
+	mov		bx, [si+MENUITEM.itemValue+ITEM_VALUE.wValueBitmask]
+	not		bx
+	and		[es:di], bx
+	; Fall to .TranslateChoiceToValueUsingLookupTable
+
+
+ALIGN JUMP_ALIGN
+.TranslateChoiceToValueUsingLookupTable:
+;
+; if the lookup pointer is NULL, no translation is needed
+;
+	mov		bx, [si+MENUITEM.itemValue+ITEM_VALUE.rgwChoiceToValueLookup]
+	test	bx, bx
+	jz		.StoreByteOrWordValueFromAXtoESDIwithItemInDSSI
+
+	shl		ax, 1			; Shift for WORD lookup
+	add		bx, ax
+	mov		ax, [bx]		; Lookup complete
+	; Fall to .StoreByteOrWordValueFromAXtoESDIwithItemInDSSI
+
+;--------------------------------------------------------------------
+; .StoreByteOrWordValueFromAXtoESDIwithItemInDSSI
+;	Parameters:
+;		AX:		Value to store
+;		DS:SI:	Ptr to MENUITEM
+;		ES:DI:	Ptr to value variable
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.StoreByteOrWordValueFromAXtoESDIwithItemInDSSI:
+	test	BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_MASKVALUE
+	jz		SHORT .StoreByteOrWord
+	push	cx
+	mov		cl, [si+MENUITEM.itemValue+ITEM_VALUE.bFieldPosition]
+	shl		ax, cl
+	pop		cx
+	or		[es:di], ax
+	jmp		SHORT .SetUnsavedChanges
+
+.StoreByteOrWord:
+	test	BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_BYTEVALUE
+	jnz		SHORT .StoreByteFromAL
+
+	mov		[es:di+1], ah
+ALIGN JUMP_ALIGN
+.StoreByteFromAL:
+	mov		[es:di], al
+	; Fall to .SetUnsavedChanges
+
+;--------------------------------------------------------------------
+; .SetUnsavedChanges
+;	Parameters:
+;		DS:SI:	Ptr to MENUITEM
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DI
+;--------------------------------------------------------------------
+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
+	CALL_MENU_LIBRARY RefreshTitle
+	CALL_MENU_LIBRARY GetHighlightedItemToAX
+	CALL_MENU_LIBRARY RefreshItemFromAX
+	ret
+
+ALIGN JUMP_ALIGN
+.ModifyItemVisibility:
+	push	es
+	push	ds
+	ePUSHA
+	call	Menupage_GetActiveMenupageToDSDI
+	call	[di+MENUPAGE.fnEnter]
+	ePOPA
+	pop		ds
+	pop		es
+	ret
+
+
+;--------------------------------------------------------------------
+; Menuitem_GetValueToAXfromMenuitemInDSSI
+;	Parameters:
+;		DS:SI:	Ptr to MENUITEM
+;	Returns:
+;		AX:		Menuitem value
+;	Corrupts registers:
+;		BX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Menuitem_GetValueToAXfromMenuitemInDSSI:
+	push	es
+	push	di
+	push	bx
+	call	GetConfigurationBufferToESDIforMenuitemInDSSI
+	add		di, [si+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
+	mov		ax, [es:di]
+
+	test	BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_BYTEVALUE
+	jz		SHORT .NoConvertWordToByteValue
+	xor		ah, ah				; conversion needs to happen before call to the reader,
+								; in case the reader unpacks the byte to a word
+
+.NoConvertWordToByteValue:
+	mov		bx, [si+MENUITEM.itemValue+ITEM_VALUE.fnValueReader]
+	test	bx,bx
+	jz		SHORT .NoReader
+
+	call	bx
+
+.NoReader:
+	pop		bx
+	pop		di
+	pop		es
+
+	test	BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_MASKVALUE
+	jz		SHORT .TestIfFlagValue
+
+	and		ax, [si+MENUITEM.itemValue+ITEM_VALUE.wValueBitmask]
+	push	cx
+	mov		cl, [si+MENUITEM.itemValue+ITEM_VALUE.bFieldPosition]
+	shr		ax, cl
+	pop		cx
+	ret
+
+.TestIfFlagValue:
+	test	BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_FLAGVALUE
+	jz		SHORT .Return
+
+	test	ax, [si+MENUITEM.itemValue+ITEM_VALUE.wValueBitmask]
+	mov		ax, TRUE<<1		; Shift for lookup
+	jnz		SHORT .Return
+	xor		ax, ax
+
+ALIGN JUMP_ALIGN, ret
+.Return:
+	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: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuitemPrint.asm
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuitemPrint.asm	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuitemPrint.asm	(revision 467)
@@ -0,0 +1,291 @@
+; Project name	:	XTIDE Universal BIOS Configurator v2
+; Description	:	Functions for printing MENUITEM name and value.
+
+;
+; XTIDE Universal BIOS and Associated Tools
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+;
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;
+
+; Section containing code
+SECTION .text
+
+;--------------------------------------------------------------------
+; MenuitemPrint_PrintQuickInfoFromDSSI
+;	Parameters:
+;		DS:SI:	Ptr to MENUITEM
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+MenuitemPrint_PrintQuickInfoFromDSSI:
+	push	si
+
+	mov		si, [si+MENUITEM.szQuickInfo]
+	CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI
+
+	pop		si
+	ret
+
+
+;--------------------------------------------------------------------
+; MenuitemPrint_NameWithPossibleValueFromDSSI
+;	Parameters:
+;		DS:SI:	Ptr to MENUITEM
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, DX, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+MenuitemPrint_NameWithPossibleValueFromDSSI:
+	eMOVZX	bx, [si+MENUITEM.bType]
+	cmp		bl, TYPE_MENUITEM_ACTION
+	ja		SHORT .PrintNameAndValueFromDSSI
+	; Fall to .PrintNameWithoutValueFromDSSI
+
+;--------------------------------------------------------------------
+; .PrintNameWithoutValueFromDSSI
+;	Parameters:
+;		BX:		Menuitem type (MENUITEM.bType)
+;		DS:SI:	Ptr to MENUITEM
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DI
+;--------------------------------------------------------------------
+.PrintNameWithoutValueFromDSSI:
+	push	bp
+	push	si
+
+	mov		bp, sp				; BP = SP before pushing parameters
+	push	WORD [cs:bx+.rgwMenuitemTypeCharacter]
+	push	WORD [si+MENUITEM.szName]
+	mov		si, g_szFormatItemWithoutValue
+	CALL_DISPLAY_LIBRARY FormatNullTerminatedStringFromCSSI
+
+	pop		si
+	pop		bp
+	ret
+.rgwMenuitemTypeCharacter:
+	dw		'-'		; TYPE_MENUITEM_PAGEBACK
+	dw		'+'		; TYPE_MENUITEM_PAGENEXT
+	dw		'*'		; TYPE_MENUITEM_ACTION
+
+
+;--------------------------------------------------------------------
+; .PrintNameAndValueFromDSSI
+;	Parameters:
+;		DS:SI:	Ptr to MENUITEM
+;		SS:BP:	Ptr to buffer for item value
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, DX, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.PrintNameAndValueFromDSSI:
+	eENTER_STRUCT	MAX_VALUE_STRING_LENGTH+2	; +2 for NULL and alignment
+	call	.FormatValueStringFromItemInDSSItoBufferInSSBP
+	call	.FormatNameFromItemInDSSIandValueFromSSBP
+	eLEAVE_STRUCT	MAX_VALUE_STRING_LENGTH+2
+	ret
+
+;--------------------------------------------------------------------
+; .FormatValueStringFromItemInDSSItoBufferInSSBP
+;	Parameters:
+;		DS:SI:	Ptr to MENUITEM
+;		SS:BP:	Ptr to buffer for item value
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, DX, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.FormatValueStringFromItemInDSSItoBufferInSSBP:
+	push	es
+	call	Registers_CopySSBPtoESDI
+	mov		al, '['
+	stosb
+	call	[si+MENUITEM.fnFormatValue]
+	mov		ax, ']'
+	stosw	; Also terminate with NULL
+	pop		es
+	ret
+
+;--------------------------------------------------------------------
+; .FormatNameFromItemInDSSIandValueFromSSBP
+;	Parameters:
+;		DS:SI:	Ptr to MENUITEM
+;		SS:BP:	Ptr to value string
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, DX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.FormatNameFromItemInDSSIandValueFromSSBP:
+	push	si
+
+	mov		bx, bp
+	mov		bp, sp				; BP = SP before pushing parameters
+	push	WORD [si+MENUITEM.szName]
+	push	bx
+	push	ss
+	mov		si, g_szFormatItemNameWithValue
+	CALL_DISPLAY_LIBRARY FormatNullTerminatedStringFromCSSI
+
+	mov		bp, bx
+	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:
+MenuitemPrint_WriteLookupValueStringToBufferInESDIfromRawItemInDSSI:
+	call	Menuitem_GetValueToAXfromMenuitemInDSSI
+	; Fall to PrintLookupValueFromAXtoBufferInESDI
+
+;--------------------------------------------------------------------
+; MenuitemPrint_WriteLookupValueStringToBufferInESDIfromItemInDSSI
+;	Parameters:
+;		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
+	test	byte [si+MENUITEM.bFlags], FLG_MENUITEM_CHOICESTRINGS
+	jnz		.lookupChoice
+
+	add		ax, [si+MENUITEM.itemValue+ITEM_VALUE.rgszValueToStringLookup]
+	xchg	bx, ax
+.found:
+	mov		si, [bx]
+.errorReturn:
+	call	String_CopyDSSItoESDIandGetLengthToCX
+	pop		si
+	ret
+
+;
+; With FLG_MENUITEM_CHOICESTRINGS, the array at .rgszChoiceToStringLookup is based on the
+; Choice number (offset within .rgwChoiceToValueLookup) instead of the value stored.
+; Here, we scan the .rgwChoiceToValueLookup array until we find the value there, and then
+; use the same offset in .rgszChoiceToStringLookup.  If we don't find the value, we
+; return an "Error!" string instead.
+;
+; Note that the pointer array at .rgszChoiceToStringLookup must be NULL terminated.  Since the
+; value could be zero, we don't use the .rgwChoiceToValueLookup array to find the end.
+;
+.lookupChoice:
+	mov		bx,[si+MENUITEM.itemValue+ITEM_VALUE.rgszChoiceToStringLookup]
+	mov		si,[si+MENUITEM.itemValue+ITEM_VALUE.rgwChoiceToValueLookup]
+
+.wordLoop:
+	cmp		ax,[si]
+	jz		.found
+	inc		bx
+	inc		bx
+	inc		si
+	inc		si
+	cmp		word [bx],0
+	jnz		.wordLoop
+
+	mov		si,g_szValueUnknownError
+	jmp		.errorReturn
+
+;--------------------------------------------------------------------
+; MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
+;	Parameters:
+;		DS:SI:	Ptr to MENUITEM
+;		ES:DI:	Ptr to destination buffer
+;	Returns:
+;		DI:		Updated
+;	Corrupts registers:
+;		AX, BX, CX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI:
+	mov		bx, di
+	mov		cx, MAX_VALUE_STRING_LENGTH
+	CALL_DISPLAY_LIBRARY PushDisplayContext
+	CALL_DISPLAY_LIBRARY PrepareOffScreenBufferInESBXwithLengthInCX
+
+	call	Menuitem_GetValueToAXfromMenuitemInDSSI
+	mov		bx, 10
+	CALL_DISPLAY_LIBRARY PrintWordFromAXwithBaseInBX
+	jmp		SHORT MenuitemPrint_FinishPrintingUnsignedOrHexValue
+
+;--------------------------------------------------------------------
+; MenuitemPrint_WriteHexValueStringToBufferInESDIfromItemInDSSI
+;	Parameters:
+;		DS:SI:	Ptr to MENUITEM
+;		ES:DI:	Ptr to destination buffer
+;	Returns:
+;		DI:		Updated
+;	Corrupts registers:
+;		AX, BX, CX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+MenuitemPrint_WriteHexValueStringToBufferInESDIfromItemInDSSI:
+	mov		bx, di
+	mov		cx, MAX_VALUE_STRING_LENGTH
+	CALL_DISPLAY_LIBRARY PushDisplayContext
+	CALL_DISPLAY_LIBRARY PrepareOffScreenBufferInESBXwithLengthInCX
+
+	call	Menuitem_GetValueToAXfromMenuitemInDSSI
+	mov		bx, 16
+	CALL_DISPLAY_LIBRARY PrintWordFromAXwithBaseInBX
+	mov		al, 'h'
+	CALL_DISPLAY_LIBRARY PrintCharacterFromAL
+ALIGN JUMP_ALIGN
+MenuitemPrint_FinishPrintingUnsignedOrHexValue:
+	CALL_DISPLAY_LIBRARY GetCharacterPointerToBXAX
+	xchg	bx, ax
+
+	CALL_DISPLAY_LIBRARY PopDisplayContext
+	mov		di, bx
+	ret
+
+
+; Section containing initialized data
+SECTION .data
+
+ALIGN WORD_ALIGN
+g_rgszValueToStringLookupForFlagBooleans:
+	dw		g_szNo
+	dw		g_szYes
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupage.asm
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupage.asm	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupage.asm	(revision 467)
@@ -0,0 +1,139 @@
+; Project name	:	XTIDE Universal BIOS Configurator v2
+; Description	:	Functions for accessing MENUPAGE structs.
+
+;
+; XTIDE Universal BIOS and Associated Tools 
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+; 
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;		
+
+; Section containing code
+SECTION .text
+
+;--------------------------------------------------------------------
+; Menupage_ChangeToNewMenupageInDSSI
+;	Parameters:
+;		DS:SI:	Ptr to new MENUPAGE
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Menupage_ChangeToNewMenupageInDSSI:
+	mov		di, si
+	call	Menupage_SetActiveMenupageFromDSDI
+	call	Menupage_GetVisibleMenuitemsToAXfromDSDI
+	CALL_MENU_LIBRARY SetTotalItemsFromAX
+	xor		ax, ax
+	CALL_MENU_LIBRARY HighlightItemFromAX
+	CALL_MENU_LIBRARY RefreshWindow
+	ret
+
+
+;--------------------------------------------------------------------
+; SetActiveMenupageFromDSDI
+;	Parameters:
+;		DS:DI:	Ptr to MENUPAGE to set active
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Menupage_SetActiveMenupageFromDSDI:
+	mov		[g_cfgVars+CFGVARS.pMenupage], di
+	ret
+
+
+;--------------------------------------------------------------------
+; Menupage_GetActiveMenupageToDSDI:
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		DS:DI:	Ptr to MENUPAGE
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Menupage_GetActiveMenupageToDSDI:
+	push	cs
+	pop		ds
+	mov		di, [g_cfgVars+CFGVARS.pMenupage]
+	ret
+
+
+;--------------------------------------------------------------------
+; Menupage_GetVisibleMenuitemsToAXfromDSDI
+;	Parameters:
+;		DS:DI:	Ptr to MENUPAGE
+;	Returns:
+;		AX:		Number of visible MENUITEMs in MENUPAGE
+;	Corrupts registers:
+;		BX, CX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Menupage_GetVisibleMenuitemsToAXfromDSDI:
+	xor		ax, ax
+	mov		cx, [di+MENUPAGE.wMenuitems]
+	lea		bx, [di+MENUPAGE.rgMenuitem]
+
+ALIGN JUMP_ALIGN
+.CheckVisibilityFromNextMenuitem:
+	test	BYTE [bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
+	jz		SHORT .PrepareToLoop
+	inc		ax
+.PrepareToLoop:
+	add		bx, BYTE MENUITEM_size
+	loop	.CheckVisibilityFromNextMenuitem
+	ret
+
+
+;--------------------------------------------------------------------
+; Menupage_GetCXthVisibleMenuitemToDSSIfromDSDI
+;	Parameters:
+;		CX:		nth visible MENUITEM to find
+;		DS:DI:	Ptr to MENUPAGE
+;	Returns:
+;		DS:SI:	Ptr to CXth visible MENUITEM
+;		CF:		Set if MENUITEM found
+;				Cleared if MENUITEM not found
+;	Corrupts registers:
+;		AX, CX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Menupage_GetCXthVisibleMenuitemToDSSIfromDSDI:
+	mov		ax, [di+MENUPAGE.wMenuitems]
+	cmp		cx, ax
+	jae		SHORT .MenuitemNotFound
+	xchg	ax, cx
+	inc		ax
+	lea		si, [di+MENUPAGE.rgMenuitem]
+ALIGN JUMP_ALIGN
+.CheckNextMenuitem:
+	test	BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
+	jz		SHORT .PrepareToLoop
+	dec		ax
+	jz		SHORT .MenuitemFound
+.PrepareToLoop:
+	add		si, BYTE MENUITEM_size
+	loop	.CheckNextMenuitem
+.MenuitemNotFound:
+	clc
+	ret
+ALIGN JUMP_ALIGN
+.MenuitemFound:
+	stc
+	ret
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm	(revision 467)
@@ -0,0 +1,263 @@
+; Project name	:	XTIDE Universal BIOS Configurator v2
+; Description	:	"Boot Menu Settings" menu structs and functions.
+
+;
+; XTIDE Universal BIOS and Associated Tools
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+;
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;
+
+; 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_MenuitemBootMnuStngsDisplayMode:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromUnshiftedItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemBootDispMode
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoDispMode
+	at	MENUITEM.szHelp,			dw	g_szNfoDispMode
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_MULTICHOICE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	ROMVARS.wDisplayMode
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgBootDispMode
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoice,				dw	g_szMultichoiceBootDispMode
+	at	MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup,		dw	g_rgwChoiceToValueLookupForDisplayModes
+	at	MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup,	dw	g_rgszValueToStringLookupForDisplayModes
+iend
+
+g_MenuitemBootMnuStngsFloppyDrives:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
+	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_MULTICHOICE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	ROMVARS.bMinFddCnt
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgBootFloppyDrvs
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoice,				dw	g_szMultichoiceBootFloppyDrvs
+	at	MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup,		dw	NULL
+	at	MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup,	dw	g_rgszValueToStringLookupForFloppyDrives
+iend
+
+g_MenuitemBootMenuSerialScanDetect:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemSerialDetect
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoSerialDetect
+	at	MENUITEM.szHelp,			dw	g_szHelpSerialDetect
+	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_szDlgSerialDetect
+	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_SERIAL_SCANDETECT
+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_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_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	NULL
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_UNSIGNED
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	ROMVARS.wBootTimeout
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgBootTimeout
+	at	MENUITEM.itemValue + ITEM_VALUE.wMinValue,					dw	2
+	at	MENUITEM.itemValue + ITEM_VALUE.wMaxValue,					dw	1092
+iend
+
+
+g_rgwChoiceToValueLookupForEnableBootMenu:
+	dw	FALSE
+	dw	BOOT_MENU_DEFAULT_TIMEOUT
+
+g_rgwChoiceToValueLookupForDisplayModes:
+	dw	DEFAULT_TEXT_MODE
+	dw	CGA_TEXT_MODE_BW40
+	dw	CGA_TEXT_MODE_CO40
+	dw	CGA_TEXT_MODE_BW80
+	dw	CGA_TEXT_MODE_CO80
+	dw	MDA_TEXT_MODE
+g_rgszValueToStringLookupForDisplayModes:
+	dw	g_szValueBootDispModeBW40
+	dw	g_szValueBootDispModeCO40
+	dw	g_szValueBootDispModeBW80
+	dw	g_szValueBootDispModeCO80
+	dw	g_szValueBootDispModeDefault
+	dw	NULL
+	dw	NULL
+	dw	g_szValueBootDispModeMono
+
+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
+	call	.EnableOrDisableScanForSerialDrives
+	call	.EnableOrDisableDefaultBootDrive
+	call	.EnableOrDisableBootMenuSelectionTimeout
+	mov		si, g_MenupageForBootMenuSettingsMenu
+	jmp		Menupage_ChangeToNewMenupageInDSSI
+
+
+;--------------------------------------------------------------------
+; .EnableOrDisableScanForSerialDrives
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableOrDisableScanForSerialDrives:
+	call	Buffers_GetRomvarsFlagsToAX
+	mov		bx, g_MenuitemBootMenuSerialScanDetect
+	test	ax, FLG_ROMVARS_MODULE_SERIAL
+	jmp		SHORT .DisableMenuitemFromCSBXifZFset
+
+
+;--------------------------------------------------------------------
+; .EnableOrDisableDefaultBootDrive
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableOrDisableDefaultBootDrive:
+	call	Buffers_GetRomvarsFlagsToAX
+	mov		bx, g_MenuitemBootMnuStngsDefaultBootDrive
+	test	ax, FLG_ROMVARS_MODULE_HOTKEYS
+	jmp		SHORT .DisableMenuitemFromCSBXifZFset
+
+
+;--------------------------------------------------------------------
+; .EnableOrDisableBootMenuSelectionTimeout
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableOrDisableBootMenuSelectionTimeout:
+	call	Buffers_GetRomvarsFlagsToAX
+	mov		bx, g_MenuitemBootMnuStngsSelectionTimeout
+	test	ax, FLG_ROMVARS_MODULE_BOOT_MENU
+.DisableMenuitemFromCSBXifZFset:
+	jz		SHORT .DisableMenuitemFromCSBX
+	; Fall to .EnableMenuitemFromCSBX
+
+
+;--------------------------------------------------------------------
+; .EnableMenuitemFromCSBX
+; .DisableMenuitemFromCSBX
+;	Parameters:
+;		CS:BX:	Ptr to MENUITEM
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableMenuitemFromCSBX:
+	or		BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
+	ret
+
+ALIGN JUMP_ALIGN
+.DisableMenuitemFromCSBX:
+	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
+ValueReaderForEnableBootMenu:
+	test	ax, ax
+	jz		SHORT .NoNeedToModify
+	mov		ax, TRUE<<1
+.NoNeedToModify:
+	ret
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/ConfigurationMenu.asm
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/ConfigurationMenu.asm	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/ConfigurationMenu.asm	(revision 467)
@@ -0,0 +1,482 @@
+; Project name	:	XTIDE Universal BIOS Configurator v2
+; Description	:	"Configure XTIDE Universal BIOS" menu structs and functions.
+
+;
+; XTIDE Universal BIOS and Associated Tools
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+;
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;
+
+; Section containing initialized data
+SECTION .data
+
+ALIGN WORD_ALIGN
+g_MenupageForConfigurationMenu:
+istruc MENUPAGE
+	at	MENUPAGE.fnEnter,			dw	ConfigurationMenu_EnterMenuOrModifyItemVisibility
+	at	MENUPAGE.fnBack,			dw	MainMenu_EnterMenuOrModifyItemVisibility
+	at	MENUPAGE.wMenuitems,		dw	10
+iend
+
+g_MenuitemConfigurationBackToMainMenu:
+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_MenuitemConfigurationPrimaryIdeController:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	PrimaryIdeController
+	at	MENUITEM.szName,			dw	g_szItemCfgIde1
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoCfgIde
+	at	MENUITEM.szHelp,			dw	g_szNfoCfgIde
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_PAGENEXT
+iend
+
+g_MenuitemConfigurationSecondaryIdeController:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	SecondaryIdeController
+	at	MENUITEM.szName,			dw	g_szItemCfgIde2
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoCfgIde
+	at	MENUITEM.szHelp,			dw	g_szNfoCfgIde
+	at	MENUITEM.bFlags,			db	NULL
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_PAGENEXT
+iend
+
+g_MenuitemConfigurationTertiaryIdeController:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	TertiaryIdeController
+	at	MENUITEM.szName,			dw	g_szItemCfgIde3
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoCfgIde
+	at	MENUITEM.szHelp,			dw	g_szNfoCfgIde
+	at	MENUITEM.bFlags,			db	NULL
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_PAGENEXT
+iend
+
+g_MenuitemConfigurationQuaternaryIdeController:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	QuaternaryIdeController
+	at	MENUITEM.szName,			dw	g_szItemCfgIde4
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoCfgIde
+	at	MENUITEM.szHelp,			dw	g_szNfoCfgIde
+	at	MENUITEM.bFlags,			db	NULL
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_PAGENEXT
+iend
+
+g_MenuitemConfigurationBootMenuSettings:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	BootMenuSettingsMenu_EnterMenuOrModifyItemVisibility
+	at	MENUITEM.szName,			dw	g_szItemCfgBootMenu
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoCfgBootMenu
+	at	MENUITEM.szHelp,			dw	g_szNfoCfgBootMenu
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_PAGENEXT
+iend
+
+g_MenuitemConfigurationFullOperatingMode:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemCfgFullMode
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoCfgFullMode
+	at	MENUITEM.szHelp,			dw	g_szHelpCfgFullMode
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_MODIFY_MENU | 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_szDlgCfgFullMode
+	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_FULLMODE
+iend
+
+g_MenuitemConfigurationKiBtoStealFromRAM:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateUnsignedInputForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemCfgStealSize
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoCfgStealSize
+	at	MENUITEM.szHelp,			dw	g_szHelpCfgStealSize
+	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.bStealSize
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgCfgStealSize
+	at	MENUITEM.itemValue + ITEM_VALUE.wMinValue,					dw	1
+	at	MENUITEM.itemValue + ITEM_VALUE.wMaxValue,					dw	255
+iend
+
+g_MenuitemConfigurationIdeControllers:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	ActivateInputForNumberOfIdeControllersMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemCfgIdeCnt
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoCfgIdeCnt
+	at	MENUITEM.szHelp,			dw	g_szNfoCfgIdeCnt
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE | FLG_MENUITEM_MODIFY_MENU | FLG_MENUITEM_BYTEVALUE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_UNSIGNED
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	ROMVARS.bIdeCnt
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgCfgIdeCnt
+	at	MENUITEM.itemValue + ITEM_VALUE.wMinValue,					dw	1
+	at	MENUITEM.itemValue + ITEM_VALUE.wMaxValue,					dw	MAX_ALLOWED_IDE_CONTROLLERS
+iend
+
+g_MenuitemConfigurationIdleTimeout:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromRawItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemCfgIdleTimeout
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoCfgIdleTimeout
+	at	MENUITEM.szHelp,			dw	g_szHelpCfgIdleTimeout
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_CHOICESTRINGS
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_MULTICHOICE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	ROMVARS.bIdleTimeout
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgCfgIdleTimeout
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoice,				dw	g_szMultichoiceIdleTimeout
+	at	MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup,		dw	g_rgwChoiceToValueLookupForIdleTimeout
+	at	MENUITEM.itemValue + ITEM_VALUE.rgszChoiceToStringLookup,	dw	g_rgszChoiceToStringLookupForIdleTimeout
+iend
+
+g_rgwChoiceToValueLookupForIdleTimeout:
+	%assign i -12
+	%rep 21
+		%assign i i+12
+		dw	i		; i / 12 = 0 (disabled) or 1...20 minutes
+	%endrep
+	%rep 4
+		%assign i i+1
+		dw	i		; 241...244 = (i - 240) * 30 minutes
+	%endrep
+g_rgszChoiceToStringLookupForIdleTimeout:
+	%assign i 0
+	%rep 25
+		dw	g_szIdleTimeoutChoice%[i]
+		%assign i i+1
+	%endrep
+	;	dw	NULL	; Is this needed? *FIXME*
+
+; Section containing code
+SECTION .text
+
+;--------------------------------------------------------------------
+; MainMenu_EnterMenuOrModifyItemVisibility
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		All, except BP
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+ConfigurationMenu_EnterMenuOrModifyItemVisibility:
+	push	cs
+	pop		ds
+	call	.DisableAllIdeControllerMenuitems
+	call	.EnableIdeControllerMenuitemsBasedOnConfiguration
+	call	.EnableOrDisableOperatingModeSelection
+	call	.EnableOrDisableKiBtoStealFromRAM
+	call	.EnableOrDisableIdleTimeout
+	call	LimitIdeControllersForLiteMode
+	mov		si, g_MenupageForConfigurationMenu
+	jmp		Menupage_ChangeToNewMenupageInDSSI
+
+;--------------------------------------------------------------------
+; .DisableAllIdeControllerMenuitems
+; .EnableIdeControllerMenuitemsBasedOnConfiguration
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, CX, DI, ES
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.DisableAllIdeControllerMenuitems:
+	mov		cx, MAX_ALLOWED_IDE_CONTROLLERS-1
+	mov		bx, g_MenuitemConfigurationSecondaryIdeController
+ALIGN JUMP_ALIGN
+.DisableNextIdeControllerMenuitem:
+	call	.DisableMenuitemFromCSBX
+	add		bx, BYTE MENUITEM_size
+	loop	.DisableNextIdeControllerMenuitem
+	ret
+
+ALIGN JUMP_ALIGN
+.EnableIdeControllerMenuitemsBasedOnConfiguration:
+	call	Buffers_GetIdeControllerCountToCX
+	dec		cx			; Primary always enabled
+	jz		SHORT .PrimaryControllerAlreadyEnabled
+	mov		bx, g_MenuitemConfigurationSecondaryIdeController
+ALIGN JUMP_ALIGN
+.EnableNextIdeControllerMenuitem:
+	call	.EnableMenuitemFromCSBX
+	add		bx, BYTE MENUITEM_size
+	loop	.EnableNextIdeControllerMenuitem
+.PrimaryControllerAlreadyEnabled:
+	ret
+
+
+;--------------------------------------------------------------------
+; .EnableOrDisableOperatingModeSelection
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		BX, DI, ES
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableOrDisableOperatingModeSelection:
+	mov		bx, g_MenuitemConfigurationFullOperatingMode
+	call	Buffers_IsXTbuildLoaded
+	je		SHORT .EnableMenuitemFromCSBX
+	jmp		SHORT .DisableMenuitemFromCSBX
+
+
+;--------------------------------------------------------------------
+; .EnableOrDisableKiBtoStealFromRAM
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, CX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableOrDisableKiBtoStealFromRAM:
+	call	Buffers_GetRomvarsFlagsToAX
+	mov		bx, g_MenuitemConfigurationKiBtoStealFromRAM
+	test	ax, FLG_ROMVARS_FULLMODE
+	jz		SHORT .DisableMenuitemFromCSBX
+	jmp		SHORT .EnableMenuitemFromCSBX
+
+
+;--------------------------------------------------------------------
+; .EnableOrDisableIdleTimeout
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableOrDisableIdleTimeout:
+	call	Buffers_GetRomvarsFlagsToAX
+	mov		bx, g_MenuitemConfigurationIdleTimeout
+	test	ax, FLG_ROMVARS_MODULE_FEATURE_SETS
+	jz		SHORT .DisableMenuitemFromCSBX
+	; Fall to .EnableMenuitemFromCSBX
+
+
+;--------------------------------------------------------------------
+; .EnableMenuitemFromCSBX
+; .DisableMenuitemFromCSBX
+;	Parameters:
+;		CS:BX:	Ptr to MENUITEM
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableMenuitemFromCSBX:
+	or		BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
+	ret
+
+ALIGN JUMP_ALIGN
+.DisableMenuitemFromCSBX:
+	and		BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
+	ret
+
+
+
+;--------------------------------------------------------------------
+; MENUITEM activation functions (.fnActivate)
+;	Parameters:
+;		SS:BP:	Ptr to MENU
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		All, except segments
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+PrimaryIdeController:
+	mov		bx, ROMVARS.ideVars0
+	jmp		SHORT DisplayIdeControllerMenu
+
+ALIGN JUMP_ALIGN
+SecondaryIdeController:
+	mov		bx, ROMVARS.ideVars1
+	jmp		SHORT DisplayIdeControllerMenu
+
+ALIGN JUMP_ALIGN
+TertiaryIdeController:
+	mov		bx, ROMVARS.ideVars2
+	jmp		SHORT DisplayIdeControllerMenu
+
+ALIGN JUMP_ALIGN
+QuaternaryIdeController:
+	mov		bx, ROMVARS.ideVars3
+	; Fall to DisplayIdeControllerMenu
+
+ALIGN JUMP_ALIGN
+DisplayIdeControllerMenu:
+	call	IdeControllerMenu_InitializeToIdevarsOffsetInBX
+	jmp		IdeControllerMenu_EnterMenuOrModifyItemVisibility
+
+
+ALIGN JUMP_ALIGN
+ActivateInputForNumberOfIdeControllersMenuitemInDSSI:
+	call	Menuitem_ActivateUnsignedInputForMenuitemInDSSI
+	; Fall to LimitIdeControllersForLiteMode
+
+;--------------------------------------------------------------------
+; LimitIdeControllersForLiteMode
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, CX, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+LimitIdeControllersForLiteMode:
+	push	es
+	call	Buffers_GetIdeControllerCountToCX
+	mov		[es:di+ROMVARS.bIdeCnt], cl
+	CALL_MENU_LIBRARY GetHighlightedItemToAX
+	CALL_MENU_LIBRARY RefreshItemFromAX
+	pop		es
+	; Fall to ConfigurationMenu_CheckAndMoveSerialDrivesToBottom
+
+;----------------------------------------------------------------------
+; ConfigurationMenu_CheckAndMoveSerialDrivesToBottom
+;
+; Checks to ensure that serial adapters are at the end of the
+; IDEVARS structures list, as serial floppies (if present) need to be
+; the last drives detected by the BIOS.  If there are other controllers
+; after a serial controller, the other controllers are moved up on the list
+; and the serial controller is placed at the end of the list.
+;
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		All
+;----------------------------------------------------------------------
+ConfigurationMenu_CheckAndMoveSerialDrivesToBottom:
+	push	es
+	push	ds
+	push	di
+	push	si
+
+	call	Buffers_GetIdeControllerCountToCX	; will also set ES:DI to point to file buffer
+	push	es
+	pop		ds
+	xor		ch, ch						; clearing high order of CX and notification flag
+	mov		dx, cx						; (probably unnecessary, CX should be less than 127, but just to be sure)
+	jcxz	.done						; probably unnecessary, but make sure there is at least one controller
+
+	lea		bx, [di+ROMVARS.ideVars0]	; add in offset of first idevars
+
+.outerLoop:
+	mov		di, bx						; start of idevars
+	xor		si, si						; first serial found
+	xor		ax, ax						; first non-serial found
+	mov		cl, dl						; idevars count
+	xor		ch, ch
+
+.loop:
+	cmp		byte [di+IDEVARS.bDevice], DEVICE_SERIAL_PORT
+	jnz		.notSerial
+
+	test	si, si						; record the first serial controller that we find
+	jnz		.next
+	mov		si, di
+	jmp		.next
+
+.notSerial:
+	mov		ax, di						; record the *last* non-serial controller that we find
+
+.next:
+	add		di, IDEVARS_size
+	loop	.loop
+
+	test	si, si						; no serial drives, nothing to do
+	jz		.done
+	cmp		si, ax						; serial port is already later on the list than any other controllers
+	ja		.done						; (also takes care of the case where there are no other controllers)
+
+;
+; move serial to end of list, others up
+;
+	cld
+
+	mov		ax, di						; save end pointer of list after scan
+
+	sub		sp, IDEVARS_size			; copy serial to temporary space on stack
+
+	mov		di, sp
+
+	mov		cx, IDEVARS_size
+	push	ss
+	pop		es
+
+	rep	movsb
+
+	lea		di, [si-IDEVARS_size]		; move up all the idevars below the serial, by one slot
+
+	mov		cx, ax						; restore end pointer of list, subtract off end of serial idevars
+	sub		cx, si
+
+	push	ds
+	pop		es
+
+	rep	movsb
+
+	mov		si, sp						; place serial (currently on the stack) at bottom of list
+	push	ss
+	pop		ds
+	mov		cx, IDEVARS_size
+	; di is already at last IDEVARS position
+
+	rep	movsb
+
+	add		sp, IDEVARS_size
+
+	push	es
+	pop		ds
+
+	mov		dh, 1						; set flag that we have done a relocation
+
+	jmp		.outerLoop
+
+.done:
+	pop		si
+	pop		di
+	pop		ds
+	pop		es
+
+	test	dh, dh
+	jz		.noWorkDone
+
+	mov		dx, g_szSerialMoved
+	call	Dialogs_DisplayNotificationFromCSDX
+
+.noWorkDone:
+	ret
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm	(revision 467)
@@ -0,0 +1,409 @@
+; Project name	:	XTIDE Universal BIOS Configurator v2
+; Description	:	"Flash EEPROM" menu structs and functions.
+
+;
+; XTIDE Universal BIOS and Associated Tools 
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+; 
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;				
+
+; 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_ActivateMultichoiceSelectionForMenuitemInDSSI
+	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_MULTICHOICE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	CFGVARS.bEepromType
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgFlashEepromType
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoice,				dw	g_szMultichoiceEepromType
+	at	MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup,		dw	g_rgwChoiceToValueLookupForEepromType
+	at	MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup,	dw	g_rgszValueToStringLookupForEepromType
+iend
+
+g_MenuitemFlashSdpCommand:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
+	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_MULTICHOICE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	CFGVARS.bSdpCommand
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgFlashSDP
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoice,				dw	g_szMultichoiceSdpCommand
+	at	MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup,		dw	g_rgwChoiceToValueLookupForSdpCommand
+	at	MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup,	dw	g_rgszValueToStringLookupForSdpCommand
+iend
+
+g_MenuitemFlashPageSize:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
+	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_MULTICHOICE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	CFGVARS.bEepromPage
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgFlashPageSize
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoice,				dw	g_szMultichoicePageSize
+	at	MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup,		dw	g_rgwChoiceToValueLookupForPageSize
+	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_ActivateMultichoiceSelectionForMenuitemInDSSI
+	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_MULTICHOICE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	CFGVARS.wFlags
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgFlashChecksum
+	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_CFGVARS_CHECKSUM
+iend
+
+g_rgwChoiceToValueLookupForEepromType:
+	dw	EEPROM_TYPE.2816_2kiB
+	dw	EEPROM_TYPE.2864_8kiB
+	dw	EEPROM_TYPE.2864_8kiB_MOD
+	dw	EEPROM_TYPE.28256_32kiB
+	dw	EEPROM_TYPE.28512_64kiB
+g_rgszValueToStringLookupForEepromType:
+	dw	g_szValueFlash2816
+	dw	g_szValueFlash2864
+	dw	g_szValueFlash2864Mod
+	dw	g_szValueFlash28256
+	dw	g_szValueFlash28512
+
+g_rgwChoiceToValueLookupForSdpCommand:
+	dw	SDP_COMMAND.none
+	dw	SDP_COMMAND.enable
+	dw	SDP_COMMAND.disable
+g_rgszValueToStringLookupForSdpCommand:
+	dw	g_szValueFlashNone
+	dw	g_szValueFlashEnable
+	dw	g_szValueFlashDisable
+
+g_rgwChoiceToValueLookupForPageSize:
+	dw	EEPROM_PAGE.1_byte
+	dw	EEPROM_PAGE.2_bytes
+	dw	EEPROM_PAGE.4_bytes
+	dw	EEPROM_PAGE.8_bytes
+	dw	EEPROM_PAGE.16_bytes
+	dw	EEPROM_PAGE.32_bytes
+	dw	EEPROM_PAGE.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
+
+	cmp		word [cs:g_cfgVars+CFGVARS.wEepromSegment], 0
+	jnz		.alreadySet
+
+	push	es
+	push	di
+	call	EEPROM_FindXtideUniversalBiosROMtoESDI
+	push	es
+	pop		ax
+	pop		di
+	pop		es
+	jc		.storeEepromSegment
+	mov		ax, DEFAULT_EEPROM_SEGMENT
+.storeEepromSegment:	
+	mov		word [cs:g_cfgVars+CFGVARS.wEepromSegment], ax
+		
+.alreadySet:	
+				
+	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:
+	call	.MakeSureThatImageFitsInEeprom
+	jc		SHORT .InvalidFlashingParameters
+	push	es
+	push	ds
+
+	call	.PrepareBuffersForFlashing
+	mov		cx, FLASHVARS_size + PROGRESS_DIALOG_IO_size
+	call	Memory_ReserveCXbytesFromStackToDSSI
+	call	.InitializeFlashvarsFromDSSI
+	mov		bx, si							; DS:BX now points to FLASHVARS
+	add		si, BYTE FLASHVARS_size			; DS:SI now points to PROGRESS_DIALOG_IO
+	call	Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX
+	call	.DisplayFlashingResultsFromFlashvarsInDSBX
+
+	add		sp, BYTE FLASHVARS_size + PROGRESS_DIALOG_IO_size
+	pop		ds
+	pop		es
+.InvalidFlashingParameters:
+	ret
+
+;--------------------------------------------------------------------
+; .MakeSureThatImageFitsInEeprom
+;	Parameters:
+;		SS:BP:	Ptr to MENU
+;	Returns:
+;		CF:		Set if EEPROM too small
+;	Corrupts registers:
+;		AX, BX, DX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.MakeSureThatImageFitsInEeprom:
+	call	.GetSelectedEepromSizeInWordsToAX
+	cmp		ax, [cs:g_cfgVars+CFGVARS.wImageSizeInWords]
+	jae		SHORT .ImageFitsInSelectedEeprom
+	mov		dx, g_szErrEepromTooSmall
+	call	Dialogs_DisplayErrorFromCSDX
+	stc
+ALIGN JUMP_ALIGN, ret
+.ImageFitsInSelectedEeprom:
+	ret
+
+;--------------------------------------------------------------------
+; .PrepareBuffersForFlashing
+;	Parameters:
+;		SS:BP:	Ptr to MENU
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, CX, SI, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.PrepareBuffersForFlashing:
+	call	EEPROM_LoadFromRomToRamComparisonBuffer
+	call	Buffers_AppendZeroesIfNeeded
+	test	WORD [cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_CHECKSUM
+	jz		SHORT .DoNotGenerateChecksumByte
+	jmp		Buffers_GenerateChecksum
+.DoNotGenerateChecksumByte:
+	ret
+
+;--------------------------------------------------------------------
+; .InitializeFlashvarsFromDSSI
+;	Parameters:
+;		DS:SI:	Ptr to FLASHVARS to initialize
+;		SS:BP:	Ptr to MENU
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, DX, DI, ES
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.InitializeFlashvarsFromDSSI:
+	call	Buffers_GetFileBufferToESDI
+	mov		[si+FLASHVARS.fpNextSourcePage], di
+	mov		[si+FLASHVARS.fpNextSourcePage+2], es
+
+	call	Buffers_GetFlashComparisonBufferToESDI
+	mov		[si+FLASHVARS.fpNextComparisonPage], di
+	mov		[si+FLASHVARS.fpNextComparisonPage+2], es
+
+	mov		ax, [cs:g_cfgVars+CFGVARS.wEepromSegment]
+	mov		WORD [si+FLASHVARS.fpNextDestinationPage], 0
+	mov		[si+FLASHVARS.fpNextDestinationPage+2], ax
+
+	mov		al, [cs:g_cfgVars+CFGVARS.bEepromType]
+	mov		[si+FLASHVARS.bEepromType], al
+
+	mov		al, [cs:g_cfgVars+CFGVARS.bSdpCommand]
+	mov		[si+FLASHVARS.bEepromSdpCommand], al
+
+	eMOVZX	bx, [cs:g_cfgVars+CFGVARS.bEepromPage]
+	mov		ax, [cs:bx+g_rgwEepromPageToSizeInBytes]
+	mov		[si+FLASHVARS.wEepromPageSize], ax
+
+	call	.GetNumberOfPagesToFlashToAX
+	mov		[si+FLASHVARS.wPagesToFlash], ax
+	ret
+
+;--------------------------------------------------------------------
+; .GetNumberOfPagesToFlashToAX
+;	Parameters:
+;		DS:SI:	Ptr to FLASHVARS to initialize
+;	Returns:
+;		AX:		Number of pages to flash (0 = 65536)
+;	Corrupts registers:
+;		BX, DX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.GetNumberOfPagesToFlashToAX:
+	call	.GetSelectedEepromSizeInWordsToAX
+	xor		dx, dx
+	shl		ax, 1		; Size in bytes to...
+	rcl		dx, 1		; ...DX:AX
+
+	cmp		WORD [si+FLASHVARS.wEepromPageSize], BYTE 1
+	jbe		SHORT .PreventDivideException
+	div		WORD [si+FLASHVARS.wEepromPageSize]
+.PreventDivideException:
+	ret
+
+;--------------------------------------------------------------------
+; .GetSelectedEepromSizeInWordsToAX
+;	Parameters:
+;		Nothing
+;	Returns:
+;		AX:		Selected EEPROM size in WORDs
+;	Corrupts registers:
+;		BX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.GetSelectedEepromSizeInWordsToAX:
+	eMOVZX	bx, [cs:g_cfgVars+CFGVARS.bEepromType]
+	mov		ax, [cs:bx+g_rgwEepromTypeToSizeInWords]
+	ret
+
+;--------------------------------------------------------------------
+; .DisplayFlashingResultsFromFlashvarsInDSBX
+;	Parameters:
+;		DS:BX:	Ptr to FLASHVARS
+;		SS:BP:	Ptr to MENU
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, DX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.DisplayFlashingResultsFromFlashvarsInDSBX:
+	eMOVZX	bx, [bx+FLASHVARS.flashResult]
+	jmp		[cs:bx+.rgfnFlashResultMessage]
+
+ALIGN WORD_ALIGN
+.rgfnFlashResultMessage:
+	dw		.DisplayFlashSuccessful
+	dw		.DisplayPollingError
+	dw		.DisplayDataVerifyError
+
+
+;--------------------------------------------------------------------
+; .DisplayPollingError
+; .DisplayDataVerifyError
+; .DisplayFlashSuccessful
+;	Parameters:
+;		SS:BP:	Ptr to MENU
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DX, DI, ES
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.DisplayPollingError:
+	mov		dx, g_szErrEepromPolling
+	jmp		Dialogs_DisplayErrorFromCSDX
+
+ALIGN JUMP_ALIGN
+.DisplayDataVerifyError:
+	mov		dx, g_szErrEepromVerify
+	jmp		Dialogs_DisplayErrorFromCSDX
+
+ALIGN JUMP_ALIGN
+.DisplayFlashSuccessful:
+	call	Buffers_GetFileBufferToESDI
+	cmp		WORD [es:di+ROMVARS.wRomSign], 0AA55h	; PC ROM?
+	je		SHORT .DisplayRebootMessageAndReboot
+	mov		dx, g_szForeignFlash
+	jmp		Dialogs_DisplayNotificationFromCSDX
+ALIGN JUMP_ALIGN
+.DisplayRebootMessageAndReboot:
+	mov		dx, g_szPCFlashSuccessful
+	call	Dialogs_DisplayNotificationFromCSDX
+	xor		ax, ax			; Cold boot flag
+	jmp		Reboot_ComputerWithBootFlagInAX
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm	(revision 467)
@@ -0,0 +1,668 @@
+; Project name	:	XTIDE Universal BIOS Configurator v2
+; Description	:	"IDE Controller" menu structs and functions.
+
+;
+; XTIDE Universal BIOS and Associated Tools
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+;
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;
+
+; Section containing initialized data
+SECTION .data
+
+ALIGN WORD_ALIGN
+g_MenupageForIdeControllerMenu:
+istruc MENUPAGE
+	at	MENUPAGE.fnEnter,			dw	IdeControllerMenu_EnterMenuOrModifyItemVisibility
+	at	MENUPAGE.fnBack,			dw	ConfigurationMenu_EnterMenuOrModifyItemVisibility
+	at	MENUPAGE.wMenuitems,		dw	11
+iend
+
+g_MenuitemIdeControllerBackToConfigurationMenu:
+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_MenuitemIdeControllerMasterDrive:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	MasterDrive
+	at	MENUITEM.szName,			dw	g_szItemIdeMaster
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoIdeMaster
+	at	MENUITEM.szHelp,			dw	g_szNfoIdeMaster
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_PAGENEXT
+iend
+
+g_MenuitemIdeControllerSlaveDrive:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	SlaveDrive
+	at	MENUITEM.szName,			dw	g_szItemIdeSlave
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoIdeSlave
+	at	MENUITEM.szHelp,			dw	g_szNfoIdeSlave
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_PAGENEXT
+iend
+
+g_MenuitemIdeControllerDevice:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromRawItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemIdeDevice
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoIdeDevice
+	at	MENUITEM.szHelp,			dw	g_szNfoIdeDevice
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_MODIFY_MENU
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_MULTICHOICE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	NULL
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgDevice
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoice,				dw	g_szMultichoiceCfgDevice
+	at	MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup,		dw	g_rgwChoiceToValueLookupForDevice
+	at	MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup,	dw	g_rgszValueToStringLookupForDevice
+	at	MENUITEM.itemValue + ITEM_VALUE.fnValueWriter,				dw	IdeControllerMenu_WriteDevice
+iend
+
+g_MenuitemIdeControllerCommandBlockAddress:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateHexInputForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteHexValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemIdeCmdPort
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoIdeCmdPort
+	at	MENUITEM.szHelp,			dw	g_szHelpIdeCmdPort
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_HEX
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	NULL
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgIdeCmdPort
+	at	MENUITEM.itemValue + ITEM_VALUE.wMinValue,					dw	0
+	at	MENUITEM.itemValue + ITEM_VALUE.wMaxValue,					dw	-1
+iend
+
+g_MenuitemIdeControllerControlBlockAddress:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateHexInputForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteHexValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemIdeCtrlPort
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoIdeCtrlPort
+	at	MENUITEM.szHelp,			dw	g_szHelpIdeCtrlPort
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_HEX
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	NULL
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgIdeCtrlPort
+	at	MENUITEM.itemValue + ITEM_VALUE.wMinValue,					dw	0
+	at	MENUITEM.itemValue + ITEM_VALUE.wMaxValue,					dw	-1
+iend
+
+g_MenuitemIdeControllerSerialCOM:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromRawItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemSerialCOM
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoIdeSerialCOM
+	at	MENUITEM.szHelp,			dw	g_szHelpIdeSerialCOM
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_MODIFY_MENU | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_CHOICESTRINGS
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_MULTICHOICE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	NULL
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgDevice
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoice,				dw	g_szSerialCOMChoice
+	at	MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup,		dw	g_rgbChoiceToValueLookupForCOM
+	at	MENUITEM.itemValue + ITEM_VALUE.rgszChoiceToStringLookup,	dw	g_rgszChoiceToStringLookupForCOM
+	at	MENUITEM.itemValue + ITEM_VALUE.fnValueWriter,				dw	IdeControllerMenu_SerialWriteCOM
+iend
+
+g_MenuitemIdeControllerSerialPort:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateHexInputForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteHexValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemSerialPort
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoIdeSerialPort
+	at	MENUITEM.szHelp,			dw	g_szHelpIdeSerialPort
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_MODIFY_MENU | FLG_MENUITEM_BYTEVALUE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_HEX
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	NULL
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgIdeCmdPort
+	at	MENUITEM.itemValue + ITEM_VALUE.wMinValue,					dw	8h
+	at	MENUITEM.itemValue + ITEM_VALUE.wMaxValue,					dw	3f8h
+	at	MENUITEM.itemValue + ITEM_VALUE.fnValueReader,				dw	IdeControllerMenu_SerialReadPort
+	at	MENUITEM.itemValue + ITEM_VALUE.fnValueWriter,				dw	IdeControllerMenu_SerialWritePort
+iend
+
+g_MenuitemIdeControllerSerialBaud:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromRawItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemSerialBaud
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoIdeSerialBaud
+	at	MENUITEM.szHelp,			dw	g_szHelpIdeSerialBaud
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_CHOICESTRINGS
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_MULTICHOICE
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	NULL
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgDevice
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoice,				dw	g_szSerialBaudChoice
+	at	MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup,		dw	g_rgbChoiceToValueLookupForBaud
+	at	MENUITEM.itemValue + ITEM_VALUE.rgszChoiceToStringLookup,	dw	g_rgszChoiceToStringLookupForBaud
+iend
+
+g_MenuitemIdeControllerEnableInterrupt:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemIdeEnIRQ
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoIdeEnIRQ
+	at	MENUITEM.szHelp,			dw	g_szHelpIdeEnIRQ
+	at	MENUITEM.bFlags,			db	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_szDlgIdeEnIRQ
+	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	15
+iend
+
+g_MenuitemIdeControllerIdeIRQ:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateUnsignedInputForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemIdeIRQ
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoIdeIRQ
+	at	MENUITEM.szHelp,			dw	g_szHelpIdeIRQ
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_BYTEVALUE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_UNSIGNED
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	NULL
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgIdeIRQ
+	at	MENUITEM.itemValue + ITEM_VALUE.wMinValue,					dw	2
+	at	MENUITEM.itemValue + ITEM_VALUE.wMaxValue,					dw	15
+iend
+
+g_rgwChoiceToValueLookupForDevice:
+	dw	DEVICE_8BIT_JRIDE_ISA
+	dw	DEVICE_8BIT_XTCF
+	dw	DEVICE_8BIT_XTIDE_REV2
+	dw	DEVICE_8BIT_XTIDE_REV1
+	dw	DEVICE_16BIT_ATA
+	dw	DEVICE_32BIT_ATA
+	dw	DEVICE_SERIAL_PORT
+g_rgszValueToStringLookupForDevice:
+	dw	g_szValueCfgDeviceJrIdeIsa
+	dw	g_szValueCfgDeviceFast
+	dw	g_szValueCfgDeviceRev2
+	dw	g_szValueCfgDeviceRev1
+	dw	g_szValueCfgDevice16b
+	dw	g_szValueCfgDevice32b
+	dw	g_szValueCfgDeviceSerial
+
+
+g_rgbChoiceToValueLookupForCOM:
+	dw	'1'
+	dw	'2'
+	dw	'3'
+	dw	'4'
+	dw	'5'
+	dw	'6'
+	dw	'7'
+	dw	'8'
+	dw	'9'
+	dw	'A'
+	dw	'B'
+	dw	'C'
+	dw	'x'				; must be last entry (see reader/write routines)
+g_rgszChoiceToStringLookupForCOM:
+	dw	g_szValueCfgCOM1
+	dw	g_szValueCfgCOM2
+	dw	g_szValueCfgCOM3
+	dw	g_szValueCfgCOM4
+	dw	g_szValueCfgCOM5
+	dw	g_szValueCfgCOM6
+	dw	g_szValueCfgCOM7
+	dw	g_szValueCfgCOM8
+	dw	g_szValueCfgCOM9
+	dw	g_szValueCfgCOMA
+	dw	g_szValueCfgCOMB
+	dw	g_szValueCfgCOMC
+	dw	g_szValueCfgCOMx
+	dw	NULL
+
+SERIAL_DEFAULT_CUSTOM_PORT   EQU		300h           ; can't be any of the pre-defined COM values
+
+PackedCOMPortAddresses:				; COM1 - COMC (or COM12)
+	db      SERIAL_COM1_IOADDRESS >> 2
+	db		SERIAL_COM2_IOADDRESS >> 2
+	db		SERIAL_COM3_IOADDRESS >> 2
+	db		SERIAL_COM4_IOADDRESS >> 2
+	db		SERIAL_COM5_IOADDRESS >> 2
+	db		SERIAL_COM6_IOADDRESS >> 2
+	db		SERIAL_COM7_IOADDRESS >> 2
+	db		SERIAL_COM8_IOADDRESS >> 2
+	db		SERIAL_COM9_IOADDRESS >> 2
+	db		SERIAL_COMA_IOADDRESS >> 2
+	db		SERIAL_COMB_IOADDRESS >> 2
+	db		SERIAL_COMC_IOADDRESS >> 2
+	db		SERIAL_DEFAULT_CUSTOM_PORT >> 2			; must be last entry (see reader/writer routines)
+SERIAL_DEFAULT_COM			EQU		'1'
+
+g_rgbChoiceToValueLookupForBaud:
+	dw		(115200 / 115200) & 0xff
+	dw		(115200 /  57600) & 0xff
+	dw		(115200 /  38400) & 0xff
+	dw		(115200 /  28800) & 0xff
+	dw		(115200 /  19200) & 0xff
+	dw		(115200 /   9600) & 0xff
+	dw		(115200 /   4800) & 0xff
+	dw		(115200 /   2400) & 0xff
+g_rgszChoiceToStringLookupForBaud:
+	dw		g_szValueCfgBaud115_2
+	dw		g_szValueCfgBaud57_6
+	dw		g_szValueCfgBaud38_4
+	dw		g_szValueCfgBaud28_8
+	dw		g_szValueCfgBaud19_2
+	dw		g_szValueCfgBaud9600
+	dw		g_szValueCfgBaud4800
+	dw		g_szValueCfgBaud2400
+	dw		NULL
+SERIAL_DEFAULT_BAUD			EQU		((115200 / 9600)	& 0xff)
+
+; Section containing code
+SECTION .text
+
+;--------------------------------------------------------------------
+; IdeControllerMenu_InitializeToIdevarsOffsetInBX
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+IdeControllerMenu_InitializeToIdevarsOffsetInBX:
+	lea		ax, [bx+IDEVARS.drvParamsMaster]
+	mov		[cs:g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+
+	lea		ax, [bx+IDEVARS.drvParamsSlave]
+	mov		[cs:g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+
+	lea		ax, [bx+IDEVARS.bDevice]
+	mov		[cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+
+	lea		ax, [bx+IDEVARS.wPort]
+	mov		[cs:g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+
+	lea		ax, [bx+IDEVARS.bSerialPort]
+	mov		[cs:g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+
+	lea		ax, [bx+IDEVARS.bSerialBaud]
+	mov		[cs:g_MenuitemIdeControllerSerialBaud+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+
+	lea		ax, [bx+IDEVARS.wPortCtrl]
+	mov		[cs:g_MenuitemIdeControllerControlBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+
+	lea		ax, [bx+IDEVARS.bSerialCOMPortChar]
+	mov		[cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+
+	lea		ax, [bx+IDEVARS.bIRQ]
+	mov		[cs:g_MenuitemIdeControllerEnableInterrupt+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+	mov		[cs:g_MenuitemIdeControllerIdeIRQ+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+
+	ret
+
+
+;--------------------------------------------------------------------
+; IdeControllerMenu_EnterMenuOrModifyItemVisibility
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		All, except BP
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+IdeControllerMenu_EnterMenuOrModifyItemVisibility:
+	push	cs
+	pop		ds
+	call	.DisableIRQchannelSelection
+	call	.EnableOrDisableEnableInterrupt
+	call	.EnableOrDisableSerial
+	mov		si, g_MenupageForIdeControllerMenu
+	jmp		Menupage_ChangeToNewMenupageInDSSI
+
+
+;--------------------------------------------------------------------
+; .EnableOrDisableEnableInterrupt
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableOrDisableEnableInterrupt:
+	call	Buffers_GetRomvarsFlagsToAX
+	mov		bx, g_MenuitemIdeControllerEnableInterrupt
+	test	ax, FLG_ROMVARS_MODULE_IRQ
+	jz		SHORT .DisableMenuitemFromCSBX
+
+	mov		bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
+	call	Buffers_GetRomvarsValueToAXfromOffsetInBX
+	mov		bx, g_MenuitemIdeControllerEnableInterrupt
+	cmp		al, DEVICE_SERIAL_PORT
+	jae		SHORT .DisableMenuitemFromCSBX
+	cmp		al, DEVICE_8BIT_XTCF
+	jbe		SHORT .DisableMenuitemFromCSBX
+
+	call	.EnableMenuitemFromCSBX
+	; Fall to .EnableOrDisableIRQchannelSelection
+
+;--------------------------------------------------------------------
+; .EnableOrDisableIRQchannelSelection
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableOrDisableIRQchannelSelection:
+	mov		bx, [cs:g_MenuitemIdeControllerEnableInterrupt+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
+	call	Buffers_GetRomvarsValueToAXfromOffsetInBX
+	mov		bx, g_MenuitemIdeControllerIdeIRQ
+	test	al, al
+	jnz		SHORT .EnableMenuitemFromCSBX
+.DisableIRQchannelSelection:
+	mov		bx, g_MenuitemIdeControllerIdeIRQ
+	jz		SHORT .DisableMenuitemFromCSBX
+	; Fall to .DisableMenuitemFromCSBX
+
+
+;--------------------------------------------------------------------
+; .DisableMenuitemFromCSBX
+; .EnableMenuitemFromCSBX
+;	Parameters:
+;		CS:BX:	Ptr to MENUITEM
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.DisableMenuitemFromCSBX:
+	and		BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
+	ret
+
+ALIGN JUMP_ALIGN
+.EnableMenuitemFromCSBX:
+	or		BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
+	ret
+
+
+.EnableOrDisableSerial:
+	mov		bx, g_MenuitemIdeControllerCommandBlockAddress
+	call	.DisableMenuitemFromCSBX
+
+	mov		bx, g_MenuitemIdeControllerControlBlockAddress
+	call	.DisableMenuitemFromCSBX
+
+	mov		bx, g_MenuitemIdeControllerSerialBaud
+	call	.DisableMenuitemFromCSBX
+
+	mov		bx, g_MenuitemIdeControllerSerialCOM
+	call	.DisableMenuitemFromCSBX
+
+	mov		bx, g_MenuitemIdeControllerSerialPort
+	call	.DisableMenuitemFromCSBX
+
+	mov		bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
+	call	Buffers_GetRomvarsValueToAXfromOffsetInBX
+	cmp		al, DEVICE_SERIAL_PORT
+	jnz		.DisableAllSerial
+
+	mov		bx, g_MenuitemIdeControllerSerialCOM
+	call	.EnableMenuitemFromCSBX
+
+	mov		bx, g_MenuitemIdeControllerSerialBaud
+	call	.EnableMenuitemFromCSBX
+
+	mov		bx, [cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
+	call	Buffers_GetRomvarsValueToAXfromOffsetInBX
+	mov		bx, g_MenuitemIdeControllerSerialPort
+	cmp		al,'x'
+	jz		.EnableMenuitemFromCSBX
+	jmp		.DisableMenuitemFromCSBX
+
+.DisableAllSerial:
+
+	mov		bx, g_MenuitemIdeControllerCommandBlockAddress
+	call	.EnableMenuitemFromCSBX
+
+	mov		bx, g_MenuitemIdeControllerControlBlockAddress
+	call	.EnableMenuitemFromCSBX
+
+	ret
+
+;--------------------------------------------------------------------
+; MENUITEM activation functions (.fnActivate)
+;	Parameters:
+;		SS:BP:	Ptr to MENU
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		All, except segments
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+MasterDrive:
+	mov		bx, [cs:g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
+	jmp		SHORT DisplayMasterSlaveMenu
+
+ALIGN JUMP_ALIGN
+SlaveDrive:
+	mov		bx, [cs:g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
+	; Fall to DisplayMasterSlaveMenu
+
+ALIGN JUMP_ALIGN
+DisplayMasterSlaveMenu:
+;
+; block mode is not supported on serial drives, disable/enable the option as appropriate
+;
+	push	bx
+	mov		bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
+	call	Buffers_GetRomvarsValueToAXfromOffsetInBX
+	mov		bx, g_MenuitemMasterSlaveBlockModeTransfers
+	cmp		al,DEVICE_SERIAL_PORT
+	jz		.isSerial
+	or		BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
+	jmp		.isDone
+.isSerial:
+	and		BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
+.isDone:
+	pop		bx
+
+	call	MasterSlaveMenu_InitializeToDrvparamsOffsetInBX
+	jmp		MasterSlaveMenu_EnterMenuOrModifyItemVisibility
+
+;------------------------------------------------------------------------------------------
+;
+; Reader/Writer Routines
+;
+; For serial drives, we pack the port number and baud rate into a single byte, and thus
+; we need to take care to properly read/write just the bits we need.  In addition, since
+; we use the Port/PortCtrl bytes in a special way for serial drives, we need to properly
+; default the values stored in both these words when switching in and out of the Serial
+; device choice.
+;
+; Writers:
+;	Parameters:
+;       AX:     Value that the MENUITEM system was interacting with
+;		ES:DI:  ROMVARS location where the value is to be stored
+;	    DS:SI:  MENUITEM pointer
+;	Returns:
+;		AX:		Value to actually write to ROMVARS
+;	Corrupts registers:
+;		AX
+;
+; Readers:
+;	Parameters:
+;       AX:     Value read from the ROMVARS location
+;		ES:DI:  ROMVARS location where the value was just read from
+;	    DS:SI:  MENUITEM pointer
+;	Returns:
+;		AX:		Value that the MENUITEM system will interact with and display
+;	Corrupts registers:
+;		AX
+;
+
+;
+; No change to Device byte, but use this opportunity to change defaults stored in wPort and wPortCtrl if we are
+; changing in/out of a Serial device (since we use these bytes in radically different ways).
+;
+ALIGN JUMP_ALIGN
+IdeControllerMenu_WriteDevice:
+		push	ax
+		push	bx
+		push	di
+
+		mov		bl,[es:di]							; what is the current Device?
+
+		add		di,IDEVARS.wPort - IDEVARS.bDevice	; Get ready to set the Port addresses
+
+		cmp		al,DEVICE_SERIAL_PORT
+		jz		.changingToSerial
+
+		cmp		bl,DEVICE_SERIAL_PORT
+		jnz		.done								; if we weren't Serial before, nothing to do
+
+.changingFromSerial:
+		cmp		al,DEVICE_16BIT_ATA
+
+		mov		ax,DEVICE_XTIDE_DEFAULT_PORT		; Defaults for 8-bit XTIDE devices
+		mov		bx,DEVICE_XTIDE_DEFAULT_PORTCTRL
+
+		jb		.writeNonSerial
+
+		mov		ax, DEVICE_ATA_PRIMARY_PORT			; Defaults for 16-bit and better ATA devices
+		mov		bx, DEVICE_ATA_PRIMARY_PORTCTRL
+
+.writeNonSerial:
+		stosw										; Store defaults in IDEVARS.wPort and IDEVARS.wPortCtrl
+		xchg	bx, ax
+		stosw
+
+		jmp		.done
+
+.changingToSerial:
+		cmp		bl,DEVICE_SERIAL_PORT
+		jz		.done								; if we were already serial, nothing to do
+
+		mov		byte [es:di+IDEVARS.bSerialBaud-IDEVARS.wPort],SERIAL_DEFAULT_BAUD
+
+		mov		al,SERIAL_DEFAULT_COM
+		add		di,IDEVARS.bSerialCOMPortChar-IDEVARS.wPort
+		call	IdeControllerMenu_SerialWriteCOM
+		stosb
+
+.done:
+		pop		di
+		pop		bx
+		pop		ax
+
+		ret
+
+;
+; Doesn't modify COM character (unless it is not recognized, which would be an error case),
+; But does update the port address based on COM port selection
+;
+ALIGN JUMP_ALIGN
+IdeControllerMenu_SerialWriteCOM:
+		push	ax
+		push	bx
+		push	si
+
+		mov		si,g_rgbChoiceToValueLookupForCOM
+		mov		bx,PackedCOMPortAddresses
+
+.loop:
+		mov		ah,[bx]
+
+		cmp		ah,(SERIAL_DEFAULT_CUSTOM_PORT >> 2)
+		jz		.notFound
+
+		cmp		al,[si]
+		jz		.found
+
+		inc		si
+		inc		si
+		inc		bx
+
+		jmp		.loop
+
+.notFound:
+		mov		al, 'x'
+
+.found:
+		mov		[es:di+IDEVARS.bSerialPort-IDEVARS.bSerialCOMPortChar], ah
+
+		pop		si
+		pop		bx
+		pop		ax
+
+		ret
+
+
+;
+; Packed Port (byte) -> Numeric Port (word)
+;
+ALIGN JUMP_ALIGN
+IdeControllerMenu_SerialReadPort:
+		xor		ah,ah
+		eSHL_IM	ax, 2
+		ret
+
+;
+; Numeric Port (word) -> Packed Port (byte)
+; And convert from Custom to a defined COM port if we match one of the pre-defined COM port numbers
+;
+ALIGN JUMP_ALIGN
+IdeControllerMenu_SerialWritePort:
+		push	bx
+		push	si
+
+		eSHR_IM	ax, 2
+		and		al,0feh			; force 8-byte boundary
+
+		mov		si,g_rgbChoiceToValueLookupForCOM
+		mov		bx,PackedCOMPortAddresses			; loop, looking for port address in known COM address list
+
+.loop:
+		mov		ah,[si]
+		cmp		ah,'x'
+		jz		.found
+
+		cmp		al,[bx]
+		jz		.found
+
+		inc		si
+		inc		si
+		inc		bx
+
+		jmp		.loop
+
+.found:
+		mov		[es:di+IDEVARS.bSerialCOMPortChar-IDEVARS.bSerialPort], ah
+
+		pop		si
+		pop		bx
+
+		ret
+
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm	(revision 467)
@@ -0,0 +1,287 @@
+; Project name	:	XTIDE Universal BIOS Configurator v2
+; Description	:	Main menu structs and functions.
+
+;
+; XTIDE Universal BIOS and Associated Tools 
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+; 
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;		
+
+; Section containing initialized data
+SECTION .data
+
+ALIGN WORD_ALIGN
+g_MenupageForMainMenu:
+istruc MENUPAGE
+	at	MENUPAGE.fnEnter,			dw	MainMenu_EnterMenuOrModifyItemVisibility
+	at	MENUPAGE.fnBack,			dw	ExitToDosFromBackButton
+	at	MENUPAGE.wMenuitems,		dw	9
+iend
+
+g_MenuitemMainMenuLicense:		
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_DisplayHelpMessageFromDSSI
+	at	MENUITEM.szName,			dw	g_szItemMainLicense
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoMainLicense
+	at	MENUITEM.szHelp,			dw	g_szHelpMainLicense
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE		
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_ACTION
+iend
+		
+g_MenuitemMainMenuLoadBiosFromFile:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	LoadBiosFromFile
+	at	MENUITEM.szName,			dw	g_szItemMainLoadFile
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoMainLoadFile
+	at	MENUITEM.szHelp,			dw	g_szNfoMainLoadFile
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_ACTION
+iend
+
+g_MenuitemMainMenuLoadXtideUniversalBiosFromRom:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	LoadXtideUniversalBiosFromRom
+	at	MENUITEM.szName,			dw	g_szItemMainLoadROM
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoMainLoadROM
+	at	MENUITEM.szHelp,			dw	g_szNfoMainLoadROM
+	at	MENUITEM.bFlags,			db	NULL
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_ACTION
+iend
+
+g_MenuitemMainMenuLoadOldSettingsFromEeprom:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	LoadOldSettingsFromEeprom
+	at	MENUITEM.szName,			dw	g_szItemMainLoadStngs
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoMainLoadStngs
+	at	MENUITEM.szHelp,			dw	g_szNfoMainLoadStngs
+	at	MENUITEM.bFlags,			db	NULL
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_ACTION
+iend
+
+g_MenuitemMainMenuConfigureXtideUniversalBios:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	ConfigurationMenu_EnterMenuOrModifyItemVisibility
+	at	MENUITEM.szName,			dw	g_szItemMainConfigure
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoMainConfigure
+	at	MENUITEM.szHelp,			dw	g_szNfoMainConfigure
+	at	MENUITEM.bFlags,			db	NULL
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_PAGENEXT
+iend
+
+g_MenuitemMainMenuFlashEeprom:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	FlashMenu_EnterMenuOrModifyItemVisibility
+	at	MENUITEM.szName,			dw	g_szItemMainFlash
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoMainFlash
+	at	MENUITEM.szHelp,			dw	g_szNfoMainFlash
+	at	MENUITEM.bFlags,			db	NULL
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_PAGENEXT
+iend
+
+g_MenuitemMainMenuSaveFile:		
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	BiosFile_SaveUnsavedChanges
+	at	MENUITEM.szName,			dw	g_szItemMainSave
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoMainSave
+	at	MENUITEM.szHelp,			dw	g_szNfoMainSave
+	at	MENUITEM.bFlags,			db	NULL
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_ACTION
+iend		
+
+g_MenuitemMainMenuExitToDos:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	ExitToDosSelectedFromMenu
+	at	MENUITEM.szName,			dw	g_szItemMainExitToDOS
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoMainExitToDOS
+	at	MENUITEM.szHelp,			dw	g_szNfoMainExitToDOS
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_ACTION
+iend
+
+g_MenuitemMainMenuHomePage:		
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_DisplayHelpMessageFromDSSI
+	at	MENUITEM.szName,			dw	g_szItemMainHomePage
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoMainHomePage
+	at	MENUITEM.szHelp,			dw	g_szNfoMainHomePage
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE		
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_ACTION
+iend						
+
+
+; Section containing code
+SECTION .text
+
+;--------------------------------------------------------------------
+; MainMenu_EnterMenuOrModifyItemVisibility
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		All, except BP
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+MainMenu_EnterMenuOrModifyItemVisibility:
+	push	cs
+	pop		ds
+	call	.EnableOrDisableXtideRomItems
+	call	.EnableOrDisableConfigureXtideUniversalBios
+	call	.EnableOrDisableFlashEeprom
+	call	.EnableOrDisableSave			
+	mov		si, g_MenupageForMainMenu
+	jmp		Menupage_ChangeToNewMenupageInDSSI
+
+;--------------------------------------------------------------------
+; .EnableOrDisableXtideRomItems
+;	Parameters:
+;		DS:		CFGVARS segment
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX, CX, SI, DI, ES
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableOrDisableXtideRomItems:
+	call	EEPROM_FindXtideUniversalBiosROMtoESDI
+	jnc		SHORT .DisableAllRomItems
+	or		BYTE [g_MenuitemMainMenuLoadXtideUniversalBiosFromRom+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
+	call	Buffers_IsXtideUniversalBiosLoaded
+	jne		SHORT .DisableLoadSettingFromRom
+	or		BYTE [g_MenuitemMainMenuLoadOldSettingsFromEeprom+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
+	ret
+
+ALIGN JUMP_ALIGN
+.DisableAllRomItems:
+	and		BYTE [g_MenuitemMainMenuLoadXtideUniversalBiosFromRom+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
+.DisableLoadSettingFromRom:
+	and		BYTE [g_MenuitemMainMenuLoadOldSettingsFromEeprom+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
+	ret
+
+;--------------------------------------------------------------------
+; .EnableOrDisableConfigureXtideUniversalBios
+;	Parameters:
+;		DS:		CFGVARS segment
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		CX, SI, DI, ES
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableOrDisableConfigureXtideUniversalBios:
+	call	Buffers_IsXtideUniversalBiosLoaded
+	jne		SHORT .DisableConfigureXtideUniversalBios
+	or		BYTE [g_MenuitemMainMenuConfigureXtideUniversalBios+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
+	ret
+
+ALIGN JUMP_ALIGN
+.DisableConfigureXtideUniversalBios:
+	and		BYTE [g_MenuitemMainMenuConfigureXtideUniversalBios+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
+	ret
+
+;--------------------------------------------------------------------
+; .EnableOrDisableFlashEeprom
+;	Parameters:
+;		DS:		CFGVARS segment
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableOrDisableFlashEeprom:
+	test	WORD [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED
+	jz		SHORT .DisableFlashEeprom
+	or		BYTE [g_MenuitemMainMenuFlashEeprom+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
+	ret
+
+ALIGN JUMP_ALIGN
+.DisableFlashEeprom:
+	and		BYTE [g_MenuitemMainMenuFlashEeprom+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
+	ret
+
+;--------------------------------------------------------------------
+; .EnableOrDisableSave
+;	Parameters:
+;		DS:		CFGVARS segment
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN		
+.EnableOrDisableSave:	
+	test	WORD [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED
+	jz		SHORT .DisableSave
+	or		BYTE [g_MenuitemMainMenuSaveFile+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
+	ret
+
+ALIGN JUMP_ALIGN				
+.DisableSave:
+	and		BYTE [g_MenuitemMainMenuSaveFile+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
+	ret
+				
+;--------------------------------------------------------------------
+; MENUITEM activation functions (.fnActivate)
+;	Parameters:
+;		SS:BP:	Ptr to MENU
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		All, except segments
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+ExitToDosSelectedFromMenu:
+	CALL_MENU_LIBRARY CloseMenuIfExitEventAllows
+ExitToDosFromBackButton:
+	ret
+
+
+ALIGN JUMP_ALIGN
+LoadBiosFromFile:
+	call	Buffers_SaveChangesIfFileLoaded
+	mov		cx, FILE_DIALOG_IO_size
+	call	Memory_ReserveCXbytesFromStackToDSSI
+	call	Dialogs_DisplayFileDialogWithDialogIoInDSSI
+	cmp		BYTE [si+FILE_DIALOG_IO.bUserCancellation], TRUE
+	je		SHORT .CancelFileLoading
+
+	add		si, BYTE FILE_DIALOG_IO.szFile
+	call	BiosFile_LoadFileFromDSSItoRamBuffer
+	call	MainMenu_EnterMenuOrModifyItemVisibility
+.CancelFileLoading:
+	add		sp, BYTE FILE_DIALOG_IO_size
+	ret
+
+
+ALIGN JUMP_ALIGN
+LoadXtideUniversalBiosFromRom:
+	call	Buffers_SaveChangesIfFileLoaded
+	call	EEPROM_LoadXtideUniversalBiosFromRomToRamBufferAndReturnSizeInDXCX
+	mov		ax, FLG_CFGVARS_ROMLOADED
+	call	Buffers_NewBiosWithSizeInDXCXandSourceInAXhasBeenLoadedForConfiguration
+	mov		dx, g_szDlgMainLoadROM
+	call	Dialogs_DisplayNotificationFromCSDX
+	jmp		MainMenu_EnterMenuOrModifyItemVisibility
+
+
+ALIGN JUMP_ALIGN
+LoadOldSettingsFromEeprom:
+	call	Buffers_SaveChangesIfFileLoaded
+	call	EEPROM_LoadOldSettingsFromRomToRamBuffer
+	and		WORD [g_cfgVars+CFGVARS.wFlags], ~FLG_CFGVARS_UNSAVED
+	mov		dx, g_szDlgMainLoadStngs
+	jmp		Dialogs_DisplayNotificationFromCSDX
+
+
+	
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MasterSlaveMenu.asm
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MasterSlaveMenu.asm	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MasterSlaveMenu.asm	(revision 467)
@@ -0,0 +1,495 @@
+; Project name	:	XTIDE Universal BIOS Configurator v2
+; Description	:	"Master/Slave Drive" menu structs and functions.
+
+;
+; XTIDE Universal BIOS and Associated Tools 
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+; 
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.		
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;		
+
+; Section containing initialized data
+SECTION .data
+
+ALIGN WORD_ALIGN
+g_MenupageForMasterSlaveMenu:
+istruc MENUPAGE
+	at	MENUPAGE.fnEnter,			dw	MasterSlaveMenu_EnterMenuOrModifyItemVisibility
+	at	MENUPAGE.fnBack,			dw	IdeControllerMenu_EnterMenuOrModifyItemVisibility
+	at	MENUPAGE.wMenuitems,		dw	10
+iend
+
+g_MenuitemMasterSlaveBackToIdeControllerMenu:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	IdeControllerMenu_EnterMenuOrModifyItemVisibility
+	at	MENUITEM.szName,			dw	g_szItemDrvBackToIde
+	at	MENUITEM.szQuickInfo,		dw	g_szItemDrvBackToIde
+	at	MENUITEM.szHelp,			dw	g_szItemDrvBackToIde
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_PAGEBACK
+iend
+
+g_MenuitemMasterSlaveBlockModeTransfers:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemDrvBlockMode
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoDrvBlockMode
+	at	MENUITEM.szHelp,			dw	g_szHelpDrvBlockMode
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_VISIBLE | 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_szDlgDrvBlockMode
+	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_BLOCKMODE
+iend
+
+g_MenuitemMasterSlaveChsTranslateMode:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromUnshiftedItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemDrvXlateMode
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoDrvXlateMode
+	at	MENUITEM.szHelp,			dw	g_szNfoDrvXlateMode
+	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_szDlgDrvXlateMode
+	at	MENUITEM.itemValue + ITEM_VALUE.szMultichoice,				dw	g_szMultichoiseXlateMode
+	at	MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup,		dw	g_rgwChoiceToValueLookupForXlateMode
+	at	MENUITEM.itemValue + ITEM_VALUE.rgszChoiceToStringLookup,	dw	g_rgszChoiceToStringLookupForXlateMode
+	at	MENUITEM.itemValue + ITEM_VALUE.wValueBitmask,				dw	MASK_DRVPARAMS_TRANSLATEMODE
+	at	MENUITEM.itemValue + ITEM_VALUE.bFieldPosition,				db	TRANSLATEMODE_FIELD_POSITION
+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
+	at	MENUITEM.itemValue + ITEM_VALUE.bFieldPosition,				db	0
+iend
+
+g_MenuitemMasterSlaveUserCHS:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemDrvUserCHS
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoDrvUserCHS
+	at	MENUITEM.szHelp,			dw	g_szHelpDrvUserCHS
+	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_szDlgDrvUserCHS
+	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_USERCHS
+	at	MENUITEM.itemValue + ITEM_VALUE.fnValueWriter,				dw	MasterSlaveMenu_WriteCHSFlag		
+iend
+
+g_MenuitemMasterSlaveCylinders:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateUnsignedInputForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemDrvCyls
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoDrvCyls
+	at	MENUITEM.szHelp,			dw	g_szNfoDrvCyls
+	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_szDlgDrvCyls
+	at	MENUITEM.itemValue + ITEM_VALUE.wMinValue,					dw	1
+	at	MENUITEM.itemValue + ITEM_VALUE.wMaxValue,					dw	MAX_USER_CYLINDERS
+%define					MASTERSLAVE_CYLINDERS_DEFAULT					65
+iend
+
+g_MenuitemMasterSlaveHeads:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateUnsignedInputForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemDrvHeads
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoDrvHeads
+	at	MENUITEM.szHelp,			dw	g_szNfoDrvHeads
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_BYTEVALUE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_UNSIGNED
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	NULL
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgDrvHeads
+	at	MENUITEM.itemValue + ITEM_VALUE.wMinValue,					dw	1
+	at	MENUITEM.itemValue + ITEM_VALUE.wMaxValue,					dw	MAX_USER_HEADS
+%define					MASTERSLAVE_HEADS_DEFAULT						MAX_USER_HEADS		
+iend
+
+g_MenuitemMasterSlaveSectors:
+istruc MENUITEM
+	at	MENUITEM.fnActivate,		dw	Menuitem_ActivateUnsignedInputForMenuitemInDSSI
+	at	MENUITEM.fnFormatValue,		dw	MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
+	at	MENUITEM.szName,			dw	g_szItemDrvSect
+	at	MENUITEM.szQuickInfo,		dw	g_szNfoDrvSect
+	at	MENUITEM.szHelp,			dw	g_szNfoDrvSect
+	at	MENUITEM.bFlags,			db	FLG_MENUITEM_BYTEVALUE
+	at	MENUITEM.bType,				db	TYPE_MENUITEM_UNSIGNED
+	at	MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,		dw	NULL
+	at	MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,				dw	g_szDlgDrvSect
+	at	MENUITEM.itemValue + ITEM_VALUE.wMinValue,					dw	1
+	at	MENUITEM.itemValue + ITEM_VALUE.wMaxValue,					dw	MAX_USER_SECTORS_PER_TRACK
+%define					MASTERSLAVE_SECTORS_DEFAULT						MAX_USER_SECTORS_PER_TRACK
+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
+	at	MENUITEM.itemValue + ITEM_VALUE.fnValueWriter,				dw	MasterSlaveMenu_WriteLBAFlag				
+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	16							; 8 GiB
+	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
+%define				MASTERSLAVE_USERLBA_DEFAULT						64
+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
+
+g_rgwChoiceToValueLookupForXlateMode:
+	dw	TRANSLATEMODE_NORMAL
+	dw	TRANSLATEMODE_LARGE
+	dw	TRANSLATEMODE_ASSISTED_LBA
+	dw	TRANSLATEMODE_AUTO
+
+g_rgszChoiceToStringLookupForXlateMode:
+	dw	g_szValueDrvXlateNormal
+	dw	g_szValueDrvXlateLarge
+	dw	g_szValueDrvXlateLBA
+	dw	g_szValueDrvXlateAuto
+
+
+; Section containing code
+SECTION .text
+
+;--------------------------------------------------------------------
+; MasterSlaveMenu_InitializeToDrvparamsOffsetInBX
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+MasterSlaveMenu_InitializeToDrvparamsOffsetInBX:
+	lea		ax, [bx+DRVPARAMS.wFlags]
+	mov		[cs:g_MenuitemMasterSlaveBlockModeTransfers+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+	mov		[cs:g_MenuitemMasterSlaveChsTranslateMode+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]
+	mov		[cs:g_MenuitemMasterSlaveCylinders+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+
+	lea		ax, [bx+DRVPARAMS.bHeads]
+	mov		[cs:g_MenuitemMasterSlaveHeads+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+
+	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
+
+
+;--------------------------------------------------------------------
+; MasterSlaveMenu_EnterMenuOrModifyItemVisibility
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		All, except BP
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+MasterSlaveMenu_EnterMenuOrModifyItemVisibility:
+	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
+
+
+;--------------------------------------------------------------------
+; .EnableOrDisableCHandS
+;	Parameters:
+;		SS:BP:	Menu handle
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, BX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableOrDisableCHandS:
+	mov		bx, [cs:g_MenuitemMasterSlaveUserCHS+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
+	call	Buffers_GetRomvarsValueToAXfromOffsetInBX
+	test	ax, FLG_DRVPARAMS_USERCHS
+	jz		SHORT .DisableCHandS
+	test	ax, FLG_DRVPARAMS_USERLBA
+	jnz		SHORT .DisableCHandS
+
+	mov		bx, g_MenuitemMasterSlaveCylinders
+	call	.EnableMenuitemFromCSBX
+	mov		bx, g_MenuitemMasterSlaveHeads
+	call	.EnableMenuitemFromCSBX
+	mov		bx, g_MenuitemMasterSlaveSectors
+	jmp		SHORT .EnableMenuitemFromCSBX
+
+ALIGN JUMP_ALIGN
+.DisableCHandS:
+	mov		bx, g_MenuitemMasterSlaveCylinders
+	call	.DisableMenuitemFromCSBX
+	mov		bx, g_MenuitemMasterSlaveHeads
+	call	.DisableMenuitemFromCSBX
+	mov		bx, g_MenuitemMasterSlaveSectors
+	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
+	; Fall to .EnableMenuitemFromCSBX
+
+
+;--------------------------------------------------------------------
+; .EnableMenuitemFromCSBX
+; .DisableMenuitemFromCSBX
+;	Parameters:
+;		CS:BX:	Ptr to MENUITEM
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		Nothing
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.EnableMenuitemFromCSBX:
+	or		BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
+	ret
+
+ALIGN JUMP_ALIGN
+.DisableMenuitemFromCSBX:
+	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:
+	push	dx
+
+	mov		ax, [es:di]
+	mov		dx, [es:di+2]		; DX:AX now holds user defined LBA28 limit
+	add		ax, BYTE 1			; Increment by one
+	adc		dx, BYTE 0
+
+	xchg	ax, dx				; SHR 16
+	eSHIFT_IM ax, 4, shr		; SHR 4 => AX = DX:AX / (1024*1024)
+
+	pop		dx
+	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:
+	push	dx
+
+	xor		dx, dx
+	eSHIFT_IM ax, 4, shl
+	xchg	dx, ax			; DX:AX now holds AX * 1024 * 1024
+
+	sub		ax, BYTE 1		; Decrement DX:AX by one
+	sbb		dx, BYTE 0		; (necessary since maximum LBA28 sector count is 0FFF FFFFh)
+
+	mov		[es:di+2], dx	; Store DX by ourselves
+	pop		dx
+	ret						; AX will be stored by our menu system
+
+;
+; No change to CHS flag, but we use this opportunity to change defaults stored in the CHS values if we are
+; changing in/out of user CHS settings (since we use these bytes in different ways with the LBA setting).
+;
+ALIGN JUMP_ALIGN		
+MasterSlaveMenu_WriteCHSFlag:
+		test	word [es:di], FLG_DRVPARAMS_USERCHS
+		jnz		.alreadySet
+
+		push	ax
+		push	di
+		push	si
+
+		mov		ax, MASTERSLAVE_CYLINDERS_DEFAULT
+		mov		si, g_MenuitemMasterSlaveCylinders
+		call	Menuitem_StoreValueFromAXtoMenuitemInDSSI
+		
+		mov		ax, MASTERSLAVE_HEADS_DEFAULT		
+		mov		si, g_MenuitemMasterSlaveHeads
+		call	Menuitem_StoreValueFromAXtoMenuitemInDSSI		
+
+		mov		ax, MASTERSLAVE_SECTORS_DEFAULT						
+		mov		si, g_MenuitemMasterSlaveSectors
+		call	Menuitem_StoreValueFromAXtoMenuitemInDSSI		
+		
+		pop		si						
+		pop		di
+		pop		ax
+
+.alreadySet:
+		ret
+
+;
+; No change to LBA flag, but we use this opportunity to change defaults stored in the LBA value if we are
+; changing in/out of user LBA settings (since we use these bytes in different ways with the CHS setting).
+;
+ALIGN JUMP_ALIGN						
+MasterSlaveMenu_WriteLBAFlag:
+		test	word [es:di], FLG_DRVPARAMS_USERLBA
+		jnz		.alreadySet
+
+		push	ax
+		push	di
+		push	si
+
+		mov		ax, MASTERSLAVE_USERLBA_DEFAULT
+		mov		si, g_MenuitemMasterSlaveUserLbaValue
+		call	Menuitem_StoreValueFromAXtoMenuitemInDSSI				
+
+		pop		si
+		pop		di
+		pop		ax
+						
+.alreadySet:
+		ret		
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm	(revision 467)
@@ -0,0 +1,493 @@
+; Project name	:	XTIDE Universal BIOS Configurator v2
+; Description	:	All strings.
+
+;
+; XTIDE Universal BIOS and Associated Tools
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+;
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+;
+
+; Section containing initialized data
+SECTION .data
+
+; Menu title
+g_szProgramTitle:
+	db	"Configuration and Flashing program for XTIDE Universal BIOS v2.0.0.",LF,CR,NULL
+g_szXtideUniversalBiosSignature:	db	"XTIDE201",NULL
+g_szBiosIsNotLoaded:				db	"BIOS is not loaded!",NULL
+g_szEEPROM:							db	"EEPROM",NULL
+g_szSourceAndTypeSeparator:			db	" : ",NULL
+g_szUnidentified:					db	"Unidentified",NULL
+g_szUnsaved:						db	" ",SINGLE_LEFT_HORIZONTAL_TO_VERTICAL,
+									db	"Unsaved",SINGLE_RIGHT_HORIZONTAL_TO_VERTICAL,NULL
+
+; Item formatting
+g_szFormatItemWithoutValue:			db	"%c%s",NULL
+g_szFormatItemNameWithValue:		db	"%25s%-10S",NULL
+
+
+g_szNo:								db	"No",NULL
+g_szMultichoiceBooleanFlag:
+									db	"No",LF
+g_szYes:							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
+
+
+; Generic dialog strings
+g_szNotificationDialog:	db	"Notification.",NULL
+g_szErrorDialog:		db	"Error!",NULL
+g_szGenericDialogInfo:	db	"Press ENTER or ESC to close dialog.",NULL
+
+; Flashing related strings
+g_szFlashTitle:			db	"Flashing EEPROM, please wait.",NULL
+g_szErrEepromTooSmall:	db	"Image is too large for selected EEPROM type!",NULL
+g_szErrEepromPolling:	db	"Timeout when polling EEPROM.",LF
+						db	"EEPROM was not flashed properly!",NULL
+g_szErrEepromVerify:	db	"EEPROM did not return the same byte that was written.",LF
+						db	"EEPROM was not flashed properly!",NULL
+g_szPCFlashSuccessful:	db	"EEPROM was written successfully.",LF
+						db	"Press any key to reboot.",NULL
+g_szForeignFlash:		db	"EEPROM was written successfully.",NULL
+
+
+; Strings for main menu
+g_szItemMainExitToDOS:	db	"Exit to DOS",NULL
+g_szItemMainLoadFile:	db	"Load BIOS from file",NULL
+g_szItemMainLoadROM:	db	"Load BIOS from EEPROM",NULL
+g_szItemMainLoadStngs:	db	"Load old settings from EEPROM",NULL
+g_szItemMainConfigure:	db	"Configure XTIDE Universal BIOS",NULL
+g_szItemMainFlash:		db	"Flash EEPROM",NULL
+g_szItemMainSave:		db	"Save BIOS back to original file",NULL
+g_szItemMainLicense:	db  "Copyright and License Information",NULL
+g_szItemMainHomePage:	db  "Web Links",NULL
+
+g_szDlgMainLoadROM:		db	"Successfully loaded XTIDE Universal BIOS from EEPROM.",NULL
+g_szDlgMainLoadStngs:	db	"Successfully loaded settings from EEPROM.",NULL
+g_szDlgMainLoadFile:	db	"Successfully loaded file for flashing.",NULL
+g_szDlgMainSaveFile:	db	"Successfully saved XTIDE Universal BIOS to file.",NULL
+g_szDlgMainFileTooBig:	db	"Selected file is too big to be loaded for flashing!",NULL
+g_szDlgMainLoadErr:		db	"Failed to load file!",NULL
+g_szDlgMainSaveErr:		db	"Failed to save file!",NULL
+g_szDlgFileTitle:		db	"Select file to be flashed.",NULL
+g_szDlgFileFilter:		db	"*.*",NULL
+
+g_szNfoMainExitToDOS:	db	"Quits XTIDE Universal BIOS Configurator.",NULL
+g_szNfoMainLoadFile:	db	"Load BIOS file to be configured or flashed.",NULL
+g_szNfoMainLoadROM:		db	"Load BIOS from EEPROM to be reconfigured.",NULL
+g_szNfoMainLoadStngs:	db	"Load old XTIDE Universal BIOS settings from EEPROM.",NULL
+g_szNfoMainConfigure:	db	"Configure XTIDE Universal BIOS settings.",NULL
+g_szNfoMainFlash:		db	"Flash loaded BIOS image to EEPROM.",NULL
+g_szNfoMainSave:		db	"Save BIOS changes back to original file from which it was loaded.",NULL
+g_szNfoMainLicense:		db	"XTIDE Universal BIOS and XTIDECFG Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team."
+						db	" Released under GNU GPL v2, with ABSOLUTELY NO WARRANTY. Press ENTER for more details...",NULL
+g_szNfoMainHomePage:	db	"Visit http://code.google.com/p/ xtideuniversalbios (home page) and http://vintage-computer.com/ vcforum (support)",NULL
+
+g_szHelpMainLicense:	incbin	"Main_License.txt"
+						db	NULL
+
+; Strings for XTIDE Universal BIOS configuration menu
+g_szItemCfgBackToMain:	db	"Back to Main Menu",NULL
+g_szItemCfgIde1:		db	"Primary IDE Controller",NULL
+g_szItemCfgIde2:		db	"Secondary IDE Controller",NULL
+g_szItemCfgIde3:		db	"Tertiary IDE Controller",NULL
+g_szItemCfgIde4:		db	"Quaternary IDE Controller",NULL
+g_szItemCfgBootMenu:	db	"Boot settings",NULL
+g_szItemCfgFullMode:	db	"Full operating mode",NULL
+g_szItemCfgStealSize:	db	"kiB to steal from RAM",NULL
+g_szItemCfgIdeCnt:		db	"IDE controllers",NULL
+g_szItemCfgIdleTimeout:	db	"Power Management",NULL
+
+g_szDlgCfgFullMode:		db	"Enable full operating mode?",NULL
+g_szDlgCfgStealSize:	db	"How many kiB of base memory to steal for XTIDE Universal BIOS variables (1...255)?",NULL
+g_szDlgCfgIdeCnt:		db	"How many IDE controllers to manage (1...4)?",NULL
+g_szDlgCfgIdleTimeout:	db	"Select the amount of time before idling drives should enter standby mode.",NULL
+
+g_szNfoCfgIde:			db	"IDE controller and drive configuration.",NULL
+g_szNfoCfgBootMenu:		db	"Boot configuration.",NULL
+g_szNfoCfgFullMode:		db	"Full mode supports multiple controllers and has more features.",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
+g_szNfoCfgIdleTimeout:	db	"Enable Power Management to set the harddrive(s) to spin down after idling a certain amount of time.",NULL
+
+g_szSerialMoved:		db  "A Serial Controller has been moved to the end of the Controller list."
+						db	" No further action is required. Serial Controllers must be placed at the end of the list.",NULL
+
+g_szHelpCfgFullMode:	incbin	"Configuration_FullMode.txt"
+						db	NULL
+g_szHelpCfgStealSize:	incbin	"Configuration_StealSize.txt"
+						db	NULL
+g_szHelpCfgIdleTimeout:	db	"This option enables the standby timer for all harddrives handled by XTIDE Universal BIOS,"
+						db	" allowing the drives to spin down after idling the selected amount of time."
+						db	" Note that this does not work with old drives that lack the Power Management feature set."
+						db	" Also note that timeouts less than 5 minutes may cause unnecessary wear on the drives and is not recommended"
+						db	" (use for compatibility testing only).",NULL
+g_szMultichoiceIdleTimeout:
+							db	"Disabled",LF
+							db	"1 m",LF
+							db	"2 m",LF
+							db	"3 m",LF
+							db	"4 m",LF
+							db	"5 m",LF
+							db	"6 m",LF
+							db	"7 m",LF
+							db	"8 m",LF
+							db	"9 m",LF
+							db	"10 m",LF
+							db	"11 m",LF
+							db	"12 m",LF
+							db	"13 m",LF
+							db	"14 m",LF
+							db	"15 m",LF
+							db	"16 m",LF
+							db	"17 m",LF
+							db	"18 m",LF
+							db	"19 m",LF
+							db	"20 m",LF
+							db	"30 m",LF
+							db	"1 h",LF
+							db	"1 h 30 m",LF
+g_szIdleTimeoutChoice24:	db	"2 h",NULL
+
+g_szIdleTimeoutChoice0:		db	"Disabled",NULL
+g_szIdleTimeoutChoice1:		db	"1 m",NULL
+g_szIdleTimeoutChoice2:		db	"2 m",NULL
+g_szIdleTimeoutChoice3:		db	"3 m",NULL
+g_szIdleTimeoutChoice4:		db	"4 m",NULL
+g_szIdleTimeoutChoice5:		db	"5 m",NULL
+g_szIdleTimeoutChoice6:		db	"6 m",NULL
+g_szIdleTimeoutChoice7:		db	"7 m",NULL
+g_szIdleTimeoutChoice8:		db	"8 m",NULL
+g_szIdleTimeoutChoice9:		db	"9 m",NULL
+g_szIdleTimeoutChoice10:	db	"10 m",NULL
+g_szIdleTimeoutChoice11:	db	"11 m",NULL
+g_szIdleTimeoutChoice12:	db	"12 m",NULL
+g_szIdleTimeoutChoice13:	db	"13 m",NULL
+g_szIdleTimeoutChoice14:	db	"14 m",NULL
+g_szIdleTimeoutChoice15:	db	"15 m",NULL
+g_szIdleTimeoutChoice16:	db	"16 m",NULL
+g_szIdleTimeoutChoice17:	db	"17 m",NULL
+g_szIdleTimeoutChoice18:	db	"18 m",NULL
+g_szIdleTimeoutChoice19:	db	"19 m",NULL
+g_szIdleTimeoutChoice20:	db	"20 m",NULL
+g_szIdleTimeoutChoice21:	db	"30 m",NULL
+g_szIdleTimeoutChoice22:	db	"1 h",NULL
+g_szIdleTimeoutChoice23:	db	"1 h 30 m",NULL
+
+; Strings for IDE Controller menu
+g_szItemBackToCfgMenu:	db	"Back to Configuration Menu",NULL
+g_szItemIdeMaster:		db	"Master Drive",NULL
+g_szItemIdeSlave:		db	"Slave Drive",NULL
+g_szItemIdeDevice:		db	"Device type",NULL
+g_szItemIdeCmdPort:		db	"Base (cmd block) address",NULL
+g_szItemIdeCtrlPort:	db	"Control block address",NULL
+g_szItemIdeEnIRQ:		db	"Enable interrupt",NULL
+g_szItemIdeIRQ:			db	"IRQ",NULL
+g_szItemSerialCOM:		db	"COM Port",NULL
+g_szItemSerialBaud:		db	"Baud Rate",NULL
+g_szItemSerialPort:		db	"COM Port I/O address",NULL
+
+g_szItemIdeSerialComPort:	db	"COM port",NULL
+g_szItemIdeSerialBaudRate:	db	"Baud rate",NULL
+
+g_szDlgDevice:			db	"Select controller type.",NULL
+g_szDlgIdeCmdPort:		db	"Enter IDE command block (base port) address.",NULL
+g_szDlgIdeCtrlPort:		db	"Enter IDE control block address (usually command block + 200h).",NULL
+g_szDlgIdeEnIRQ:		db	"Enable interrupt?",NULL
+g_szDlgIdeIRQ:			db	"Enter IRQ channel (2...7 for 8-bit controllers, 2...15 for any other controller).",NULL
+
+g_szNfoIdeBackToCfgMenu:db	"Back to XTIDE Universal BIOS Configuration Menu.",NULL
+g_szNfoIdeMaster:		db	"Settings for Master Drive.",NULL
+g_szNfoIdeSlave:		db	"Settings for Slave Drive.",NULL
+g_szNfoIdeDevice:		db	"Select controller device type.",NULL
+g_szNfoIdeCmdPort:		db	"IDE Controller Command Block (base port) address.",NULL
+g_szNfoIdeCtrlPort:		db	"IDE Controller Control Block address. Usually Cmd Block + 8 for XTIDE, and Cmd Block + 200h for ATA.",NULL
+g_szNfoIdeEnIRQ:		db	"Interrupt or polling mode.",NULL
+g_szNfoIdeIRQ:			db	"IRQ channel to use.",NULL
+g_szNfoIdeSerialCOM:	db	"Select a COM port by number.",NULL
+g_szNfoIdeSerialBaud:	db	"Select the COM port's Baud Rate. The server must match this speed."
+						db	" Note that UART clock multipliers may impact the actual speed.",NULL
+g_szNfoIdeSerialPort:	db	"Select a COM port by custom I/O port address. Any address is valid up to 3f8h, but must be on an 8-byte boundary.",NULL
+
+g_szHelpIdeCmdPort:		incbin	"IDE_CommandPort.txt"
+						db	NULL
+g_szHelpIdeCtrlPort:	incbin	"IDE_ControlPort.txt"
+						db	NULL
+g_szHelpIdeEnIRQ:		incbin	"IDE_EnableInterrupt.txt"
+						db	NULL
+g_szHelpIdeIRQ:			incbin	"IDE_IRQ.txt"
+						db	NULL
+g_szHelpIdeSerialCOM:	incbin  "IDE_SerialCOM.txt"
+						db	NULL
+g_szHelpIdeSerialPort:	incbin  "IDE_SerialPort.txt"
+						db  NULL
+g_szHelpIdeSerialBaud:	incbin  "IDE_SerialBaud.txt"
+						db  NULL
+
+g_szMultichoiceCfgDevice:
+						db	"JR-IDE/ISA",LF
+						db	"Lo-tech XT-CF",LF
+						db	"XTIDE rev 2 or modded rev 1",LF
+						db	"XTIDE rev 1",LF
+						db	"16-bit ISA/VLB/PCI IDE",LF
+						db	"32-bit VLB/PCI IDE",LF
+						db	"Serial port virtual device",NULL
+
+
+g_szSerialCOMChoice:
+						db  "COM1 - address 3f8h",LF
+						db	"COM2 - address 2f8h",LF
+						db  "COM3 - address 3e8h",LF
+						db  "COM4 - address 2e8h",LF
+						db  "COM5 - address 2f0h",LF
+						db  "COM6 - address 3e0h",LF
+						db	"COM7 - address 2e0h",LF
+						db	"COM8 - address 260h",LF
+						db	"COM9 - address 368h",LF
+						db	"COMA - address 268h",LF
+						db	"COMB - address 360h",LF
+						db	"COMC - address 270h",LF
+						db  "COMx - Custom address",NULL
+
+g_szValueCfgCOM1:		db		"COM1",NULL
+g_szValueCfgCOM2:		db		"COM2",NULL
+g_szValueCfgCOM3:		db		"COM3",NULL
+g_szValueCfgCOM4:		db		"COM4",NULL
+g_szValueCfgCOM5:		db		"COM5",NULL
+g_szValueCfgCOM6:		db		"COM6",NULL
+g_szValueCfgCOM7:		db		"COM7",NULL
+g_szValueCfgCOM8:		db		"COM8",NULL
+g_szValueCfgCOM9:		db		"COM9",NULL
+g_szValueCfgCOMA:		db		"COMA",NULL
+g_szValueCfgCOMB:		db		"COMB",NULL
+g_szValueCfgCOMC:		db		"COMC",NULL
+g_szValueCfgCOMx:		db		"Custom",NULL
+
+g_szSerialBaudChoice:
+						db  "115.2K baud",LF
+						db  "57.6K baud",LF
+						db	"38.4K baud",LF
+						db  "28.8K baud",LF
+						db  "19.2K baud",LF
+						db	"9600 baud",LF
+						db  "4800 baud",LF
+						db  "2400 baud",NULL
+
+g_szValueCfgBaud115_2:	db		"115.2K",NULL
+g_szValueCfgBaud57_6:	db		"57.6K",NULL
+g_szValueCfgBaud38_4:	db		"38.4K",NULL
+g_szValueCfgBaud28_8:	db		"28.8K",NULL
+g_szValueCfgBaud19_2:	db		"19.2K",NULL
+g_szValueCfgBaud9600:	db		"9600",NULL
+g_szValueCfgBaud4800:	db		"4800",NULL
+g_szValueCfgBaud2400:	db		"2400",NULL
+
+
+g_szValueCfgDeviceJrIdeIsa:	db	"JR-ISA",NULL
+g_szValueCfgDeviceFast:		db	"XT-CF",NULL
+g_szValueCfgDeviceRev2:		db	"XTIDE r2",NULL
+g_szValueCfgDeviceRev1:		db	"XTIDE r1",NULL
+g_szValueCfgDevice16b:		db	"16-bit",NULL
+g_szValueCfgDevice32b:		db	"32-bit",NULL
+g_szValueCfgDeviceSerial:	db	"Serial",NULL
+
+
+
+; Strings for DRVPARAMS menu
+g_szItemDrvBackToIde:	db	"Back to IDE Controller Menu",NULL
+g_szItemDrvBlockMode:	db	"Block Mode Transfers",NULL
+g_szItemDrvXlateMode:	db	"CHS translation method",NULL
+g_szItemDrvWriteCache:	db	"Internal Write Cache",NULL
+g_szItemDrvUserCHS:		db	"User specified CHS",NULL
+g_szItemDrvCyls:		db	"Cylinders",NULL
+g_szItemDrvHeads:		db	"Heads",NULL
+g_szItemDrvSect:		db	"Sectors per track",NULL
+g_szItemDrvUserLBA:		db	"User specified LBA",NULL
+g_szItemDrvLbaSectors:	db	"Millions of sectors",NULL
+
+g_szDlgDrvBlockMode:	db	"Enable Block Mode Transfers?",NULL
+g_szDlgDrvXlateMode:	db	"Select P-CHS to L-CHS translation method.",NULL
+g_szDlgDrvWriteCache:	db	"Select hard drive internal write cache settings.",NULL
+g_szDlgDrvUserCHS:		db	"Specify (P-)CHS parameters manually?",NULL
+g_szDlgDrvCyls:			db	"Enter number of P-CHS cylinders (1...16383).",NULL
+g_szDlgDrvHeads:		db	"Enter number of P-CHS heads (1...16).",NULL
+g_szDlgDrvSect:			db	"Enter number of sectors per track (1...63).",NULL
+g_szDlgDrvUserLBA:		db	"Limit drive capacity?",NULL
+g_szDlgDrvLbaSectors:	db	"Enter maximum capacity in millions of sectors (16...256).",NULL
+
+g_szNfoDrvBlockMode:	db	"Transfer multiple sectors per data request.",NULL
+g_szNfoDrvXlateMode:	db	"P-CHS to L-CHS translation method.",NULL
+g_szNfoDrvWriteCache:	db	"Hard Drive Internal Write Cache settings (WARNING!).",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
+g_szNfoDrvSect:			db	"Number of user specified P-CHS sectors per track.",NULL
+g_szNfoDrvUserLBA:		db	"Limit drive capacity to X million sectors.",NULL
+g_szNfoDrvLbaSectors:	db	"Millions of sectors (1024*1024). 1M sectors = 512 MiB.",NULL
+
+g_szHelpDrvBlockMode:	incbin	"Drive_BlockMode.txt"
+						db	NULL
+g_szHelpDrvWriteCache:	incbin	"Drive_WriteCache.txt"
+						db	NULL
+g_szHelpDrvUserCHS:		incbin	"Drive_UserCHS.txt"
+						db	NULL
+g_szHelpDrvUserLBA:		incbin	"Drive_UserLBA.txt"
+						db	NULL
+
+g_szMultichoiseXlateMode:
+						db	"NORMAL",LF
+						db	"LARGE",LF
+						db	"Assisted LBA",LF
+						db	"Autodetect",NULL
+
+g_szValueDrvXlateNormal:db	"NORMAL",NULL
+g_szValueDrvXlateLarge:	db	"LARGE",NULL
+g_szValueDrvXlateLBA:	db	"LBA",NULL
+g_szValueDrvXlateAuto:	db	"Auto",NULL
+
+g_szMultichoiseWrCache:	db	"Drive Default",LF
+						db	"Disable Write Cache",LF
+						db	"Enable Write Cache",NULL
+
+g_szValueDrvWrCaDis:	db	"Disabled",NULL
+g_szValueDrvWrCaEn:		db	"Enabled",NULL
+
+
+; Strings for boot settings menu
+g_szItemBootTimeout:	db	"Selection timeout",NULL
+g_szItemBootDrive:		db	"Default boot drive",NULL
+g_szItemBootDispMode:	db	"Display Mode",NULL
+g_szItemBootFloppyDrvs:	db	"Number of Floppy Drives",NULL
+g_szItemSerialDetect:	db	"Scan for Serial Drives",NULL
+
+g_szDlgBootTimeout:		db	"Enter Boot Menu selection timeout in BIOS timer ticks (2...1092).",NULL
+g_szDlgBootDrive:		db	"Enter default drive number (0xh for Floppy Drives, 8xh for Hard Disks).",NULL
+g_szDlgBootDispMode:	db	"Select display mode.",NULL
+g_szDlgBootFloppyDrvs:	db	"Select number of Floppy Drives in system.",NULL
+g_szDlgSerialDetect:	db	"Scan for serial drives?",NULL
+
+g_szNfoBootTimeout:		db	"Menu item selection timeout in BIOS timer ticks. 1 tick = 54.9 ms.",NULL
+g_szNfoBootDrive:		db	"Default boot drive.",NULL
+g_szNfoDispMode:		db	"Display mode to set when booting.",NULL
+g_szNfoBootFloppyDrvs:	db	"Number of Floppy Drives in system.",NULL
+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_szHelpBootTimeout:	incbin	"Bootmenu_Timeout.txt"
+						db	NULL
+g_szHelpBootDrive:		incbin	"Bootmenu_DefaultDrive.txt"
+						db	NULL
+g_szHelpBootFloppyDrvs:	incbin	"Bootmenu_FloppyDrives.txt"
+						db	NULL
+g_szHelpSerialDetect:	incbin  "Bootmenu_SerialDetect.txt"
+						db  NULL
+
+g_szMultichoiceBootDispMode:
+						db	"Default",LF
+						db	"40x25 Black & White",LF
+						db	"40x25 Color",LF
+						db	"80x25 Black & White",LF
+						db	"80x25 Color",LF
+						db	"80x25 Monochrome",NULL
+
+g_szMultichoiceBootFloppyDrvs:
+						db	"Autodetect",LF
+						db	"1",LF
+						db	"2",LF
+						db	"3",LF
+						db	"4",NULL
+
+g_szValueBootDispModeDefault:	db	"Default",NULL
+g_szValueBootDispModeBW40:		db	"BW40",NULL
+g_szValueBootDispModeCO40:		db	"CO40",NULL
+g_szValueBootDispModeBW80:		db	"BW80",NULL
+g_szValueBootDispModeCO80:		db	"CO80",NULL
+g_szValueBootDispModeMono:		db	"Mono",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
+g_szItemFlashPageSize:	db	"Page size",NULL
+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	"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
+g_szNfoFlashAddr:		db	"Address (segment) where EEPROM is located.",NULL
+g_szNfoFlashPageSize:	db	"Number of bytes to write before delay.",NULL
+g_szNfoFlashChecksum:	db	"Generate checksum byte to the end of BIOS image.",NULL
+
+g_szHelpFlashSDP:		incbin	"Flash_SdpCommand.txt"
+						db	NULL
+g_szHelpFlashPageSize:	incbin	"Flash_PageSize.txt"
+						db	NULL
+g_szHelpFlashChecksum:	incbin	"Flash_Checksum.txt"
+						db	NULL
+
+g_szMultichoiceEepromType:
+						db	"2816 (2 kiB)",LF
+						db	"2864 (8 kiB)",LF
+						db	"2864 mod (8 kiB)",LF
+						db	"28256 (32 kiB)",LF
+						db	"28512 (64 kiB)",NULL
+g_szValueFlash2816:		db	"2816",NULL
+g_szValueFlash2864:		db	"2864",NULL
+g_szValueFlash2864Mod:	db	"2864mod",NULL
+g_szValueFlash28256:	db	"28256",NULL
+g_szValueFlash28512:	db	"28512",NULL
+
+g_szMultichoiceSdpCommand:
+						db	"None",LF
+						db	"Enable",LF
+g_szValueFlashDisable:	db	"Disable",NULL
+g_szValueFlashNone:		db	"None",NULL
+g_szValueFlashEnable:	db	"Enable",NULL
+
+g_szMultichoicePageSize:
+						db	"1 byte",LF
+						db	"2 bytes",LF
+						db	"4 bytes",LF
+						db	"8 bytes",LF
+						db	"16 bytes",LF
+						db	"32 bytes",LF
+g_szValueFlash64bytes:	db	"64 bytes",NULL
+g_szValueFlash1byte:	db	"1 byte",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_szSelectionTimeout:	db	DOUBLE_BOTTOM_LEFT_CORNER,DOUBLE_LEFT_HORIZONTAL_TO_SINGLE_VERTICAL,"%ASelection in %2u s",NULL
+
+g_szDashForZero:		db	"- ",NULL
+
+g_szValueUnknownError:	db	"Error!",NULL
+
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/gpl-2.0.txt
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/gpl-2.0.txt	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/gpl-2.0.txt	(revision 467)
@@ -0,0 +1,339 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                            NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
Index: tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/makefile
===================================================================
--- tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/makefile	(revision 467)
+++ tags/v2.0.0_beta_2/XTIDE_Universal_BIOS_Configurator_v2/makefile	(revision 467)
@@ -0,0 +1,137 @@
+###############################################################################
+# Makefile to build XTIDE Universal BIOS Configurator v2.                     #
+#                                                                             #
+# Valid makefile targets are:                                                 #
+# all		Removes existing files and builds binary file in \Build           #
+# clean		Removes all files from \Build                                     #
+#                                                                             #
+# Build directory must be created manually if it does not exist.              #
+#                                                                             #
+###############################################################################
+
+###########################################
+# Source files and destination executable #
+###########################################
+
+# Assembly source code file (*.asm):
+SRC_ASM = Src/Main.asm
+
+# Program executable file name without extension:
+PROG = xtidecfg
+EXTENSION = com
+
+
+#######################################
+# Destination and include directories #
+#######################################
+
+# Directory where binary file will be compiled to
+BUILD_DIR = Build
+
+# Subdirectories where included files are:
+HEADERS = Inc/
+HEADERS += Inc/Help/
+HEADERS += Src/
+HEADERS += Src/Menupages/
+
+# Subdirectories where library files are:
+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)
+
+
+#################################################################
+# Assembler preprocessor defines.                               #
+#################################################################
+DEFINES = EXCLUDE_FROM_XTIDECFG
+DEFINES_XT = ELIMINATE_CGA_SNOW
+DEFINES_XTPLUS = USE_186 ELIMINATE_CGA_SNOW
+DEFINES_AT = USE_286 USE_AT
+
+
+###################
+# Other variables #
+###################
+
+# Add -D in front of every preprocessor define declaration
+DEFS = $(DEFINES:%=-D%)
+DEFS_XT = $(DEFINES_XT:%=-D%)
+DEFS_XTPLUS = $(DEFINES_XTPLUS:%=-D%)
+DEFS_AT = $(DEFINES_AT:%=-D%)
+
+# Add -I in front of all header directories
+IHEADERS = $(HEADERS:%=-I%)
+
+# Path + target file to be built
+TARGET = $(BUILD_DIR)/$(PROG)
+
+
+#########################
+# Compilers and linkers #
+#########################
+
+# Make
+MAKE = mingw32-make.exe
+
+# Assembler
+AS = nasm.exe
+
+# use this command to erase files.
+RM = -del /Q
+
+
+#############################
+# Compiler and linker flags #
+#############################
+
+# Assembly compiler flags
+ASFLAGS = -f bin				# Produce binary object files
+ASFLAGS += $(DEFS)				# Preprocessor defines
+ASFLAGS += $(IHEADERS)			# Set header file directory paths
+ASFLAGS += -Worphan-labels		# Warn about labels without colon
+ASFLAGS += -O9					# Optimize operands to their shortest forms
+
+
+############################################
+# Build process. Actual work is done here. #
+############################################
+
+.PHONY: all at xtplus xt clean release
+
+all: clean release
+	@echo All done!
+
+at:
+	@$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_AT) -l"$(TARGET)_at.lst" -o"$(TARGET)_at.$(EXTENSION)"
+	@echo AT version "$(TARGET)_at.$(EXTENSION)" built.
+
+xtplus:
+	@$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XTPLUS) -l"$(TARGET)_xtp.lst" -o"$(TARGET)_xtp.$(EXTENSION)"
+	@echo XT Plus version "$(TARGET)_xtp.$(EXTENSION)" built.
+
+xt:
+	@$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -l"$(TARGET)_xt.lst" -o"$(TARGET).$(EXTENSION)"
+	@echo XT version "$(TARGET).$(EXTENSION)" built.
+
+clean:
+	@$(RM) $(BUILD_DIR)\*.*
+	@echo Deleted "(*.*)" from "$(BUILD_DIR)/"
+
+release: xt
+	@echo Compressing with UPX...
+	@upx -qq --8086 --ultra-brute $(TARGET).$(EXTENSION)
+	@echo Done! XT version is ready for release.
+
+xt_unused: xt
+	@$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -o"$(TARGET)_xt_unused.asm" -E -DCHECK_FOR_UNUSED_ENTRYPOINTS
+	@perl ..\tools\unused.pl $(TARGET)_xt.lst $(TARGET)_xt_unused.asm
+
