# HG changeset patch
# User JeanDo
# Date 1312906563 -7200
# Node ID a17b85b0fbccd5358dcd2e829cb1325b174d988f
# Parent  b9cf06de8aca20a93cacf8503f86c391926d5cf1
NEW: Decoplanner Warms in red if CNS is too high.

diff -r b9cf06de8aca -r a17b85b0fbcc code_part1/OSTC_code_asm_part1/changelog.txt
--- a/code_part1/OSTC_code_asm_part1/changelog.txt	Tue Aug 09 18:10:27 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/changelog.txt	Tue Aug 09 18:16:03 2011 +0200
@@ -1,6 +1,7 @@
 New in 1.96 beta:
 NEW: Logbook displays ceilings and temperature curve.
 BUGFIX: Decoplanner accumulates CNS during ascent.
+NEW: Decoplanner Warms in red if CNS is too high.
 
 New in 1.95 beta:
 CHANGE: 0.98bar equal 10m depths with salinity set to 1.00kg/l
diff -r b9cf06de8aca -r a17b85b0fbcc code_part1/OSTC_code_asm_part1/simulator.asm
--- a/code_part1/OSTC_code_asm_part1/simulator.asm	Tue Aug 09 18:10:27 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/simulator.asm	Tue Aug 09 18:16:03 2011 +0200
@@ -216,15 +216,30 @@
 
 simulator_decoplan_notts:
         WIN_TOP .190                    ; Print calculated CNS before and after dive
+
+        incf    sim_CNS,W               ; Detect CNS simulation overflow.
+        bz      simulator_decoplan_cns_1
+
+        movlw   .100                    ; Detect if CNS > 100%
+        cpfslt  sim_CNS
+        call    PLED_warnings_color     ; Yes: draw in red !
+
         STRCPY  "CNS:"
         movff   char_O_CNS_fraction,lo  ; Current CNS, before dive.
         output_8
-
         STRCAT  "%\x92"                 ; Right-arrow
+       
         movff   sim_CNS,lo              ; Get back CNS value.
         output_8                        ; CNS after dive.
         STRCAT_PRINT    "%"
+        bra     simulator_decoplan_cns_2
 
+simulator_decoplan_cns_1:
+        call    PLED_warnings_color     ; Yes: draw in red !
+        STRCPY_PRINT    "CNS > 250%"
+
+simulator_decoplan_cns_2:
+        call    PLED_standard_color     ; Back to normal.
         WIN_INVERT	.1	                ; Init new Wordprocessor	
         DISPLAYTEXT	.188		        ; Sim. Results:
         WIN_INVERT	.0                  ; Init new Wordprocessor	
diff -r b9cf06de8aca -r a17b85b0fbcc code_part1/OSTC_code_c_part2/p2_deco.o
Binary file code_part1/OSTC_code_c_part2/p2_deco.o has changed