# HG changeset patch # User heinrichsweikamp # Date 1422621545 -3600 # Node ID fec91971e4b9b3ea0758566f03d392d34e83e980 # Parent 798c1acb750af466cd0e4b3cfc8016e787fd4461 BUGFIX: Entry time in logbook when dive was around midnight diff -r 798c1acb750a -r fec91971e4b9 code_part1/OSTC_code_asm_part1/changelog.txt --- 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) diff -r 798c1acb750a -r fec91971e4b9 code_part1/OSTC_code_asm_part1/definitions.asm --- 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) diff -r 798c1acb750a -r fec91971e4b9 code_part1/OSTC_code_asm_part1/menu_logbook.asm --- 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: