Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 150:fc699a7460e6
Fix desat graph:
+ clean right part, to allow decreasing animation.
+ In divemode, show every 10 seconds.
author | JeanDo |
---|---|
date | Mon, 10 Jan 2011 02:57:59 +0100 |
parents | 55a763d514ed |
children | e5f1cfec8113 |
comparison
equal
deleted
inserted
replaced
149:55a763d514ed | 150:fc699a7460e6 |
---|---|
2226 movff WREG,win_top | 2226 movff WREG,win_top |
2227 movlw d'18'+1 ; 19 --> height (bank safe !) | 2227 movlw d'18'+1 ; 19 --> height (bank safe !) |
2228 movff WREG,win_height | 2228 movff WREG,win_height |
2229 movlw .122 | 2229 movlw .122 |
2230 movff WREG,win_leftx2 ; column left (0-159) | 2230 movff WREG,win_leftx2 ; column left (0-159) |
2231 | 2231 movlw .16 |
2232 ; Draw used area (lo = minutes): | 2232 movff WREG,win_width ; column max width. |
2233 | |
2234 ; Draw used area (hi = minutes): | |
2233 call PLED_standard_color | 2235 call PLED_standard_color |
2234 movlw d'16' ; Limit length (16min) | 2236 movlw d'16' ; Limit length (16min) |
2235 cpfslt hi | 2237 cpfslt hi |
2236 movwf hi | 2238 movwf hi |
2237 movff hi,win_width ; Bar width | 2239 movff hi,win_bargraph ; Active width, the rest is cleared. |
2238 tstfsz hi ; Skip 0-size bar... | |
2239 call PLED_box | 2240 call PLED_box |
2240 | 2241 |
2241 ; Clear unused area: | |
2242 movlw .0 | |
2243 movff WREG,win_color1 | |
2244 movff WREG,win_color2 | |
2245 movlw .122 ; (width+left-1)+1 | |
2246 addwf hi,W | |
2247 movff WREG,win_leftx2 ; --> left | |
2248 movf hi,W | |
2249 sublw .16 ; 16-left --> width | |
2250 movff WREG,win_width | |
2251 tstfsz WREG ; Skip 0-size bar. | |
2252 call PLED_box | |
2253 | |
2254 ; Restore win_top | 2242 ; Restore win_top |
2255 movff win_top,WREG ; decf win_top (BANK SAFE) | 2243 movff win_top,WREG ; decf win_top (BANK SAFE) |
2256 decf WREG | 2244 decf WREG |
2257 movff WREG,win_top | 2245 movff WREG,win_top |
2258 return | 2246 return |
2261 ; Clear unused area belw last stop | 2249 ; Clear unused area belw last stop |
2262 ; Inputs: win_top : last used area... | 2250 ; Inputs: win_top : last used area... |
2263 PLED_decoplan_clear_bottom: | 2251 PLED_decoplan_clear_bottom: |
2264 movff win_top,WREG ; Get back from bank0 | 2252 movff win_top,WREG ; Get back from bank0 |
2265 btfsc divemode ; In dive mode ? | 2253 btfsc divemode ; In dive mode ? |
2266 sublw .170 ; Yes: bottom row in divemode | 2254 sublw .168 ; Yes: bottom row in divemode |
2267 btfss divemode ; In dive mode ? | 2255 btfss divemode ; In dive mode ? |
2268 sublw .240 ; No: bottom row in planning | 2256 sublw .240 ; No: bottom row in planning |
2269 movff WREG,win_height | 2257 movff WREG,win_height |
2270 | 2258 |
2271 WIN_LEFT .82 ; Full divemenu width | 2259 WIN_LEFT .82 ; Full divemenu width |
2660 lfsr FSR2, char_O_tissue_saturation+.000 ; N2 | 2648 lfsr FSR2, char_O_tissue_saturation+.000 ; N2 |
2661 movlw d'16' | 2649 movlw d'16' |
2662 movwf wait_temp ; 16 tissues | 2650 movwf wait_temp ; 16 tissues |
2663 clrf waitms_temp ; Row offset | 2651 clrf waitms_temp ; Row offset |
2664 | 2652 |
2665 call PLED_standard_color | |
2666 movlw .1 | 2653 movlw .1 |
2667 movff WREG,win_height ; row bottom (0-239) | 2654 movff WREG,win_height ; row bottom (0-239) |
2668 movlw .82+.18 ; surfmode | 2655 movlw .82+.18 ; surfmode |
2669 btfsc divemode | 2656 btfsc divemode |
2670 movlw .90+.18 ; divemode | 2657 movlw .90+.18 ; divemode |
2671 movff WREG,win_leftx2 ; column left (0-159) | 2658 movff WREG,win_leftx2 ; column left (0-159) |
2659 movlw .57 ; surfmode: max width 57pix | |
2660 btfsc divemode | |
2661 movlw .57-8 ; divemode: 8pix less... | |
2662 movff WREG,win_width | |
2672 | 2663 |
2673 PLED_tissue_saturation_graph3: | 2664 PLED_tissue_saturation_graph3: |
2665 call PLED_standard_color ; Reset color foreach iteration | |
2666 | |
2674 movlw .25+3 ; surfmode: 3pix below top border | 2667 movlw .25+3 ; surfmode: 3pix below top border |
2675 btfsc divemode | 2668 btfsc divemode |
2676 movlw .169+3 ; divemode | 2669 movlw .169+3 ; divemode |
2677 addwf waitms_temp,W | 2670 addwf waitms_temp,W |
2678 movff WREG,win_top ; row top (0-239) | 2671 movff WREG,win_top ; row top (0-239) |
2685 rrcf WREG ; And divide by 4 | 2678 rrcf WREG ; And divide by 4 |
2686 bcf STATUS,C | 2679 bcf STATUS,C |
2687 rrcf WREG | 2680 rrcf WREG |
2688 movwf temp1 | 2681 movwf temp1 |
2689 | 2682 |
2690 movlw .57 ; surfmode: max 57pix | 2683 movff win_width,WREG ; Max width. |
2691 btfsc divemode | |
2692 movlw .57-8 ; divemode: 8pix less...s | |
2693 cpfslt temp1 ; skip if 57 (WREG) < win_width | 2684 cpfslt temp1 ; skip if 57 (WREG) < win_width |
2694 movwf temp1 | 2685 movwf temp1 |
2695 movff temp1,win_width | 2686 movff temp1,win_bargraph |
2696 | 2687 |
2697 call PLED_box | 2688 call PLED_box |
2698 | 2689 |
2699 decfsz wait_temp,F | 2690 decfsz wait_temp,F |
2700 bra PLED_tissue_saturation_graph3 | 2691 bra PLED_tissue_saturation_graph3 |
2704 movlw d'16' | 2695 movlw d'16' |
2705 movwf wait_temp ; 16 tissues | 2696 movwf wait_temp ; 16 tissues |
2706 clrf waitms_temp ; Row offset | 2697 clrf waitms_temp ; Row offset |
2707 | 2698 |
2708 PLED_tissue_saturation_graph2: | 2699 PLED_tissue_saturation_graph2: |
2700 call PLED_standard_color ; Reset color foreach iteration | |
2709 | 2701 |
2710 movlw .120-.33 ; surfmode : 33pix above bottom border | 2702 movlw .120-.33 ; surfmode : 33pix above bottom border |
2711 btfsc divemode | 2703 btfsc divemode |
2712 movlw .239-.33 ; divemode | 2704 movlw .239-.33 ; divemode |
2713 addwf waitms_temp,W | 2705 addwf waitms_temp,W |
2720 bcf STATUS,C ; Clear carry | 2712 bcf STATUS,C ; Clear carry |
2721 rrcf WREG ; And divide by 4 | 2713 rrcf WREG ; And divide by 4 |
2722 bcf STATUS,C | 2714 bcf STATUS,C |
2723 rrcf WREG | 2715 rrcf WREG |
2724 movwf temp1 | 2716 movwf temp1 |
2725 movlw .57 ; surfmode: max 57pix | 2717 |
2726 btfsc divemode | 2718 movff win_width,WREG ; Max width. |
2727 movlw .57-8 ; divemode: 8pix less...s | |
2728 cpfslt temp1 ; skip if 57 (WREG) < win_width | 2719 cpfslt temp1 ; skip if 57 (WREG) < win_width |
2729 movwf temp1 | 2720 movwf temp1 |
2730 movff temp1,win_width | 2721 movff temp1,win_bargraph |
2731 | 2722 |
2732 call PLED_box | 2723 call PLED_box |
2733 | 2724 |
2734 decfsz wait_temp,F | 2725 decfsz wait_temp,F |
2735 bra PLED_tissue_saturation_graph2 | 2726 bra PLED_tissue_saturation_graph2 |
2736 | 2727 |
2737 ;---- Draw N2/He Text ---------------------------------------------------- | 2728 ;---- Draw N2/He Text ---------------------------------------------------- |
2729 call PLED_standard_color ; Reset color after last iterarion. | |
2730 | |
2738 movlw .82+2 ; surfmode: 2pix right of left border | 2731 movlw .82+2 ; surfmode: 2pix right of left border |
2739 btfsc divemode | 2732 btfsc divemode |
2740 movlw .90+2 ; divemode | 2733 movlw .90+2 ; divemode |
2741 movff WREG,win_leftx2 | 2734 movff WREG,win_leftx2 |
2742 | 2735 |