comparison src/tft_outputs.asm @ 503:4542d03f748a

NEW: Last Dive customviews in surface mode with divetime, depth and interval
author heinrichsweikamp
date Sun, 11 Jun 2017 17:11:40 +0200
parents 8dfb93e80338
children f522210b3743
comparison
equal deleted inserted replaced
502:0910c227018f 503:4542d03f748a
3555 WIN_MEDIUM dm_custom_s_check_ppo2_dil_col, dm_custom_s_check_value_row 3555 WIN_MEDIUM dm_custom_s_check_ppo2_dil_col, dm_custom_s_check_value_row
3556 ; ; hijacking neg_flag_velocity to know where the value is displayed 3556 ; ; hijacking neg_flag_velocity to know where the value is displayed
3557 bsf neg_flag_velocity 3557 bsf neg_flag_velocity
3558 goto TFT_display_ppo2_com; and return... 3558 goto TFT_display_ppo2_com; and return...
3559 3559
3560 global TFT_surface_lastdive
3561 TFT_surface_lastdive:
3562 call TFT_divemask_color
3563 WIN_TINY surf_gaslist_column,surf_gaslist_row+.5
3564 STRCAT_TEXT_PRINT tLastDive ; Last Dive:
3565 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)+.5
3566 STRCAT_TEXT_PRINT tDivetime ; Divetime
3567 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)+.5
3568 STRCAT_TEXT_PRINT tMaxDepth ; Max. Depth
3569 call TFT_standard_color
3570 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row
3571 movff lastdive_time+0,xC+0
3572 movff lastdive_time+1,xC+1
3573 movff lastdive_time+2,xC+2
3574 movff lastdive_time+3,xC+3
3575 movlw LOW .3600
3576 movwf xB+0
3577 movlw HIGH .3600
3578 movwf xB+1 ; One day = 3600s
3579 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
3580 ;xC+0:xC+1 -> Full hours
3581 movff xC+1,xA+1
3582 movff xC+0,xA+0
3583 clrf xB+1
3584 movlw .24
3585 movwf xB+0
3586 call div16x16 ;xA/xB=xC with xA+0 as remainder
3587 movff xC+0,lo
3588 movff xC+1,hi ; Full days
3589 bsf leftbind
3590 output_16
3591 PUTC "d"
3592 movff xA+0,lo ; Full hours
3593 output_8
3594 STRCAT_PRINT "h"
3595 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row+(surf_gaslist_spacing*.1)
3596 movff lastdive_duration+0,lo
3597 movff lastdive_duration+1,hi
3598 output_16 ; divetime minutes
3599 PUTC ":"
3600 movff lastdive_duration+3,lo
3601 output_99x ; divetime seconds
3602 STRCAT_PRINT ""
3603 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row+(surf_gaslist_spacing*.2)
3604 movff lastdive_maxdepth+0,lo
3605 movff lastdive_maxdepth+1,hi
3606 TSTOSS opt_units ; 0=Meters, 1=Feets
3607 bra TFT_surface_lastdive_metric
3608 ;imperial
3609 rcall convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
3610 output_16_3 ; limit to 999 and display only (0-999)
3611 STRCAT_TEXT tFeets1
3612 bra TFT_surface_lastdive2
3613
3614 TFT_surface_lastdive_metric:
3615 bsf ignore_digit5 ; no cm...
3616 movlw d'1' ; +1
3617 movff WREG,ignore_digits ; no 1000m
3618 output_16dp .3 ; xxx.y
3619 STRCAT_TEXT tMeters
3620 TFT_surface_lastdive2:
3621 STRCAT_PRINT ""
3622 bcf leftbind
3623 return ; Done.
3560 3624
3561 global TFT_surface_tissues 3625 global TFT_surface_tissues
3562 TFT_surface_tissues: ; Show Tissue diagram in surface mode 3626 TFT_surface_tissues: ; Show Tissue diagram in surface mode
3563 WIN_SMALL surf_tissue_N2_column,surf_tissue_N2_row 3627 WIN_SMALL surf_tissue_N2_column,surf_tissue_N2_row
3564 STRCPY_TEXT_PRINT tN2 3628 STRCPY_TEXT_PRINT tN2
3800 banksel common 3864 banksel common
3801 movlw dm_warning_length ; Divemode string length 3865 movlw dm_warning_length ; Divemode string length
3802 ; neg_flag_velocity is hijacked, used to toggle the fillup lenght. 3866 ; neg_flag_velocity is hijacked, used to toggle the fillup lenght.
3803 btfsc neg_flag_velocity 3867 btfsc neg_flag_velocity
3804 movlw .4 3868 movlw .4
3805 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) 3869 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
3806 STRCAT_PRINT "" 3870 STRCAT_PRINT ""
3807 bcf win_invert 3871 bcf win_invert
3808 goto TFT_standard_color; and return... 3872 goto TFT_standard_color; and return...
3809 3873
3810 TFT_show_ppO2_3: 3874 TFT_show_ppO2_3: