0
|
1 ;=============================================================================
|
|
2 ;
|
628
|
3 ; File strings.asm combined next generation V3.03.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
|
|
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 extern start_huge_block
|
|
148 WIN_HUGE macro x, y
|
|
149 call start_huge_block
|
|
150 DB x, y
|
|
151 endm
|
|
152
|
0
|
153 ;=============================================================================
|
604
|
154 ; Shortcuts for compact display programmings
|
|
155 ;
|
|
156 TEXT_TINY macro x, y, txt
|
|
157 WIN_TINY x,y
|
|
158 STRCPY_TEXT_PRINT txt
|
|
159 endm
|
0
|
160
|
604
|
161 TEXT_SMALL macro x, y, txt
|
|
162 WIN_SMALL x,y
|
|
163 STRCPY_TEXT_PRINT txt
|
|
164 endm
|
0
|
165
|
604
|
166 TEXT_SMALL_INVERT macro x, y, txt
|
|
167 WIN_SMALL_INVERT x,y
|
|
168 STRCPY_TEXT_PRINT txt
|
|
169 endm
|
0
|
170
|
623
|
171 TEXT_STD macro x, y, txt
|
|
172 WIN_STD x,y
|
|
173 STRCPY_TEXT_PRINT txt
|
|
174 endm
|
|
175
|
604
|
176 TEXT_MEDIUM macro x, y, txt
|
|
177 WIN_MEDIUM x,y
|
|
178 STRCPY_TEXT_PRINT txt
|
|
179 endm
|
0
|
180
|
604
|
181 TEXT_LARGE macro x, y, txt
|
|
182 WIN_LARGE x,y
|
|
183 STRCPY_TEXT_PRINT txt
|
|
184 endm
|
0
|
185
|
623
|
186 TEXT_HUGE macro x, y, txt
|
|
187 WIN_HUGE x,y
|
|
188 STRCPY_TEXT_PRINT txt
|
|
189 endm
|
|
190
|
|
191
|
604
|
192 STRING_TINY macro x, y, string
|
|
193 WIN_SMALL x,y
|
|
194 STRCPY_PRINT string
|
|
195 endm
|
0
|
196
|
604
|
197 STRING_SMALL macro x, y, string
|
|
198 WIN_SMALL x,y
|
|
199 STRCPY_PRINT string
|
|
200 endm
|
0
|
201
|
604
|
202 STRING_MEDIUM macro x, y, string
|
|
203 WIN_MEDIUM x,y
|
|
204 STRCPY_PRINT string
|
|
205 endm
|
0
|
206
|
604
|
207 STRING_LARGE macro x, y, string
|
|
208 WIN_LARGE x,y
|
|
209 STRCPY_PRINT string
|
|
210 endm
|
623
|
211
|
|
212 STRING_HUGE macro x, y, string
|
|
213 WIN_HUGE x,y
|
|
214 STRCPY_PRINT string
|
|
215 endm
|