comparison src/simulator.asm @ 40:1e2d2b0bca5b

Bugfix: Simulator in CC mode
author mh@mh-THINK.fritz.box
date Thu, 15 Aug 2013 14:34:50 +0200
parents 150d07db6048
children 05227510cae0
comparison
equal deleted inserted replaced
39:e4e91fe8b09d 40:1e2d2b0bca5b
84 retlw .1 ; No first gas found, use #1 84 retlw .1 ; No first gas found, use #1
85 get_first_gas_to_WREG3: 85 get_first_gas_to_WREG3:
86 movf lo,W ; Put into Wreg 86 movf lo,W ; Put into Wreg
87 return ; Done 87 return ; Done
88 88
89 global deco_setup
90 deco_setup: 89 deco_setup:
91 banksel char_I_step_is_1min ; Select the right bank... 90 banksel char_I_step_is_1min ; Select the right bank...
92 clrf char_I_step_is_1min ; Default to 2sec steps. 91 clrf char_I_step_is_1min ; Default to 2sec steps.
93 92
94 ; Fixed ambient surface pressure to 1bar. 93 ; Fixed ambient surface pressure to 1bar.
97 movwf int_I_pres_respiration+0 96 movwf int_I_pres_respiration+0
98 movlw HIGH(.1000) 97 movlw HIGH(.1000)
99 movwf int_I_pres_surface+1 98 movwf int_I_pres_surface+1
100 movwf int_I_pres_respiration+1 99 movwf int_I_pres_respiration+1
101 100
102 clrf int_I_divemins+0 ; Dive start 101 clrf int_I_divemins+0 ; Dive start
103 clrf int_I_divemins+1 102 clrf int_I_divemins+1
104 103 bcf use_agf ; =1: Use aGF
105 call get_first_gas_to_WREG ; Gets first gas (0-4) into WREG 104 rcall deco_setup_dive
105
106 movff char_I_setpoint_cbar+0,char_I_const_ppO2 ; Setup fixed Setpoint (Always start with SP1)
107
108 rcall get_first_gas_to_WREG ; Gets first gas (0-4) into WREG
106 movff WREG,char_I_first_gas ; Copy for compatibility 109 movff WREG,char_I_first_gas ; Copy for compatibility
107 extern setup_gas_registers 110 extern setup_gas_registers
108 call setup_gas_registers ; With WREG=Gas 0-4, set current N2/He/O2 ratios. 111 call setup_gas_registers ; With WREG=Gas 0-4, set current N2/He/O2 ratios.
109 extern set_actual_ppo2 112 extern set_actual_ppo2
110 call set_actual_ppo2 ; Then configure char_I_actual_ppO2 (For CNS) 113 call set_actual_ppo2 ; Then configure char_I_actual_ppO2 (For CNS)
114 return
111 115
112 global deco_setup_dive 116 global deco_setup_dive
113 deco_setup_dive: ; Called from divemode 117 deco_setup_dive: ; Called from divemode
114 banksel common ; Bank1 118 banksel common ; Bank1
115 119
588 movff char_I_GF_High_percentage,lo 592 movff char_I_GF_High_percentage,lo
589 output_99x 593 output_99x
590 STRCAT_PRINT "%" 594 STRCAT_PRINT "%"
591 ;bra deco_show_plan_m2 595 ;bra deco_show_plan_m2
592 596
593 deco_show_plan_m2: 597 deco_show_plan_m2:
598 ; Show deco mode
599 extern TFT_display_decotype_surface1
600 WIN_TOP .90
601 lfsr FSR2,buffer
602 movff opt_dive_mode,lo ; 0=OC, 1=CC, 2=Gauge, 3=Apnea
603 call TFT_display_decotype_surface1
594 604
595 ;---- Display TTS result 605 ;---- Display TTS result
596 WIN_TOP .165 606 WIN_TOP .165
597 STRCPY_TEXT tTTS 607 STRCPY_TEXT tTTS
598 STRCAT ": " 608 STRCAT ": "