diff code_part1/OSTC_code_asm_part1/divemode_menu.asm @ 395:0e0cf4701c17

Merge with 64kByte Logbook
author JeanDo
date Thu, 23 Jun 2011 01:37:59 +0200
parents 88660a400338
children 47b1135cbff3
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/divemode_menu.asm	Fri Jun 10 01:14:38 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/divemode_menu.asm	Thu Jun 23 01:37:59 2011 +0200
@@ -131,6 +131,8 @@
 	movlw	d'7'						; Number of entries for this menu+1 = 7
 	btfsc	display_set_xgas			; Are we in the Gas6 menu?
 	movlw	d'7'						; Number of entries for this menu+1 = 7
+	btfsc	display_set_simulator		; Are we in the simulator menu?
+	movlw	d'7'						; Number of entries for this menu+1 = 7
 	cpfseq	menupos						; =limit?
 	bra		test_switches_divemode_menu1; No!
 	movlw	d'1'						; Yes, reset to position 1!
@@ -348,6 +350,8 @@
 	bra		divemode_menu_simulator_p10	; Adjust +10m
 	dcfsnz	menupos,F
 	bra		divemode_menu_simulator_m10	; Adjust -10m
+	dcfsnz	menupos,F
+	bra		divemode_menu_simulator_quit; Adjust to zero m
 	bra		timeout_divemenu2			; quit underwater menu!
 
 divemode_menu_simulator_common:
@@ -366,7 +370,6 @@
 	movlw	HIGH	d'14000'
 	movwf	sim_pressure+1
 	return
-
 divemode_menu_simulator_common2:
 	movlw	LOW		d'1000'             ; Compare to 1bar == 0m == 1000 mbar.
 	subwf   sim_pressure+0,W
@@ -401,6 +404,13 @@
 	movwf	menupos						; reset cursor
 	bra		divemode_menu_simulator_common
 
+divemode_menu_simulator_quit:
+	movlw	LOW		d'1000'
+	movwf	sim_pressure+0
+	movlw	HIGH	d'1000'
+	movwf	sim_pressure+1
+	bra		timeout_divemenu2			; quit menu
+
 divemode_menu_simulator_p1:
 	movlw	d'100'
 	addwf	sim_pressure+0,F