Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm	(revision 170)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm	(revision 181)
@@ -92,11 +92,7 @@
 	call	Registers_ExchangeDSSIwithESDI
 	call	FileIO_ReadDXCXbytesToDSSIusingHandleFromBX
-	jnc		SHORT .StoreFileNameToCfgvarsFromESDI
-
-	pop		es
-	ret
-
-ALIGN JUMP_ALIGN
-.StoreFileNameToCfgvarsFromESDI:
+	jc		SHORT .ReturnError
+
+	; Store filename to Cfgvars from ESDI
 	push	cx
 
@@ -107,8 +103,10 @@
 	cld
 	call	String_CopyDSSItoESDIandGetLengthToCX
+	clc
 
 	pop		cx
+ALIGN JUMP_ALIGN
+.ReturnError:
 	pop		es
-	clc
 	ret
 
@@ -157,5 +155,5 @@
 	xor		dx, dx
 	shl		cx, 1
-	rcl		dx, 1			; WORDs to BYTEs	
+	rcl		dx, 1			; WORDs to BYTEs
 
 	mov		al, FILE_ACCESS.WriteOnly
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Dialogs.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Dialogs.asm	(revision 170)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Dialogs.asm	(revision 181)
@@ -159,12 +159,5 @@
 ALIGN JUMP_ALIGN
 Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX:
-	call	.InitializeProgressDialogIoInDSSIwithFlashvarsInDSBX
-	mov		dx, ds
-	mov		ax, bx
-	CALL_MENU_LIBRARY StartProgressTaskWithIoInDSSIandParamInDXAX
-	ret
-
-ALIGN JUMP_ALIGN
-.InitializeProgressDialogIoInDSSIwithFlashvarsInDSBX:
+	; Initialize progress dialog I/O in DS:SI with flashvars in DS:BX
 	call	InitializeDialogInputFromDSSI
 	mov		WORD [si+DIALOG_INPUT.fszTitle], g_szFlashTitle
@@ -177,4 +170,9 @@
 	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
 
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm	(revision 170)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm	(revision 181)
@@ -169,5 +169,5 @@
 	call	Buffers_IsXtideUniversalBiosSignatureInESDI
 	je		SHORT .RomFound
-	add		bx, 200h				; Increment by 8kB
+	add		bh, 2					; Increment by 8kB
 	jnc		SHORT .SegmentLoop		; Loop until segment overflows
 	clc
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Flash.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Flash.asm	(revision 170)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Flash.asm	(revision 181)
@@ -1,7 +1,3 @@
-; File name		:	Flash.asm
 ; Project name	:	XTIDE Universal BIOS Configurator v2
-; Created date	:	1.12.2010
-; Last update	:	3.12.2010
-; Author		:	Tomi Tilli
 ; Description	:	Functions for flashing the EEPROM.
 
@@ -37,5 +33,9 @@
 
 	loop	.FlashNextPage
+%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
 	ret
 
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuEvents.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuEvents.asm	(revision 170)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuEvents.asm	(revision 181)
@@ -135,9 +135,8 @@
 .KeyStrokeInAX:
 	cmp		ah, KEY_DISPLAY_ITEM_HELP
-	je		SHORT .DisplayHelp
-	jmp		SHORT .EventNotHandled
-
-ALIGN JUMP_ALIGN
-.DisplayHelp:
+	jne		SHORT .EventNotHandled
+
+;ALIGN JUMP_ALIGN
+;.DisplayHelp:
 	call	Menupage_GetActiveMenupageToDSDI
 	CALL_MENU_LIBRARY GetHighlightedItemToAX
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menuitem.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menuitem.asm	(revision 170)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menuitem.asm	(revision 181)
@@ -150,6 +150,4 @@
 	add		di, [si+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
 	jmp		[cs:bx+.rgfnJumpToStoreValueBasedOnItemType]
-.InvalidItemType:
-	ret
 
 ALIGN WORD_ALIGN
@@ -242,4 +240,5 @@
 	CALL_MENU_LIBRARY GetHighlightedItemToAX
 	CALL_MENU_LIBRARY RefreshItemFromAX
+.InvalidItemType:
 	ret
 
@@ -268,13 +267,4 @@
 ALIGN JUMP_ALIGN
 Menuitem_GetValueToAXfromMenuitemInDSSI:
-	call	.GetMenuitemValueToAX
-	test	BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_BYTEVALUE
-	jnz		SHORT .ConvertWordToByteValue
-	test	BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_FLAGVALUE
-	jnz		SHORT .ConvertWordToFlagValue
-	ret
-
-ALIGN JUMP_ALIGN
-.GetMenuitemValueToAX:
 	push	es
 	push	di
@@ -284,20 +274,19 @@
 	pop		di
 	pop		es
-	ret
-
+
+	test	BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_BYTEVALUE
+	jnz		SHORT .ConvertWordToByteValue
+	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
 .ConvertWordToByteValue:
 	xor		ah, ah
-	ret
-
-ALIGN JUMP_ALIGN
-.ConvertWordToFlagValue:
-	test	ax, [si+MENUITEM.itemValue+ITEM_VALUE.wValueBitmask]
-	jnz		SHORT .ReturnTrue
-	xor		ax, ax
-	ret
-ALIGN JUMP_ALIGN
-.ReturnTrue:
-	mov		ax, TRUE<<1		; Shift for lookup
+ALIGN JUMP_ALIGN, ret
+.Return:
 	ret
 
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/ConfigurationMenu.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/ConfigurationMenu.asm	(revision 170)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/ConfigurationMenu.asm	(revision 181)
@@ -168,5 +168,5 @@
 	call	.GetIdeControllerCountToCX
 	dec		cx			; Primary always enabled
-	jcxz	.PrimaryControllerAlreadyEnabled
+	jz		.PrimaryControllerAlreadyEnabled
 	mov		bx, g_MenuitemConfigurationSecondaryIdeController
 ALIGN JUMP_ALIGN
@@ -191,13 +191,13 @@
 	call	Buffers_GetRomvarsFlagsToAX
 	test	ax, FLG_ROMVARS_FULLMODE
+	mov		al, 1	; Assume lite mode
 	jz		SHORT .AllowOnlyOneIdeControllerInLiteMode
 
 	mov		bx, ROMVARS.bIdeCnt
 	call	Buffers_GetRomvarsValueToAXfromOffsetInBX
-	eMOVZX	cx, al
-	ret
 ALIGN JUMP_ALIGN
 .AllowOnlyOneIdeControllerInLiteMode:
-	mov		cx, 1
+	cbw		; A maximum of 127 controllers should be sufficient
+	xchg	cx, ax
 	ret
 
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm	(revision 170)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm	(revision 181)
@@ -390,5 +390,5 @@
 	mov		al, 0FEh				; System reset (AT+ keyboard controller)
 	out		64h, al					; Reset computer (AT+)
-	mov		ax, 10
+	mov		al, 10
 	call	Delay_MicrosecondsFromAX
 .ResetXT:
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/makefile
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/makefile	(revision 170)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/makefile	(revision 181)
@@ -58,5 +58,5 @@
 # Assembler preprocessor defines.                               #
 #################################################################
-DEFINES =
+DEFINES = EXCLUDE_FROM_XTIDECFG
 DEFINES_XT = ELIMINATE_CGA_SNOW
 DEFINES_XTPLUS = USE_186 ELIMINATE_CGA_SNOW
