comparison src/strings.inc @ 604:ca4556fb60b9

bump to 2.99beta, work on 3.00 stable
author heinrichsweikamp
date Thu, 22 Nov 2018 19:47:26 +0100
parents e79bc535ef9e
children c40025d8e750
comparison
equal deleted inserted replaced
603:00b24fb4324d 604:ca4556fb60b9
1 ;============================================================================= 1 ;=============================================================================
2 ; 2 ;
3 ; File strings.asm 3 ; File strings.asm
4 ; 4 ;
5 ; Implementation code various string functions. 5 ; Implementation code various string functions
6 ; 6 ;
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
8 ;============================================================================= 8 ;=============================================================================
9 ; HISTORY 9 ; HISTORY
10 ; 2010-12-02 : [jDG] Creation... 10 ; 2010-12-02 : [jDG] Creation
11 ; 11 ;
12 12
13 ;============================================================================= 13 ;=============================================================================
14 ; Copy a short embebed string at start of the string buffer (letter) 14 ; Copy a short embedded string to the start of the string buffer
15 ; Input: (nothing) 15 ; Input : string after macro name
16 ; Output: chars are copied into letter, starting at the beginning. 16 ; Output : chars are copied to the start of the string buffer
17 ; FSR2 point to the first unused char (the NULL termination). 17 ; FSR2 points to the first unused char containing the NULL termination
18 ; 18 ; Trashed: WREG, TBLPTR, TABLAT, PRODL
19 ; Trashed: WREG, TBLPTR, TABLAT, PRODL 19 ; Note : uses bank-safe calls only
20 ; Note: This are all bank-safe call.
21 ; 20 ;
22 extern strcpy_block 21 extern strcpy_block
23 STRCPY macro string 22 STRCPY macro string
24 call strcpy_block 23 call strcpy_block
25 DB string, 0 24 DB string, 0
26 endm 25 endm
27 26
28 ;============================================================================= 27 ;=============================================================================
29 ; A variant of STRCPY that appends chars to the current FSR2 pointer. 28 ; A variant of STRCPY that appends chars in the string buffer at the current
30 ; Input/Output/Trashed : see STRCPY. 29 ; FSR2 pointer position
31 extern strcat_block 30 ; Input/Output/Trashed: see STRCPY
32 STRCAT macro string 31 ;
33 call strcat_block 32 extern strcat_block
34 DB string, 0 33 STRCAT macro string
35 endm 34 call strcat_block
35 DB string, 0
36 endm
36 37
37 ;============================================================================= 38 ;=============================================================================
38 ; A variant of STRCAT when there is just on char to output 39 ; A variant of STRCAT when there is just on char to output
39 ; Input/Output/Trashed : none. 40 ; Input/Output/Trashed: see STRCPY
40 PUTC macro char 41 ;
41 movlw char 42 PUTC macro char
42 movwf POSTINC2 43 movlw char
43 endm 44 movwf POSTINC2
45 endm
44 46
45 ;============================================================================= 47 ;=============================================================================
46 ; A variant of STRCPY that send the string to the word processor afterwards. 48 ; A variant of STRCPY that sends the string to the word processor afterwards
47 ; Input/Output: see STRCPY. 49 ; Input/Output: see STRCPY
48 ; Trashed: See STRCPY + word_processor. In particular, switch RAM to Bank1 50 ; Trashed : see STRCPY + word_processor. In particular, switches RAM to Bank1
49 ; 51 ;
50 extern strcpy_block_print 52 extern strcpy_block_print
51 STRCPY_PRINT macro string 53 STRCPY_PRINT macro string
52 call strcpy_block_print 54 call strcpy_block_print
53 DB string, 0 55 DB string, 0
54 endm 56 endm
55 57
56 ; Trashed: See STRCPY + word_processor. In particular, switch RAM to Bank1 58 ;=============================================================================
57 extern strcat_block_print 59 ; A variant of STRCAT that sends the string to the word processor afterwards
58 STRCAT_PRINT macro string 60 ; Input/Output: see STRCAT
59 call strcat_block_print 61 ; Trashed : see STRCPY + word_processor. In particular, switches RAM to Bank1
60 DB string, 0 62 ;
61 endm 63 extern strcat_block_print
64 STRCAT_PRINT macro string
65 call strcat_block_print
66 DB string, 0
67 endm
62 68
63 ;============================================================================= 69 ;=============================================================================
64 ; Subroutines to operate on strings from PROM code 70 ; Subroutines to operate on strings from PROM code
65 ; 71 ;
66 ; Input: TBLPTR : string pointer into PROM. 72 ; Input : TBLPTR : string pointer into PROM
67 ; Output: string in buffer, FSR2 pointer on the closing null byte. 73 ; Trashed: FSR1
74 ; Output : string in buffer, FSR2 pointer on the closing null byte
68 75
69 extern strcpy_prom, strcat_prom 76 extern strcpy_prom, strcat_prom
70 extern strcpy_prom_print, strcat_prom_print 77 extern strcpy_prom_print, strcat_prom_print
71 78
72 ;============================================================================= 79 ;=============================================================================
73 ; Subroutines and macros to operate on multilingual text 80 ; Subroutines and macros to operate on multilingual text
74 ; 81 ;
75 extern strcpy_text 82 extern strcpy_text
76 STRCPY_TEXT macro txt 83 STRCPY_TEXT macro txt
77 extern txt 84 extern txt
78 lfsr FSR1, txt 85 lfsr FSR1, txt
79 call strcpy_text 86 call strcpy_text
80 endm 87 endm
81 88
82 extern strcpy_text_print 89 extern strcpy_text_print
83 STRCPY_TEXT_PRINT macro txt 90 STRCPY_TEXT_PRINT macro txt
84 extern txt 91 extern txt
85 lfsr FSR1, txt 92 lfsr FSR1, txt
86 call strcpy_text_print 93 call strcpy_text_print
87 endm 94 endm
88 95
89 extern strcat_text 96 extern strcat_text
90 STRCAT_TEXT macro txt 97 STRCAT_TEXT macro txt
91 extern txt 98 extern txt
92 lfsr FSR1, txt 99 lfsr FSR1, txt
93 call strcat_text 100 call strcat_text
94 endm 101 endm
95 102
96 extern strcat_text_print 103 extern strcat_text_print
97 STRCAT_TEXT_PRINT macro txt 104 STRCAT_TEXT_PRINT macro txt
98 extern txt 105 extern txt
99 lfsr FSR1, txt 106 lfsr FSR1, txt
100 call strcat_text_print 107 call strcat_text_print
101 endm 108 endm
102 109
103 ;============================================================================= 110 ;=============================================================================
104 ; A shortcut for the macros WIN_TOP + WIN_LEFT + WIN_FONT. 111 ; A shortcut for the macros WIN_TOP + WIN_LEFT + WIN_FONT
105 ; The idea is to replace a 4x6=24 bytes sequence by a more compact 6bytes one. 112 ; The idea is to replace a 4x6=24 bytes sequence by a more compact 6 bytes one.
106 ; 113 ;
107 ; Trashed: TBLPTR, TABLAT, WREG. 114 ; Trashed: TBLPTR, TABLAT, WREG.
108 ; Note: This are all bank-safe call. 115 ; Note : uses bank-safe calls only
109 extern start_tiny_block 116 ;
117 extern start_tiny_block
110 WIN_TINY macro x, y 118 WIN_TINY macro x, y
111 call start_tiny_block 119 call start_tiny_block
112 DB x, y 120 DB x, y
113 endm 121 endm
114 122
115 extern start_small_block 123 extern start_small_block
116 WIN_SMALL macro x, y 124 WIN_SMALL macro x, y
117 call start_small_block 125 call start_small_block
118 DB x, y 126 DB x, y
119 endm 127 endm
120 128
121 extern start_std_block 129 extern start_std_block
122 WIN_STD macro x, y 130 WIN_STD macro x, y
123 call start_std_block 131 call start_std_block
124 DB x, y 132 DB x, y
125 endm 133 endm
126 134
127 extern start_medium_block 135 extern start_medium_block
128 WIN_MEDIUM macro x, y 136 WIN_MEDIUM macro x, y
129 call start_medium_block 137 call start_medium_block
130 DB x, y 138 DB x, y
131 endm 139 endm
132 140
133 extern start_large_block 141 extern start_large_block
134 WIN_LARGE macro x, y 142 WIN_LARGE macro x, y
135 call start_large_block 143 call start_large_block
136 DB x, y 144 DB x, y
137 endm 145 endm
138 146
139 ;============================================================================= 147 ;=============================================================================
140 ; Shortcuts for compact display programmings. 148 ; Shortcuts for compact display programmings
141 TEXT_TINY macro x, y, txt 149 ;
142 WIN_TINY x,y 150 TEXT_TINY macro x, y, txt
143 STRCPY_TEXT_PRINT txt 151 WIN_TINY x,y
144 endm 152 STRCPY_TEXT_PRINT txt
153 endm
145 154
146 TEXT_SMALL macro x, y, txt 155 TEXT_SMALL macro x, y, txt
147 WIN_SMALL x,y 156 WIN_SMALL x,y
148 STRCPY_TEXT_PRINT txt 157 STRCPY_TEXT_PRINT txt
149 endm 158 endm
150 159
151 TEXT_SMALL_INVERT macro x, y, txt 160 TEXT_SMALL_INVERT macro x, y, txt
152 WIN_SMALL_INVERT x,y 161 WIN_SMALL_INVERT x,y
153 STRCPY_TEXT_PRINT txt 162 STRCPY_TEXT_PRINT txt
154 endm 163 endm
155 164
156 TEXT_MEDIUM macro x, y, txt 165 TEXT_MEDIUM macro x, y, txt
157 WIN_MEDIUM x,y 166 WIN_MEDIUM x,y
158 STRCPY_TEXT_PRINT txt 167 STRCPY_TEXT_PRINT txt
159 endm 168 endm
160 169
161 TEXT_LARGE macro x, y, txt 170 TEXT_LARGE macro x, y, txt
162 WIN_LARGE x,y 171 WIN_LARGE x,y
163 STRCPY_TEXT_PRINT txt 172 STRCPY_TEXT_PRINT txt
164 endm 173 endm
165 174
166 STRING_TINY macro x, y, string 175 STRING_TINY macro x, y, string
167 WIN_SMALL x,y 176 WIN_SMALL x,y
168 STRCPY_PRINT string 177 STRCPY_PRINT string
169 endm 178 endm
170 179
171 STRING_SMALL macro x, y, string 180 STRING_SMALL macro x, y, string
172 WIN_SMALL x,y 181 WIN_SMALL x,y
173 STRCPY_PRINT string 182 STRCPY_PRINT string
174 endm 183 endm
175 184
176 STRING_MEDIUM macro x, y, string 185 STRING_MEDIUM macro x, y, string
177 WIN_MEDIUM x,y 186 WIN_MEDIUM x,y
178 STRCPY_PRINT string 187 STRCPY_PRINT string
179 endm 188 endm
180 189
181 STRING_LARGE macro x, y, string 190 STRING_LARGE macro x, y, string
182 WIN_LARGE x,y 191 WIN_LARGE x,y
183 STRCPY_PRINT string 192 STRCPY_PRINT string
184 endm 193 endm
185