changeset 97:dc349e4264bb

Cleanup CF for bad 15bits value display Cleanup old printf prototype New strings macro
author JeanDo
date Sun, 12 Dec 2010 01:13:48 +0100
parents 25433449bcb5
children 6f8e3a08011e
files code_part1/OSTC_code_asm_part1/MAIN.ASM code_part1/OSTC_code_asm_part1/aa_tests.asm code_part1/OSTC_code_asm_part1/definitions.asm code_part1/OSTC_code_asm_part1/menu_custom.asm code_part1/OSTC_code_asm_part1/printf.asm code_part1/OSTC_code_asm_part1/printf.inc code_part1/OSTC_code_asm_part1/start.asm code_part1/OSTC_code_asm_part1/strings.asm code_part1/OSTC_code_asm_part1/strings.inc code_part1/OSTC_code_asm_part1/test_printf.asm
diffstat 10 files changed, 306 insertions(+), 398 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/MAIN.ASM	Sat Dec 11 19:13:26 2010 +0100
+++ b/code_part1/OSTC_code_asm_part1/MAIN.ASM	Sun Dec 12 01:13:48 2010 +0100
@@ -82,6 +82,8 @@
 
 ;=============================================================================
 osct_asm	code
+#include    strings.inc
+
 #include	displaytext.asm		; sends texts to wordprocessor
 #include	math.asm			; mathematical functions
 #include 	wait.asm			; waitroutines
@@ -111,24 +113,19 @@
 #include	start.asm			; Startup and init, checks background debugger
 #include	simulator.asm		; Stand-alone simulator routines
 #include 	io.asm				; Low-Level I/O access
-
-;=============================================================================
-#include	printf.asm			; jDG's compact printf test implementation.
-#ifdef TESTING
-	#include	aa_tests.asm	; And testing code.
-	#include	test_printf.asm	; Special font/colors page
-#endif
+#include    strings.asm         ; Basic string operations
 
 ;=============================================================================
-#ifdef AAFONTS
+; Include C sub-routines automatically
+
+p3_wp			code	0x09A00			; Mark segment name into the .map file
+
+  ifdef AAFONTS
 	; New antialiased word processor and fonts
 	#include	aa_wordprocessor.asm ; ASM wordprocessor under tests.
-#else
-	; Include C sub-routines automatically
-p3_wp			code	0x09A00			; Mark segment name into the .map file
-;	#include 	p3_wordprocessor_9A00_BAFF_0B468.txt ; jDG's C-Code
+  else
 	#include 	ostc_part3_wordprocessor_NEW_CURSOR_9A00_to_B960_jump_in_B410.txt	; Christians fonts...
-#endif
+  endif
 
 ;=============================================================================
 p2_deco	code	0x0C000			; Mark segment name into the .map file
