Index: trunk/Assembly_Library/Inc/Menu.inc
===================================================================
--- trunk/Assembly_Library/Inc/Menu.inc	(revision 60)
+++ trunk/Assembly_Library/Inc/Menu.inc	(revision 62)
@@ -129,4 +129,6 @@
 MENU_TEXT_ROW_OFFSET				EQU		1
 MENU_TEXT_COLUMN_OFFSET				EQU		2
+MENU_TIMEOUT_STRING_CHARACTERS		EQU		23
+MENU_TIMEOUT_SECONDS_FOR_HURRY		EQU		3
 
 SCROLL_TRACK_CHARACTER				EQU		BLOCK_EVEN_BACKGROUND_AND_FOREGROUND
Index: trunk/Assembly_Library/Src/Menu/MenuBorders.asm
===================================================================
--- trunk/Assembly_Library/Src/Menu/MenuBorders.asm	(revision 60)
+++ trunk/Assembly_Library/Src/Menu/MenuBorders.asm	(revision 62)
@@ -2,5 +2,5 @@
 ; Project name	:	Assembly Library
 ; Created date	:	14.7.2010
-; Last update	:	25.11.2010
+; Last update	:	30.11.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Functions for drawing menu borders.
@@ -34,5 +34,4 @@
 	call	RefreshInformationBorders
 	call	DrawBottomBorderLine
-	call	DrawTimeoutCounterOverBottomBorderLine
 	jmp		DrawBottomShadowLine
 
@@ -53,23 +52,5 @@
 	CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
 	call	GetNumberOfMiddleCharactersToDX
-	jmp		DrawBottomBorderLine
-
-
-;--------------------------------------------------------------------
-; MenuBorders_RedrawTimeoutValue
-;	Parameters
-;		SS:BP:	Ptr to MENU
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, BX, SI, DI
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-MenuBorders_RedrawTimeoutValue:
-	call	MenuBorders_AdjustDisplayContextForDrawingBorders
-	call	MenuLocation_GetBottomBordersTopLeftCoordinatesToAX
-	inc		ah		; Increment for shadow border
-	CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
-	jmp		DrawTimeoutCounterOverBottomBorderLine
+	jmp		SHORT DrawBottomBorderLine
 
 
@@ -235,16 +216,12 @@
 DrawBottomBorderLine:
 	mov		si, g_rgbBottomBorderCharacters
-	jmp		SHORT PrintBorderCharactersFromCSSIandShadowCharacter
-
-ALIGN JUMP_ALIGN
-DrawTimeoutCounterOverBottomBorderLine:
 	test	BYTE [bp+MENU.bFlags], FLG_MENU_TIMEOUT_COUNTDOWN
-	jz		SHORT .NoNeedToDrawSinceTimeoutDisabled
-	mov		ax, (-1)<<8	; Decrement row
-	call	MenuLocation_MoveCursorByALcolumnsAndAHrows
-	call	MenuTime_GetTimeoutSecondsLeftToAX
-	call	PrintTimeoutStringWithSecondsInAX
-	jmp		SHORT PrintNewlineToEndBorderLine
-.NoNeedToDrawSinceTimeoutDisabled:
+	jz		SHORT PrintBorderCharactersFromCSSIandShadowCharacter
+
+	call	DrawTimeoutCounterString
+	sub		dx, BYTE MENU_TIMEOUT_STRING_CHARACTERS
+	mov		si, g_BottomBorderWithTimeoutCharacters
+	call	PrintBorderCharactersFromCSSIandShadowCharacter
+	add		dx, BYTE MENU_TIMEOUT_STRING_CHARACTERS
 	ret
 
@@ -382,5 +359,19 @@
 
 ;--------------------------------------------------------------------
-; PrintTimeoutStringWithSecondsInAX
+; DrawTimeoutCounterString
+;	Parameters
+;		SS:BP:	Ptr to MENU
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, SI, DI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+DrawTimeoutCounterString:
+	call	MenuTime_GetTimeoutSecondsLeftToAX
+	; Fall to .PrintTimeoutStringWithSecondsInAX
+
+;--------------------------------------------------------------------
+; .PrintTimeoutStringWithSecondsInAX
 ;	Parameters
 ;		AX:		Seconds to print
@@ -391,6 +382,6 @@
 ;		AX, SI, DI
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-PrintTimeoutStringWithSecondsInAX:
+;ALIGN JUMP_ALIGN
+.PrintTimeoutStringWithSecondsInAX:
 	push	bp
 
@@ -403,8 +394,5 @@
 	CALL_DISPLAY_LIBRARY FormatNullTerminatedStringFromCSSI
 	pop		bp
-
-	; Draw right border with normal border color
-	mov		al, DOUBLE_RIGHT_HORIZONTAL_TO_SINGLE_VERTICAL
-	jmp		MenuBorders_PrintSingleBorderCharacterFromAL
+	ret
 .szSelectionTimeout:
 	db		DOUBLE_BOTTOM_LEFT_CORNER
@@ -424,5 +412,5 @@
 .GetTimeoutAttributeToAXfromSecondsInDI:
 	mov		si, ATTRIBUTE_CHARS.cNormalTimeout
-	cmp		di, BYTE 3
+	cmp		di, BYTE MENU_TIMEOUT_SECONDS_FOR_HURRY
 	eCMOVB	si, ATTRIBUTE_CHARS.cHurryTimeout
 	jmp		MenuAttribute_GetToAXfromTypeInSI
@@ -451,4 +439,11 @@
 iend
 
+g_BottomBorderWithTimeoutCharacters:
+istruc BORDER_CHARS
+	at	BORDER_CHARS.cLeft,		db	DOUBLE_RIGHT_HORIZONTAL_TO_SINGLE_VERTICAL
+	at	BORDER_CHARS.cMiddle,	db	DOUBLE_HORIZONTAL
+	at	BORDER_CHARS.cRight,	db	DOUBLE_BOTTOM_RIGHT_CORNER
+iend
+
 g_rgbTextBorderCharacters:
 istruc BORDER_CHARS
Index: trunk/Assembly_Library/Src/Menu/MenuTime.asm
===================================================================
--- trunk/Assembly_Library/Src/Menu/MenuTime.asm	(revision 60)
+++ trunk/Assembly_Library/Src/Menu/MenuTime.asm	(revision 62)
@@ -2,5 +2,5 @@
 ; Project name	:	Assembly Library
 ; Created date	:	25.7.2010
-; Last update	:	25.11.2010
+; Last update	:	30.11.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Menu timeouts other time related functions.
@@ -75,5 +75,5 @@
 ALIGN JUMP_ALIGN
 .RedrawSinceNoTimeout:
-	call	MenuBorders_RedrawTimeoutValue
+	call	MenuBorders_RedrawBottomBorderLine
 	clc
 ALIGN JUMP_ALIGN
@@ -100,13 +100,11 @@
 	call	PointDSBXtoTimeoutCounter
 	call	TimerTicks_GetTimeoutTicksLeftToAXfromDSBX
-	jc		SHORT .TimeoutHasOccurred
+	jc		SHORT .TimeoutHasOccurredSoMakeSureTicksAreNotBelowZero
 
 	xchg	dx, ax
 	call	TimerTicks_GetSecondsToAXfromTicksInDX
-	clc
 	jmp		SHORT .PopRegistersAndReturn
-.TimeoutHasOccurred:
+.TimeoutHasOccurredSoMakeSureTicksAreNotBelowZero:
 	xor		ax, ax
-	stc
 .PopRegistersAndReturn:
 	pop		bx
