Mercurial > public > hwos_code
comparison src/tft_outputs.asm @ 507:4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
author | heinrichsweikamp |
---|---|
date | Tue, 27 Jun 2017 13:50:42 +0200 |
parents | f522210b3743 |
children | 2ef8cf6b320d |
comparison
equal
deleted
inserted
replaced
506:b9f06f1a1f74 | 507:4e6f5c36f4cc |
---|---|
157 call subU16 | 157 call subU16 |
158 btfsc neg_flag | 158 btfsc neg_flag |
159 bra TFT_warnings_color ; too low -> Warning Color! | 159 bra TFT_warnings_color ; too low -> Warning Color! |
160 | 160 |
161 ; Check for high ppo2 | 161 ; Check for high ppo2 |
162 movff opt_ppO2_max,WREG ; PPO2 Max for MOD calculation and color coding in divemode | 162 movff gaslist_gas_global,WREG ; Read current gas O2 ratio |
163 lfsr FSR1,opt_gas_type ; 0=Disabled, 1=First, 2=Travel, 3=Deco for OC gases and 0=Disabled, 1=First, 2=Normal for diluents | |
164 movff PLUSW1,xA+0 ; xA+0 used as temp here -> holds type | |
165 | |
166 movff opt_ppO2_max_deco,xB+1 ; xB+1 used as temp here | |
167 movlw .3 | |
168 cpfseq xA+0 ; Deco? | |
169 movff opt_ppO2_max,xB+1 ; No, overwrite with travel/bottom max | |
170 movf xB+1,W ; Result in WREG | |
163 mullw d'100' ; opt_ppO2_max*100 | 171 mullw d'100' ; opt_ppO2_max*100 |
164 movff PRODL,sub_b+0 | 172 movff PRODL,sub_b+0 |
165 movff PRODH,sub_b+1 | 173 movff PRODH,sub_b+1 |
166 call subU16 ; sub_c = sub_a - sub_b | 174 call subU16 ; sub_c = sub_a - sub_b |
167 btfss neg_flag | 175 btfss neg_flag |
238 btfsc xC+1,7 | 246 btfsc xC+1,7 |
239 bra TFT_color_code_depth_warn | 247 bra TFT_color_code_depth_warn |
240 | 248 |
241 movff xC+0,sub_a+0 | 249 movff xC+0,sub_a+0 |
242 movff xC+1,sub_a+1 | 250 movff xC+1,sub_a+1 |
243 movff opt_ppO2_max,WREG ; PPO2 Max for MOD calculation and color coding in divemode | 251 ;active_gas_type -> 0=Disabled, 1=First, 2=Travel, 3=Deco for OC gases and 0=Disabled, 1=First, 2=Normal for diluents |
252 movff active_gas_type,xA+0 ; xA+0 used as temp here -> holds type | |
253 movff opt_ppO2_max_deco,xB+1 ; xB+1 used as temp here | |
254 movlw .3 | |
255 cpfseq xA+0 ; Deco? | |
256 movff opt_ppO2_max,xB+1 ; No, overwrite with travel/bottom max | |
257 movf xB+1,W ; Result in WREG | |
244 mullw d'100' | 258 mullw d'100' |
245 movff PRODL,sub_b+0 | 259 movff PRODL,sub_b+0 |
246 movff PRODH,sub_b+1 | 260 movff PRODH,sub_b+1 |
247 call subU16 ; sub_c = sub_a - sub_b | 261 call subU16 ; sub_c = sub_a - sub_b |
248 btfss neg_flag | 262 btfss neg_flag |
297 btfsc xC+1,7 | 311 btfsc xC+1,7 |
298 bra TFT_warnings_color ; Yes, warn in warning color | 312 bra TFT_warnings_color ; Yes, warn in warning color |
299 | 313 |
300 movff xC+0,sub_a+0 | 314 movff xC+0,sub_a+0 |
301 movff xC+1,sub_a+1 | 315 movff xC+1,sub_a+1 |
302 movff opt_ppO2_max,WREG ; PPO2 Max for MOD calculation and color coding in divemode | 316 |
317 ;active_gas_type -> 0=Disabled, 1=First, 2=Travel, 3=Deco for OC gases and 0=Disabled, 1=First, 2=Normal for diluents | |
318 movff active_gas_type,xA+0 ; xA+0 used as temp here -> holds type | |
319 movff opt_ppO2_max_deco,xB+1 ; xB+1 used as temp here | |
320 movlw .3 | |
321 cpfseq xA+0 ; Deco? | |
322 movff opt_ppO2_max,xB+1 ; No, overwrite with travel/bottom max | |
323 movf xB+1,W ; Result in WREG | |
324 | |
303 mullw d'100' | 325 mullw d'100' |
304 movff PRODL,sub_b+0 | 326 movff PRODL,sub_b+0 |
305 movff PRODH,sub_b+1 | 327 movff PRODH,sub_b+1 |
306 call subU16 ; sub_c = sub_a - sub_b | 328 call subU16 ; sub_c = sub_a - sub_b |
307 btfss neg_flag | 329 btfss neg_flag |
3070 divesets_ppo2_common2: | 3092 divesets_ppo2_common2: |
3071 PUTC "*" | 3093 PUTC "*" |
3072 return ; Done. | 3094 return ; Done. |
3073 | 3095 |
3074 global divesets_ppo2_min | 3096 global divesets_ppo2_min |
3075 extern tPPO2Min | 3097 extern tPPO2MIN |
3076 divesets_ppo2_min: | 3098 divesets_ppo2_min: |
3077 lfsr FSR1,tPPO2Min | 3099 lfsr FSR1,tPPO2MIN |
3078 call strcat_text | 3100 call strcat_text |
3079 movff opt_ppO2_min,lo | 3101 movff opt_ppO2_min,lo |
3080 movlw ppo2_warning_low | 3102 movlw ppo2_warning_low |
3081 bra divesets_ppo2_common | 3103 bra divesets_ppo2_common |
3082 | 3104 |
3105 global divesets_ppo2_max_deco | |
3106 extern tPPO2DECO | |
3107 divesets_ppo2_max_deco: | |
3108 lfsr FSR1,tPPO2DECO | |
3109 call strcat_text | |
3110 movff opt_ppO2_max_deco,lo | |
3111 movlw ppo2_warning_high_deco | |
3112 bra divesets_ppo2_common | |
3113 | |
3114 | |
3083 ;============================================================================= | 3115 ;============================================================================= |
3084 | 3116 |
3085 global TFT_clear_warning_text | 3117 global TFT_clear_warning_text |
3086 TFT_clear_warning_text: | 3118 TFT_clear_warning_text: |
3087 btfss divemode ; in divemode? | 3119 btfss divemode ; in divemode? |