Index: trunk/Assembly_Library/Src/Display/DisplayContext.asm
===================================================================
--- trunk/Assembly_Library/Src/Display/DisplayContext.asm	(revision 489)
+++ trunk/Assembly_Library/Src/Display/DisplayContext.asm	(revision 491)
@@ -3,5 +3,5 @@
 
 ;
-; XTIDE Universal BIOS and Associated Tools 
+; XTIDE Universal BIOS and Associated Tools
 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
 ;
@@ -10,11 +10,11 @@
 ; the Free Software Foundation; either version 2 of the License, or
 ; (at your option) any later version.
-; 
+;
 ; This program is distributed in the hope that it will be useful,
 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-; GNU General Public License for more details.		
+; GNU General Public License for more details.
 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-;		
+;
 
 ; Section containing code
@@ -102,8 +102,7 @@
 
 
-%ifdef INCLUDE_MENU_LIBRARY
-
 ;--------------------------------------------------------------------
 ; DisplayContext_Push
+; DisplayContext_Pop
 ;	Parameters:
 ;		Nothing
@@ -113,4 +112,11 @@
 ;		AX, DI
 ;--------------------------------------------------------------------
+%ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
+	%ifndef MODULE_BOOT_MENU
+		%define EXCLUDE
+	%endif
+%endif
+
+%ifndef EXCLUDE
 ALIGN DISPLAY_JUMP_ALIGN
 DisplayContext_Push:
@@ -126,17 +132,9 @@
 	%endrep
 %endif
-		
+
 	mov		ds, di					; Restore DS
 	jmp		ax
 
-;--------------------------------------------------------------------
-; DisplayContext_Pop
-;	Parameters:
-;		Nothing
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, DI
-;--------------------------------------------------------------------
+
 ALIGN DISPLAY_JUMP_ALIGN
 DisplayContext_Pop:
@@ -145,5 +143,5 @@
 	pop		ax						; Pop return address
 
-%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS		
+%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
 	%assign i DISPLAY_CONTEXT_size-2
 	%rep DISPLAY_CONTEXT_size / 2
@@ -152,5 +150,5 @@
 	%endrep
 %endif
-		
+
 	push	ax						; Push return address
 	push	dx
@@ -159,5 +157,7 @@
 	mov		ds, di					; Restore DS
 	ret
-%endif
+%endif ; EXCLUDE
+%undef EXCLUDE
+
 
 ;--------------------------------------------------------------------
@@ -189,6 +189,5 @@
 	pop		ds
 	ret
-
-%endif  ; INCLUDE_MENU_LIBRARY
+%endif ; EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
 
 
@@ -231,6 +230,10 @@
 %endif
 
-%ifdef INCLUDE_MENU_LIBRARY
-
+
+%ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
+	%ifndef MODULE_BOOT_MENU
+		%define EXCLUDE
+	%endif
+%endif
 ;--------------------------------------------------------------------
 ; DisplayContext_SetCharOutputFunctionFromAXwithAttribFlagInBL
@@ -244,4 +247,5 @@
 ;		BL
 ;--------------------------------------------------------------------
+%ifndef EXCLUDE	; 1 of 3
 ALIGN DISPLAY_JUMP_ALIGN
 DisplayContext_SetCharOutputFunctionFromAXwithAttribFlagInBL:
@@ -251,4 +255,5 @@
 	mov		[VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fnCharOut], ax
 	ret
+%endif
 
 
@@ -263,8 +268,10 @@
 ;		Nothing
 ;--------------------------------------------------------------------
+%ifndef EXCLUDE	; 2 of 3
 ALIGN DISPLAY_JUMP_ALIGN
 DisplayContext_SetCharacterAttributeFromAL:
 	mov		[VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bAttribute], al
 	ret
+%endif
 
 
@@ -279,11 +286,14 @@
 ;		Nothing
 ;--------------------------------------------------------------------
+%ifndef EXCLUDE	; 3 of 3
 ALIGN DISPLAY_JUMP_ALIGN
 DisplayContext_SetCharacterOutputParameterFromAX:
 	mov		[VIDEO_BDA.displayContext+DISPLAY_CONTEXT.wCharOutParam], ax
 	ret
-		
-%endif	 ; INCLUDE_MENU_LIBRARY
-		
+%endif
+
+%undef EXCLUDE
+
+
 ;--------------------------------------------------------------------
 ; DisplayContext_GetCharacterOutputParameterToDX
@@ -295,5 +305,5 @@
 ;		Nothing
 ;--------------------------------------------------------------------
-%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG	; This is currently unused (dead code)
+%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG
 ALIGN DISPLAY_JUMP_ALIGN
 DisplayContext_GetCharacterOutputParameterToDX:
@@ -322,5 +332,5 @@
 %endif
 
-		
+
 ;--------------------------------------------------------------------
 ; DisplayContext_GetByteOffsetToAXfromCharacterOffsetInAX
