# HG changeset patch # User heinrichsweikamp # Date 1404812340 -7200 # Node ID ec0b1e8293998df7c638957c731d3ae259b27303 # Parent 35b9da423de66edfc656f5007d0f125af97e59e1 Bugfix: Start dive mode simulator in correct depth diff -r 35b9da423de6 -r ec0b1e829399 src/changelog.txt --- a/src/changelog.txt Fri Jul 04 12:51:20 2014 +0200 +++ b/src/changelog.txt Tue Jul 08 11:39:00 2014 +0200 @@ -2,6 +2,7 @@ - Beta Version - NEW: Update warnings every second NEW: Show "Stop" in front of Safety Stop +BUGFIX: Start dive mode simulator in correct depth New in 1.41: - Beta Version - diff -r 35b9da423de6 -r ec0b1e829399 src/ostc3.inc --- a/src/ostc3.inc Fri Jul 04 12:51:20 2014 +0200 +++ b/src/ostc3.inc Tue Jul 08 11:39:00 2014 +0200 @@ -121,7 +121,6 @@ #DEFINE depth_warn_mbar .13000 ; [mbar] #DEFINE wake_up_from_sleep .1160 ; [mbar] #DEFINE gf_display_threshold .20 ; [%] -#DEFINE simulator_start_depth .2500 ; [mbar] + 1000mbar surface #DEFINE simulator_timeout .15 ; [s] diff -r 35b9da423de6 -r ec0b1e829399 src/simulator.asm --- a/src/simulator.asm Fri Jul 04 12:51:20 2014 +0200 +++ b/src/simulator.asm Tue Jul 08 11:39:00 2014 +0200 @@ -709,15 +709,18 @@ bra $-2 bsf simulatormode_active ; Set Flag - movlw LOW simulator_start_depth - movff WREG,rel_pressure+0 - movlw HIGH simulator_start_depth - movff WREG,rel_pressure+1 ; Set Depth - - movlw LOW (simulator_start_depth+.1000) - movff WREG,sim_pressure+0 - movlw HIGH (simulator_start_depth+.1000) - movff WREG,sim_pressure+1 ; Set Depth + ; Compute dive ambient conditions + banksel char_I_bottom_depth + movf char_I_bottom_depth,W + mullw .100 + movff PRODL,rel_pressure+0 + movff PRODH,rel_pressure+1 + movlw LOW(.1000) + addwf PRODL,W + movff WREG,sim_pressure+0 + movlw HIGH(.1000) + addwfc PRODH,W + movff WREG,sim_pressure+1 bsf divemode goto diveloop ; Switch into Divemode!