Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_DefaultDrive.txt
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_DefaultDrive.txt	(revision 68)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_DefaultDrive.txt	(revision 68)
@@ -0,0 +1,1 @@
+Drive to be set selected by default when Boot Menu is displayed.
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_FloppyDrives.txt
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_FloppyDrives.txt	(revision 68)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_FloppyDrives.txt	(revision 68)
@@ -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: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_RomBoot.txt
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_RomBoot.txt	(revision 68)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_RomBoot.txt	(revision 68)
@@ -0,0 +1,1 @@
+Some old systems have BASIC or DOS in ROM. Since most systems don't have either, ROM Boot setting is disabled by default. Enable it if you have use for it.
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_SwapDrives.txt
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_SwapDrives.txt	(revision 68)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_SwapDrives.txt	(revision 68)
@@ -0,0 +1,1 @@
+Some old operating systems (DOS) can only boot from Floppy Drive A (00h) or first Hard Disk (80h, usually drive C). Drive Translation can be used to modify drive numbers so that selected drive will be mapped to 00h or 80h so that it can be booted.
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_Timeout.txt
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_Timeout.txt	(revision 68)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_Timeout.txt	(revision 68)
@@ -0,0 +1,1 @@
+Boot Menu selection timeout in seconds. When time goes to zero, currently selected drive will be booted automatically. Timeout can be disabled by setting this to 0.
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Configuration_FullMode.txt
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Configuration_FullMode.txt	(revision 68)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Configuration_FullMode.txt	(revision 68)
@@ -0,0 +1,5 @@
+Full mode supports up to 5 IDE controllers (10 drives). Full mode reserves a bit of RAM from top of Conventional memory. This makes possible to use ROM BASIC and software that requires top of 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 top of interrupt vectors (30:0h) so no Conventional memory needs to be reserved. Lite mode cannot be used if some software requires 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 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: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Configuration_StealSize.txt
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Configuration_StealSize.txt	(revision 68)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Configuration_StealSize.txt	(revision 68)
@@ -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: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Drive_BlockMode.txt
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Drive_BlockMode.txt	(revision 68)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Drive_BlockMode.txt	(revision 68)
@@ -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: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Drive_UserCHS.txt
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Drive_UserCHS.txt	(revision 68)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Drive_UserCHS.txt	(revision 68)
@@ -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: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Flash_Checksum.txt
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Flash_Checksum.txt	(revision 68)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Flash_Checksum.txt	(revision 68)
@@ -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: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Flash_PageSize.txt
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Flash_PageSize.txt	(revision 68)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Flash_PageSize.txt	(revision 68)
@@ -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: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Flash_SdpCommand.txt
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Flash_SdpCommand.txt	(revision 68)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Flash_SdpCommand.txt	(revision 68)
@@ -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: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_CommandPort.txt
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_CommandPort.txt	(revision 68)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_CommandPort.txt	(revision 68)
@@ -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: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_ControlPort.txt
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_ControlPort.txt	(revision 68)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_ControlPort.txt	(revision 68)
@@ -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: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_EnableInterrupt.txt
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_EnableInterrupt.txt	(revision 68)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_EnableInterrupt.txt	(revision 68)
@@ -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: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_IRQ.txt
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_IRQ.txt	(revision 68)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_IRQ.txt	(revision 68)
@@ -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: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Variables.inc
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Variables.inc	(revision 67)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Variables.inc	(revision 68)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Univeral BIOS Configurator v2
 ; Created date	:	5.10.2010
-; Last update	:	2.12.2010
+; Last update	:	6.12.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Global variables for configuration program.
@@ -13,5 +13,5 @@
 XTIDE_SIGNATURE_LENGTH				EQU		8	; XTIDE Universal BIOS signature string length
 NUMBER_OF_EEPROM_TYPES				EQU		4
-MAX_EEPROM_SIZE						EQU	65536
+MAX_EEPROM_SIZE_IN_BYTES			EQU		65536
 
 
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm	(revision 67)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm	(revision 68)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Univeral BIOS Configurator v2
 ; Created date	:	10.10.2010
