Index: /trunk/Configurator/Src/Libraries/menu/menu.asm
===================================================================
--- /trunk/Configurator/Src/Libraries/menu/menu.asm	(revision 82)
+++ /trunk/Configurator/Src/Libraries/menu/menu.asm	(revision 83)
@@ -2,6 +2,7 @@
 ; Project name	:	Menu library
 ; Created date	:	9.11.2009
-; Last update	:	21.1.2010
-; Author		:	Tomi Tilli
+; Last update	:	6.1.2011
+; Author		:	Tomi Tilli,
+;				:	Krister Nordvall (optimizations)
 ; Description	:	ASM library to menu system.
 ;
@@ -418,5 +419,6 @@
 	mov		[bp+MENUVARS.wItemSel], ax
 	mov		[bp+MENUVARS.wItemTop], ax
-	mov		cx, -1					; Invalidate all items
+	xchg	cx, ax					; CX = 0
+	dec		cx						; CX = -1 (Invalidate all items)
 	or		dl, MFL_UPD_ITEM
 %endif
@@ -544,12 +546,10 @@
 	add		dl, [bp+MENUVARS.bVisCnt]		; Inc to one past...
 	adc		dh, 0							; ...last visible menuitem
-	cmp		ax, dx							; Over last visible?
-	jae		.RetFalse						;  If so, return false
+	cmp		ax, dx							; Over last visible or not?
+	cmc										; Either way, fall through
+ALIGN JUMP_ALIGN							; CF will reflect TRUE/FALSE
+.RetFalse:
+	cmc
 	pop		dx
-	ret										; Return with CF set
-ALIGN JUMP_ALIGN
-.RetFalse:
-	pop		dx
-	clc
 	ret
 
@@ -631,4 +631,28 @@
 Menu_ShowYNDlg:
 	mov		dx, MenuDlg_YNEvent	; Offset to event handler
+	jmp		ContinueMenuShowDlg
+
+
+;--------------------------------------------------------------------
+; Shows dialog that asks any string from user.
+;
+; Menu_ShowStrDlg
+;	Parameters:
+;		BL:		Dialog width with borders included
+;		CX:		Buffer length with STOP included
+;		SS:BP:	Ptr to MENUVARS
+;		ES:DI:	Ptr to STOP terminated string to display
+;		DS:SI:	Prt to buffer to receive string
+;	Returns:
+;		AX:		String length in characters without STOP
+;		CF:		Set if string inputted successfully
+;				Cleared if user cancellation
+;	Corrupts registers:
+;		BX, CX, DX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Menu_ShowStrDlg:
+	mov		dx, MenuDlg_StrEvent	; Offset to event handler
+ContinueMenuShowDlg:
 	call	MenuDlg_Show
 	push	ax
@@ -641,33 +665,4 @@
 
 ;--------------------------------------------------------------------
-; Shows dialog that asks any string from user.
-;
-; Menu_ShowStrDlg
-;	Parameters:
-;		BL:		Dialog width with borders included
-;		CX:		Buffer length with STOP included
-;		SS:BP:	Ptr to MENUVARS
-;		ES:DI:	Ptr to STOP terminated string to display
-;		DS:SI:	Prt to buffer to receive string
-;	Returns:
-;		AX:		String length in characters without STOP
-;		CF:		Set if string inputted successfully
-;				Cleared if user cancellation
-;	Corrupts registers:
-;		BX, CX, DX
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-Menu_ShowStrDlg:
-	mov		dx, MenuDlg_StrEvent	; Offset to event handler
-	call	MenuDlg_Show
-	push	ax
-	pushf
-	call	Menu_RefreshMenu
-	popf
-	pop		ax
-	ret
-
-
-;--------------------------------------------------------------------
 ; Shows progress bar dialog.
 ;
Index: /trunk/Configurator/Src/Libraries/menu/menufile.asm
===================================================================
--- /trunk/Configurator/Src/Libraries/menu/menufile.asm	(revision 82)
+++ /trunk/Configurator/Src/Libraries/menu/menufile.asm	(revision 83)
@@ -2,6 +2,7 @@
 ; Project name	:	Menu library
 ; Created date	:	20.11.2009
-; Last update	:	8.1.2010
-; Author		:	Tomi Tilli
+; Last update	:	6.1.2011
+; Author		:	Tomi Tilli,
+;				:	Krister Nordvall (Optimizations)
 ; Description	:	ASM library to menu system.
 ;					Contains functions for displaying file dialog.
@@ -72,5 +73,5 @@
 	mov		[bp+FDLGVARS.wDrvCnt], cx
 	mov		WORD [bp+MENUVARS.fnEvent], MenuFile_Event
-	mov		BYTE [bp+FDLGVARS.fSuccess], 0	; For user cancel
+	mov		[bp+FDLGVARS.fSuccess], cl		; For user cancel
 	call	MenuMsg_GetLineCnt				; Get Info line count to CX
 	xchg	cl, ch							; CH=Info lines, CL=Title lines
