Index: trunk/Assembly_Library/Src/Display/CgaSnow.asm
===================================================================
--- trunk/Assembly_Library/Src/Display/CgaSnow.asm	(revision 67)
+++ trunk/Assembly_Library/Src/Display/CgaSnow.asm	(revision 101)
@@ -1,7 +1,3 @@
-; File name		:	CgaSnow.asm
 ; Project name	:	Assembly Library
-; Created date	:	8.10.2010
-; Last update	:	12.10.2010
-; Author		:	Tomi Tilli
 ; Description	:	Functions for preventing CGA snow.
 
Index: trunk/Assembly_Library/Src/Display/Display.asm
===================================================================
--- trunk/Assembly_Library/Src/Display/Display.asm	(revision 67)
+++ trunk/Assembly_Library/Src/Display/Display.asm	(revision 101)
@@ -1,7 +1,3 @@
-; File name		:	Display.asm
 ; Project name	:	Assembly Library
-; Created date	:	2.7.2010
-; Last update	:	7.12.2010
-; Author		:	Tomi Tilli
 ; Description	:	Display Library functions for CALL_DISPLAY_LIBRARY macro
 ;					that users should use to make library call.
@@ -49,5 +45,5 @@
 ALIGN JUMP_ALIGN
 .FormatNullTerminatedStringFromCSSI:
-	pop		ax					; Discard return address to inside DisplayFunctionFromDI
+	pop		ax					; Discard return address to inside Display_FunctionFromDI
 	call	DisplayPrint_FormattedNullTerminatedStringFromCSSI
 	mov		[VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], di
Index: trunk/Assembly_Library/Src/Display/DisplayCharOut.asm
===================================================================
--- trunk/Assembly_Library/Src/Display/DisplayCharOut.asm	(revision 67)
+++ trunk/Assembly_Library/Src/Display/DisplayCharOut.asm	(revision 101)
@@ -1,7 +1,3 @@
-; File name		:	DisplayCharOut.asm
 ; Project name	:	Assembly Library
-; Created date	:	26.6.2010
-; Last update	:	24.10.2010
-; Author		:	Tomi Tilli
 ; Description	:	Functions for outputting characters to video memory.
 ;					These functions are meant to be called by Display_CharacterFromAL
@@ -54,20 +50,6 @@
 	call	DisplayCursor_SynchronizeCoordinatesToHardware
 	pop		ax
-	call	.OutputCharacterWithBIOS
-	call	DisplayCursor_GetHardwareCoordinatesToAX
-	jmp		DisplayCursor_SetCoordinatesFromAX
 
-;--------------------------------------------------------------------
-; .OutputCharacterWithBIOS
-;	Parameters:
-;		AL:		Character to output
-;		DS:		BDA segment
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-.OutputCharacterWithBIOS:
+	; Output character with BIOS
 	push	bx
 	mov		ah, TELETYPE_OUTPUT
@@ -75,5 +57,7 @@
 	int		BIOS_VIDEO_INTERRUPT_10h
 	pop		bx
-	ret
+
+	call	DisplayCursor_GetHardwareCoordinatesToAX
+	jmp		DisplayCursor_SetCoordinatesFromAX
 
 
Index: trunk/Assembly_Library/Src/Display/DisplayContext.asm
===================================================================
--- trunk/Assembly_Library/Src/Display/DisplayContext.asm	(revision 67)
+++ trunk/Assembly_Library/Src/Display/DisplayContext.asm	(revision 101)
@@ -1,7 +1,3 @@
-; File name		:	DisplayContext.asm
 ; Project name	:	Assembly Library
-; Created date	:	25.6.2010
-; Last update	:	11.10.2010
-; Author		:	Tomi Tilli
 ; Description	:	Functions for managing display context.
 
@@ -20,11 +16,8 @@
 ALIGN JUMP_ALIGN
 DisplayContext_Initialize:
-	call	.DetectAndSetDisplaySegment	; and .InitializeFlags
 	mov		WORD [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fnCharOut], DEFAULT_CHARACTER_OUTPUT
 	mov		WORD [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.wCursorShape], CURSOR_NORMAL
 	mov		BYTE [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bAttribute], SCREEN_BACKGROUND_ATTRIBUTE
-	xor		ax, ax
-	call	DisplayCursor_SetCoordinatesFromAX
-	jmp		DisplayContext_SynchronizeToHardware
+	; Fall to .DetectAndSetDisplaySegment
 
 ;--------------------------------------------------------------------
