Index: trunk/Assembly_Library/Src/Display/DisplayPrint.asm
===================================================================
--- trunk/Assembly_Library/Src/Display/DisplayPrint.asm	(revision 181)
+++ trunk/Assembly_Library/Src/Display/DisplayPrint.asm	(revision 186)
@@ -5,4 +5,5 @@
 SECTION .text
 
+				
 ;--------------------------------------------------------------------
 ; Supports following formatting types:
@@ -61,4 +62,5 @@
 	pop		si
 	pop		bp
+
 	ret
 
@@ -102,4 +104,7 @@
 ;		AX, DX
 ;--------------------------------------------------------------------
+		
+%ifndef MODULE_STRINGS_COMPRESSED
+		
 ALIGN JUMP_ALIGN
 DisplayPrint_WordFromAXWithBaseInBX:
@@ -131,4 +136,6 @@
 .rgcDigitToCharacter:	db	"0123456789ABCDEF"
 
+%endif	; MODULE_STRINGS_COMPRESSED
+
 
 ;--------------------------------------------------------------------
@@ -165,56 +172,4 @@
 
 
-;--------------------------------------------------------------------
-; DisplayPrint_NullTerminatedStringFromCSSI
-;	Parameters:
-;		CS:SI:	Ptr to NULL terminated string
-;		DS:		BDA segment (zero)
-;		ES:DI:	Ptr to cursor location in video RAM
-;	Returns:
-;		DI:		Updated offset to video RAM
-;	Corrupts registers:
-;		AX, DX
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-DisplayPrint_NullTerminatedStringFromCSSI:
-	push	bx
-	mov		bx, cs
-	call	DisplayPrint_NullTerminatedStringFromBXSI
-	pop		bx
-	ret
-
-
-;--------------------------------------------------------------------
-; DisplayPrint_NullTerminatedStringFromBXSI
-;	Parameters:
-;		DS:		BDA segment (zero)
-;		BX:SI:	Ptr to NULL terminated string
-;		ES:DI:	Ptr to cursor location in video RAM
-;	Returns:
-;		DI:		Updated offset to video RAM
-;	Corrupts registers:
-;		AX, DX
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-DisplayPrint_NullTerminatedStringFromBXSI:
-	push	si
-	push	cx
-
-	xor		cx, cx
-ALIGN JUMP_ALIGN
-.PrintNextCharacter:
-	mov		ds, bx				; String segment to DS
-	lodsb
-	mov		ds, cx				; BDA segment to DS
-	test	al, al				; NULL?
-	jz		SHORT .EndOfString
-	call	DisplayPrint_CharacterFromAL
-	jmp		SHORT .PrintNextCharacter
-
-ALIGN JUMP_ALIGN
-.EndOfString:
-	pop		cx
-	pop		si
-	ret
 
 
@@ -320,6 +275,41 @@
 	pop		cx
 .NothingToRepeat:
-	ret
-
+
+	ret
+
+;--------------------------------------------------------------------
+; DisplayPrint_NullTerminatedStringFromCSSI
+;	Parameters:
+;		CS:SI:	Ptr to NULL terminated string
+;		DS:		BDA segment (zero)
+;		ES:DI:	Ptr to cursor location in video RAM
+;	Returns:
+;		DI:		Updated offset to video RAM
+;	Corrupts registers:
+;		AX, DX
+;--------------------------------------------------------------------
+
+%ifndef MODULE_STRINGS_COMPRESSED
+;;;
+;;; Take care when using this routine with compressed strings (which is why it is disabled).
+;;; All strings in CSSI should go through the DisplayFormatCompressed code to be decoded.
+;;; 
+ALIGN JUMP_ALIGN
+DisplayPrint_NullTerminatedStringFromCSSI:
+	push	bx
+	mov		bx, cs
+	call	DisplayPrint_NullTerminatedStringFromBXSI
+	pop		bx
+
+	ret
+%endif
+
+		
+
+
+;;;
+;;; Note that the following routines need to be at the bottom of this file
+;;; to accomodate short jumps from the next file (DisplayFormat/DisplayFormatCompressed)
+;;; 
 
 ;--------------------------------------------------------------------
@@ -333,5 +323,14 @@
 ;		AX, DX
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
+%ifdef MODULE_STRINGS_COMPRESSED
+ALIGN JUMP_ALIGN
+DisplayPrint_Newline_FormatAdjustBP:
+	inc		bp					; we didn't need a parameter after all, readjust BP 
+	inc		bp
+;;; fall-through
+%endif
+
+ALIGN JUMP_ALIGN
+		
 DisplayPrint_Newline:
 	mov		al, LF
@@ -344,4 +343,5 @@
 ;	Parameters:
 ;		AL:		Character to display
+;               Zero value is ignored (no characer is printed)
 ;		DS:		BDA segment (zero)
 ;		ES:DI:	Ptr to cursor location in video RAM
@@ -353,4 +353,47 @@
 ALIGN JUMP_ALIGN
 DisplayPrint_CharacterFromAL:
+%ifdef MODULE_STRINGS_COMPRESSED
+	test	al,al
+	jz		DisplayPrint_Ret
+%endif
 	mov		ah, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bAttribute]
 	jmp		[VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fnCharOut]
+
+
+		
+;--------------------------------------------------------------------
+; DisplayPrint_NullTerminatedStringFromBXSI
+;	Parameters:
+;		DS:		BDA segment (zero)
+;		BX:SI:	Ptr to NULL terminated string
+;		ES:DI:	Ptr to cursor location in video RAM
+;	Returns:
+;		DI:		Updated offset to video RAM
+;	Corrupts registers:
+;		AX, DX
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+DisplayPrint_NullTerminatedStringFromBXSI:
+	push	si
+	push	cx
+
+	xor		cx, cx
+ALIGN JUMP_ALIGN
+.PrintNextCharacter:
+	mov		ds, bx				; String segment to DS
+	lodsb
+	mov		ds, cx				; BDA segment to DS
+	test	al, al				; NULL?
+	jz		SHORT .EndOfString
+	call	DisplayPrint_CharacterFromAL
+	jmp		SHORT .PrintNextCharacter
+
+ALIGN JUMP_ALIGN
+.EndOfString:
+	pop		cx
+	pop		si
+		
+DisplayPrint_Ret:				; random ret to jump to 				
+	ret
+
+