--- a/code_part1/OSTC_code_asm_part1/aa_tests.asm	Sat Dec 11 19:13:26 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-;=============================================================================
-;
-; file   aa_tests.asm
-; brief  Draw various OSTC MK2 menus.
-; author JD Gascuel.
-;
-; copyright (c) 2010, JD Gascuel. All rights reserved.
-; $Id$
-;=============================================================================
-; HISTORY
-;  2010-11-29 : [jDG] Reset, for TESTING=1 mode...
-;
-; BUGS:
-;
-
-battery_eedata:
-	DB		0xB8, 0x0B,  .12,  .31,  .10, 0xB4, 0x01,  .12
-	DB		 .31,  .10, 0x2C, 0x01, 0x96, 0x00, 0x00, 0x00
-	DB		 .12,  .31,  .10, 0xE7, 0x03,  .12,  .31,  .10
-battery_eedata_end:
-
-    ;=========================================================================
-
-test_menus:
-	call	PLED_confirmbox
-	movwf	WREG						; NOP, but set Z
-	bz		skip_fonts
-	call	test_printf
-	rcall	wait_page
-
-skip_fonts:
-	movlw	0xFC						; Reset ambiant pres to 1015 mBar
-	movwf	D1+0
-	movlw	0x21
-	movwf	D1+1
-	movff	D1+0, amb_pressure+0
-	movff	D1+1, amb_pressure+1
-
-	movlw	0x48						; Reset temperature ~ 19°C
-	movwf	D2
-	movlw	0x26
-	movwf	D2+1
-
-	call	do_menu_reset_all2			; Force reset all CFxx
-
-	return
-
-    ;=========================================================================
-
-wait_page:
-	bcf		switch_left
-	bcf		switch_right
-
-wait_page_loop:
-	bsf		LED_red		; Set it many times, better for OLEDSim...
-	bsf		LED_blue
-
-	WAITMS	.250
-	WAITMS	.250
-	btfsc	switch_right
-	bra		wait_page_done
-
-	WAITMS	.250
-	WAITMS	.250
-	btfss	switch_left
-	bra		wait_page_loop
-
-wait_page_done:
-	bcf		LED_red
-	bcf		LED_blue
-
-	bcf		switch_left
-	bcf		switch_right
-	goto	PLED_ClearScreen
-	
\ No newline at end of file
--- a/code_part1/OSTC_code_asm_part1/definitions.asm	Sat Dec 11 19:13:26 2010 +0100
+++ b/code_part1/OSTC_code_asm_part1/definitions.asm	Sun Dec 12 01:13:48 2010 +0100
@@ -339,7 +339,6 @@
 	convert_value_temp:3		; used in menu_battery_state_convert_date
 	box_temp:5
 	time_correction_value		; Adds to Seconds on midnight
-	printf_len
 	ENDC
 
   ifndef AAFONTS
--- a/code_part1/OSTC_code_asm_part1/menu_custom.asm	Sat Dec 11 19:13:26 2010 +0100
+++ b/code_part1/OSTC_code_asm_part1/menu_custom.asm	Sun Dec 12 01:13:48 2010 +0100
@@ -19,7 +19,7 @@
 ; Menu "Custom Functions", Custom Functions checker (Displays permanent warning if critical custom functions are altered)
 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com
 ; written: 05/10/30
-; last updated: 08/08/31
+; last updated: 2010/12/11
 ; known bugs:
 ; ToDo: 
 
@@ -45,7 +45,8 @@
 
 ; [jDG] 2010-11-30 More fancy displsy of the various CF types
 ; data types. When we do have a 8bit data (bit16=0), the high byte serves to
-; define the display format:
+; define the display format. Also stores min/max bounds into the PROM table.
+; And provides surfacemode checking of all parameters.
 
 CF_INT8		EQU	0	; Default display, 8 or 15 bits values.
 CF_PERCENT	EQU	1	    ; Displays 110%
@@ -391,9 +392,6 @@
     bcf     hi,7                        ; clear 15bit flag
     
     movff   TABLAT,cf_type              ; type (high byte) --> cf_type
-    movlw   CF_MILI
-    btfsc   cf_type,7                   ; Display all 15bits as 1.234 floats.
-    movwf   cf_type
 
     tblrd*+
     movff   TABLAT,cf_min               ; Then get optional min/max
