# HG changeset patch # User JeanDo # Date 1303175542 -7200 # Node ID 8514588eb6a2c7453b5db5bf79859a4c637c52ab # Parent 17aab4ca05475d224c78220203b29523bffcfa98 Mark gas-switch stops for decoplans, displayed in yellow. diff -r 17aab4ca0547 -r 8514588eb6a2 code_part1/OSTC_code_asm_part1/pled_outputs.asm --- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm Tue Apr 19 02:26:41 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm Tue Apr 19 03:12:22 2011 +0200 @@ -2348,6 +2348,7 @@ ;----------------------------------------------------------------------------- ; Draw a stop of the deco plan (simulator or dive). ; Inputs: lo = depth. Range 3m...93m +; + 80 if this is a switch-gas stop. ; hi = minutes. range 1'..240'. ; win_top = line to draw on screen. ; Trashed: hi, lo, win_height, win_leftx2, win_width, win_color*, @@ -2356,7 +2357,19 @@ PLED_decoplan_show_stop: ;---- Print depth ---------------------------------------------------- WIN_LEFT .100 + + btfss lo,7 ; Bit set ? + bra PLED_decoplan_std_stop ; No : Just an usual stop. + + movlw b'11111101' ; Yellow. + call PLED_set_color + bcf lo,7 ; and cleanup depth. + bra PLED_decoplan_nstd_stop + +PLED_decoplan_std_stop: call PLED_standard_color + +PLED_decoplan_nstd_stop: lfsr FSR2,letter bsf leftbind output_8 ; outputs into Postinc2! @@ -2390,7 +2403,6 @@ movff WREG,win_width ; column max width. ; Draw used area (hi = minutes): - call PLED_standard_color movlw d'16' ; Limit length (16min) cpfslt hi movwf hi @@ -2398,6 +2410,7 @@ call PLED_box ; Restore win_top + call PLED_standard_color movff win_top,WREG ; decf win_top (BANK SAFE) decf WREG movff WREG,win_top diff -r 17aab4ca0547 -r 8514588eb6a2 code_part1/OSTC_code_asm_part1/simulator.asm --- a/code_part1/OSTC_code_asm_part1/simulator.asm Tue Apr 19 02:26:41 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/simulator.asm Tue Apr 19 03:12:22 2011 +0200 @@ -151,6 +151,9 @@ ostc_debug 'P' ; Sends debug-information to screen if debugmode active goto diveloop ; Start Divemode +;============================================================================= +; Show decoplanning result. +; simulator_show_decoplan: call PLED_ClearScreen call PLED_simdata_screen @@ -168,7 +171,7 @@ WIN_TOP .160 lfsr FSR2, letter - OUTPUTTEXT .85 ; TTS (for translation). + OUTPUTTEXT .85 ; TTS STRCAT ": " bsf leftbind output_16 diff -r 17aab4ca0547 -r 8514588eb6a2 code_part1/OSTC_code_c_part2/p2_deco.c --- a/code_part1/OSTC_code_c_part2/p2_deco.c Tue Apr 19 02:26:41 2011 +0200 +++ b/code_part1/OSTC_code_c_part2/p2_deco.c Tue Apr 19 03:12:22 2011 +0200 @@ -829,7 +829,7 @@ { // Copy depth of the first (deepest) stop, because when reversing // order, it will be hard to find... - char_O_first_deco_depth = internal_deco_depth[0]; + char_O_first_deco_depth = internal_deco_depth[0] & 0x7F; char_O_first_deco_time = internal_deco_time [0]; if( read_custom_function(54) & 1 ) //---- Should we reverse table ? ------ @@ -1836,7 +1836,7 @@ // Make sure deco-stops are recorded in order: assert( !internal_deco_depth[x] || temp_depth_limit <= internal_deco_depth[x] ); - if( internal_deco_depth[x] == temp_depth_limit ) + if( (internal_deco_depth[x] & 0x7F) == temp_depth_limit ) { // Do not overflow (max 255') if( internal_deco_time[x] < 255 ) @@ -1850,6 +1850,9 @@ if( internal_deco_depth[x] == 0 ) { internal_deco_depth[x] = temp_depth_limit; + if( sim_gas_delay > sim_dive_mins ) + internal_deco_depth[x] |= 0x80; + internal_deco_time[x] = 1; return; } diff -r 17aab4ca0547 -r 8514588eb6a2 code_part1/OSTC_code_c_part2/p2_deco.o Binary file code_part1/OSTC_code_c_part2/p2_deco.o has changed