Index: trunk/Configurator/Src/Libraries/menu/menudraw.asm
===================================================================
--- trunk/Configurator/Src/Libraries/menu/menudraw.asm	(revision 7)
+++ trunk/Configurator/Src/Libraries/menu/menudraw.asm	(revision 9)
@@ -2,5 +2,5 @@
 ; Project name	:	Menu library
 ; Created date	:	9.11.2009
-; Last update	:	21.1.2010
+; Last update	:	25.5.2010
 ; Author		:	Tomi Tilli
 ; Description	:	ASM library to menu system.
@@ -288,11 +288,13 @@
 	xor		dx, dx							; Zero DX
 	call	MenuCrsr_PointNfoBrdr			; Set cursor
-	cmp		BYTE [bp+MENUVARS.bInfoH], 0	; Any info strings?
-	jz		MenuDraw_BottomBorder			;  If not, draw bottom border
-	test	BYTE [bp+MENUVARS.bFlags], FLG_MNU_HIDENFO
-	jnz		MenuDraw_BottomBorder			; Draw bottom border if info is hidden
+	eMOVZX	cx, BYTE [bp+MENUVARS.bInfoH]	; Load number of info strings
+	test	BYTE [bp+MENUVARS.bFlags], FLG_MNU_HIDENFO	; Information hidden?
+	jnz		SHORT .JumpToBottomBorder
+	test	cx, cx							; Any info strings?
+	jz		SHORT MenuDraw_BottomBorder
+	push	cx
 	call	MenuDraw_MiddleBorder			; Draw middle border
 	call	MenuDraw_NewlineBrdr			; Change line
-	eMOVZX	cx, BYTE [bp+MENUVARS.bInfoH]	; Load number of info strings
+	pop		cx
 ALIGN JUMP_ALIGN
 .LineLoop:
@@ -302,6 +304,8 @@
 	pop		cx
 	loop	.LineLoop
-	jmp		MenuDraw_BottomBorder
-	
+ALIGN JUMP_ALIGN
+.JumpToBottomBorder:
+	jmp		SHORT MenuDraw_BottomBorder
+
 ALIGN JUMP_ALIGN
 MenuDraw_Timeout:
@@ -309,15 +313,14 @@
 	call	MenuCrsr_PointNfoBrdr			; Set cursor
 	mov		ch, [bp+MENUVARS.bInfoH]		; Load info str count to CH
-	test	ch, ch							; Any info strings?
-	jz		MenuDraw_BottomBorder			;  If not, draw bottom border
+	and		cx, 0FF00h						; Any info strings? (clears CL)
+	jz		SHORT MenuDraw_BottomBorder		;  If not, draw bottom border
 	inc		ch								; Increment for info top border
-	xor		cl, cl							; Zero X coordinate
 	call	MenuCrsr_Move					; Move cursor
-	jmp		MenuDraw_BottomBorder
+	jmp		SHORT MenuDraw_BottomBorder
 
 ALIGN JUMP_ALIGN
 MenuDraw_ItemBorders:
-	cmp		WORD [bp+MENUVARS.wItemCnt], 0	; Any items?
-	jz		.Return							;  If not, return
+	cmp		WORD [bp+MENUVARS.wItemCnt], BYTE 0	; Any items?
+	jz		SHORT .Return					;  If not, return
 	xor		dx, dx							; Zero DX
 	call	MenuCrsr_PointItemBrdr			; Set cursor
@@ -354,5 +357,5 @@
 	mov		bl, B_H
 	mov		dh, B_TR
-	jmp		MenuDraw_BorderChars
+	jmp		SHORT MenuDraw_BorderChars
 	
 ALIGN JUMP_ALIGN
@@ -361,5 +364,5 @@
 	mov		bl, ' '
 	mov		dh, B_V
-	jmp		MenuDraw_BorderChars
+	jmp		SHORT MenuDraw_BorderChars
 
 ALIGN JUMP_ALIGN
@@ -368,5 +371,5 @@
 	mov		bh, B_V
 	mov		bl, ' '
-	jmp		MenuDraw_BorderChars
+	jmp		SHORT MenuDraw_BorderChars
 
 ALIGN JUMP_ALIGN
Index: trunk/Configurator/Src/Libraries/menu/menuloop.asm
===================================================================
--- trunk/Configurator/Src/Libraries/menu/menuloop.asm	(revision 7)
+++ trunk/Configurator/Src/Libraries/menu/menuloop.asm	(revision 9)
@@ -2,5 +2,5 @@
 ; Project name	:	Menu library
 ; Created date	:	11.11.2009
-; Last update	:	10.12.2009
+; Last update	:	25.5.2010
 ; Author		:	Tomi Tilli
 ; Description	:	ASM library to menu system.
@@ -92,5 +92,5 @@
 ; MenuLoop_SendEvent		Sends any event to user event handler
 ;	Parameters:
-;		BX:		Event code
+;		BX:		Event code (MenuLoop_SendEvent only)
 ;		DX:		Event parameter (event specific)
 ;		SS:BP:	Ptr to MENUVARS
@@ -193,5 +193,8 @@
 	mov		[bp+MENUVARS.wItemSel], ax		; Store new index
 	cmp		ax, [bp+MENUVARS.wItemTop]		; Need to scroll?
-	jae		.DrawSelection					;  If not, go to draw selection
+	jb		SHORT .ScrollUp
+	jmp		.DrawSelection					;  If not, go to draw selection
+ALIGN JUMP_ALIGN
+.ScrollUp:
 	dec		WORD [bp+MENUVARS.wItemTop]		; Scroll
 	jmp		.ScrollMenu
@@ -222,5 +225,8 @@
 	add		bx, [bp+MENUVARS.wItemTop]		; BX to one past last visible index
 	cmp		ax, bx							; Need to scroll?
-	jb		.DrawSelection					;  If not, go to draw selection
+	jae		.ScrollDown
+	jmp		.DrawSelection
+ALIGN JUMP_ALIGN
+.ScrollDown:
 	inc		WORD [bp+MENUVARS.wItemTop]		; Scroll
 	jmp		.ScrollMenu
@@ -236,4 +242,26 @@
 	jmp		.ScrollMenu
 %endif
+
+	; HOME pressed
+ALIGN JUMP_ALIGN
+.KeyHome:
+	xor		ax, ax
+	mov		[bp+MENUVARS.wItemSel], ax
+	mov		[bp+MENUVARS.wItemTop], ax
+	jmp		.ScrollMenu
+
+	; END pressed
+ALIGN JUMP_ALIGN
+.KeyEnd:
+	mov		ax, [bp+MENUVARS.wItemCnt]		; Load number if menuitems
+	mov		bx, ax							; Copy menuitem count to BX
+	dec		ax								; Decrement for last index
+	mov		[bp+MENUVARS.wItemSel], ax		; Store new selection
+	sub		bl, [bp+MENUVARS.bVisCnt]		; BX to first menuitem to draw
+	sbb		bh, 0
+	mov		[bp+MENUVARS.wItemTop], bx		; Store first menuitem to draw
+	jnc		.ScrollMenu	
+	mov		WORD [bp+MENUVARS.wItemTop], 0	; Overflow, start with 0
+	jmp		.ScrollMenu
 
 	; PGUP pressed
@@ -262,26 +290,4 @@
 	mov		[bp+MENUVARS.wItemSel], ax
 	mov		[bp+MENUVARS.wItemTop], ax
-	jmp		.ScrollMenu
-
-	; HOME pressed
-ALIGN JUMP_ALIGN
-.KeyHome:
-	xor		ax, ax
-	mov		[bp+MENUVARS.wItemSel], ax
-	mov		[bp+MENUVARS.wItemTop], ax
-	jmp		.ScrollMenu
-
-	; END pressed
-ALIGN JUMP_ALIGN
-.KeyEnd:
-	mov		ax, [bp+MENUVARS.wItemCnt]		; Load number if menuitems
-	mov		bx, ax							; Copy menuitem count to BX
-	dec		ax								; Decrement for last index
-	mov		[bp+MENUVARS.wItemSel], ax		; Store new selection
-	sub		bl, [bp+MENUVARS.bVisCnt]		; BX to first menuitem to draw
-	sbb		bh, 0
-	mov		[bp+MENUVARS.wItemTop], bx		; Store first menuitem to draw
-	jnc		.ScrollMenu	
-	mov		WORD [bp+MENUVARS.wItemTop], 0	; Overflow, start with 0
 	; Fall to .ScrollMenu
 
Index: trunk/Configurator/makefile
===================================================================
--- trunk/Configurator/makefile	(revision 7)
+++ trunk/Configurator/makefile	(revision 9)
@@ -71,5 +71,6 @@
 
 # Assembler
-AS = nasm.exe
+#AS = nasm.exe
+AS = yasm.exe
 
 # use this command to erase files.
