Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/menu_logbook.asm @ 123:6a94f96e9cea
The big cleanup, again.
author | JeanDo |
---|---|
date | Thu, 30 Dec 2010 23:45:20 +0100 |
parents | 475a9e536d77 |
children | d721b49b8934 |
comparison
equal
deleted
inserted
replaced
122:3003a8040b78 | 123:6a94f96e9cea |
---|---|
260 bcf logbook_profile_view ; clear flag for search routine | 260 bcf logbook_profile_view ; clear flag for search routine |
261 | 261 |
262 call PLED_display_wait_clear | 262 call PLED_display_wait_clear |
263 WIN_TOP .0 | 263 WIN_TOP .0 |
264 WIN_LEFT .0 | 264 WIN_LEFT .0 |
265 lfsr FSR2,letter | 265 STRCPY "#" |
266 movlw '#' | |
267 movwf POSTINC2 | |
268 | 266 |
269 GETCUSTOM15 .28 ; Logbook Offset -> lo, hi | 267 GETCUSTOM15 .28 ; Logbook Offset -> lo, hi |
270 tstfsz lo ; lo=0? | 268 tstfsz lo ; lo=0? |
271 bra display_profile_offset1 ; No, adjust offset | 269 bra display_profile_offset1 ; No, adjust offset |
272 tstfsz hi ; hi=0? | 270 tstfsz hi ; hi=0? |
292 display_profile_offset2: | 290 display_profile_offset2: |
293 movff divesecs,lo | 291 movff divesecs,lo |
294 output_99x ; # of dive | 292 output_99x ; # of dive |
295 | 293 |
296 display_profile_offset3: | 294 display_profile_offset3: |
297 movlw ' ' | 295 PUTC ' ' |
298 movwf POSTINC2 | |
299 call I2CREAD2 | 296 call I2CREAD2 |
300 movff SSPBUF,lo ; | 297 movff SSPBUF,lo ; |
301 | 298 |
302 call I2CREAD2 ; Skip Profile version | 299 call I2CREAD2 ; Skip Profile version |
303 movff SSPBUF,lo ; read month | 300 movff SSPBUF,lo ; read month |
319 movff SSPBUF,convert_value_temp+1 | 316 movff SSPBUF,convert_value_temp+1 |
320 call I2CREAD2 ; Year | 317 call I2CREAD2 ; Year |
321 movff SSPBUF,convert_value_temp+2 | 318 movff SSPBUF,convert_value_temp+2 |
322 call PLED_convert_date ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2 | 319 call PLED_convert_date ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2 |
323 | 320 |
324 movlw ' ' | 321 PUTC ' ' |
325 movwf POSTINC2 | |
326 call I2CREAD2 ; hour | 322 call I2CREAD2 ; hour |
327 movff SSPBUF,lo | 323 movff SSPBUF,lo |
328 output_99x | 324 output_99x |
329 movlw ':' | 325 PUTC ':' |
330 movwf POSTINC2 | |
331 call I2CREAD2 ; Minute | 326 call I2CREAD2 ; Minute |
332 movff SSPBUF,lo | 327 movff SSPBUF,lo |
333 output_99x | 328 output_99x |
334 call word_processor ; Display 1st row of details | 329 call word_processor ; Display 1st row of details |
335 | 330 |
352 movlw d'0' | 347 movlw d'0' |
353 addwfc sim_pressure+1,F | 348 addwfc sim_pressure+1,F |
354 | 349 |
355 bsf leftbind | 350 bsf leftbind |
356 output_16dp d'3' ; max. depth | 351 output_16dp d'3' ; max. depth |
357 movlw 'm' | 352 STRCAT "m " |
358 movwf POSTINC2 | |
359 movlw ' ' | |
360 movwf POSTINC2 | |
361 call I2CREAD2 | 353 call I2CREAD2 |
362 movff SSPBUF,lo | 354 movff SSPBUF,lo |
363 call I2CREAD2 | 355 call I2CREAD2 |
364 movff SSPBUF,hi | 356 movff SSPBUF,hi |
365 | 357 |
370 clrf xB+1 | 362 clrf xB+1 |
371 call mult16x16 ; result is in xC:2 ! | 363 call mult16x16 ; result is in xC:2 ! |
372 | 364 |
373 bsf leftbind | 365 bsf leftbind |
374 output_16 ; divetime minutes | 366 output_16 ; divetime minutes |
375 movlw d'39' | 367 PUTC d'39' |
376 movwf POSTINC2 | |
377 call I2CREAD2 | 368 call I2CREAD2 |
378 movff SSPBUF,lo | 369 movff SSPBUF,lo |
379 movf lo,W ; add seconds to total seconds | 370 movf lo,W ; add seconds to total seconds |
380 addwf xC+0 | 371 addwf xC+0 |
381 movlw d'0' | 372 movlw d'0' |
398 movlw d'0' | 389 movlw d'0' |
399 addwfc profile_temp+1,F | 390 addwfc profile_temp+1,F |
400 | 391 |
401 bsf leftbind | 392 bsf leftbind |
402 output_99x ; divetime seconds | 393 output_99x ; divetime seconds |
403 movlw '"' | 394 STRCAT "\" " |
404 movwf POSTINC2 | |
405 movlw ' ' | |
406 movwf POSTINC2 | |
407 call I2CREAD2 | 395 call I2CREAD2 |
408 movff SSPBUF,lo | 396 movff SSPBUF,lo |
409 call I2CREAD2 | 397 call I2CREAD2 |
410 movff SSPBUF,hi | 398 movff SSPBUF,hi |
411 movlw d'3' | 399 movlw d'3' |
412 movwf ignore_digits | 400 movwf ignore_digits |
413 bsf leftbind | 401 bsf leftbind |
414 output_16dp d'2' ; temperature | 402 output_16dp d'2' ; temperature |
415 movlw '°' | 403 STRCAT_PRINT "°C" ; Display 2nd row of details |
416 movwf POSTINC2 | |
417 movlw 'C' | |
418 movwf POSTINC2 | |
419 call word_processor ; Display 2nd row of details | |
420 | 404 |
421 WIN_TOP .50 | 405 WIN_TOP .50 |
422 WIN_LEFT .05 | 406 WIN_LEFT .05 |
423 lfsr FSR2,letter | 407 lfsr FSR2,letter |
424 | 408 |
426 movff SSPBUF,lo | 410 movff SSPBUF,lo |
427 call I2CREAD2 | 411 call I2CREAD2 |
428 movff SSPBUF,hi | 412 movff SSPBUF,hi |
429 bsf leftbind | 413 bsf leftbind |
430 output_16 ; Air pressure before dive | 414 output_16 ; Air pressure before dive |
431 movlw 'm' | 415 STRCAT "mbar Desat " |
432 movwf POSTINC2 | |
433 movlw 'b' | |
434 movwf POSTINC2 | |
435 movlw 'a' | |
436 movwf POSTINC2 | |
437 movlw 'r' | |
438 movwf POSTINC2 | |
439 movlw ' ' | |
440 movwf POSTINC2 | |
441 | |
442 movlw 'D' | |
443 movwf POSTINC2 | |
444 movlw 'e' | |
445 movwf POSTINC2 | |
446 movlw 's' | |
447 movwf POSTINC2 | |
448 movlw 'a' | |
449 movwf POSTINC2 | |
450 movlw 't' | |
451 movwf POSTINC2 | |
452 movlw ' ' | |
453 movwf POSTINC2 | |
454 | 416 |
455 call I2CREAD2 | 417 call I2CREAD2 |
456 movff SSPBUF,lo | 418 movff SSPBUF,lo |
457 call I2CREAD2 | 419 call I2CREAD2 |
458 movff SSPBUF,hi | 420 movff SSPBUF,hi |
460 bsf leftbind | 422 bsf leftbind |
461 movf lo,W | 423 movf lo,W |
462 movff hi,lo | 424 movff hi,lo |
463 movwf hi ; exchange lo and hi... | 425 movwf hi ; exchange lo and hi... |
464 output_8 ; Hours | 426 output_8 ; Hours |
465 movlw ':' | 427 PUTC ':' |
466 movwf POSTINC2 | |
467 movff hi,lo ; Minutes | 428 movff hi,lo ; Minutes |
468 output_99x | 429 output_99x |
469 bcf leftbind | 430 bcf leftbind |
470 call word_processor ; display 3rd page of details | 431 call word_processor ; display 3rd page of details |
471 | 432 |
515 | 476 |
516 display_profile2d: | 477 display_profile2d: |
517 ; Start Profile display | 478 ; Start Profile display |
518 | 479 |
519 movlw color_deepblue | 480 movlw color_deepblue |
520 movff WREG,box_temp+0 ; Data | 481 WIN_BOX_COLOR .75, .239, .0, .159 |
521 movlw .75 | |
522 movff WREG,box_temp+1 ; row top (0-239) | |
523 movlw .239 | |
524 movff WREG,box_temp+2 ; row bottom (0-239) | |
525 movlw .0 | |
526 movff WREG,box_temp+3 ; column left (0-159) | |
527 movlw .159 | |
528 movff WREG,box_temp+4 ; column right (0-159) | |
529 call PLED_box | |
530 | |
531 | 482 |
532 call I2CREAD2 ; skip 0xFB (Header-end) | 483 call I2CREAD2 ; skip 0xFB (Header-end) |
533 clrf timeout_counter2 ; here: used as counter for depth readings | 484 clrf timeout_counter2 ; here: used as counter for depth readings |
534 call I2CREAD2 ; skip 0xFB (Header-end) | 485 call I2CREAD2 ; skip 0xFB (Header-end) |
535 movlw d'158' | 486 movlw d'158' |
842 movff WREG,win_top | 793 movff WREG,win_top |
843 | 794 |
844 lfsr FSR2,letter | 795 lfsr FSR2,letter |
845 movff divenumber,lo | 796 movff divenumber,lo |
846 output_99x ; # of dive | 797 output_99x ; # of dive |
847 movlw ' ' | 798 PUTC ' ' |
848 movwf POSTINC2 | |
849 call I2CREAD2 | 799 call I2CREAD2 |
850 movff SSPBUF,lo | 800 movff SSPBUF,lo |
851 movlw d'13' | 801 movlw d'13' |
852 cpfsgt lo ; Skip if lo>13 | 802 cpfsgt lo ; Skip if lo>13 |
853 bra display_listdive2 ; use old format | 803 bra display_listdive2 ; use old format |
859 movff lo,convert_value_temp+0 ; Month (in lo, see above) | 809 movff lo,convert_value_temp+0 ; Month (in lo, see above) |
860 call I2CREAD2 ; Day | 810 call I2CREAD2 ; Day |
861 movff SSPBUF,convert_value_temp+1 | 811 movff SSPBUF,convert_value_temp+1 |
862 call I2CREAD2 ; Year | 812 call I2CREAD2 ; Year |
863 movff SSPBUF,convert_value_temp+2 | 813 movff SSPBUF,convert_value_temp+2 |
864 call PLED_convert_date_short ; converts into "DD/MM" or "MM/DD" or "MM/DD" in postinc2 | 814 call PLED_convert_date_short ; converts into "DD/MM" or "MM/DD" or "MM/DD" in s |
865 | 815 |
866 | 816 |
867 call I2CREAD2 ; hours (Skip) | 817 call I2CREAD2 ; hours (Skip) |
868 call I2CREAD2 ; minutes (skip) | 818 call I2CREAD2 ; minutes (skip) |
869 movlw ' ' | 819 PUTC ' ' |
870 movwf POSTINC2 | |
871 call I2CREAD2 ; Depth | 820 call I2CREAD2 ; Depth |
872 movff SSPBUF,lo | 821 movff SSPBUF,lo |
873 call I2CREAD2 | 822 call I2CREAD2 |
874 movff SSPBUF,hi | 823 movff SSPBUF,hi |
875 bsf leftbind | 824 bsf leftbind |
876 bsf ignore_digit5 ; Do not display 1cm figure | 825 bsf ignore_digit5 ; Do not display 1cm figure |
877 output_16dp d'3' ; max. depth | 826 output_16dp d'3' ; max. depth |
878 movlw 'm' | 827 STRCAT "m " |
879 movwf POSTINC2 | |
880 movlw ' ' | |
881 movwf POSTINC2 | |
882 call I2CREAD2 | 828 call I2CREAD2 |
883 movff SSPBUF,lo | 829 movff SSPBUF,lo |
884 call I2CREAD2 | 830 call I2CREAD2 |
885 movff SSPBUF,hi | 831 movff SSPBUF,hi |
886 bsf leftbind | 832 bsf leftbind |
887 output_16 ; Divetime minutes | 833 output_16 ; Divetime minutes |
888 movlw d'39' ; "'" | 834 STRCAT_PRINT "'" ; Display header-row in list |
889 movwf POSTINC2 | |
890 | |
891 call word_processor ; Display header-row in list | |
892 return | 835 return |
893 | 836 |
894 | 837 |
895 ;profileview_menu: | 838 ;profileview_menu: |
896 ; movlw d'1' | 839 ; movlw d'1' |