Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/altimeter.asm @ 174:53b16a746166
Multi-lang
+ Move texts to single compact table.
+ Place at address 0x15000, reserved up to 0x17AFF (10kB)
+ Generate the english_test.asm reference (4kB)
+ Move altimeter texts into the table.
author | JeanDo |
---|---|
date | Thu, 03 Feb 2011 04:09:21 +0100 |
parents | 0f7ca37b1412 |
children | f5e9db793dd3 |
comparison
equal
deleted
inserted
replaced
173:4a7a778d9e49 | 174:53b16a746166 |
---|---|
225 altimeter_menu_1: | 225 altimeter_menu_1: |
226 call PLED_ClearScreen ; Menu header. | 226 call PLED_ClearScreen ; Menu header. |
227 call PLED_standard_color | 227 call PLED_standard_color |
228 call PLED_topline_box | 228 call PLED_topline_box |
229 WIN_INVERT .1 ; Init new Wordprocessor | 229 WIN_INVERT .1 ; Init new Wordprocessor |
230 WIN_FONT .0 | 230 DISPLAYTEXTH .288 ; Title bar |
231 WIN_LEFT .80-7*7 | |
232 WIN_TOP .1 | |
233 STRCPY_PRINT "Set Altimeter:" | |
234 | 231 |
235 movlw 2 ; Start menu on line 2. | 232 movlw 2 ; Start menu on line 2. |
236 movwf menupos | 233 movwf menupos |
237 | 234 |
238 altimeter_menu_2: | 235 altimeter_menu_2: |
239 WIN_FONT .0 ; Reset, because compute erase that... | 236 WIN_INVERT 0 |
240 WIN_INVERT .0 | 237 WIN_FONT 0 |
241 WIN_LEFT .20 ; First line: | 238 WIN_LEFT .20 ; First line: |
242 WIN_TOP .35 | 239 WIN_TOP .35 |
243 STRCPY "Sea ref: " | 240 lfsr FSR2,letter |
241 OUTPUTTEXTH .289 ; Sea ref: | |
244 | 242 |
245 movff pressureRef+0, lo | 243 movff pressureRef+0, lo |
246 movff pressureRef+1, hi | 244 movff pressureRef+1, hi |
247 bcf STATUS,C ; Divide ref pressure by 4 | 245 bcf STATUS,C ; Divide ref pressure by 4 |
248 rrcf hi ; to get the integer part of it: | 246 rrcf hi ; to get the integer part of it: |
251 rrcf hi | 249 rrcf hi |
252 rrcf lo | 250 rrcf lo |
253 bsf leftbind | 251 bsf leftbind |
254 output_16 | 252 output_16 |
255 | 253 |
256 ; PUTC '.' | |
257 ; movff pressureRef+0, hi ; Decimal part is constructed | |
258 ; clrf WREG ; from the 2 lower bits. | |
259 ; btfsc hi,0 | |
260 ; addlw .25 | |
261 ; btfsc hi,1 | |
262 ; addlw .50 | |
263 ; movwf lo | |
264 ; output_99x | |
265 | |
266 STRCAT_PRINT " mbar " | 254 STRCAT_PRINT " mbar " |
267 | 255 |
268 WIN_TOP .65 ; Action enable | 256 WIN_TOP .65 ; Action enable |
269 STRCPY "Enabled: " | 257 lfsr FSR2, letter |
258 OUTPUTTEXTH .290 | |
270 GETCUSTOM8 .49 | 259 GETCUSTOM8 .49 |
271 btfss WREG,0 | 260 btfss WREG,0 |
272 bra alt_menu_1 | 261 bra alt_menu_1 |
273 STRCAT_PRINT "ON " | 262 STRCAT_PRINT "ON " |
274 bra alt_menu_2 | 263 bra alt_menu_2 |
275 alt_menu_1: | 264 alt_menu_1: |
276 STRCAT_PRINT "OFF" | 265 STRCAT_PRINT "OFF" |
277 alt_menu_2: | 266 alt_menu_2: |
278 | 267 |
279 WIN_TOP .95 ; Action reset | 268 DISPLAYTEXTH .291 ; Action reset |
280 STRCPY_PRINT "Default: 1013 mbar" | 269 DISPLAYTEXTH .292 ; Action add |
281 WIN_TOP .125 ; Action add | 270 DISPLAYTEXTH .293 ; Action sub |
282 STRCPY_PRINT "+1 mbar" | 271 DISPLAYTEXT .011 ; Action exit |
283 WIN_TOP .155 ; Action sub | 272 |
284 STRCPY_PRINT "-1 mbar" | 273 WIN_LEFT .85 ; Bottom right. |
285 WIN_TOP .185 ; Action exit | 274 lfsr FSR2, letter |
286 STRCPY_PRINT "Exit" | 275 OUTPUTTEXTH .294 ; "Alt: " |
287 | 276 |
288 WIN_LEFT .85 ; Bottom right. | |
289 STRCPY "Alt: " | |
290 movff altitude+0, lo | 277 movff altitude+0, lo |
291 movff altitude+1, hi | 278 movff altitude+1, hi |
292 btfss hi,7 ; Is altitude negativ ? | 279 btfss hi,7 ; Is altitude negativ ? |
293 bra altimeter_menu_3 ; No: just print it | 280 bra altimeter_menu_3 ; No: just print it |
294 | 281 |