--- a/code_part1/OSTC_code_asm_part1/printf.asm	Sat Dec 11 19:13:26 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-;=============================================================================
-;
-; file   printf.asm
-; brief  Implementation code for the PRINTF macros.
-; author JD Gascuel.
-;
-; copyright (c) 2010, JD Gascuel. All rights reserved.
-; $Id: printf.asm 60 2010-11-27 18:40:53Z gascuel $
-;=============================================================================
-; HISTORY
-;  2010-11-17 : [jDG] Creation...
-;
-; BUGS : repetitive calls to the same CF# color do strange things...
-
-#include printf.inc
-
-; We need to keep the flags. To avoid trouble of memory alloc, put it in
-; some register untouched by any called function...
-#define		flags	FSR0L
-
-printf_subroutine:
-			movff	TBLPTRL, printf_len	; Save bloc start before parsing
-
-			tblrd*+						; Read flags...
-			movf	TABLAT,W			; Get flags
-			movwf	flags				; and save for later use.
-
-			andlw	3					; Select font bits
-			bz		printf_keep_font	; Keep font ? skip setting
-			decf	WREG				; Minus one make it font size.
-			movff	WREG, win_font
-
-printf_keep_font:
-			clrf	WREG				; Normal or invert video ?
-			btfsc	flags,2
-			movlw	1
-			movff	WREG, win_invert
-
-			btfss	flags,3				; Optional Top/Left position ?
-			bra		printf_no_position
-
-			tblrd*+						; Copy it...
-			movff	TABLAT, win_top
-			tblrd*+
-			movff	TABLAT, win_leftx2
-
-printf_no_position:
-			btfss	flags,4				; Optional RRRGGGBB packed color ?
-			bra		printf_no_color8
-			tblrd*+
-			movff	TABLAT, WREG
-			call	PLED_set_color
-
-printf_no_color8:
-			btfss	flags,5				; Optional CF color ?
-			bra		printf_no_color_cf
-			tblrd*+
-			movff	TABLAT, WREG
-			call	getcustom8_1		; Read CF into WREG
-			call	PLED_set_color		; convert it to 16bits into win_color1:2
-
-printf_no_color_cf:
-			movf	flags,W				; Should we completely skip string copy/append ?
-			andlw	.192
-			xorlw	.192				; Is command 192 (no string op) ?
-			bz		printf_exec
-
-			btfsc	flags,7				; Don't reset FRS2 index ?
-			bra		printf_strcat
-			lfsr	FSR2, letter
-			bra		printf_loop
-
-printf_strcat:
-			movlw	0x60
-			cpfslt	FSR2L
-			decf	FSR2L
-
-printf_loop:							; Loop over string append byte by byte.
-			tblrd*+
-			movff	TABLAT, POSTINC2
-			tstfsz	TABLAT
-			bra		printf_loop
-
-printf_exec:
-			movf	printf_len,W		; Get back block start
-			subwf	TBLPTRL,W			; Compute block len
-			movwf	printf_len			; And backup for inline variante
-
-			movf	flags,W				; Was is a NO-PRINT command ?
-			addlw	.64					; DEF/CPY/CAT/PRT ->64/128/192/0
-			btfsc	WREG,7				; Test if 128 or 192 ?
-			return
-
-	ifdef AAFFONTS
-			goto	aa_wordprocessor	; TESTING NEW STRINGWIDTH ROUTINE
-	else
-			goto	word_processor
-	endif
-
-;=============================================================================
-
-printf_inline:
-			movff	TOSU, TBLPTRU		; Transfer return addr to Table ptr
-			movff	TOSH, TBLPTRH
-			movff	TOSL, TBLPTRL
-
-			rcall	printf_subroutine	; Execute command bloc
-
-			movlb	1					; Restore BANK1 after C-code
-
-			; Round-up block length, so to branch to even addr.
-			movf	printf_len,W		; Get back block len
-			incf	WREG				; Add +1
-			andlw	0xFE				; Then clean odd bit
-
-			; Then add len to return address
-			addwf	TOSL,F
-			movlw	0					; Clear WREG, but keep carry
-			addwfc	TOSH,F
-			addwfc	TOSU,F
-			return
--- a/code_part1/OSTC_code_asm_part1/printf.inc	Sat Dec 11 19:13:26 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-;=============================================================================
-;
-; file   printf.inc
-; brief  Compact macro to print PROM text, with formating options.
-; author JD Gascuel.
-;
-; copyright (c) 2010, JD Gascuel. All rights reserved.
-; $Id: printf.inc 37 2010-11-22 03:22:39Z gascuel $
-;=============================================================================
-; HISTORY
-;  2010-11-17 : [jDG] Creation...
-;
-;=============================================================================
-;
-; Compact macro to print PROM text, with formating options.
-;
-; The aim is to allow compact formating code, with formating options, to allow
-; smaller footprint in the PROM.
-;
-; A print block (in PROM space) is used as paramaters. The block starts with
-; a set of flags, telling what options are needed.
-;
-; The block format is :
-;	label	DB	flag+flag+flag+...	; A combination of various flags...
-;			DB	top, leftx2			; Optional text position.
-;			DB  0b1110011			; Optional color in RRRGGGBB format.
-;			DB  .35					; Optional CF color (CF35 = standard).
-;			DB  "The text string."	; Optional null-terminated text string
-;			DB	0
-;
-; Two usage variantes:
-; + The more compact one, use just 4 bytes for the call:
-;           code_pack               ; Don't insert nulls 
-;           call printf_inline
-;     tfAILED   DB  PRINTF_FONT_SMALL + PRINTF_TOPLEFT + PRINTF_COLOR8
-;               DB  100, 100
-;               DB  color_red
-;               DB  "FAILED"
-;               DB  0
-;           code                    ; back to normal
-;
-; + A more classic one, but uses 16 bytes to load 24bits address:
-;           WIN_PRINTF tFAILED
-;
-;=============================================================================
-; Flags for basic option (no argument):
-#define		PRINTF_FONT_KEEP	.0		; Keep last font size. DEFAULT.
-#define		PRINTF_FONT_SMALL	.1		; Switch to small font.
-#define		PRINTF_FONT_MEDIUM	.2		; Switch to medium font.
-#define		PRINTF_FONT_LARGE	.3		; Switch to large font.
-
-#define		PRINTF_INVERT		.4		; Draw in reverse color.
-
-; Flags that requires optional argument:
-#define		PRINTF_TOPLEFT		.8		; Set Top/Left text position.
-#define		PRINTF_COLOR8		.16		; Change text color to packed RRRGGGBB format.
-#define		PRINTF_COLOR_CF		.32		; Change text color to preference CF#
-
-; Flags for final operation
-#define		PRINTF_COPY_PRINT	.0		; strcpy() from PROM, then print. DEFAULT.
-#define		PRINTF_COPY			.64		; just strcpy(), no final print.
-#define		PRINTF_APPEND		.128	; just strcat() (don't reset FSR2 fist), no final print.
-#define		PRINTF_PRINT		.192	; no string ops, just final call to print.
-
-;=============================================================================
-
-WIN_PRINTF	macro	bloc
-			movlw	UPPER bloc
-			movwf	TBLPTRU
-			movlw	HIGH bloc
-			movwf	TBLPTRH
-			movlw	LOW bloc
-			movwf	TBLPTRL
-			call	printf_subroutine
-			endm
-
--- a/code_part1/OSTC_code_asm_part1/start.asm	Sat Dec 11 19:13:26 2010 +0100
+++ b/code_part1/OSTC_code_asm_part1/start.asm	Sun Dec 12 01:13:48 2010 +0100
@@ -40,9 +40,9 @@
 	call	disable_rs232			; disable UART module
 	call	RTCinit					; reset RTC
 
