0
|
1 ;=============================================================================
|
|
2 ;
|
634
|
3 ; File strings.inc * combined next generation V3.08.5
|
0
|
4 ;
|
604
|
5 ; Implementation code various string functions
|
0
|
6 ;
|
|
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
|
|
8 ;=============================================================================
|
|
9 ; HISTORY
|
604
|
10 ; 2010-12-02 : [jDG] Creation
|
0
|
11 ;
|
|
12
|
634
|
13
|
|
14 ;-----------------------------------------------------------------------------
|
|
15 ; Initialize the Buffer
|
|
16 ;
|
|
17 INIT_BUFFER macro
|
|
18 lfsr FSR2,buffer ; load FSR2 with base address of the buffer
|
|
19 endm
|
|
20
|
|
21
|
|
22 ;-----------------------------------------------------------------------------
|
|
23 ; Re-Initialize the Buffer
|
0
|
24 ;
|
634
|
25 REINIT_BUFFER macro
|
|
26 clrf FSR2L ; reset the buffer pointer
|
|
27 endm
|
|
28
|
|
29
|
|
30 ;-----------------------------------------------------------------------------
|
|
31 ; Font Size Selection
|
|
32 ;
|
|
33 FONT_SIZE macro font_size_input
|
|
34 movlw font_size_input
|
|
35 movwf font_size
|
|
36 endm
|
|
37
|
|
38
|
|
39 ;-----------------------------------------------------------------------------
|
|
40 ; Dump the Buffer to Screen
|
|
41 ;
|
|
42 PRINT macro
|
|
43 extern print
|
|
44 call print ; append terminator to buffer and print buffer
|
604
|
45 endm
|
0
|
46
|
634
|
47
|
|
48 ;-----------------------------------------------------------------------------
|
|
49 ; Macros to print embedded (untranslated) Texts
|
|
50 ;-----------------------------------------------------------------------------
|
|
51
|
|
52 ;-----------------------------------------------------------------------------
|
|
53 ; Copy an embedded (untranslated) Text to the Buffer
|
604
|
54 ;
|
634
|
55 STRCPY macro string
|
|
56 extern strcpy_block
|
|
57 call strcpy_block ; copy text to buffer
|
|
58 DB string, 0 ; inline text with terminator
|
604
|
59 endm
|
0
|
60
|
634
|
61
|
|
62 ;-----------------------------------------------------------------------------
|
|
63 ; Append an embedded (untranslated) Text to the Buffer
|
604
|
64 ;
|
634
|
65 STRCAT macro string
|
|
66 extern strcat_block
|
|
67 call strcat_block ; append text to buffer
|
|
68 DB string, 0 ; inline text with terminator
|
604
|
69 endm
|
0
|
70
|
634
|
71
|
|
72 ;-----------------------------------------------------------------------------
|
|
73 ; Append a single Character to the Buffer
|
0
|
74 ;
|
634
|
75 PUTC macro char
|
|
76 movlw char ; get character into WREG
|
|
77 movwf POSTINC2 ; append character to buffer
|
|
78 endm
|
|
79
|
|
80
|
|
81 ;-----------------------------------------------------------------------------
|
|
82 ; Append a single Character to the Buffer and dump the Buffer to Screen
|
|
83 ;
|
|
84 PUTC_PRINT macro char
|
|
85 extern putc_print
|
|
86 movlw char ; get character into WREG
|
|
87 call putc_print ; append charcator to buffer and print whole buffer
|
604
|
88 endm
|
0
|
89
|
634
|
90
|
|
91 ;-----------------------------------------------------------------------------
|
|
92 ; Copy an embedded Text to the Start of the Buffer and dump the Buffer to Screen
|
604
|
93 ;
|
634
|
94 STRCPY_PRINT macro string
|
|
95 extern strcpy_block_print
|
|
96 call strcpy_block_print ; copy text to buffer and print whole buffer
|
|
97 DB string, 0 ; inline text with terminator
|
604
|
98 endm
|
0
|
99
|
634
|
100
|
|
101 ;-----------------------------------------------------------------------------
|
|
102 ; Append an embedded Text to the Content of the Buffer and dump the Buffer to Screen
|
0
|
103 ;
|
634
|
104 STRCAT_PRINT macro string
|
|
105 extern strcat_block_print
|
|
106 call strcat_block_print ; append text to buffer and print whole buffer
|
|
107 DB string, 0 ; inline text with terminator
|
604
|
108 endm
|
0
|
109
|
634
|
110
|
|
111 ;-----------------------------------------------------------------------------
|
|
112 ; Functions for direct printing of multi-lingual Texts pointed to by FSR1
|
|
113 ;-----------------------------------------------------------------------------
|
|
114
|
|
115 extern strcpy_text_FSR ; translate and copy text to buffer
|
|
116 extern strcat_text_FSR ; translate and append text to buffer
|
|
117
|
|
118
|
|
119 ;-----------------------------------------------------------------------------
|
|
120 ; Macros to print multi-lingual (translated) Texts
|
|
121 ;-----------------------------------------------------------------------------
|
|
122
|
|
123 ;-----------------------------------------------------------------------------
|
|
124 ; Copy a multi-lingual Text to the Start of the Buffer
|
|
125 ;
|
|
126 STRCPY_TEXT macro txt
|
|
127 extern strcpy_text
|
604
|
128 extern txt
|
634
|
129 call strcpy_text ; translate and copy text to buffer
|
|
130 DB LOW(txt), HIGH(txt)
|
604
|
131 endm
|
0
|
132
|
634
|
133
|
|
134 ;-----------------------------------------------------------------------------
|
|
135 ; Append a multi-lingual Text to the Content of the Buffer
|
|
136 ;
|
|
137 STRCAT_TEXT macro txt
|
|
138 extern strcat_text
|
604
|
139 extern txt
|
634
|
140 call strcat_text ; translate and append text to buffer
|
|
141 DB LOW(txt), HIGH(txt)
|
604
|
142 endm
|
0
|
143
|
634
|
144
|
|
145 ;-----------------------------------------------------------------------------
|
|
146 ; Copy a multi-lingual Text to the Start of the Buffer and dump the Buffer to Screen
|
|
147 ;
|
|
148 STRCPY_TEXT_PRINT macro txt
|
|
149 extern strcpy_text_print
|
|
150 extern txt
|
|
151 call strcpy_text_print ; translate and copy text to buffer, then dump buffer to screen
|
|
152 DB LOW(txt), HIGH(txt)
|
|
153 endm
|
|
154
|
|
155
|
|
156 ;-----------------------------------------------------------------------------
|
|
157 ; Append a multi-lingual Text to the Content of the Buffer and dump the Buffer to Screen
|
0
|
158 ;
|
634
|
159 STRCAT_TEXT_PRINT macro txt
|
|
160 extern strcat_text_print
|
|
161 extern txt
|
|
162 call strcat_text_print ; translate and copy text to buffer, then dump buffer to screen
|
|
163 DB LOW(txt), HIGH(txt)
|
|
164 endm
|
|
165
|
|
166
|
|
167 ;-----------------------------------------------------------------------------
|
|
168 ; Macros to set Font Size and Output Position in one Batch
|
|
169 ;-----------------------------------------------------------------------------
|
|
170
|
|
171 WIN_TINY macro x, y
|
604
|
172 extern start_tiny_block
|
|
173 call start_tiny_block
|
|
174 DB x, y
|
|
175 endm
|
0
|
176
|
634
|
177 WIN_SMALL macro x, y
|
604
|
178 extern start_small_block
|
|
179 call start_small_block
|
|
180 DB x, y
|
|
181 endm
|
0
|
182
|
634
|
183 WIN_STD macro x, y
|
604
|
184 extern start_std_block
|
|
185 call start_std_block
|
|
186 DB x, y
|
|
187 endm
|
0
|
188
|
634
|
189 WIN_MEDIUM macro x, y
|
604
|
190 extern start_medium_block
|
|
191 call start_medium_block
|
|
192 DB x, y
|
|
193 endm
|
0
|
194
|
634
|
195 WIN_LARGE macro x, y
|
604
|
196 extern start_large_block
|
|
197 call start_large_block
|
|
198 DB x, y
|
|
199 endm
|
0
|
200
|
634
|
201 WIN_HUGE macro x, y
|
623
|
202 extern start_huge_block
|
|
203 call start_huge_block
|
|
204 DB x, y
|
|
205 endm
|
|
206
|
634
|
207 ;-----------------------------------------------------------------------------
|
0
|
208
|