comparison src/gaslist.asm @ 540:9a17b1db095b

Re-insert Rev. 530 changes into gaslist.asm
author heinrichsweikamp
date Mon, 28 Aug 2017 18:45:45 +0200
parents a7ac5d3fd046
children b7eb98dbd800
comparison
equal deleted inserted replaced
539:8d7a6c8af208 540:9a17b1db095b
48 lfsr FSR1,opt_gas_He_ratio ; Read opt_gas_He_ratio[WREG] 48 lfsr FSR1,opt_gas_He_ratio ; Read opt_gas_He_ratio[WREG]
49 movff PLUSW1,gaslist_He 49 movff PLUSW1,gaslist_He
50 50
51 movff gaslist_O2,lo 51 movff gaslist_O2,lo
52 movff gaslist_He,hi 52 movff gaslist_He,hi
53 call customview_show_mix ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2 53 goto customview_show_mix ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2, and RETURN
54 return 54
55 55
56 56
57 ;============================================================================= 57 ;=============================================================================
58 ; Append current mix to current string (For divemode) 58 ; Append current mix to current string (For divemode)
59 ; Input: FSR2 : Current string position. 59 ; Input: FSR2 : Current string position.
62 gaslist_strcat_gasx: ; Show current O2/He mix 62 gaslist_strcat_gasx: ; Show current O2/He mix
63 STRCAT_TEXT tGas 63 STRCAT_TEXT tGas
64 STRCAT ": " 64 STRCAT ": "
65 movff char_I_O2_ratio,lo 65 movff char_I_O2_ratio,lo
66 movff char_I_He_ratio,hi 66 movff char_I_He_ratio,hi
67 call customview_show_mix ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2 67 goto customview_show_mix ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2, and RETURN
68 return
69 68
70 global gaslist_show_type 69 global gaslist_show_type
71 extern tGasDisabled 70 extern tGasDisabled
72 extern tDilDisabled 71 extern tDilDisabled
73 gaslist_show_type: 72 gaslist_show_type:
213 212
214 movf gaslist_gas,W ; (0-4 for OC/Bailout, 5-9 for Diluents) 213 movf gaslist_gas,W ; (0-4 for OC/Bailout, 5-9 for Diluents)
215 movf PLUSW1,W 214 movf PLUSW1,W
216 bnz gaslist_strcat_3 215 bnz gaslist_strcat_3
217 call TFT_disabled_color 216 call TFT_disabled_color
218 ;bra gaslist_strcat_3 ; NEW ; No MOD-check and red color for disabled gases 217 bra gaslist_strcat_4 ; NEW ; No MOD-check and red color for disabled gases
219 gaslist_strcat_3: 218 gaslist_strcat_3:
220 rcall gaslist_strcat_gas_0 219 rcall gaslist_strcat_gas_0
221 PUTC " " 220 PUTC " "
222 ; Read switch depth 221 ; Read switch depth
223 lfsr FSR1,char_I_dil_change-.5 ; Setup Diluents-5 222 lfsr FSR1,char_I_dil_change-.5 ; Setup Diluents-5
228 movf gaslist_gas,W ; (0-4 for OC/Bailout, 5-9 for Diluents) 227 movf gaslist_gas,W ; (0-4 for OC/Bailout, 5-9 for Diluents)
229 movff PLUSW1,lo 228 movff PLUSW1,lo
230 rcall gaslist_calc_mod ; Compute MOD into WREG 229 rcall gaslist_calc_mod ; Compute MOD into WREG
231 cpfsgt lo 230 cpfsgt lo
232 bra gaslist_strcat_5 231 bra gaslist_strcat_5
232 call TFT_warnings_color ; Turn red if bigger
233 bra gaslist_strcat_5 ; skip gaslist_strcat_gas_0 here
234 gaslist_strcat_4:
235 rcall gaslist_strcat_gas_0
236 PUTC " "
237
238 ; Dummy code, needs some cleanup somedays...
239 ; Read switch depth
240 lfsr FSR1,char_I_dil_change-.5 ; Setup Diluents-5
241 movlw .4
242 cpfsgt gaslist_gas ; >4? (-> Diluents)
243 lfsr FSR1,opt_OC_bail_gas_change ; Setup OC Gases
244
245 movf gaslist_gas,W ; (0-4 for OC/Bailout, 5-9 for Diluents)
246 movff PLUSW1,lo
247 ;rcall gaslist_calc_mod ; Compute MOD into WREG
233 248
234 movf gaslist_gas,W ; load gas index
235 lfsr FSR1,opt_gas_type ; set-up index read from gas table
236 movff PLUSW1,gaslist_Type ; get current gas type into lo
237 movlw .3 ; compare current gas type with 3 = deco
238 cpfseq gaslist_Type ; skip next line if gas is of type deco
239 bra gaslist_strcat_5 ; gas is not deco gas
240
241 call TFT_warnings_color ; Turn red if bigger and gas is a deco gas
242 ;bra gaslist_strcat_5 ; skip gaslist_strcat_gas_0 here
243
244 gaslist_strcat_5: 249 gaslist_strcat_5:
245 TSTOSS opt_units ; 0=Meters, 1=Feets 250 TSTOSS opt_units ; 0=Meters, 1=Feets
246 bra gaslist_strcat_3_metric 251 bra gaslist_strcat_3_metric
247 ;gaslist_strcat_3_imperial: 252 ;gaslist_strcat_3_imperial:
248 btfsc ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10") 253 btfsc ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10")
249 bra gaslist_imperial_decogas 254 bra gaslist_imperial_non_travel
250 movf gaslist_gas,W 255 movf gaslist_gas,W
251 lfsr FSR1,opt_gas_type ; Read opt_gas_type[WREG] 256 lfsr FSR1,opt_gas_type ; Read opt_gas_type[WREG]
252 movff PLUSW1,gaslist_Type 257 movff PLUSW1,gaslist_Type
253 movlw .3 ; 0= Diabled, 1 = First, 2=Travel/Normal, 3 = Deco 258 movlw .2 ; 2=Travel
254 cpfslt gaslist_Type ; skip next line for disabled, first and travel gases 259 cpfseq gaslist_Type
255 bra gaslist_imperial_decogas ; Deco gas ? show meters 260 bra gaslist_imperial_non_travel ; Non-Travel Gas
256 bra gaslist_strcat_depth_nondeco ; Show "---" instead of "0m"... 261 bra gaslist_strcat_depth_travel ; Show "---" instead of "0m"...
257 262
258 gaslist_imperial_decogas: 263 gaslist_imperial_non_travel:
259 movf lo,W 264 movf lo,W
260 mullw .100 ; convert meters to mbar 265 mullw .100 ; convert meters to mbar
261 movff PRODL,lo 266 movff PRODL,lo
262 movff PRODH,hi 267 movff PRODH,hi
263 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet 268 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
264 bsf leftbind 269 bsf leftbind
265 output_16_3 ; limit to 999 and display only (0-999) 270 output_16_3 ; limit to 999 and display only (0-999)
266 STRCAT_TEXT tFeets ; "ft" 271 STRCAT_TEXT tFeets ; "ft"
267 return 272 return
268 273
269 gaslist_strcat_3_metric: 274 gaslist_strcat_3_metric:
270 btfsc ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10") 275 btfsc ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10")
271 bra gaslist_metric_decogas 276 bra gaslist_metric_non_travel
272 movf gaslist_gas,W 277 movf gaslist_gas,W
273 lfsr FSR1,opt_gas_type ; Read opt_gas_type[WREG] 278 lfsr FSR1,opt_gas_type ; Read opt_gas_type[WREG]
274 movff PLUSW1,gaslist_Type 279 movff PLUSW1,gaslist_Type
275 movlw .3 ; 0= Diabled, 1 = First, 2=Travel/Normal, 3 = Deco 280 movlw .2 ; 2=Travel
276 cpfslt gaslist_Type ; skip next line for disabled, first and travel gases 281 cpfseq gaslist_Type
277 bra gaslist_metric_decogas ; Deco gas ? show meters 282 bra gaslist_metric_non_travel ; Non-Travel Gas
278 gaslist_strcat_depth_nondeco: ; Show "---" instead of "0m"... 283 gaslist_strcat_depth_travel: ; Show "---" instead of "0m"...
279 STRCAT "---" 284 STRCAT "---"
280 return 285 return
281 gaslist_metric_decogas: 286 gaslist_metric_non_travel:
282 output_99 287 output_99
283 STRCAT_TEXT tMeters ; "m" 288 STRCAT_TEXT tMeters ; "m"
284 return 289 return
285 290
286 ;---------------------------------------------------------------------------- 291 ;----------------------------------------------------------------------------