changeset 803:fec91971e4b9

BUGFIX: Entry time in logbook when dive was around midnight
author heinrichsweikamp
date Fri, 30 Jan 2015 13:39:05 +0100
parents 798c1acb750a
children 7f3f79e53f66
files code_part1/OSTC_code_asm_part1/changelog.txt code_part1/OSTC_code_asm_part1/definitions.asm code_part1/OSTC_code_asm_part1/menu_logbook.asm
diffstat 3 files changed, 30 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/changelog.txt	Mon Oct 13 15:18:47 2014 +0200
+++ b/code_part1/OSTC_code_asm_part1/changelog.txt	Fri Jan 30 13:39:05 2015 +0100
@@ -1,3 +1,8 @@
+New in 3.01:
+Stable Release
+BUGFIX: Entry time in logbook when dive was around midnight
+
+
 New in 3.00:
 Stable Release
 BUGFIX: Fix color codes 192-223 (Mk.2 and 2N only)
--- a/code_part1/OSTC_code_asm_part1/definitions.asm	Mon Oct 13 15:18:47 2014 +0200
+++ b/code_part1/OSTC_code_asm_part1/definitions.asm	Fri Jan 30 13:39:05 2015 +0100
@@ -22,7 +22,7 @@
 ; ToDo:
 
 #DEFINE	softwareversion_x		d'3'		; Software version  XX.YY
-#DEFINE	softwareversion_y		d'0'		; Software version  XX.YY
+#DEFINE	softwareversion_y		d'01'		; Software version  XX.YY
 
 #DEFINE softwareversion_beta 	0 			; (and 0 for release)
 
--- a/code_part1/OSTC_code_asm_part1/menu_logbook.asm	Mon Oct 13 15:18:47 2014 +0200
+++ b/code_part1/OSTC_code_asm_part1/menu_logbook.asm	Fri Jan 30 13:39:05 2015 +0100
@@ -357,6 +357,21 @@
 	movff		PRODL,sub_a+0
 	movff		PRODH,sub_a+1
 	call		subU16					; sub_c = sub_a - sub_b (with UNSIGNED values)
+
+    btfss       neg_flag
+    bra         display_start_dive_normal       ; Not during midnight...
+
+    ; subtract result from 1440 (amount minutes/day)
+    bsf         premenu                ; Set temporary flag
+    movlw       LOW     .1440
+    movwf       sub_a+0
+    movlw       HIGH    .1440
+    movwf       sub_a+1
+    movff       sub_c+0,sub_b+0
+    movff       sub_c+1,sub_b+1
+    call        subU16					; sub_c = sub_a - sub_b (with UNSIGNED values)
+
+display_start_dive_normal:
 	; sub_c:2 holds entry time in minutes
 	movff		sub_c+0,lo
 	movff		sub_c+1,hi
@@ -367,6 +382,15 @@
 	PUTC		':'
 	movff		PRODL,lo			
 	output_99x							; minute
+
+    btfss       premenu                 ; premenu is still 1 if dive was during midnight...
+	bra			logbook_divetime_common
+
+    ; ...show a ",-1" behind the entry time to indicate that...
+    PUTC        ","
+    PUTC        "-"
+    PUTC        "1"
+    bcf         premenu
 	bra			logbook_divetime_common		; Skip end-of-divetime
 	
 display_end_of_divetime: