diff code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 274:a728b4a1b660

Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
author heinrichsweikamp
date Sun, 17 Apr 2011 17:57:44 +0200
parents d8dfbc7041b0
children 46d1012d096a
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Wed Apr 13 10:07:37 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Sun Apr 17 17:57:44 2011 +0200
@@ -3040,6 +3040,62 @@
 	call	PLED_standard_color
 	return
 
+PLED_show_end_ead_divemode:
+	WIN_LEFT	.95
+	WIN_TOP		.192
+	WIN_FONT	FT_SMALL
+	call		PLED_divemask_color	; Set Color for Divemode mask
+	lfsr	FSR2,letter
+	STRCAT_PRINT  "EAD:"
+	WIN_LEFT	.95
+	WIN_TOP		.216
+	lfsr	FSR2,letter
+	STRCAT_PRINT  "END:"
+; Show EAD: char_I_N2_ratio/0.79*rel_pressure:2*10 -> char_I_N2_ratio*rel_pressure:2/7900 -> EAD in m
+	call	PLED_standard_color
+	WIN_LEFT	.125
+	WIN_TOP		.192
+	movff	char_I_N2_ratio,xA+0
+	clrf	xA+1
+	movff	rel_pressure+0,xB+0
+	movff	rel_pressure+1,xB+1
+	call	mult16x16                   ; xA*xB=xC
+	movlw	LOW		d'7900'
+	movwf	xB+0
+	movlw	HIGH	d'7900'
+	movwf	xB+1
+	call	div32x16  ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
+	movff	xC+0,lo
+	movff	xC+1,hi						; lo:hi now hold EAD in m
+	lfsr	FSR2,letter
+	output_16_3							; Display only full meters
+	STRCAT_PRINT  "m"					; Display EAD
+
+	WIN_LEFT	.125
+	WIN_TOP		.216
+; Show END = rel_pressure × (100 - char_I_He_ratio)/10000 -> Result in m
+	movff	char_I_He_ratio,lo			; temp
+	movlw	d'100'
+	bsf		STATUS,C	
+	subfwb	lo,W
+	movwf	xA+0
+	clrf	xA+1
+	movff	rel_pressure+0,xB+0
+	movff	rel_pressure+1,xB+1
+	call	mult16x16                   ; xA*xB=xC
+	movlw	LOW		d'10000'
+	movwf	xB+0
+	movlw	HIGH	d'10000'
+	movwf	xB+1
+	call	div32x16  ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
+	movff	xC+0,lo
+	movff	xC+1,hi						; lo:hi now hold END in m
+	lfsr	FSR2,letter
+	output_16_3
+	STRCAT_PRINT  "m"					; Display END
+	return
+
+
 PLED_show_leading_tissue:
 	call		PLED_divemask_color	; Set Color for Divemode mask
 	DISPLAYTEXTH	.282		; L. Tissue: