Index: /trunk/Assembly_Library/Src/Display/DisplayCharOut.asm
===================================================================
--- /trunk/Assembly_Library/Src/Display/DisplayCharOut.asm	(revision 46)
+++ /trunk/Assembly_Library/Src/Display/DisplayCharOut.asm	(revision 47)
@@ -2,5 +2,5 @@
 ; Project name	:	Assembly Library
 ; Created date	:	26.6.2010
-; Last update	:	22.9.2010
+; Last update	:	4.10.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Functions for outputting characters to video memory.
@@ -169,10 +169,9 @@
 ;		DX:		CGA Status Register Address (3DAh)
 ;	Returns:
-;		Interrupts disabled
+;		Nothing
 ;	Corrupts registers:
 ;		AL
 ;--------------------------------------------------------------------
 %macro WAIT_UNTIL_SAFE_CGA_WRITE 0
-	cli				; Interrupt request would mess up timing
 %%WaitUntilNotInRetrace:
 	in		al, dx
@@ -201,38 +200,35 @@
 ALIGN JUMP_ALIGN
 StosbWithoutCgaSnow:
-	call	LoadAndVerifyStatusRegisterFromBDA
+	call	DisplayCharOut_LoadAndVerifyStatusRegisterFromBDA
 	jne		SHORT .StosbWithoutWaitSinceUnknownPort
 
 	mov		ah, al
+	cli				; Interrupt request would mess up timing
 	WAIT_UNTIL_SAFE_CGA_WRITE
 	mov		al, ah
+.StosbWithoutWaitSinceUnknownPort:
 	stosb
 	sti
 	ret
-ALIGN JUMP_ALIGN
-.StosbWithoutWaitSinceUnknownPort:
-	stosb
-	ret
 
 ALIGN JUMP_ALIGN
 StoswWithoutCgaSnow:
-	call	LoadAndVerifyStatusRegisterFromBDA
+	push	bx
+	call	DisplayCharOut_LoadAndVerifyStatusRegisterFromBDA
 	jne		SHORT .StoswWithoutWaitSinceUnknownPort
 
-	push	bx
 	xchg	bx, ax
+	cli				; Interrupt request would mess up timing
 	WAIT_UNTIL_SAFE_CGA_WRITE
 	xchg	ax, bx
+.StoswWithoutWaitSinceUnknownPort:
 	stosw
 	pop		bx
 	sti
 	ret
-ALIGN JUMP_ALIGN
-.StoswWithoutWaitSinceUnknownPort:
-	stosw
-	ret
-
-;--------------------------------------------------------------------
-; LoadAndVerifyStatusRegisterFromBDA
+
+
+;--------------------------------------------------------------------
+; DisplayCharOut_LoadAndVerifyStatusRegisterFromBDA
 ;	Parameters:
 ;		DS:		BDA segment (zero)
@@ -244,5 +240,5 @@
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
-LoadAndVerifyStatusRegisterFromBDA:
+DisplayCharOut_LoadAndVerifyStatusRegisterFromBDA:
 	mov		dx, [BDA.wVidPort]
 	add		dl, OFFSET_TO_CGA_STATUS_REGISTER
Index: /trunk/Assembly_Library/Src/Display/DisplayFormat.asm
===================================================================
--- /trunk/Assembly_Library/Src/Display/DisplayFormat.asm	(revision 46)
+++ /trunk/Assembly_Library/Src/Display/DisplayFormat.asm	(revision 47)
@@ -2,5 +2,5 @@
 ; Project name	:	Assembly Library
 ; Created date	:	29.6.2010
-; Last update	:	26.9.2010
+; Last update	:	4.10.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Functions for displaying formatted strings.
@@ -212,29 +212,91 @@
 	jle		SHORT .NothingToAppendOrPrepend
 
-	mov		bx, di
-	add		bx, ax				; BX = DI after prepending
-
+	std
 	push	si
-	dec		di					; DI = Offset to last byte formatted
-	mov		si, di
-	add		di, ax				; DI = Offset to new location for last byte
-	std
+
+	lea		si, [di-1]			; SI = Offset to last byte formatted
+	add		di, ax				; DI = Cursor location after preceeding completed
+	push	di
+	dec		di					; DI = Offset where to move last byte formatted
+	xchg	bx, ax				; BX = BYTEs to prepend
+	call	.ReverseMoveCXbytesFromESSItoESDI
+	xchg	ax, bx
+	call	.ReversePrintAXspacesStartingFromESDI
+
+	pop		di
+	pop		si
+	cld							; Restore DF
+.NothingToAppendOrPrepend:
+	ret
+
+;--------------------------------------------------------------------
+; .ReverseMoveCXbytesFromESSItoESDI
+;	Parameters:
+;		CX:		Number of bytes to move
+;		DS:		BDA segment (zero)
+;		ES:SI:	Ptr to source in video RAM
+;		ES:DI:	Ptr to destination in video RAM
+;	Returns:
+;		DI:		Offset to character preceeding string just moved
+;	Corrupts registers:
+;		AX, CX, DX, SI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.ReverseMoveCXbytesFromESSItoESDI:
+%ifdef ELIMINATE_CGA_SNOW
+	call	DisplayCharOut_LoadAndVerifyStatusRegisterFromBDA
+	je		SHORT .WaitUntilReadyToMoveNextByte
+%endif
+
 	eSEG_STR rep, es, movsb
 