@@ -40,9 +33,7 @@
 	mov		ax, COLOR_TEXT_SEGMENT
 	cmp		BYTE [VIDEO_BDA.bMode], MDA_TEXT_MODE
-	jne		SHORT .StoreSegmentToDisplayContext
-	mov		ax, MONO_TEXT_SEGMENT
-.StoreSegmentToDisplayContext:
+	eCMOVE	ah, MONO_TEXT_SEGMENT >> 8
 	mov		[VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition+2], ax
-	; Fall to InitializeFlags
+	; Fall to .InitializeFlags
 
 ;--------------------------------------------------------------------
@@ -62,5 +53,34 @@
 .DoNotSetCgaFlag:
 	mov		[VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bFlags], dl
-	ret
+	; Fall to .InitializeCursor
+
+;--------------------------------------------------------------------
+; .InitializeCursor
+;	Parameters:
+;		DS:		BDA segment (zero)
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DX
+;--------------------------------------------------------------------
+.InitializeCursor:
+	xor		ax, ax
+	call	DisplayCursor_SetCoordinatesFromAX
+	; Fall to DisplayContext_SynchronizeToHardware
+
+;--------------------------------------------------------------------
+; DisplayContext_SynchronizeToHardware
+;	Parameters:
+;		DS:		BDA segment (zero)
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, DX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+DisplayContext_SynchronizeToHardware:
+	call	DisplayPage_SynchronizeToHardware
+	call	DisplayCursor_SynchronizeShapeToHardware
+	jmp		DisplayCursor_SynchronizeCoordinatesToHardware
 
 
@@ -145,20 +165,4 @@
 	pop		ds
 	ret
-
-
-;--------------------------------------------------------------------
-; DisplayContext_SynchronizeToHardware
-;	Parameters:
-;		DS:		BDA segment (zero)
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, DX
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-DisplayContext_SynchronizeToHardware:
-	call	DisplayPage_SynchronizeToHardware
-	call	DisplayCursor_SynchronizeShapeToHardware
-	jmp		DisplayCursor_SynchronizeCoordinatesToHardware
 
 
Index: trunk/Assembly_Library/Src/Display/DisplayCursor.asm
===================================================================
--- trunk/Assembly_Library/Src/Display/DisplayCursor.asm	(revision 67)
+++ trunk/Assembly_Library/Src/Display/DisplayCursor.asm	(revision 101)
@@ -1,7 +1,3 @@
-; File name		:	DisplayCursor.asm
 ; Project name	:	Assembly Library
-; Created date	:	26.6.2010
-; Last update	:	15.7.2010
-; Author		:	Tomi Tilli
 ; Description	:	Functions for managing display cursor.
 
@@ -39,28 +35,12 @@
 DisplayCursor_SetCoordinatesFromAX:
 	xchg	dx, ax
-	call	.ConvertOffsetToAXfromCoordinatesInDX
-	add		ax, [VIDEO_BDA.wPageOffset]				; AX = Video RAM offset
+	mov		ax, [VIDEO_BDA.wColumns]		; Column count, 40 or 80
+	mul		dh								; AX = Column count * row index
+	xor		dh, dh
+	add		ax, dx							; Add column offset
+	shl		ax, 1							; Convert to WORD offset
+	add		ax, [VIDEO_BDA.wPageOffset]		; AX = Video RAM offset
 	mov		[VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], ax
 	xchg	di, ax
-	ret
-
-;--------------------------------------------------------------------
-; .ConvertOffsetToAXfromCoordinatesInDX
-;	Parameters:
-;		DL:		Cursor column (X-coordinate)
-;		DH:		Cursor row (Y-coordinate)
-;		DS:		BDA segment (zero)
-;	Returns:
-;		AX:		Offset to cursor location in selected page
-;	Corrupts registers:
-;		Nothing
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-.ConvertOffsetToAXfromCoordinatesInDX:
-	mov		ax, [VIDEO_BDA.wColumns]		; Column count, 40 or 80
-	mul		dh								; AX = Column count * row index
-	add		al, dl							; Add column offset
-	adc		ah, 0
-	shl		ax, 1							; Convert to WORD offset
 	ret
 
@@ -145,5 +125,4 @@
 	int		BIOS_VIDEO_INTERRUPT_10h
 	pop		cx
