diff code_part1/OSTC_code_asm_part1/divemode_menu.asm @ 516:b498245da3f1

imperial units patch from Vlad
author heinrichsweikamp
date Mon, 05 Dec 2011 20:40:10 +0100
parents 9fc8feff27a5
children a73a452ca155
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/divemode_menu.asm	Mon Dec 05 14:31:31 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/divemode_menu.asm	Mon Dec 05 20:40:10 2011 +0100
@@ -351,6 +351,20 @@
 divemode_menu_simulator2:
 	dcfsnz	menupos,F
 	bra		timeout_divemenu2			; close underwater menu!
+	GETCUSTOM8  d'63'                   ; Check CF#63 Conversion to imperial units
+	btfss   WREG,0                      ; Enabled ?
+	bra divemode_menu_simulator3        ; NO
+	dcfsnz	menupos,F
+	bra		divemode_menu_simulator_p1ft	; Adjust +1ft
+	dcfsnz	menupos,F
+	bra		divemode_menu_simulator_m1ft	; Adjust -1ft
+	dcfsnz	menupos,F
+	bra		divemode_menu_simulator_p10ft	; Adjust +10ft
+	dcfsnz	menupos,F
+	bra		divemode_menu_simulator_m10ft	; Adjust -10ft
+	bra divemode_menu_simulator4
+
+divemode_menu_simulator3:
 	dcfsnz	menupos,F
 	bra		divemode_menu_simulator_p1	; Adjust +1m
 	dcfsnz	menupos,F
@@ -359,6 +373,8 @@
 	bra		divemode_menu_simulator_p10	; Adjust +10m
 	dcfsnz	menupos,F
 	bra		divemode_menu_simulator_m10	; Adjust -10m
+
+divemode_menu_simulator4:
 	dcfsnz	menupos,F
 	bra		divemode_menu_simulator_quit; Adjust to zero m
 	bra		timeout_divemenu2			; quit underwater menu!
@@ -413,6 +429,25 @@
 	movwf	menupos						; reset cursor
 	bra		divemode_menu_simulator_common
 
+divemode_menu_simulator_m10ft:
+	movlw	LOW		d'305'
+	subwf	sim_pressure+0,F
+	movlw	HIGH	d'305'
+	subwfb	sim_pressure+1,F
+	movlw	d'5'
+	movwf	menupos						; reset cursor
+	bra		divemode_menu_simulator_common
+
+divemode_menu_simulator_p10ft:
+	movlw	LOW		d'305'
+	addwf	sim_pressure+0,F
+	movlw	HIGH	d'305'
+	addwfc	sim_pressure+1,F
+
+	movlw	d'4'
+	movwf	menupos						; reset cursor
+	bra		divemode_menu_simulator_common
+
 divemode_menu_simulator_quit:
 	movlw	LOW		d'1000'
 	movwf	sim_pressure+0
@@ -438,6 +473,24 @@
 	movwf	menupos						; reset cursor
 	bra		divemode_menu_simulator_common
 
+divemode_menu_simulator_p1ft:
+	movlw	d'30'
+	addwf	sim_pressure+0,F
+	movlw	d'0'
+	addwfc	sim_pressure+1,F
+	movlw	d'2'
+	movwf	menupos						; reset cursor
+	bra		divemode_menu_simulator_common
+
+divemode_menu_simulator_m1ft:
+	movlw	d'30'
+	subwf	sim_pressure+0,F
+	movlw	d'0'
+	subwfb	sim_pressure+1,F
+	movlw	d'3'
+	movwf	menupos						; reset cursor
+	bra		divemode_menu_simulator_common
+
 divemenu_see_decoplan:
 	bsf		display_see_deco			; set flag
 	call	PLED_clear_divemode_menu	; Clear Menu