-	mov		dl, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bFlags]
-	and		dx, BYTE FLG_CONTEXT_ATTRIBUTES
-	not		dx
-	and		di, dx				; WORD alignment when using attributes
-
+%ifdef ELIMINATE_CGA_SNOW
+	jmp		SHORT .AlignDIforFirstPreceedingSpace
+.WaitUntilReadyToMoveNextByte:
+	cli				; Interrupt request would mess up timing
+	WAIT_UNTIL_SAFE_CGA_WRITE
+.MovsbWithoutWaitSinceUnknownPort:
+	eSEG	es
+	movsb
+	sti
+	loop	.WaitUntilReadyToMoveNextByte
+%endif
+	; Fall to .AlignDIforFirstPreceedingSpace
+
+;--------------------------------------------------------------------
+; .AlignDIforFirstPreceedingSpace
+;	Parameters:
+;		DS:		BDA segment (zero)
+;		ES:DI:	Byte offset before last byte moved
+;	Returns:
+;		DI:		Offset to space preceeding moved string
+;	Corrupts registers:
+;		AX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+.AlignDIforFirstPreceedingSpace:
+	mov		al, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bFlags]
+	and		ax, BYTE FLG_CONTEXT_ATTRIBUTES
+	not		ax
+	and		di, ax
+	ret
+
+;--------------------------------------------------------------------
+; .ReversePrintAXspacesStartingFromESDI
+;	Parameters:
+;		AX:		Number of spaces to print
+;		DS:		BDA segment (zero)
+;		ES:DI:	Ptr to destination in video RAM
+;	Returns:
+;		DI:		Updated
+;	Corrupts registers:
+;		AX, CX, DX
+ALIGN JUMP_ALIGN
+.ReversePrintAXspacesStartingFromESDI:
 	call	DisplayContext_GetCharacterOffsetToAXfromByteOffsetInAX
 	xchg	cx, ax				; CX = Spaces to prepend
 	mov		al, ' '
-	call	DisplayPrint_RepeatCharacterFromALwithCountInCX
-	cld							; Restore DF
-
-	mov		di, bx
-	pop		si
-.NothingToAppendOrPrepend:
-	ret
+	jmp		DisplayPrint_RepeatCharacterFromALwithCountInCX
+
 
 
Index: /trunk/Assembly_Library/Src/Menu/MenuAttributes.asm
===================================================================
--- /trunk/Assembly_Library/Src/Menu/MenuAttributes.asm	(revision 46)
+++ /trunk/Assembly_Library/Src/Menu/MenuAttributes.asm	(revision 47)
@@ -97,5 +97,5 @@
 	at	ATTRIBUTE_CHARS.cTitle,					db	COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLACK)
 	at	ATTRIBUTE_CHARS.cItem,					db	COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLACK)
-	at	ATTRIBUTE_CHARS.cHighlightedItem,		db	COLOR_ATTRIBUTE(COLOR_BLACK, COLOR_WHITE)
+	at	ATTRIBUTE_CHARS.cHighlightedItem,		db	COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_WHITE)
 	at	ATTRIBUTE_CHARS.cHurryTimeout,			db	COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLACK) | FLG_COLOR_BLINK
 	at	ATTRIBUTE_CHARS.cNormalTimeout,			db	COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLACK)
Index: /trunk/Assembly_Library/Src/Menu/MenuTime.asm
===================================================================
--- /trunk/Assembly_Library/Src/Menu/MenuTime.asm	(revision 46)
+++ /trunk/Assembly_Library/Src/Menu/MenuTime.asm	(revision 47)
@@ -2,5 +2,5 @@
 ; Project name	:	Assembly Library
 ; Created date	:	25.7.2010
-; Last update	:	28.9.2010
+; Last update	:	4.10.2010
 ; Author		:	Tomi Tilli
 ; Description	:	Menu timeouts other time related functions.
@@ -176,5 +176,5 @@
 	db		DOUBLE_BOTTOM_LEFT_CORNER
 	db		DOUBLE_LEFT_HORIZONTAL_TO_SINGLE_VERTICAL
-	db		"%AAutoselection in %2-us",NULL
+	db		"%AAutoselection in %2u s",NULL
 
 ;--------------------------------------------------------------------
Index: /trunk/Assembly_Library/makefile
===================================================================
--- /trunk/Assembly_Library/makefile	(revision 46)
+++ /trunk/Assembly_Library/makefile	(revision 47)
@@ -50,7 +50,7 @@
 # Assembler preprocessor defines.                               #
 #################################################################
-DEFINES = ELIMINATE_CGA_SNOW
-DEFINES_XT = 
-DEFINES_XTPLUS = USE_186
+DEFINES = 
+DEFINES_XT = ELIMINATE_CGA_SNOW
+DEFINES_XTPLUS = USE_186 ELIMINATE_CGA_SNOW
 DEFINES_AT = USE_186 USE_286 USE_AT
 