-; Last update	:	30.11.2010
+; Last update	:	6.12.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Functions for loading and saving BIOS image file.
@@ -23,11 +23,11 @@
 	push	ds
 
-	call	.OpenFileForLoadingFromDSSIandGetSizeToCX
-	jc		SHORT .DisplayErrorMessage
-	call	.LoadFileWithNameInDSSIhandleInBXandSizeInCXtoRamBuffer
+	call	.OpenFileForLoadingFromDSSIandGetSizeToDXCX
+	jc		SHORT .DisplayErrorMessage
+	call	.LoadFileWithNameInDSSIhandleInBXandSizeInDXCXtoRamBuffer
 	jc		SHORT .DisplayErrorMessage
 
 	mov		ax, FLG_CFGVARS_FILELOADED
-	call	Buffers_NewBiosWithSizeInCXandSourceInAXhasBeenLoadedForConfiguration
+	call	Buffers_NewBiosWithSizeInDXCXandSourceInAXhasBeenLoadedForConfiguration
 	call	DisplayFileLoadedSuccesfully
 	call	FileIO_CloseUsingHandleFromBX
@@ -43,17 +43,17 @@
 
 ;--------------------------------------------------------------------
-; .OpenFileForLoadingFromDSSIandGetSizeToCX
+; .OpenFileForLoadingFromDSSIandGetSizeInBytesToDXCX
 ;	Parameters:
 ;		DS:SI:	Name of file to open
 ;	Returns:
 ;		BX:		File handle (if succesfull)
-;		CX:		File size (if succesfull)
+;		DX:CX:	File size (if succesfull)
 ;		CF:		Clear if successfull
 ;				Set if error
 ;	Corrupts registers:
-;		AX, DX
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-.OpenFileForLoadingFromDSSIandGetSizeToCX:
+;		AX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.OpenFileForLoadingFromDSSIandGetSizeToDXCX:
 	mov		al, FILE_ACCESS.ReadOnly
 	call	FileIO_OpenWithPathInDSSIandFileAccessInAL
@@ -62,11 +62,10 @@
 	jc		SHORT .FileError
 
-	cmp		dx, BYTE 1		; File size over 65536 bytes?
+	cmp		dx, MAX_EEPROM_SIZE_IN_BYTES >> 16
 	ja		SHORT .FileTooBig
-	jb		SHORT .CopyFileSizeToCX
-	test	ax, ax
-	jnz		SHORT .FileTooBig
-	dec		ax				; Prepare to load 65535 bytes
-.CopyFileSizeToCX:
+	jb		SHORT .FileNotTooBig
+	cmp		ax, MAX_EEPROM_SIZE_IN_BYTES & 0FFFFh
+	ja		SHORT .FileTooBig
+.FileNotTooBig:
 	xchg	cx, ax
 	clc
@@ -79,8 +78,8 @@
 
 ;--------------------------------------------------------------------
-; .LoadFileWithNameInDSSIhandleInBXandSizeInCXtoRamBuffer
+; .LoadFileWithNameInDSSIhandleInBXandSizeInDXCXtoRamBuffer
 ;	Parameters:
 ;		BX:		File Handle
-;		CX:		File size
+;		DX:CX:	File size
 ;		DS:SI:	File name
 ;	Returns:
@@ -91,10 +90,10 @@
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
-.LoadFileWithNameInDSSIhandleInBXandSizeInCXtoRamBuffer:
+.LoadFileWithNameInDSSIhandleInBXandSizeInDXCXtoRamBuffer:
 	push	es
 
 	call	Buffers_GetFileBufferToESDI
 	call	Registers_ExchangeDSSIwithESDI
-	call	FileIO_ReadCXbytesToDSSIusingHandleFromBX
+	call	FileIO_ReadDXCXbytesToDSSIusingHandleFromBX
 	jnc		SHORT .StoreFileNameToCfgvarsFromESDI
 
@@ -163,7 +162,9 @@
 	call	Buffers_GetFileBufferToESDI
 	call	Registers_CopyESDItoDSSI
+	xor		dx, dx
 	mov		cx, [cs:g_cfgVars+CFGVARS.wImageSizeInWords]
 	shl		cx, 1
-	call	FileIO_WriteCXbytesFromDSSIusingHandleFromBX
+	rcl		dx, 1			; WORDs to BYTEs
+	call	FileIO_WriteDXCXbytesFromDSSIusingHandleFromBX
 	jc		SHORT .DisplayErrorMessage
 
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm	(revision 67)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm	(revision 68)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Universal BIOS Configurator v2
 ; Created date	:	6.10.2010
-; Last update	:	5.12.2010
+; Last update	:	6.12.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Functions for accessing file and flash buffers.
@@ -41,15 +41,9 @@
 
 	call	Buffers_GetFileBufferToESDI
-	call	Buffers_IsXtideUniversalBiosSignatureInESDI
-	jnz		SHORT .NoFileOrBiosLoaded
-	jmp		SHORT .IsSupportedVersionOfXtideUniversalBiosLoaded
+	jmp		SHORT Buffers_IsXtideUniversalBiosSignatureInESDI
 .NoFileOrBiosLoaded:
 	or		cl, 1		; Clear ZF
 	ret
 
-
-ALIGN JUMP_ALIGN
-.IsSupportedVersionOfXtideUniversalBiosLoaded:
-	
 
 ;--------------------------------------------------------------------
@@ -81,17 +75,16 @@
 ;	Parameters:
 ;		AX:		EEPROM source (FLG_CFGVARS_FILELOADED or FLG_CFGVARS_ROMLOADED)
-;		CX:		EEPROM size in bytes
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, CX
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-Buffers_NewBiosWithSizeInCXandSourceInAXhasBeenLoadedForConfiguration:
+;		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
-	mov		ax, (64<<10) / 2	; 32768 WORDs
-	shr		cx, 1				; Bytes to WORDs
-	eCMOVZ	cx, ax
+	shr		dx, 1
+	rcr		cx, 1
 	mov		[cs:g_cfgVars+CFGVARS.wImageSizeInWords], cx
 	ret
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm	(revision 67)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm	(revision 68)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Univeral BIOS Configurator v2
 ; Created date	:	19.4.2010
-; Last update	:	3.12.2010
+; Last update	:	9.12.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Functions for managing EEPROM contents.
@@ -31,36 +31,37 @@
 
 ;--------------------------------------------------------------------
-; EEPROM_LoadXtideUniversalBiosFromRomToRamBuffer
+; EEPROM_LoadXtideUniversalBiosFromRomToRamBufferAndReturnSizeInDXCX
 ;	Parameters:
 ;		Nothing
 ;	Returns:
-;		CX:		BIOS size in bytes
+;		DX:CX:	BIOS size in bytes
 ;	Corrupts registers:
 ;		AX, BX, SI, DI
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
-EEPROM_LoadXtideUniversalBiosFromRomToRamBuffer:
+EEPROM_LoadXtideUniversalBiosFromRomToRamBufferAndReturnSizeInDXCX:
 	push	es
 
 	call	EEPROM_FindXtideUniversalBiosROMtoESDI
-	call	.GetXtideUniversalBiosSizeFromEStoCX
+	call	.GetXtideUniversalBiosSizeFromEStoDXCX
 	xor		si, si				; Load from beginning of ROM
 	call	LoadBytesFromRomToRamBuffer
 
-	call	.GetXtideUniversalBiosSizeFromEStoCX
+	call	.GetXtideUniversalBiosSizeFromEStoDXCX
 	pop		es
 	ret
 
 ;--------------------------------------------------------------------
-; .GetXtideUniversalBiosSizeFromEStoCX
+; .GetXtideUniversalBiosSizeFromEStoDXCX
 ;	Parameters:
 ;		Nothing
 ;	Returns:
-;		AX:		Bios size in bytes
+;		DX:CX:	Bios size in bytes
 ;	Corrupts registers:
-;		AX, BX
+;		Nothing
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
-.GetXtideUniversalBiosSizeFromEStoCX:
+.GetXtideUniversalBiosSizeFromEStoDXCX:
+	xor		dx, dx
 	eMOVZX	cx, BYTE [es:ROMVARS.bRomSize]
 	eSHL_IM	cx, 9				; *= 512 for byte count
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm	(revision 67)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm	(revision 68)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Univeral BIOS Configurator v2
 ; Created date	:	5.10.2010
-; Last update	:	3.12.2010
+; Last update	:	7.12.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Program start and exit.			
@@ -54,14 +54,34 @@
 ALIGN JUMP_ALIGN
 Main_Start:
-	CALL_DISPLAY_LIBRARY InitializeDisplayContext
-	CALL_DISPLAY_LIBRARY ClearScreen
+	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
-	CALL_DISPLAY_LIBRARY SynchronizeDisplayContextToHardware
 	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
 
 
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm	(revision 67)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm	(revision 68)
@@ -185,4 +185,6 @@
 ALIGN JUMP_ALIGN
 StartFlashing:
+	call	.MakeSureThatImageFitsInEeprom
+	jc		SHORT .InvalidFlashingParameters
 	push	es
 	push	ds
@@ -200,4 +202,28 @@
 	pop		ds
 	pop		es
+.InvalidFlashingParameters:
+	ret
+
+;--------------------------------------------------------------------
+; .MakeSureThatImageFitsInEeprom
+;	Parameters:
+;		SS:BP:	Ptr to MENU
+;	Returns:
+;		Nothing
+;	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
+	ret
+ALIGN JUMP_ALIGN
+.ImageFitsInSelectedEeprom:
+	clc
 	ret
 
@@ -270,6 +296,5 @@
 ALIGN JUMP_ALIGN
 .GetNumberOfPagesToFlashToAX:
-	eMOVZX	bx, BYTE [si+FLASHVARS.bEepromType]
-	mov		ax, [cs:bx+g_rgwEepromTypeToSizeInWords]
+	call	.GetSelectedEepromSizeInWordsToAX
 	xor		dx, dx
 	shl		ax, 1		; Size in bytes to...
@@ -282,4 +307,18 @@
 	ret
 
+;--------------------------------------------------------------------
+; .GetSelectedEepromSizeInWordsToAX
+;	Parameters:
+;		Nothing
+;	Returns:
+;		AX:		Selected EEPROM size in WORDs
+;	Corrupts registers:
+;		BX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.GetSelectedEepromSizeInWordsToAX:
+	eMOVZX	bx, BYTE [cs:g_cfgVars+CFGVARS.bEepromType]
+	mov		ax, [cs:bx+g_rgwEepromTypeToSizeInWords]
+	ret
 
 ;--------------------------------------------------------------------
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm	(revision 67)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm	(revision 68)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Universal BIOS Configurator v2
 ; Created date	:	6.10.2010
-; Last update	:	19.11.2010
+; Last update	:	9.12.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Main menu structs and functions.
@@ -226,12 +226,9 @@
 LoadXtideUniversalBiosFromRom:
 	call	Buffers_SaveChangesIfFileLoaded
-	call	EEPROM_LoadXtideUniversalBiosFromRomToRamBuffer
+	call	EEPROM_LoadXtideUniversalBiosFromRomToRamBufferAndReturnSizeInDXCX
 	mov		ax, FLG_CFGVARS_ROMLOADED
-	call	Buffers_NewBiosWithSizeInCXandSourceInAXhasBeenLoadedForConfiguration
-	push	cs
-	pop		ds
-	mov		si, g_szDlgMainLoadROM
-	CALL_MENU_LIBRARY DisplayMessageWithInputInDSSI
-	ret
+	call	Buffers_NewBiosWithSizeInDXCXandSourceInAXhasBeenLoadedForConfiguration
+	mov		dx, g_szDlgMainLoadROM
+	jmp		Dialogs_DisplayNotificationFromCSDX
 
 
@@ -241,7 +238,4 @@
 	call	EEPROM_LoadOldSettingsFromRomToRamBuffer
 	and		WORD [g_cfgVars+CFGVARS.wFlags], ~FLG_CFGVARS_UNSAVED
-	push	cs
-	pop		ds
-	mov		si, g_szDlgMainLoadStngs
-	CALL_MENU_LIBRARY DisplayMessageWithInputInDSSI
-	ret
+	mov		dx, g_szDlgMainLoadStngs
+	jmp		Dialogs_DisplayNotificationFromCSDX
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm	(revision 67)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm	(revision 68)
@@ -2,5 +2,5 @@
 ; Project name	:	XTIDE Universal BIOS Configurator v2
 ; Created date	:	5.10.2010
