Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 274:a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
author | heinrichsweikamp |
---|---|
date | Sun, 17 Apr 2011 17:57:44 +0200 |
parents | d8dfbc7041b0 |
children | 46d1012d096a |
comparison
equal
deleted
inserted
replaced
273:35bbab4d3c6f | 274:a728b4a1b660 |
---|---|
3038 bcf leftbind | 3038 bcf leftbind |
3039 call word_processor | 3039 call word_processor |
3040 call PLED_standard_color | 3040 call PLED_standard_color |
3041 return | 3041 return |
3042 | 3042 |
3043 PLED_show_end_ead_divemode: | |
3044 WIN_LEFT .95 | |
3045 WIN_TOP .192 | |
3046 WIN_FONT FT_SMALL | |
3047 call PLED_divemask_color ; Set Color for Divemode mask | |
3048 lfsr FSR2,letter | |
3049 STRCAT_PRINT "EAD:" | |
3050 WIN_LEFT .95 | |
3051 WIN_TOP .216 | |
3052 lfsr FSR2,letter | |
3053 STRCAT_PRINT "END:" | |
3054 ; Show EAD: char_I_N2_ratio/0.79*rel_pressure:2*10 -> char_I_N2_ratio*rel_pressure:2/7900 -> EAD in m | |
3055 call PLED_standard_color | |
3056 WIN_LEFT .125 | |
3057 WIN_TOP .192 | |
3058 movff char_I_N2_ratio,xA+0 | |
3059 clrf xA+1 | |
3060 movff rel_pressure+0,xB+0 | |
3061 movff rel_pressure+1,xB+1 | |
3062 call mult16x16 ; xA*xB=xC | |
3063 movlw LOW d'7900' | |
3064 movwf xB+0 | |
3065 movlw HIGH d'7900' | |
3066 movwf xB+1 | |
3067 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder | |
3068 movff xC+0,lo | |
3069 movff xC+1,hi ; lo:hi now hold EAD in m | |
3070 lfsr FSR2,letter | |
3071 output_16_3 ; Display only full meters | |
3072 STRCAT_PRINT "m" ; Display EAD | |
3073 | |
3074 WIN_LEFT .125 | |
3075 WIN_TOP .216 | |
3076 ; Show END = rel_pressure × (100 - char_I_He_ratio)/10000 -> Result in m | |
3077 movff char_I_He_ratio,lo ; temp | |
3078 movlw d'100' | |
3079 bsf STATUS,C | |
3080 subfwb lo,W | |
3081 movwf xA+0 | |
3082 clrf xA+1 | |
3083 movff rel_pressure+0,xB+0 | |
3084 movff rel_pressure+1,xB+1 | |
3085 call mult16x16 ; xA*xB=xC | |
3086 movlw LOW d'10000' | |
3087 movwf xB+0 | |
3088 movlw HIGH d'10000' | |
3089 movwf xB+1 | |
3090 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder | |
3091 movff xC+0,lo | |
3092 movff xC+1,hi ; lo:hi now hold END in m | |
3093 lfsr FSR2,letter | |
3094 output_16_3 | |
3095 STRCAT_PRINT "m" ; Display END | |
3096 return | |
3097 | |
3098 | |
3043 PLED_show_leading_tissue: | 3099 PLED_show_leading_tissue: |
3044 call PLED_divemask_color ; Set Color for Divemode mask | 3100 call PLED_divemask_color ; Set Color for Divemode mask |
3045 DISPLAYTEXTH .282 ; L. Tissue: | 3101 DISPLAYTEXTH .282 ; L. Tissue: |
3046 PLED_show_leading_tissue_2: | 3102 PLED_show_leading_tissue_2: |
3047 call deco_calc_desaturation_time ; calculate desaturation time | 3103 call deco_calc_desaturation_time ; calculate desaturation time |