comparison src/tft_outputs.asm @ 428:eccae727702f

some cleanup
author heinrichsweikamp
date Wed, 15 Jun 2016 12:26:48 +0200
parents 12e85930d95c
children 4b93354b7738
comparison
equal deleted inserted replaced
427:ceb1b7329dce 428:eccae727702f
90 TFT_standard_color: 90 TFT_standard_color:
91 setf WREG ; Default white 91 setf WREG ; Default white
92 btfsc divemode ; in Divemode? 92 btfsc divemode ; in Divemode?
93 rcall TFT_standard_color_dive 93 rcall TFT_standard_color_dive
94 TFT_standard_color0: 94 TFT_standard_color0:
95 call TFT_set_color 95 goto TFT_set_color ; and return...
96 return
97 TFT_standard_color_dive: 96 TFT_standard_color_dive:
98 movff opt_dive_color_scheme,WREG ; 0-3 97 movff opt_dive_color_scheme,WREG ; 0-3
99 incf WREG 98 incf WREG
100 dcfsnz WREG 99 dcfsnz WREG
101 retlw color_scheme_divemode_std1 ;0 100 retlw color_scheme_divemode_std1 ;0
181 clrf xB+1 ; Devide/100 -> xC+0 = Depth in m 180 clrf xB+1 ; Devide/100 -> xC+0 = Depth in m
182 call div16x16 ; xA/xB=xC with xA as remainder 181 call div16x16 ; xA/xB=xC with xA as remainder
183 movf xC+0,W ; Depth in m 182 movf xC+0,W ; Depth in m
184 subwf lo,W 183 subwf lo,W
185 btfsc STATUS,C 184 btfsc STATUS,C
186 bra TFT_warnings_color ; Set to warning color 185 bra TFT_warnings_color ; Set to warning color
187 call TFT_standard_color 186 bra TFT_standard_color ; and return...
188 return
189 187
190 TFT_color_code_depth: 188 TFT_color_code_depth:
191 movff hi,hi_temp 189 movff hi,hi_temp
192 movff lo,lo_temp 190 movff lo,lo_temp
193 SAFE_2BYTE_COPY rel_pressure, lo 191 SAFE_2BYTE_COPY rel_pressure, lo
206 TSTOSS opt_modwarning ; 0=standard, 1=blink 204 TSTOSS opt_modwarning ; 0=standard, 1=blink
207 bra TFT_color_code_depth_std 205 bra TFT_color_code_depth_std
208 ;TFT_color_code_depth_blink: 206 ;TFT_color_code_depth_blink:
209 call subU16 ; sub_c = sub_a - sub_b 207 call subU16 ; sub_c = sub_a - sub_b
210 btfss neg_flag 208 btfss neg_flag
211 bra TFT_color_code_depth_warn ; Set to warning color 209 bra TFT_color_code_depth_warn ; Set to warning color
212 call TFT_color_code_ppo2_depth ; check depth against MOD 210 bra TFT_color_code_ppo2_depth ; check depth against MOD ; and return...
213 return 211
214 212
215 TFT_color_code_depth_std: 213 TFT_color_code_depth_std:
216 call subU16 ; sub_c = sub_a - sub_b 214 call subU16 ; sub_c = sub_a - sub_b
217 btfss neg_flag 215 btfss neg_flag
218 bra TFT_warnings_color ; Set to warning color 216 bra TFT_warnings_color ; Set to warning color
219 call TFT_standard_color 217 bra TFT_standard_color ; and return...
220 return 218
221 219
222 TFT_color_code_ppo2_depth: 220 TFT_color_code_ppo2_depth:
223 SAFE_2BYTE_COPY amb_pressure, xA 221 SAFE_2BYTE_COPY amb_pressure, xA
224 movlw d'10' 222 movlw d'10'
225 movwf xB+0 223 movwf xB+0
278 bra TFT_warnings_color ; Yes 276 bra TFT_warnings_color ; Yes
279 movff int_O_CNS_fraction+0,lo 277 movff int_O_CNS_fraction+0,lo
280 movlw color_code_cns_high ; CNS Warn [%] 278 movlw color_code_cns_high ; CNS Warn [%]
281 subwf lo,W 279 subwf lo,W
282 btfsc STATUS,C 280 btfsc STATUS,C
283 bra TFT_warnings_color ; Set to warning color 281 bra TFT_warnings_color ; Set to warning color
284 call TFT_standard_color 282 bra TFT_standard_color ; and return...
285 return
286 283
287 TFT_color_code_gf: 284 TFT_color_code_gf:
288 movff char_O_gradient_factor,lo ; gradient factor 285 movff char_O_gradient_factor,lo ; gradient factor
289 movlw color_code_gf_warn_high ; GF Warn [%] 286 movlw color_code_gf_warn_high ; GF Warn [%]
290 subwf lo,W 287 subwf lo,W
291 btfsc STATUS,C 288 btfsc STATUS,C
292 bra TFT_warnings_color ; Set to warning color 289 bra TFT_warnings_color ; Set to warning color
293 call TFT_standard_color 290 bra TFT_standard_color ; and return...
294 return
295 291
296 TFT_color_code_ppo2: 292 TFT_color_code_ppo2:
297 ; Check if ppO2>6,55bar 293 ; Check if ppO2>6,55bar
298 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55bar? 294 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55bar?
299 bra TFT_warnings_color ; Yes, warn in warning color 295 bra TFT_warnings_color ; Yes, warn in warning color
317 mullw d'100' 313 mullw d'100'
318 movff PRODL,sub_b+0 314 movff PRODL,sub_b+0
319 movff PRODH,sub_b+1 315 movff PRODH,sub_b+1
320 call subU16 ; sub_c = sub_a - sub_b 316 call subU16 ; sub_c = sub_a - sub_b
321 btfsc neg_flag 317 btfsc neg_flag
322 bra TFT_warnings_color ; Set to warning color 318 bra TFT_warnings_color ; Set to warning color
323 call TFT_standard_color 319 bra TFT_standard_color ; and return...
324 return
325 320
326 TFT_color_code_ppo2_hud: ; With ppO2 [cbar] in lo 321 TFT_color_code_ppo2_hud: ; With ppO2 [cbar] in lo
327 movff opt_ppO2_max,WREG ; PPO2 Max for MOD calculation and color coding in divemode 322 movff opt_ppO2_max,WREG ; PPO2 Max for MOD calculation and color coding in divemode
328 cpfsgt lo ; lo > opt_ppO2_max? 323 cpfsgt lo ; lo > opt_ppO2_max?
329 bra TFT_color_code_ppo2_hud1; No 324 bra TFT_color_code_ppo2_hud1; No
332 movff opt_ppO2_min,WREG ; PPO2 min for Sensors and color coding in divemode 327 movff opt_ppO2_min,WREG ; PPO2 min for Sensors and color coding in divemode
333 cpfslt lo ; lo < opt_ppO2_min? 328 cpfslt lo ; lo < opt_ppO2_min?
334 bra TFT_color_code_ppo2_hud2; No 329 bra TFT_color_code_ppo2_hud2; No
335 bra TFT_warnings_color ; Yes 330 bra TFT_warnings_color ; Yes
336 TFT_color_code_ppo2_hud2: 331 TFT_color_code_ppo2_hud2:
337 call TFT_standard_color 332 bra TFT_standard_color ; and return...
338 return
339 333
340 TFT_color_code_battery: ; With battery percent in lo 334 TFT_color_code_battery: ; With battery percent in lo
341 movlw color_code_battery_low 335 movlw color_code_battery_low
342 cpfsgt lo ; lo < color_code_battery_low ? 336 cpfsgt lo ; lo < color_code_battery_low ?
343 bra TFT_warnings_color ; No 337 bra TFT_warnings_color ; No
344 call TFT_standard_color 338 bra TFT_standard_color ; and return...
345 return
346 339
347 ; **************************************************************************** 340 ; ****************************************************************************
348 341
349 global TFT_show_OC_startgas_surface 342 global TFT_show_OC_startgas_surface
350 TFT_show_OC_startgas_surface: ; Show first gas and "OSTC2-like" active gases 343 TFT_show_OC_startgas_surface: ; Show first gas and "OSTC2-like" active gases
517 bra $+4 510 bra $+4
518 WIN_FRAME_COLOR16 dm_warning_row-.1, dm_warning_row-.1, dm_max_depth_column_nvsi, .159 ;top, bottom, left, right 511 WIN_FRAME_COLOR16 dm_warning_row-.1, dm_warning_row-.1, dm_max_depth_column_nvsi, .159 ;top, bottom, left, right
519 call TFT_draw_gassep_line 512 call TFT_draw_gassep_line
520 endif 513 endif
521 514
522 call TFT_standard_color 515 bra TFT_standard_color ; and return...
523 return
524 516
525 global TFT_draw_gassep_line 517 global TFT_draw_gassep_line
526 TFT_draw_gassep_line: 518 TFT_draw_gassep_line:
527 btfsc FLAG_apnoe_mode ; Ignore in Apnoe mode 519 btfsc FLAG_apnoe_mode ; Ignore in Apnoe mode
528 return 520 return
531 if dm_offset == 0 523 if dm_offset == 0
532 movlw color_dark_red 524 movlw color_dark_red
533 call TFT_set_color 525 call TFT_set_color
534 WIN_FRAME_COLOR16 dm_gassep_row, dm_gassep_bot, dm_gassep_column, dm_gassep_column 526 WIN_FRAME_COLOR16 dm_gassep_row, dm_gassep_bot, dm_gassep_column, dm_gassep_column
535 endif 527 endif
536 call TFT_standard_color 528 bra TFT_standard_color ; and return...
537 return
538 529
539 ;========================================================================= 530 ;=========================================================================
540 531
541 global TFT_display_velocity 532 global TFT_display_velocity
542 TFT_display_velocity: ; With divA+0 = m/min, neg_flag_velocity: ascend=1, descend=0 533 TFT_display_velocity: ; With divA+0 = m/min, neg_flag_velocity: ascend=1, descend=0
658 movwf POSTINC2 649 movwf POSTINC2
659 bsf leftbind 650 bsf leftbind
660 output_16 651 output_16
661 bcf leftbind 652 bcf leftbind
662 STRCAT_TEXT_PRINT tVelImperial ; Unit switch 653 STRCAT_TEXT_PRINT tVelImperial ; Unit switch
663 return 654 return
664 655
665 TFT_velocity_metric: 656 TFT_velocity_metric:
666 movff divA+0,lo ; divA+0 = m/min 657 movff divA+0,lo ; divA+0 = m/min
667 movlw '-' 658 movlw '-'
668 btfsc neg_flag_velocity 659 btfsc neg_flag_velocity
669 movlw '+' 660 movlw '+'
670 movwf POSTINC2 661 movwf POSTINC2
671 output_99 662 output_99
672 STRCAT_TEXT_PRINT tVelMetric ; Unit switch 663 STRCAT_TEXT_PRINT tVelMetric ; Unit switch
673 return 664 return
674 665
675 TFT_velocity_graph: ; divA+0 = m/min 666 TFT_velocity_graph: ; divA+0 = m/min
676 ; divA+0 holding the ascend speed in m/min 667 ; divA+0 holding the ascend speed in m/min
677 movff divA+0,hi ; Copy 668 movff divA+0,hi ; Copy
678 WIN_BOX_BLACK dm_velobar_top, dm_velobar_bot, dm_velobar_lft, dm_velobar_rgt ;top, bottom, left, right -> outer frame 669 WIN_BOX_BLACK dm_velobar_top, dm_velobar_bot, dm_velobar_lft, dm_velobar_rgt ;top, bottom, left, right -> outer frame
788 else 779 else
789 call TFT_attention_color 780 call TFT_attention_color
790 endif 781 endif
791 WIN_STD dm_ndl_text_column, dm_ndl_text_row 782 WIN_STD dm_ndl_text_column, dm_ndl_text_row
792 STRCPY_TEXT_PRINT tNDL ; NDL 783 STRCPY_TEXT_PRINT tNDL ; NDL
793 call TFT_standard_color 784 bra TFT_standard_color ; and return...
794 return
795 785
796 global TFT_show_TTS_divemode 786 global TFT_show_TTS_divemode
797 TFT_show_TTS_divemode: 787 TFT_show_TTS_divemode:
798 btfsc divemode_menu ; Is the dive mode menu shown? 788 btfsc divemode_menu ; Is the dive mode menu shown?
799 return ; Yes, return 789 return ; Yes, return
895 movff char_O_first_deco_depth,lo ; Ceiling in m 885 movff char_O_first_deco_depth,lo ; Ceiling in m
896 rcall TFT_display_deko_output_depth ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft) 886 rcall TFT_display_deko_output_depth ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft)
897 movff char_O_first_deco_time,lo ; length of first stop in min 887 movff char_O_first_deco_time,lo ; length of first stop in min
898 output_99 888 output_99
899 STRCAT_PRINT "'" 889 STRCAT_PRINT "'"
900 call TFT_standard_color 890 bra TFT_standard_color ; and return...
901 return
902 891
903 global TFT_decoplan 892 global TFT_decoplan
904 TFT_decoplan: 893 TFT_decoplan:
905 call TFT_divemask_color 894 call TFT_divemask_color
906 WIN_TINY dm_custom_decoplan_title_column, dm_custom_decoplan_title_row 895 WIN_TINY dm_custom_decoplan_title_column, dm_custom_decoplan_title_row
907 STRCPY_TEXT_PRINT tDiveDecoplan 896 STRCPY_TEXT_PRINT tDiveDecoplan
908 call TFT_standard_color 897 rcall TFT_standard_color
909 898
910 movff char_O_deco_depth+1,lo 899 movff char_O_deco_depth+1,lo
911 tstfsz lo ; Show another stop? 900 tstfsz lo ; Show another stop?
912 bra TFT_display_deko2 ; Yes 901 bra TFT_display_deko2 ; Yes
913 ; No, clear output and return 902 ; No, clear output and return
1029 btfss safety_stop_active ; Displayed? 1018 btfss safety_stop_active ; Displayed?
1030 return ; No 1019 return ; No
1031 bcf safety_stop_active ; Clear flag 1020 bcf safety_stop_active ; Clear flag
1032 btfsc divemode_menu ; Is the dive mode menu shown? 1021 btfsc divemode_menu ; Is the dive mode menu shown?
1033 return ; Yes, return 1022 return ; Yes, return
1034 rcall TFT_clear_safety_stop ; Yes, Clear stop 1023 bra TFT_clear_safety_stop ; Yes, Clear stop ; and return...
1035 return
1036 1024
1037 TFT_show_safety_stop2: 1025 TFT_show_safety_stop2:
1038 bsf safety_stop_active ; Set flag 1026 bsf safety_stop_active ; Set flag
1039 decf safety_stop_countdown,F ; Reduce countdown 1027 decf safety_stop_countdown,F ; Reduce countdown
1040 1028
1065 PUTC ':' 1053 PUTC ':'
1066 movff hi,lo 1054 movff hi,lo
1067 output_99x 1055 output_99x
1068 STRCAT_PRINT "" 1056 STRCAT_PRINT ""
1069 WIN_FONT FT_SMALL 1057 WIN_FONT FT_SMALL
1070 call TFT_standard_color 1058 goto TFT_standard_color; and return...
1071 return
1072 1059
1073 global TFT_mask_avr_stopwatch ; Show mask for average depth and stopwatch 1060 global TFT_mask_avr_stopwatch ; Show mask for average depth and stopwatch
1074 TFT_mask_avr_stopwatch: 1061 TFT_mask_avr_stopwatch:
1075 ; The mask 1062 ; The mask
1076 call TFT_divemask_color 1063 call TFT_divemask_color
1078 STRCPY_TEXT_PRINT tDiveTotalAvr 1065 STRCPY_TEXT_PRINT tDiveTotalAvr
1079 WIN_TINY dm_custom_avr_stop_title_column2,dm_custom_avr_stop_title_row 1066 WIN_TINY dm_custom_avr_stop_title_column2,dm_custom_avr_stop_title_row
1080 STRCPY_TEXT_PRINT tDiveStopwatch 1067 STRCPY_TEXT_PRINT tDiveStopwatch
1081 WIN_TINY dm_custom_avr_stop_title_column3,dm_custom_avr_stop_title_row 1068 WIN_TINY dm_custom_avr_stop_title_column3,dm_custom_avr_stop_title_row
1082 STRCPY_TEXT_PRINT tDiveStopAvr 1069 STRCPY_TEXT_PRINT tDiveStopAvr
1083 call TFT_standard_color 1070 goto TFT_standard_color ; and return...
1084 return
1085 1071
1086 global TFT_dyn_gaslist 1072 global TFT_dyn_gaslist
1087 TFT_dyn_gaslist: ; Show the dynamic gaslist 1073 TFT_dyn_gaslist: ; Show the dynamic gaslist
1088 ; The mask 1074 ; The mask
1089 call TFT_divemask_color 1075 call TFT_divemask_color
1099 rcall TFT_dyn_gaslist_common 1085 rcall TFT_dyn_gaslist_common
1100 WIN_SMALL dm_custom_dyn_gas_column2,dm_custom_dyn_gas_row1 1086 WIN_SMALL dm_custom_dyn_gas_column2,dm_custom_dyn_gas_row1
1101 rcall TFT_dyn_gaslist_common 1087 rcall TFT_dyn_gaslist_common
1102 WIN_SMALL dm_custom_dyn_gas_column2,dm_custom_dyn_gas_row2 1088 WIN_SMALL dm_custom_dyn_gas_column2,dm_custom_dyn_gas_row2
1103 rcall TFT_dyn_gaslist_common 1089 rcall TFT_dyn_gaslist_common
1104 call TFT_standard_color 1090 goto TFT_standard_color ; and return...
1105 return
1106 1091
1107 TFT_dyn_gaslist_common: 1092 TFT_dyn_gaslist_common:
1108 incf uart1_temp,F ; +1 1093 incf uart1_temp,F ; +1
1109 movf uart1_temp,W ; into W 1094 movf uart1_temp,W ; into W
1110 cpfseq active_gas ;1-5 1095 cpfseq active_gas ;1-5
1195 global TFT_ceiling_mask ; The ceiling mask 1180 global TFT_ceiling_mask ; The ceiling mask
1196 TFT_ceiling_mask: 1181 TFT_ceiling_mask:
1197 call TFT_divemask_color 1182 call TFT_divemask_color
1198 WIN_TINY dm_custom_ceiling_text_column,dm_custom_ceiling_text_row 1183 WIN_TINY dm_custom_ceiling_text_column,dm_custom_ceiling_text_row
1199 STRCPY_TEXT_PRINT tCeiling 1184 STRCPY_TEXT_PRINT tCeiling
1200 call TFT_standard_color 1185 goto TFT_standard_color ; and return...
1201 return
1202 1186
1203 global TFT_ceiling ; Ceiling 1187 global TFT_ceiling ; Ceiling
1204 TFT_ceiling: 1188 TFT_ceiling:
1205 call TFT_standard_color 1189 call TFT_standard_color
1206 WIN_MEDIUM dm_custom_ceiling_value_column,dm_custom_ceiling_value_row 1190 WIN_MEDIUM dm_custom_ceiling_value_column,dm_custom_ceiling_value_row
1232 STRCPY_TEXT_PRINT tDiveHudMask1 1216 STRCPY_TEXT_PRINT tDiveHudMask1
1233 WIN_TINY dm_custom_hud_column2,dm_custom_hud_row 1217 WIN_TINY dm_custom_hud_column2,dm_custom_hud_row
1234 STRCPY_TEXT_PRINT tDiveHudMask2 1218 STRCPY_TEXT_PRINT tDiveHudMask2
1235 WIN_TINY dm_custom_hud_column3,dm_custom_hud_row 1219 WIN_TINY dm_custom_hud_column3,dm_custom_hud_row
1236 STRCPY_TEXT_PRINT tDiveHudMask3 1220 STRCPY_TEXT_PRINT tDiveHudMask3
1237 call TFT_standard_color 1221 goto TFT_standard_color ; and return...
1238 return
1239 1222
1240 global TFT_hud_voltages 1223 global TFT_hud_voltages
1241 TFT_hud_voltages: ; Show HUD details 1224 TFT_hud_voltages: ; Show HUD details
1242 WIN_SMALL dm_custom_hud_sensor1_column,dm_custom_hud_data_row 1225 WIN_SMALL dm_custom_hud_sensor1_column,dm_custom_hud_data_row
1243 call TFT_standard_color 1226 call TFT_standard_color
1267 movff o2_mv_sensor3+1,hi 1250 movff o2_mv_sensor3+1,hi
1268 bsf leftbind 1251 bsf leftbind
1269 output_16dp .4 ; x.xx 1252 output_16dp .4 ; x.xx
1270 bcf leftbind 1253 bcf leftbind
1271 STRCAT_PRINT "mV " 1254 STRCAT_PRINT "mV "
1272 call TFT_standard_color 1255 goto TFT_standard_color ; and return...
1273 return
1274 1256
1275 global TFT_update_ppo2_sensors ; Update Sensor data 1257 global TFT_update_ppo2_sensors ; Update Sensor data
1276 TFT_update_ppo2_sensors: 1258 TFT_update_ppo2_sensors:
1277 ; show three sensors 1259 ; show three sensors
1278 bsf leftbind 1260 bsf leftbind
1347 STRCAT_PRINT "" 1329 STRCAT_PRINT ""
1348 bcf win_invert 1330 bcf win_invert
1349 bsf dive_hud3_displayed ; Set display flag 1331 bsf dive_hud3_displayed ; Set display flag
1350 TFT_update_hud6: 1332 TFT_update_hud6:
1351 bcf leftbind 1333 bcf leftbind
1352 call TFT_standard_color 1334 goto TFT_standard_color ; and return...
1353 return 1335
1354 1336
1355 global TFT_surface_sensor ; Update Sensor data in surface mode 1337 global TFT_surface_sensor ; Update Sensor data in surface mode
1356 TFT_surface_sensor: 1338 TFT_surface_sensor:
1357 movf hardware_flag,W 1339 movf hardware_flag,W
1358 sublw 0x11 ; 2 with BLE 1340 sublw 0x11 ; 2 with BLE
1399 clrf hi 1381 clrf hi
1400 output_16dp .3 ; x.xx bar 1382 output_16dp .3 ; x.xx bar
1401 STRCAT_PRINT "" 1383 STRCAT_PRINT ""
1402 TFT_surface_sensor6: 1384 TFT_surface_sensor6:
1403 bcf leftbind 1385 bcf leftbind
1404 call TFT_standard_color 1386 goto TFT_standard_color; and return...
1405 return
1406 1387
1407 global TFT_menu_hud 1388 global TFT_menu_hud
1408 TFT_menu_hud: ; Yes, update HUD data 1389 TFT_menu_hud: ; Yes, update HUD data
1409 call compute_ppo2 ; compute mv_sensorX and ppo2_sensorX arrays 1390 call compute_ppo2 ; compute mv_sensorX and ppo2_sensorX arrays
1410 call TFT_attention_color ; show in yellow 1391 call TFT_attention_color ; show in yellow
1476 ; PUTC "@" 1457 ; PUTC "@"
1477 ; SAFE_2BYTE_COPY amb_pressure, lo 1458 ; SAFE_2BYTE_COPY amb_pressure, lo
1478 ; output_16 1459 ; output_16
1479 ; STRCAT_TEXT tMBAR ; mbar 1460 ; STRCAT_TEXT tMBAR ; mbar
1480 ; STRCAT_PRINT " " 1461 ; STRCAT_PRINT " "
1481 call TFT_standard_color 1462 bcf leftbind
1482 bcf leftbind 1463 goto TFT_standard_color ; and return...
1483 return
1484 1464
1485 global TFT_clock 1465 global TFT_clock
1486 TFT_clock: 1466 TFT_clock:
1487 WIN_SMALL surf_clock_column,surf_clock_row 1467 WIN_SMALL surf_clock_column,surf_clock_row
1488 TFT_clock2: ; called from divemode clock 1468 TFT_clock2: ; called from divemode clock
1895 endif 1875 endif
1896 movff char_I_O2_ratio,lo ; lo now stores O2 in % 1876 movff char_I_O2_ratio,lo ; lo now stores O2 in %
1897 movff char_I_He_ratio,hi ; hi now stores He in % 1877 movff char_I_He_ratio,hi ; hi now stores He in %
1898 rcall TFT_show_dil_divemode2 ; Show gas 1878 rcall TFT_show_dil_divemode2 ; Show gas
1899 bcf win_invert ; Reset invert flag 1879 bcf win_invert ; Reset invert flag
1900 call TFT_standard_color 1880 goto TFT_standard_color; and return...
1901 return ; Done.
1902 1881
1903 TFT_show_dil_divemode2: 1882 TFT_show_dil_divemode2:
1904 call customview_show_mix ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2 1883 call customview_show_mix ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2
1905 STRCAT_PRINT "" 1884 STRCAT_PRINT ""
1906 return 1885 return
1986 STRCAT_TEXT_PRINT tDvGauge ; Gauge 1965 STRCAT_TEXT_PRINT tDvGauge ; Gauge
1987 bra TFT_display_decotype_exit 1966 bra TFT_display_decotype_exit
1988 TFT_display_decotype_surface4: 1967 TFT_display_decotype_surface4:
1989 STRCAT_TEXT_PRINT tDvApnea ; Apnea 1968 STRCAT_TEXT_PRINT tDvApnea ; Apnea
1990 TFT_display_decotype_exit: 1969 TFT_display_decotype_exit:
1991 call TFT_standard_color 1970 goto TFT_standard_color ; and return...
1992 return
1993 1971
1994 global TFT_display_decotype_surface1 ; Used from logbook! 1972 global TFT_display_decotype_surface1 ; Used from logbook!
1995 TFT_display_decotype_surface1: ; Used from logbook! 1973 TFT_display_decotype_surface1: ; Used from logbook!
1996 tstfsz lo 1974 tstfsz lo
1997 bra TFT_display_decotype_surface1_2 1975 bra TFT_display_decotype_surface1_2
2320 rcall TFT_custom_text_2 ; Show up to 12 chars and print 2298 rcall TFT_custom_text_2 ; Show up to 12 chars and print
2321 incfsz lo,F ; Was lo=255? 2299 incfsz lo,F ; Was lo=255?
2322 return ; No, all done. 2300 return ; No, all done.
2323 lfsr FSR0, opt_name+.48 ; Source 2301 lfsr FSR0, opt_name+.48 ; Source
2324 WIN_SMALL surf_customtext_column,surf_customtext_row5 ; Fifth row 2302 WIN_SMALL surf_customtext_column,surf_customtext_row5 ; Fifth row
2325 rcall TFT_custom_text_2 ; Show up to 12 chars and print 2303 bra TFT_custom_text_2 ; Show up to 12 chars and print ; and return...
2326 return ; Done. 2304
2327 2305
2328 TFT_custom_text_2: 2306 TFT_custom_text_2:
2329 lfsr FSR2, buffer ; destination 2307 lfsr FSR2, buffer ; destination
2330 movlw .12 2308 movlw .12
2331 movwf lo ; length/line 2309 movwf lo ; length/line
2381 update_surf_press2: 2359 update_surf_press2:
2382 movff lo,sub_b+0 2360 movff lo,sub_b+0
2383 movff hi,sub_b+1 2361 movff hi,sub_b+1
2384 movff last_surfpressure_30min+0,sub_a+0 2362 movff last_surfpressure_30min+0,sub_a+0
2385 movff last_surfpressure_30min+1,sub_a+1 2363 movff last_surfpressure_30min+1,sub_a+1
2386 call subU16 ; sub_c = sub_a - sub_b 2364 goto subU16 ; sub_c = sub_a - sub_b ; and return...
2387 return 2365
2388 2366
2389 ;============================================================================= 2367 ;=============================================================================
2390 2368
2391 global TFT_update_batt_voltage 2369 global TFT_update_batt_voltage
2392 TFT_update_batt_voltage: 2370 TFT_update_batt_voltage:
2879 2857
2880 call TFT_warnings_color 2858 call TFT_warnings_color
2881 WIN_LEFT .160-4*9/2 ; Right pad. 2859 WIN_LEFT .160-4*9/2 ; Right pad.
2882 STRCPY_TEXT_PRINT tBeta 2860 STRCPY_TEXT_PRINT tBeta
2883 endif 2861 endif
2884 call TFT_standard_color 2862 goto TFT_standard_color ; and return...
2885 return 2863
2886 2864
2887 2865
2888 2866
2889 ;============================================================================= 2867 ;=============================================================================
2890 ; For the Information menu: append firmware x.yy version. 2868 ; For the Information menu: append firmware x.yy version.
2919 cpfsgt day ; > threshold? 2897 cpfsgt day ; > threshold?
2920 return 2898 return
2921 2899
2922 ; Show in "change firmware" style 2900 ; Show in "change firmware" style
2923 movlw color_yellow 2901 movlw color_yellow
2924 call TFT_set_color 2902 bcf win_invert
2925 bsf win_invert ; Set invert flag 2903 goto TFT_set_color ; and return...
2926 return
2927 2904
2928 ;----------------------------------------------------------------------------- 2905 ;-----------------------------------------------------------------------------
2929 ; For the Information menu: append serial number 2906 ; For the Information menu: append serial number
2930 global info_menu_serial 2907 global info_menu_serial
2931 extern tSerial 2908 extern tSerial
3129 call TFT_warnings_color 3106 call TFT_warnings_color
3130 STRCPY_TEXT tDiveFallback ; "Fallback!" 3107 STRCPY_TEXT tDiveFallback ; "Fallback!"
3131 movlw dm_warning_length ; Divemode string length 3108 movlw dm_warning_length ; Divemode string length
3132 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) 3109 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
3133 STRCAT_PRINT "" 3110 STRCAT_PRINT ""
3134 call TFT_standard_color 3111 goto TFT_standard_color ; and return...
3135 return
3136 3112
3137 global TFT_warning_gf 3113 global TFT_warning_gf
3138 TFT_warning_gf: ;GF 3114 TFT_warning_gf: ;GF
3139 rcall TFT_warning_set_window ; Sets the row and column for the current warning 3115 rcall TFT_warning_set_window ; Sets the row and column for the current warning
3140 tstfsz WREG ; Is there room for the warning? 3116 tstfsz WREG ; Is there room for the warning?
3150 btfss divemode ; In Divemode? 3126 btfss divemode ; In Divemode?
3151 movlw surf_warning_length ; No, use surface string length 3127 movlw surf_warning_length ; No, use surface string length
3152 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) 3128 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
3153 STRCAT_PRINT "" 3129 STRCAT_PRINT ""
3154 bcf leftbind 3130 bcf leftbind
3155 call TFT_standard_color 3131 bcf win_invert
3156 bcf win_invert 3132 goto TFT_standard_color ; and return...
3157 return
3158 3133
3159 TFT_warning_set_window: ; Sets the row and column for the current warning 3134 TFT_warning_set_window: ; Sets the row and column for the current warning
3160 ; ignore warning (now)? 3135 ; ignore warning (now)?
3161 decf warning_counter,W ; -1 3136 decf warning_counter,W ; -1
3162 bcf STATUS,C 3137 bcf STATUS,C
3212 movlw dm_warning_length ; Divemode string length 3187 movlw dm_warning_length ; Divemode string length
3213 btfss divemode ; In Divemode? 3188 btfss divemode ; In Divemode?
3214 movlw surf_warning_length ; No, use surface string length 3189 movlw surf_warning_length ; No, use surface string length
3215 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) 3190 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
3216 STRCAT_PRINT "" 3191 STRCAT_PRINT ""
3217 call TFT_standard_color 3192 bcf win_invert
3218 bcf win_invert 3193 goto TFT_standard_color ; and return...
3219 return
3220 3194
3221 global TFT_gf_mask ; Setup Mask 3195 global TFT_gf_mask ; Setup Mask
3222 TFT_gf_mask: 3196 TFT_gf_mask:
3223 ; The mask 3197 ; The mask
3224 call TFT_divemask_color 3198 call TFT_divemask_color
3256 PUTC "/" 3230 PUTC "/"
3257 movff opt_aGF_high,lo 3231 movff opt_aGF_high,lo
3258 output_8 3232 output_8
3259 STRCAT_PRINT "" 3233 STRCAT_PRINT ""
3260 bcf leftbind 3234 bcf leftbind
3261 call TFT_standard_color 3235 goto TFT_standard_color ; and return...
3262 return
3263 3236
3264 TFT_gf_mask2: 3237 TFT_gf_mask2:
3265 WIN_STD dm_custom_agf_column+.10, dm_custom_agf_row 3238 WIN_STD dm_custom_agf_column+.10, dm_custom_agf_row
3266 STRCPY_PRINT "---" 3239 STRCPY_PRINT "---"
3267 bcf leftbind 3240 bcf leftbind
3271 TFT_gf_mask_cGF: 3244 TFT_gf_mask_cGF:
3272 ; The mask 3245 ; The mask
3273 call TFT_divemask_color 3246 call TFT_divemask_color
3274 WIN_TINY dm_custom_gf_title_col3, dm_custom_gf_title_row 3247 WIN_TINY dm_custom_gf_title_col3, dm_custom_gf_title_row
3275 STRCPY_TEXT_PRINT tGFInfo 3248 STRCPY_TEXT_PRINT tGFInfo
3276 call TFT_standard_color 3249 goto TFT_standard_color; and return...
3277 return
3278 3250
3279 global TFT_gf_info ; Show GF informations 3251 global TFT_gf_info ; Show GF informations
3280 TFT_gf_info: 3252 TFT_gf_info:
3281 call TFT_standard_color 3253 call TFT_standard_color
3282 ; Show current GF 3254 ; Show current GF
3303 WIN_TINY dm_custom_tissue_title_column, dm_custom_tissue_title_row 3275 WIN_TINY dm_custom_tissue_title_column, dm_custom_tissue_title_row
3304 STRCPY_TEXT_PRINT tDiveTissues 3276 STRCPY_TEXT_PRINT tDiveTissues
3305 TFT_ead_end_tissues_clock_mask2: ; Show only clock 3277 TFT_ead_end_tissues_clock_mask2: ; Show only clock
3306 WIN_TINY dm_custom_clock_column, dm_custom_clock_title_row 3278 WIN_TINY dm_custom_clock_column, dm_custom_clock_title_row
3307 STRCPY_TEXT_PRINT tDiveClock 3279 STRCPY_TEXT_PRINT tDiveClock
3308 call TFT_standard_color 3280 goto TFT_standard_color; and return...
3309 return
3310 3281
3311 global TFT_ead_end_tissues_clock ; Show EAD/END, Tissues and clock 3282 global TFT_ead_end_tissues_clock ; Show EAD/END, Tissues and clock
3312 TFT_ead_end_tissues_clock: 3283 TFT_ead_end_tissues_clock:
3313 ; Update clock and date 3284 ; Update clock and date
3314 WIN_SMALL dm_custom_clock_column, dm_custom_clock_row 3285 WIN_SMALL dm_custom_clock_column, dm_custom_clock_row
3371 STRCPY_TEXT_PRINT tN2 3342 STRCPY_TEXT_PRINT tN2
3372 WIN_TINY dm_custom_tissue_He_column, dm_custom_tissue_He_row 3343 WIN_TINY dm_custom_tissue_He_column, dm_custom_tissue_He_row
3373 STRCPY_TEXT_PRINT tHe 3344 STRCPY_TEXT_PRINT tHe
3374 call deco_calc_desaturation_time ; calculate desaturation time (and char_O_tissue_N2_saturation and char_O_tissue_He_saturation) 3345 call deco_calc_desaturation_time ; calculate desaturation time (and char_O_tissue_N2_saturation and char_O_tissue_He_saturation)
3375 movlb b'00000001' ; select ram bank 1 3346 movlb b'00000001' ; select ram bank 1
3376 rcall DISP_tissue_saturation_graph ; Show char_O_tissue_N2_saturation and char_O_tissue_He_saturation 3347 bra DISP_tissue_saturation_graph ; Show char_O_tissue_N2_saturation and char_O_tissue_He_saturation ; and return...
3377 return
3378 3348
3379 TFT_end_ead_common: ; print "lo m" (or ft) and limit to 8 chars 3349 TFT_end_ead_common: ; print "lo m" (or ft) and limit to 8 chars
3380 bsf leftbind 3350 bsf leftbind
3381 TSTOSS opt_units ; 0=Meters, 1=Feets 3351 TSTOSS opt_units ; 0=Meters, 1=Feets
3382 bra TFT_end_ead_common_metric 3352 bra TFT_end_ead_common_metric
3448 call TFT_standard_color 3418 call TFT_standard_color
3449 TFT_color_code warn_ppo2 ; Color-code output (ppO2 stored in xC) 3419 TFT_color_code warn_ppo2 ; Color-code output (ppO2 stored in xC)
3450 WIN_MEDIUM dm_custom_s_check_ppo2_dil_col, dm_custom_s_check_value_row 3420 WIN_MEDIUM dm_custom_s_check_ppo2_dil_col, dm_custom_s_check_value_row
3451 ; ; hijacking neg_flag_velocity to know where the value is displayed 3421 ; ; hijacking neg_flag_velocity to know where the value is displayed
3452 bsf neg_flag_velocity 3422 bsf neg_flag_velocity
3453 call TFT_display_ppo2_com 3423 goto TFT_display_ppo2_com; and return...
3454 return ; Done.
3455 3424
3456 3425
3457 global TFT_surface_tissues 3426 global TFT_surface_tissues
3458 TFT_surface_tissues: ; Show Tissue diagram in surface mode 3427 TFT_surface_tissues: ; Show Tissue diagram in surface mode
3459 WIN_SMALL surf_tissue_N2_column,surf_tissue_N2_row 3428 WIN_SMALL surf_tissue_N2_column,surf_tissue_N2_row
3522 subwf temp1,F ; Subtract some offset 3491 subwf temp1,F ; Subtract some offset
3523 movff win_width,WREG ; Max width. 3492 movff win_width,WREG ; Max width.
3524 cpfslt temp1 ; skip if WREG < win_width 3493 cpfslt temp1 ; skip if WREG < win_width
3525 movwf temp1 3494 movwf temp1
3526 movff temp1,win_bargraph 3495 movff temp1,win_bargraph
3527 call TFT_box 3496 goto TFT_box ; and return...
3528 return
3529 3497
3530 ;============================================================================= 3498 ;=============================================================================
3531 ; Draw saturation graph, is surface mode or in dive mode. 3499 ; Draw saturation graph, is surface mode or in dive mode.
3532 DISP_tissue_saturation_graph: 3500 DISP_tissue_saturation_graph:
3533 ;---- Draw Frame 3501 ;---- Draw Frame
3606 movlw dm_warning_length ; Divemode string length 3574 movlw dm_warning_length ; Divemode string length
3607 btfss divemode ; In Divemode? 3575 btfss divemode ; In Divemode?
3608 movlw surf_warning_length ; No, use surface string length 3576 movlw surf_warning_length ; No, use surface string length
3609 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) 3577 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
3610 STRCAT_PRINT "" 3578 STRCAT_PRINT ""
3611 call TFT_standard_color 3579 bcf win_invert
3612 bcf win_invert 3580 goto TFT_standard_color; and return...
3613 return
3614 3581
3615 global TFT_mask_ppo2 3582 global TFT_mask_ppo2
3616 TFT_mask_ppo2: 3583 TFT_mask_ppo2:
3617 call TFT_divemask_color 3584 call TFT_divemask_color
3618 WIN_TINY dm_custom_ceiling_ppo2_column, dm_custom_ceiling_text_row 3585 WIN_TINY dm_custom_ceiling_ppo2_column, dm_custom_ceiling_text_row
3619 STRCPY_TEXT_PRINT tppO2 3586 STRCPY_TEXT_PRINT tppO2
3620 call TFT_standard_color 3587 goto TFT_standard_color; and return...
3621 return
3622 3588
3623 global TFT_display_ppo2_val 3589 global TFT_display_ppo2_val
3624 TFT_display_ppo2_val: 3590 TFT_display_ppo2_val:
3625 SAFE_2BYTE_COPY amb_pressure, xA 3591 SAFE_2BYTE_COPY amb_pressure, xA
3626 movlw d'10' 3592 movlw d'10'
3678 ; neg_flag_velocity is hijacked, used to toggle the fillup lenght. 3644 ; neg_flag_velocity is hijacked, used to toggle the fillup lenght.
3679 btfsc neg_flag_velocity 3645 btfsc neg_flag_velocity
3680 movlw .4 3646 movlw .4
3681 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) 3647 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
3682 STRCAT_PRINT "" 3648 STRCAT_PRINT ""
3683 call TFT_standard_color 3649 bcf win_invert
3684 bcf win_invert 3650 goto TFT_standard_color; and return...
3685 return
3686 3651
3687 TFT_show_ppO2_3: 3652 TFT_show_ppO2_3:
3688 ; STRCAT "'6.6" ; Workaround until a ">" is available in STD font 3653 ; STRCAT "'6.6" ; Workaround until a ">" is available in STD font
3689 STRCAT "6.65" ; Workaround until a ">" is available in STD font 3654 STRCAT "6.65" ; Workaround until a ">" is available in STD font
3690 bra TFT_show_ppO2_2 3655 bra TFT_show_ppO2_2