-; Extra power-up testing jDG jDG jDG jDG
+; Extra power-up reset jDG jDG jDG jDG
 	ifdef	TESTING
-		call 	test_menus
+		call 	do_menu_reset_all2
 	endif
 ; DONE jDG jDG jDG jDG
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/code_part1/OSTC_code_asm_part1/strings.asm	Sun Dec 12 01:13:48 2010 +0100
@@ -0,0 +1,146 @@
+;=============================================================================
+;
+;    File strings.asm
+;
+;    Implementation code various string functions.
+;
+;    This program is free software: you can redistribute it and/or modify
+;    it under the terms of the GNU General Public License as published by
+;    the Free Software Foundation, either version 3 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.
+;
+;    You should have received a copy of the GNU General Public License
+;    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+;
+;    Copyright (c) 2010, JD Gascuel.
+;=============================================================================
+; HISTORY
+;  2010-12-02 : [jDG] Creation...
+;
+; See strings.inc for doc and public calling macros.
+
+VARARGS_BEGIN   macro
+        movff   TOSL, TBLPTRL
+        movff   TOSH, TBLPTRH
+        movff   TOSU, TBLPTRU
+        endm
+
+VARARGS_GET8    macro   register
+        tblrd*+
+        movff   TABLAT, register
+        endm
+
+VARARGS_GET16   macro   register
+        tblrd*+
+        movff   TABLAT, register+0
+        tblrd*+
+        movff   TABLAT, register+1
+        endm
+
+VARARGS_ALIGN   macro
+        btfss   TBLPTRL,0
+        local   no_tblptr_align
+        bra     no_tblptr_align
+        incf    TBLPTRL
+        movlw   0
+        addwfc  TBLPTRH
+no_tblptr_align:
+        endm
+        
+VARARGS_END macro
+        ; Compute string length (modulo 256):
+        movf    TOSL,W
+        subwf   TBLPTRL,W
+        
+		; Then 24bit add to return address
+		addwf	TOSL,F
+		movlw	0			            ; Clear WREG, but keep carry
+		addwfc	TOSH,F
+		addwfc	TOSU,F
+		endm
+
+;=============================================================================
+; Variants that call word_processor at the end:
+strcpy_block_print:
+        lfsr    FSR2, letter
+strcat_block_print:
+        clrf    PRODL,A
+        bra     strings_common
+
+; Variants that do not call word_processor at end:
+strcpy_block:
+        lfsr    FSR2, letter
+strcat_block:
+        setf    PRODL,A
+        
+; Common part: append the string from PROM return address:
+strings_common:
+        VARARGS_BEGIN
+
+strcpy_loop:
+        tblrd*+
+        movf    TABLAT,W
+        movwf   POSTINC2
+        bnz     strcpy_loop
+        movf    POSTDEC2,W               ; rewind one char in string buffer.
+
+        VARARGS_ALIGN
+        VARARGS_END
+		
+		btfsc   PRODL,0,A               ; Should we print afterward ?
+		return                          ; NO: then return straight away.
+		goto    word_processor          ; ELSE: print it...
+
+;=============================================================================
+
+start_small_block:
+        clrf        WREG,A
+        movff       WREG, win_font      ; Need a bank-safe move here !
+        movff       WREG, win_invert
+        bra         start_common
+
+start_small_invert_block:
+        clrf        WREG,A
+        movff       WREG, win_font      ; Need a bank-safe move here !
+        setf        WREG,A
+        movff       WREG, win_invert
+        bra         start_common
+
+start_medium_block:
+        movlw       1
+        movff       WREG, win_font      ; Need a bank-safe move here !
+        clrf        WREG,A
+        movff       WREG, win_invert
+        bra         start_common
+
+start_medium_invert_block:
+        movlw       1
+        movff       WREG, win_font      ; Need a bank-safe move here !
+        movff       WREG, win_invert
+        bra         start_common
+
+start_large_block:
+        movlw       2
+        movff       WREG, win_font      ; Need a bank-safe move here !
+        clrf        WREG,A
+        movff       WREG, win_invert
+        bra         start_common
+
+start_large_invert_block:
+        movlw       2
+        movff       WREG, win_font      ; Need a bank-safe move here !
+        movlw       1
+        movff       WREG, win_invert
+        bra         start_common
+
+start_common:
+        VARARGS_BEGIN
+            VARARGS_GET8    win_leftx2
+            VARARGS_GET8    win_top
+        VARARGS_END
+        return
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/code_part1/OSTC_code_asm_part1/strings.inc	Sun Dec 12 01:13:48 2010 +0100
@@ -0,0 +1,145 @@
+;=============================================================================
+;
+;    File strings.inc
+;
+;    Implementation code various string functions.
+;
+;    This program is free software: you can redistribute it and/or modify
+;    it under the terms of the GNU General Public License as published by
+;    the Free Software Foundation, either version 3 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.
+;
+;    You should have received a copy of the GNU General Public License
+;    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+;
+;    Copyright (c) 2010, JD Gascuel.
+;=============================================================================
+; HISTORY
+;  2010-12-02 : [jDG] Creation...
+;
+; RATIONALS for STRCAT / STRCPY / STRCAT_PRINT / STRCPY_PRINT:
+;  * Gain PROM space: each time a string operation is done, we have a bunch
+;    of lines in the style:
+;           movlw   '+'
+;           movwf   POSTINC2
+;           movlw   '/'
+;           movwf   POSTINC2
+;           movlw   '-'
+;           movwf   POSTINC2
+;           movlw   ':'
+;           movwf   POSTINC2
+;           call    word_processor
+;    which takes 20 bytes of PROM space (eg. 4 + chars/4). Whereas :
+;           STRCAT_PRINT  "+/-:"
+;    takes just 10 bytes (4 + chars + 1, even rounded up).
+;
+;    Note that the other common sequence :
+;           OUTPUTTEXT  .113
+;    does compile in (6 bytes per call), plus (1 + chars, even rouded up)
+;    once it the whole code. Also, it is slower to execute, because it have
+;    to roll through the string table.
+;
+; RATIONALS for a formating variant... not yet done... 
+;  * Embeding formatting commands into the string allows even mode compact
+;    sequence.
+;    Possible commandes:
+;           \xF0    output_8            ; arg in hi, and move lo to hi,
+;           \xF1    output_9            ; so we can have two 8bits concertion
+;           \xF2    output_99           ; in a single sequence...
+;           \xF3    output_99x
+;           \xF4    output_16           ; arg in hi:lo
+;           \xF5    output_16dp 1
+;           \xF6    output_16dp 2
+;           \xF7    output_16dp 3
+;           ....
+;    Usage:
+;           movff       apnoe_min, hi
+;           movff       apnoe_sec, lo
+;           FORMAT_PRINT "Time: \xF3:\xF3"
+;
+;  * Cons: code redeability is poor: reader have to remember exactly what
+;    each cryptic hexa code is doing...
+;    No-macro-syntax:
+;           call    format_print_block
+;           DB  "Time: ", FORMAT_99x, ':', FORMAT_99x, 0
+;    is denitively more secure in that respect...
+
+;=============================================================================
+; Copy a short embebed string at start of the string buffer (letter)
+; Input:    (nothing)
+; Output:   chars are copied into letter, starting at the beginning.
+;           FSR2 point to the first unused char (the NULL termination).
+;           
+; Trashed:  WREG, TBLPTR, TABLAT, PRODL
+; Note:     This are all bank-safe call.
+;
+STRCPY  macro   string
+        call    strcpy_block
+        DB  string, 0
+        endm
+
+;=============================================================================
+; A variant of STRCPY that appends chars to the current FSR2 pointer.
+; Input/Output/Trashed : see STRCPY.
+STRCAT  macro   string
+        call    strcat_block
+        DB  string, 0
+        endm
+
+;=============================================================================
+; A variant of STRCPY that send the string to the word processor afterwards.
+; Input/Output: see STRCPY.
+; Trashed: See STRCPY + word_processor. In particular, switch RAM to Bank1 
+;
+STRCPY_PRINT    macro string
+        call    strcpy_block_print
+        DB  string, 0
+        endm
+
+; Trashed: See STRCPY + word_processor. In particular, switch RAM to Bank1 
+STRCAT_PRINT    macro string
+        call    strcat_block_print
+        DB  string, 0
+        endm
+
+;=============================================================================
+; A shortcut for the macros WIN_TOP + WIN_LEFT + WIN_FONT + WIN_INVERT.
+; The idea is to replace a 4x6=24 bytes sequence by a more compact 6bytes one.
+;
+; Trashed: TBLPTR, TABLAT, WREG.
+; Note:    This are all bank-safe call.
+
+WIN_SMALL macro x, y
+        call    start_small_block
+        DB      x, y
+        endm
+
+WIN_SMALL_INVERT macro x, y
+        call    start_small_invert_block
+        DB      x, y
+        endm
+
+WIN_MEDIUM   macro   x, y
+        call    start_medium_block
+        DB      x, y
+        endm
+
+WIN_MEDIUM_INVERT   macro   x, y
+        call    start_medium_invert_block
+        DB      x, y
+        endm
+
+WIN_LARGE   macro   x, y
+        call    start_large_block
+        DB      x, y
+        endm
+
+WIN_LARGE_INVERT   macro   x, y
+        call    start_large_invert_block
+        DB      x, y
+        endm
--- a/code_part1/OSTC_code_asm_part1/test_printf.asm	Sat Dec 11 19:13:26 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-;////////////////////////////////////////////////////////////////////////////
-;
-; file   printf.inc
-; brief  Compact macro to print PROM text, with formating options.
-; author JD Gascuel.
-;
-; copyright (c) 2010, JD Gascuel. All rights reserved.
-; $Id: test_printf.asm 72 2010-11-29 22:45:12Z gascuel $
-;//////////////////////////////////////////////////////////////////////////////
-; HISTORY
-;  2010-11-17 : [jDG] Creation...
-;
-
-;=============================================================================
-; test font screen
-
-test_printf	code_pack
-test_printf:		
-			call	PLED_ClearScreen
-
-			call	printf_inline
-				DB	PRINTF_FONT_SMALL + PRINTF_TOPLEFT + PRINTF_COLOR8
-				DB	.4, .2		; top, leftx2
-				DB	0xFF		; White
-				DB	" !\"#$%&'()*+,-;/"
-				DB 0,0
-
-			call	printf_inline
-				DB	PRINTF_INVERT + PRINTF_TOPLEFT + PRINTF_COLOR8
-				DB	.30, .2		; top, leftx2
-				DB	0xE0		; Red
-				DB  "0123456789:;<=>?"
-				DB	0,0
-
-			call	printf_inline
-				DB	PRINTF_TOPLEFT + PRINTF_COLOR8
-				DB	.56, .2		; top, leftx2
-				DB	0x1C		; Green
-				DB	"@ABCDEFGHIJKLMNO"
-				DB	0,0
-	
-			call	printf_inline
-				DB	PRINTF_INVERT + PRINTF_TOPLEFT + PRINTF_COLOR8
-				DB	.82, .2		; top, leftx2
-				DB	0x03		; Blue
-				DB	"PQRSTUVWXYZ[\\]^_"
-				DB	0,0
-	
-			call	printf_inline
-				DB	PRINTF_TOPLEFT + PRINTF_COLOR8
-				DB	.108, .2	; top, leftx2
-				DB	0x1F		; Cyan
-				DB	"`abcdefghijklmno"
-				DB 	0,0
-		
-			call	printf_inline
-				DB	PRINTF_TOPLEFT + PRINTF_COLOR8
-				DB	.134, .2	; top, leftx2
-				DB	0xE3		; Magenta
-				DB	"pqrstuvwxyz{|}~¤"
-				DB 	0,0
-
-			call	printf_inline
-				DB	PRINTF_TOPLEFT + PRINTF_COLOR8
-				DB	.160, .2	; top, leftx2
-				DB	0xFC		; Yellow
-				DB	"°", 0xB7
-				DB	0x01, ' '
-				DB	0x1F, ' '
-				DB	0x84, ' '
-				DB	0xFF, ' '
-				DB 	0,0
-
-			;=================================================================
-			call 	wait_page
-
-			call	printf_inline
-				DB	PRINTF_FONT_MEDIUM + PRINTF_TOPLEFT + PRINTF_COLOR8
-				DB	.4, .4	; top, leftx2
-				DB	0xFF		; White
-				DB	"{/.01234567/}" 
-				DB	0
-
-			call	printf_inline
-				DB	PRINTF_INVERT + PRINTF_FONT_MEDIUM + PRINTF_TOPLEFT
-				DB	.36, .4	; top, leftx2
-				DB "[/890:'\"m /]"
-				DB	0
-
-			call	printf_inline
-				DB	PRINTF_INVERT + PRINTF_FONT_LARGE + PRINTF_TOPLEFT
-				DB	.68, .4
-				DB	"123456"
-				DB	0
-
-			call	printf_inline
-				DB	PRINTF_INVERT + PRINTF_FONT_LARGE + PRINTF_TOPLEFT
-				DB	.124, .4
-				DB	"789. "
-				DB	0,0
-
-			return
-
-; Back to auto-aligned code:
-post_test	code
\ No newline at end of file