-; Last update	:	5.12.2010
+; Last update	:	9.12.2010
 ; Author		:	Tomi Tilli
 ; Description	:	All strings.
@@ -43,4 +43,5 @@
 
 ; Flashing related strings
+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
@@ -102,6 +103,8 @@
 g_szNfoCfgIdeCnt:		db	"Number of IDE controllers to manage.",NULL
 
-g_szHelpCfgFullMode:	db	"incbin goes here.",NULL
-g_szHelpCfgStealSize:	db	"incbin goes here.",NULL
+g_szHelpCfgFullMode:	incbin	"Configuration_FullMode.txt"
+						db	NULL
+g_szHelpCfgStealSize:	incbin	"Configuration_StealSize.txt"
+						db	NULL
 
 g_szMultichoiseCfgBootLoader:
@@ -140,8 +143,12 @@
 g_szNfoIdeIRQ:			db	"IRQ channel to use.",NULL
 
-g_szHelpIdeCmdPort:		db	"incbin goes here.",NULL
-g_szHelpIdeCtrlPort:	db	"incbin goes here.",NULL
-g_szHelpIdeEnIRQ:		db	"incbin goes here.",NULL
-g_szHelpIdeIRQ:			db	"incbin goes here.",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_szMultichoiseCfgBusType:
@@ -177,6 +184,8 @@
 g_szNfoDrvSect:			db	"Number of user specified P-CHS sectors per track.",NULL
 
-g_szHelpDrvBlockMode:	db	"incbin goes here.",NULL
-g_szHelpDrvUserCHS:		db	"incbin goes here.",NULL
+g_szHelpDrvBlockMode:	incbin	"Drive_BlockMode.txt"
+						db	NULL
+g_szHelpDrvUserCHS:		incbin	"Drive_UserCHS.txt"
+						db	NULL
 
 
@@ -200,9 +209,14 @@
 g_szNfoBootRomBoot:		db	"Show ROM Basic or ROM DOS boot option.",NULL
 
-g_szHelpBootTimeout:	db	"incbin goes here.",NULL
-g_szHelpBootDrive:		db	"incbin goes here.",NULL
-g_szHelpBootFloppyDrvs:	db	"incbin goes here.",NULL
-g_szHelpBootSwap:		db	"incbin goes here.",NULL
-g_szHelpBootRomBoot:	db	"incbin goes here.",NULL
+g_szHelpBootTimeout:	incbin	"Bootmenu_Timeout.txt"
+						db	NULL
+g_szHelpBootDrive:		incbin	"Bootmenu_DefaultDrive.txt"
+						db	NULL
+g_szHelpBootFloppyDrvs:	incbin	"Bootmenu_FloppyDrives.txt"
+						db	NULL
+g_szHelpBootSwap:		incbin	"Bootmenu_SwapDrives.txt"
+						db	NULL
+g_szHelpBootRomBoot:	incbin	"Bootmenu_RomBoot.txt"
+						db	NULL
 
 g_szMultichoiseBootFloppyDrvs:
@@ -241,7 +255,10 @@
 g_szNfoFlashChecksum:	db	"Generate checksum byte to the end of BIOS image.",NULL
 
-g_szHelpFlashSDP:		db	"incbin goes here.",NULL
-g_szHelpFlashPageSize:	db	"incbin goes here.",NULL
-g_szHelpFlashChecksum:	db	"incbin goes here.",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_szMultichoiseEepromType:
Index: /trunk/XTIDE_Universal_BIOS_Configurator_v2/makefile
===================================================================
--- /trunk/XTIDE_Universal_BIOS_Configurator_v2/makefile	(revision 67)
+++ /trunk/XTIDE_Universal_BIOS_Configurator_v2/makefile	(revision 68)
@@ -35,4 +35,5 @@
 # Subdirectories where included files are:
 HEADERS = Inc/
+HEADERS += Inc/Help/
 HEADERS += Src/
 HEADERS += Src/Menupages/
