Mercurial > public > hwos_code
comparison src/strings.asm @ 560:b7eb98dbd800
bump to 2.96beta (REFACTORED VERSION)
author | heinrichsweikamp |
---|---|
date | Wed, 31 Jan 2018 19:39:37 +0100 |
parents | aadfe9f2edaf |
children | ca4556fb60b9 |
comparison
equal
deleted
inserted
replaced
559:9cb967d844f0 | 560:b7eb98dbd800 |
---|---|
1 ;============================================================================= | 1 ;============================================================================= |
2 ; | 2 ; |
3 ; File strings.asm | 3 ; File strings.asm Version 2.92 = 2.26 |
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 ;============================================================================= |
99 ; Output: TBLPTR = 24bits of PROM address. | 99 ; Output: TBLPTR = 24bits of PROM address. |
100 ; | 100 ; |
101 global text_get_tblptr | 101 global text_get_tblptr |
102 text_get_tblptr: | 102 text_get_tblptr: |
103 extern text_1_base | 103 extern text_1_base |
104 movlw UPPER(text_1_base); Complete 12bits to 24bits address. | 104 movlw UPPER(text_1_base) ; Complete 12bits to 24bits address. |
105 movwf TBLPTRU | 105 movwf TBLPTRU |
106 movlw HIGH(text_1_base) | 106 movlw HIGH(text_1_base) |
107 andlw 0xF0 | 107 andlw 0xF0 |
108 iorwf FSR1H,W | 108 iorwf FSR1H,W |
109 movwf TBLPTRH | 109 movwf TBLPTRH |
110 movff FSR1L,TBLPTRL | 110 movff FSR1L,TBLPTRL |
111 | 111 |
112 movff opt_language,WREG ; Get lang | 112 |
113 bz text_get_lang1 ; 0 == English | 113 movff opt_language,WREG ; Get lang |
114 dcfsnz WREG ; 1 == German | 114 bz text_get_lang1 ; 0 == English |
115 bra text_get_lang2 | 115 dcfsnz WREG ; 1 == German |
116 bra text_get_lang2 | |
116 ; Other ??? Keep language 1 | 117 ; Other ??? Keep language 1 |
117 | 118 |
118 ; Read 2-byte pointer to string | 119 ; Read 2-byte pointer to string |
119 text_get_lang1: | 120 text_get_lang1: |
120 tblrd*+ | 121 tblrd*+ |
124 movff TABLAT,TBLPTRH | 125 movff TABLAT,TBLPTRH |
125 return | 126 return |
126 | 127 |
127 ; Add correction for German table: | 128 ; Add correction for German table: |
128 text_get_lang2: | 129 text_get_lang2: |
129 extern text_2_base | 130 extern text_2_base |
130 movlw LOW(text_2_base) | 131 movlw LOW(text_2_base) |
131 addwf TBLPTRL | 132 addwf TBLPTRL |
132 movlw HIGH(text_2_base) | 133 movlw HIGH(text_2_base) |
133 addwfc TBLPTRH | 134 addwfc TBLPTRH |
134 movlw UPPER(text_2_base) | 135 movlw UPPER(text_2_base) |
135 addwfc TBLPTRU | 136 addwfc TBLPTRU |
136 | 137 |
137 movlw LOW(text_1_base) | 138 movlw LOW(text_1_base) |
138 subwf TBLPTRL | 139 subwf TBLPTRL |
139 movlw HIGH(text_1_base) | 140 movlw HIGH(text_1_base) |
140 subwfb TBLPTRH | 141 subwfb TBLPTRH |
141 movlw UPPER(text_1_base) | 142 movlw UPPER(text_1_base) |
142 subwfb TBLPTRU | 143 subwfb TBLPTRU |
143 bra text_get_lang1 | 144 bra text_get_lang1 |
144 | 145 |
145 ;============================================================================= | 146 ;============================================================================= |
146 ; Copy a null-terminated string from TBLPTR to buffer. | 147 ; Copy a null-terminated string from TBLPTR to buffer. |
147 ; | 148 ; |
148 ; Input: TBLPTR : string pointer into PROM. | 149 ; Input: TBLPTR : string pointer into PROM. |
181 ;============================================================================= | 182 ;============================================================================= |
182 | 183 |
183 global start_tiny_block | 184 global start_tiny_block |
184 start_tiny_block: | 185 start_tiny_block: |
185 clrf WREG | 186 clrf WREG |
186 movff WREG, win_font ; Need a bank-safe move here ! | |
187 bra start_common | 187 bra start_common |
188 | 188 |
189 global start_small_block | 189 global start_small_block |
190 start_small_block: | 190 start_small_block: |
191 movlw 1 | 191 movlw 1 |
192 movff WREG, win_font ; Need a bank-safe move here ! | |
193 bra start_common | 192 bra start_common |
194 | 193 |
195 global start_std_block | 194 global start_std_block |
196 start_std_block: | 195 start_std_block: |
197 movlw 2 | 196 movlw 2 |
198 movff WREG, win_font ; Need a bank-safe move here ! | |
199 bra start_common | 197 bra start_common |
200 | 198 |
201 global start_medium_block | 199 global start_medium_block |
202 start_medium_block: | 200 start_medium_block: |
203 movlw 3 | 201 movlw 3 |
204 movff WREG, win_font ; Need a bank-safe move here ! | |
205 bra start_common | 202 bra start_common |
206 | 203 |
207 global start_large_block | 204 global start_large_block |
208 start_large_block: | 205 start_large_block: |
209 movlw 4 | 206 movlw 4 |
210 movff WREG, win_font ; Need a bank-safe move here ! | |
211 ; bra start_common | 207 ; bra start_common |
212 start_common: | 208 start_common: |
209 movff WREG, win_font ; Need a bank-safe move here ! | |
213 VARARGS_BEGIN | 210 VARARGS_BEGIN |
214 VARARGS_GET8 win_leftx2 | 211 VARARGS_GET8 win_leftx2 |
215 VARARGS_GET8 win_top | 212 VARARGS_GET8 win_top |
216 VARARGS_END | 213 VARARGS_END |
217 lfsr FSR2,buffer ; point to buffer here | 214 lfsr FSR2,buffer ; point to buffer here |