diff code_part1/OSTC_code_asm_part1/divemode.asm @ 793:55bd11e07d9f

BUGFIX: Surface interval was paused during simulator
author heinrichsweikamp
date Sun, 28 Sep 2014 20:56:16 +0200
parents 53425d598585
children ba084dfa4b36
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Fri Aug 29 10:35:26 2014 +0200
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Sun Sep 28 20:56:16 2014 +0200
@@ -1302,7 +1302,7 @@
 ; In DEBUG compile, keep all simulated dives in logbook, Desat time, nofly, etc...
     ifndef __DEBUG
     	btfsc	simulatormode_active		; Are we in simulator mode?
-    	goto	end_dive_common				; Yes, discard everything
+    	goto	end_dive_common_sim         ; Yes, discard everything
     endif
 
 	; Dive finished (and longer then one minute or Apnoe timeout occured)
@@ -1682,6 +1682,13 @@
 
 	goto	surfloop_no_display_init	; and return to surfaceloop
 
+end_dive_common_sim:
+    movf    divemins+0,W
+    addwf   surface_interval+0,F
+    movf    divemins+1,W
+	addwfc  surface_interval+1				; Add simulated divetime to surface interval
+    bra     end_dive_common
+
 timeout_divemode:
 	btfss	realdive					; Dive longer then one minute
 	return