-ALIGN JUMP_ALIGN, ret
 .Return:
 	ret
@@ -175,5 +154,4 @@
 ;		AX, DX
 ;--------------------------------------------------------------------
-;ALIGN JUMP_ALIGN
 .SetHardwareCursorCoordinatesFromAX:
 	push	bx
Index: trunk/Assembly_Library/Src/Display/DisplayFormat.asm
===================================================================
--- trunk/Assembly_Library/Src/Display/DisplayFormat.asm	(revision 67)
+++ trunk/Assembly_Library/Src/Display/DisplayFormat.asm	(revision 101)
@@ -1,7 +1,3 @@
-; File name		:	DisplayFormat.asm
 ; Project name	:	Assembly Library
-; Created date	:	29.6.2010
-; Last update	:	8.10.2010
-; Author		:	Tomi Tilli
 ; Description	:	Functions for displaying formatted strings.
 
@@ -25,16 +21,11 @@
 DisplayFormat_ParseCharacters:
 	call	ReadCharacterAndTestForNull
-	jz		SHORT .QuitCharacterParsing
+	jz		SHORT ReturnFromFormat
 
 	ePUSH_T	cx, DisplayFormat_ParseCharacters	; Return address
 	xor		cx, cx								; Initial placeholder size
 	cmp		al, '%'								; Format specifier?
-	je		SHORT ParseFormatSpecifier
-	jmp		DisplayPrint_CharacterFromAL
-
-ALIGN JUMP_ALIGN
-.QuitCharacterParsing:
-	ret
-
+	jne		SHORT DisplayPrint_CharacterFromAL
+	; Fall to ParseFormatSpecifier
 
 ;--------------------------------------------------------------------
@@ -53,9 +44,8 @@
 ;		AX, BX, CX, DX
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 ParseFormatSpecifier:
 	call	ReadCharacterAndTestForNull
 	call	Char_IsDecimalDigitInAL
-	jc		SHORT .ParsePlaceholderSizeDigitFromALtoCX
+	jc		SHORT ParsePlaceholderSizeDigitFromALtoCX
 	call	GetFormatSpecifierParserToAX
 	call	ax				; Parser function
@@ -64,8 +54,9 @@
 	test	cx, cx
 	jnz		SHORT PrependOrAppendSpaces
-	ret
-
-;--------------------------------------------------------------------
-; .ParsePlaceholderSizeDigitFromALtoCX
+ReturnFromFormat:
+	ret
+
+;--------------------------------------------------------------------
+; ParsePlaceholderSizeDigitFromALtoCX
 ;	Parameters:
 ;		AL:		Digit character from format string
@@ -79,5 +70,5 @@
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
-.ParsePlaceholderSizeDigitFromALtoCX:
+ParsePlaceholderSizeDigitFromALtoCX:
 	mov		[VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], di
 	sub		al, '0'				; Digit '0'...'9' to integer 0...9
Index: trunk/Assembly_Library/Src/Display/DisplayPage.asm
===================================================================
--- trunk/Assembly_Library/Src/Display/DisplayPage.asm	(revision 67)
+++ trunk/Assembly_Library/Src/Display/DisplayPage.asm	(revision 101)
@@ -1,7 +1,3 @@
-; File name		:	DisplayPage.asm
 ; Project name	:	Assembly Library
-; Created date	:	26.6.2010
-; Last update	:	3.7.2010
-; Author		:	Tomi Tilli
 ; Description	:	Functions for managing display page.
 
@@ -63,5 +59,4 @@
 	mov		ah, SELECT_ACTIVE_DISPLAY_PAGE
 	int		BIOS_VIDEO_INTERRUPT_10h
-ALIGN JUMP_ALIGN, ret
 .Return:
 	ret
Index: trunk/Assembly_Library/Src/Display/DisplayPrint.asm
===================================================================
--- trunk/Assembly_Library/Src/Display/DisplayPrint.asm	(revision 67)
+++ trunk/Assembly_Library/Src/Display/DisplayPrint.asm	(revision 101)
@@ -1,7 +1,3 @@
-; File name		:	Display.asm
 ; Project name	:	Assembly Library
-; Created date	:	26.6.2010
-; Last update	:	7.12.2010
-; Author		:	Tomi Tilli
 ; Description	:	Functions for display output.
 