Index: /trunk/XTIDE_Universal_BIOS/Src/Boot/BootInfo.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Boot/BootInfo.asm	(revision 82)
+++ /trunk/XTIDE_Universal_BIOS/Src/Boot/BootInfo.asm	(revision 83)
@@ -2,6 +2,7 @@
 ; Project name	:	IDE BIOS
 ; Created date	:	16.3.2010
-; Last update	:	9.4.2010
-; Author		:	Tomi Tilli
+; Last update	:	6.1.2011
+; Author		:	Tomi Tilli,
+;				:	Krister Nordvall (optimizations)
 ; Description	:	Functions for generating and accessing drive
 ;					information to be displayed on boot menu.
@@ -50,6 +51,6 @@
 	sub		bl, [RAMVARS.bFirstDrv]		; Drive number to index
 	mul		bl							; AX = Offset inside BOOTNFO array
-	mov		bx, ax						; Copy offset to BX
-	add		bx, BOOTVARS.rgBootNfo		; Add offset to BOOTNFO array
+	add		ax, BOOTVARS.rgBootNfo		; Add offset to BOOTNFO array
+	xchg	bx, ax						; Copy result to BX
 	ret
 
Index: /trunk/XTIDE_Universal_BIOS/Src/Libraries/menu/menu.asm
===================================================================
--- /trunk/XTIDE_Universal_BIOS/Src/Libraries/menu/menu.asm	(revision 82)
+++ /trunk/XTIDE_Universal_BIOS/Src/Libraries/menu/menu.asm	(revision 83)
@@ -2,6 +2,7 @@
 ; Project name	:	Menu library
 ; Created date	:	9.11.2009
-; Last update	:	21.1.2010
-; Author		:	Tomi Tilli
+; Last update	:	6.1.2011
+; Author		:	Tomi Tilli,
+;				:	Krister Nordvall (optimizations)
 ; Description	:	ASM library to menu system.
 ;
@@ -418,5 +419,6 @@
 	mov		[bp+MENUVARS.wItemSel], ax
 	mov		[bp+MENUVARS.wItemTop], ax
-	mov		cx, -1					; Invalidate all items
+	xchg	cx, ax					; CX = 0
+	dec		cx						; CX = -1 (Invalidate all items)
 	or		dl, MFL_UPD_ITEM
 %endif
@@ -544,12 +546,10 @@
 	add		dl, [bp+MENUVARS.bVisCnt]		; Inc to one past...
 	adc		dh, 0							; ...last visible menuitem
-	cmp		ax, dx							; Over last visible?
-	jae		.RetFalse						;  If so, return false
+	cmp		ax, dx							; Over last visible or not?
+	cmc										; Either way, fall through
+ALIGN JUMP_ALIGN							; CF will reflect TRUE/FALSE
+.RetFalse:
+	cmc
 	pop		dx
-	ret										; Return with CF set
-ALIGN JUMP_ALIGN
-.RetFalse:
-	pop		dx
-	clc
 	ret
 
@@ -631,4 +631,28 @@
 Menu_ShowYNDlg:
 	mov		dx, MenuDlg_YNEvent	; Offset to event handler
+	jmp		ContinueMenuShowDlg
+
+
+;--------------------------------------------------------------------
+; Shows dialog that asks any string from user.
+;
+; Menu_ShowStrDlg
+;	Parameters:
+;		BL:		Dialog width with borders included
+;		CX:		Buffer length with STOP included
+;		SS:BP:	Ptr to MENUVARS
+;		ES:DI:	Ptr to STOP terminated string to display
+;		DS:SI:	Prt to buffer to receive string
+;	Returns:
+;		AX:		String length in characters without STOP
+;		CF:		Set if string inputted successfully
+;				Cleared if user cancellation
+;	Corrupts registers:
+;		BX, CX, DX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Menu_ShowStrDlg:
+	mov		dx, MenuDlg_StrEvent	; Offset to event handler
+ContinueMenuShowDlg:
 	call	MenuDlg_Show
 	push	ax
@@ -641,33 +665,4 @@
 
 ;--------------------------------------------------------------------
-; Shows dialog that asks any string from user.
-;
-; Menu_ShowStrDlg
-;	Parameters:
-;		BL:		Dialog width with borders included
-;		CX:		Buffer length with STOP included
-;		SS:BP:	Ptr to MENUVARS
-;		ES:DI:	Ptr to STOP terminated string to display
-;		DS:SI:	Prt to buffer to receive string
-;	Returns:
-;		AX:		String length in characters without STOP
-;		CF:		Set if string inputted successfully
-;				Cleared if user cancellation
-;	Corrupts registers:
-;		BX, CX, DX
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-Menu_ShowStrDlg:
-	mov		dx, MenuDlg_StrEvent	; Offset to event handler
-	call	MenuDlg_Show
-	push	ax
-	pushf
-	call	Menu_RefreshMenu
-	popf
-	pop		ax
-	ret
-
-
-;--------------------------------------------------------------------
 ; Shows progress bar dialog.
 ;
