0
|
1 ;=============================================================================
|
|
2 ;
|
623
|
3 ; File strings.asm combined next generation V3.03.2
|
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
|
|
13 ;=============================================================================
|
604
|
14 ; Copy a short embedded string to the start of the string buffer
|
|
15 ; Input : string after macro name
|
|
16 ; Output : chars are copied to the start of the string buffer
|
|
17 ; FSR2 points to the first unused char containing the NULL termination
|
|
18 ; Trashed: WREG, TBLPTR, TABLAT, PRODL
|
|
19 ; Note : uses bank-safe calls only
|
0
|
20 ;
|
604
|
21 extern strcpy_block
|
|
22 STRCPY macro string
|
|
23 call strcpy_block
|
|
24 DB string, 0
|
|
25 endm
|
0
|
26
|
|
27 ;=============================================================================
|
604
|
28 ; A variant of STRCPY that appends chars in the string buffer at the current
|
|
29 ; FSR2 pointer position
|
|
30 ; Input/Output/Trashed: see STRCPY
|
|
31 ;
|
|
32 extern strcat_block
|
|
33 STRCAT macro string
|
|
34 call strcat_block
|
|
35 DB string, 0
|
|
36 endm
|
0
|
37
|
|
38 ;=============================================================================
|
|
39 ; A variant of STRCAT when there is just on char to output
|
604
|
40 ; Input/Output/Trashed: see STRCPY
|
|
41 ;
|
|
42 PUTC macro char
|
|
43 movlw char
|
|
44 movwf POSTINC2
|
|
45 endm
|
0
|
46
|
|
47 ;=============================================================================
|
604
|
48 ; A variant of STRCPY that sends the string to the word processor afterwards
|
|
49 ; Input/Output: see STRCPY
|
|
50 ; Trashed : see STRCPY + word_processor. In particular, switches RAM to Bank1
|
0
|
51 ;
|
604
|
52 extern strcpy_block_print
|
|
53 STRCPY_PRINT macro string
|
|
54 call strcpy_block_print
|
|
55 DB string, 0
|
|
56 endm
|
0
|
57
|
604
|
58 ;=============================================================================
|
|
59 ; A variant of STRCAT that sends the string to the word processor afterwards
|
|
60 ; Input/Output: see STRCAT
|
|
61 ; Trashed : see STRCPY + word_processor. In particular, switches RAM to Bank1
|
|
62 ;
|
|
63 extern strcat_block_print
|
|
64 STRCAT_PRINT macro string
|
|
65 call strcat_block_print
|
|
66 DB string, 0
|
|
67 endm
|
0
|
68
|
|
69 ;=============================================================================
|
|
70 ; Subroutines to operate on strings from PROM code
|
|
71 ;
|
604
|
72 ; Input : TBLPTR : string pointer into PROM
|
|
73 ; Trashed: FSR1
|
|
74 ; Output : string in buffer, FSR2 pointer on the closing null byte
|
0
|
75
|
604
|
76 extern strcpy_prom, strcat_prom
|
|
77 extern strcpy_prom_print, strcat_prom_print
|
0
|
78
|
|
79 ;=============================================================================
|
|
80 ; Subroutines and macros to operate on multilingual text
|
|
81 ;
|
604
|
82 extern strcpy_text
|
|
83 STRCPY_TEXT macro txt
|
|
84 extern txt
|
|
85 lfsr FSR1, txt
|
|
86 call strcpy_text
|
|
87 endm
|
0
|
88
|
604
|
89 extern strcpy_text_print
|
|
90 STRCPY_TEXT_PRINT macro txt
|
|
91 extern txt
|
|
92 lfsr FSR1, txt
|
|
93 call strcpy_text_print
|
|
94 endm
|
0
|
95
|
604
|
96 extern strcat_text
|
|
97 STRCAT_TEXT macro txt
|
|
98 extern txt
|
|
99 lfsr FSR1, txt
|
|
100 call strcat_text
|
|
101 endm
|
0
|
102
|
604
|
103 extern strcat_text_print
|
|
104 STRCAT_TEXT_PRINT macro txt
|
|
105 extern txt
|
|
106 lfsr FSR1, txt
|
|
107 call strcat_text_print
|
|
108 endm
|
0
|
109
|
|
110 ;=============================================================================
|
604
|
111 ; A shortcut for the macros WIN_TOP + WIN_LEFT + WIN_FONT
|
|
112 ; The idea is to replace a 4x6=24 bytes sequence by a more compact 6 bytes one.
|
0
|
113 ;
|
|
114 ; Trashed: TBLPTR, TABLAT, WREG.
|
604
|
115 ; Note : uses bank-safe calls only
|
|
116 ;
|
|
117 extern start_tiny_block
|
0
|
118 WIN_TINY macro x, y
|
604
|
119 call start_tiny_block
|
|
120 DB x, y
|
|
121 endm
|
0
|
122
|
604
|
123 extern start_small_block
|
0
|
124 WIN_SMALL macro x, y
|
604
|
125 call start_small_block
|
|
126 DB x, y
|
|
127 endm
|
0
|
128
|
604
|
129 extern start_std_block
|
0
|
130 WIN_STD macro x, y
|
604
|
131 call start_std_block
|
|
132 DB x, y
|
|
133 endm
|
0
|
134
|
604
|
135 extern start_medium_block
|
|
136 WIN_MEDIUM macro x, y
|
|
137 call start_medium_block
|
|
138 DB x, y
|
|
139 endm
|
0
|
140
|
604
|
141 extern start_large_block
|
|
142 WIN_LARGE macro x, y
|
|
143 call start_large_block
|
|
144 DB x, y
|
|
145 endm
|
0
|
146
|
623
|
147 IFDEF _huge_font
|
|
148 extern start_huge_block
|
|
149 WIN_HUGE macro x, y
|
|
150 call start_huge_block
|
|
151 DB x, y
|
|
152 endm
|
|
153 ENDIF
|
|
154
|
0
|
155 ;=============================================================================
|
604
|
156 ; Shortcuts for compact display programmings
|
|
157 ;
|
|
158 TEXT_TINY macro x, y, txt
|
|
159 WIN_TINY x,y
|
|
160 STRCPY_TEXT_PRINT txt
|
|
161 endm
|
0
|
162
|
604
|
163 TEXT_SMALL macro x, y, txt
|
|
164 WIN_SMALL x,y
|
|
165 STRCPY_TEXT_PRINT txt
|
|
166 endm
|
0
|
167
|
604
|
168 TEXT_SMALL_INVERT macro x, y, txt
|
|
169 WIN_SMALL_INVERT x,y
|
|
170 STRCPY_TEXT_PRINT txt
|
|
171 endm
|
0
|
172
|
623
|
173 TEXT_STD macro x, y, txt
|
|
174 WIN_STD x,y
|
|
175 STRCPY_TEXT_PRINT txt
|
|
176 endm
|
|
177
|
604
|
178 TEXT_MEDIUM macro x, y, txt
|
|
179 WIN_MEDIUM x,y
|
|
180 STRCPY_TEXT_PRINT txt
|
|
181 endm
|
0
|
182
|
604
|
183 TEXT_LARGE macro x, y, txt
|
|
184 WIN_LARGE x,y
|
|
185 STRCPY_TEXT_PRINT txt
|
|
186 endm
|
0
|
187
|
623
|
188 TEXT_HUGE macro x, y, txt
|
|
189 WIN_HUGE x,y
|
|
190 STRCPY_TEXT_PRINT txt
|
|
191 endm
|
|
192
|
|
193
|
604
|
194 STRING_TINY macro x, y, string
|
|
195 WIN_SMALL x,y
|
|
196 STRCPY_PRINT string
|
|
197 endm
|
0
|
198
|
604
|
199 STRING_SMALL macro x, y, string
|
|
200 WIN_SMALL x,y
|
|
201 STRCPY_PRINT string
|
|
202 endm
|
0
|
203
|
604
|
204 STRING_MEDIUM macro x, y, string
|
|
205 WIN_MEDIUM x,y
|
|
206 STRCPY_PRINT string
|
|
207 endm
|
0
|
208
|
604
|
209 STRING_LARGE macro x, y, string
|
|
210 WIN_LARGE x,y
|
|
211 STRCPY_PRINT string
|
|
212 endm
|
623
|
213
|
|
214 STRING_HUGE macro x, y, string
|
|
215 WIN_HUGE x,y
|
|
216 STRCPY_PRINT string
|
|
217 endm
|