comparison code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 128:4c588c3d1f12

Saturation graphs in customview divemode
author JeanDo
date Tue, 04 Jan 2011 15:14:42 +0100
parents 245de99d1d15
children 03df42de03e1
comparison
equal deleted inserted replaced
127:245de99d1d15 128:4c588c3d1f12
21 ; written: 15/01/05 21 ; written: 15/01/05
22 ; 22 ;
23 ; History: 23 ; History:
24 ; 2008-06-06 [MH] last updated 24 ; 2008-06-06 [MH] last updated
25 ; 2010-12-31 [jDG] Multi-page display for GF decoplan 25 ; 2010-12-31 [jDG] Multi-page display for GF decoplan
26 ; 2011-01-04 [jDG] Saturation graphs in customview divemode
26 ; 27 ;
27 ; known bugs: 28 ; known bugs:
28 ; ToDo: More comments 29 ; ToDo: More comments
29 30
30 PLED_divemask_color: 31 PLED_divemask_color:
2509 2510
2510 bcf leftbind 2511 bcf leftbind
2511 return ; no, return 2512 return ; no, return
2512 2513
2513 PLED_clear_divemode_menu: 2514 PLED_clear_divemode_menu:
2514 WIN_BOX_BLACK .0, .169, .82, .160 2515 WIN_BOX_BLACK .0, .168, .82, .160
2515 return 2516 return
2516 2517
2517 PLED_divemenu_cursor: 2518 PLED_divemenu_cursor:
2518 ostc_debug 'l' ; Sends debug-information to screen if debugmode active 2519 ostc_debug 'l' ; Sends debug-information to screen if debugmode active
2519 2520
2548 ; DISPLAYTEXT .127 ;"Exit" 2549 ; DISPLAYTEXT .127 ;"Exit"
2549 ; DISPLAYTEXT .128 ;"Delete" 2550 ; DISPLAYTEXT .128 ;"Delete"
2550 ;; DISPLAYTEXT .132 ;"Format" 2551 ;; DISPLAYTEXT .132 ;"Format"
2551 ; return 2552 ; return
2552 2553
2553 ;PLED_saturation_graph_divemode: 2554
2554 ; ostc_debug 'h' ; Sends debug-information to screen if debugmode active 2555 ;=============================================================================
2556 ; Draw saturation graph, is surface mode or in dive mode.
2557 ;
2555 PLED_tissue_saturation_graph: 2558 PLED_tissue_saturation_graph:
2556 ostc_debug 'i' ; Sends debug-information to screen if debugmode active 2559 ostc_debug 'i' ; Sends debug-information to screen if debugmode active
2557 2560
2558 ;; Clear graph area... 2561 ;---- Draw Frame ---------------------------------------------------------
2559 ; WIN_BOX_BLACK .25, .120, .82, .159 2562 btfsc divemode
2560 2563 bra PLED_tsg_1
2561 ; Draw Frame 2564
2562 WIN_FRAME_STD .25, .120, .82, .159 2565 WIN_FRAME_STD .25, .120, .82, .159 ; Surfmode
2563 2566 bra PLED_tsg_2
2564 ; Draw N2 Tissues 2567 PLED_tsg_1:
2568 WIN_FRAME_STD .169, .239, .90, .159 ; Divemode
2569 PLED_tsg_2:
2570
2571 ;---- Draw grid ----------------------------------------------------------
2572 movlw color_grey
2573 call PLED_set_color
2574
2575 movlw .25+.1 ; surfmode
2576 btfsc divemode
2577 movlw .169+.1 ; divemode
2578 movff WREG,win_top
2579
2580 movlw .120-.25-.1 ; surfmode
2581 btfsc divemode
2582 movlw .239-.169-.1 ; divemode
2583 movff WREG,win_height
2584
2585 movlw 1
2586 movff WREG,win_width
2587
2588 movlw .122
2589 movff WREG,win_leftx2
2590 call PLED_box
2591 movlw .131
2592 movff WREG,win_leftx2
2593 call PLED_box
2594 movlw .140
2595 movff WREG,win_leftx2
2596 call PLED_box
2597 movlw .149
2598 movff WREG,win_leftx2
2599 call PLED_box
2600
2601 ;---- Draw N2 Tissues ----------------------------------------------------
2565 lfsr FSR2, char_O_tissue_saturation+.000 ; N2 2602 lfsr FSR2, char_O_tissue_saturation+.000 ; N2
2566 movlw d'16' 2603 movlw d'16'
2567 movwf wait_temp ; 16 tissues 2604 movwf wait_temp ; 16 tissues
2568 clrf waitms_temp ; Row offset 2605 clrf waitms_temp ; Row offset
2569 2606
2607 call PLED_standard_color
2570 movlw .1 2608 movlw .1
2571 movff WREG,win_height ; row bottom (0-239) 2609 movff WREG,win_height ; row bottom (0-239)
2572 movlw .100 2610 movlw .82+.18 ; surfmode
2611 btfsc divemode
2612 movlw .90+.10 ; divemode
2573 movff WREG,win_leftx2 ; column left (0-159) 2613 movff WREG,win_leftx2 ; column left (0-159)
2574 2614
2575 PLED_tissue_saturation_graph3: 2615 PLED_tissue_saturation_graph3:
2576 2616 movlw .25+3 ; surfmode: 3pix below top border
2577 movlw .28 2617 btfsc divemode
2618 movlw .169+3 ; divemode
2578 addwf waitms_temp,W 2619 addwf waitms_temp,W
2579 movff WREG,win_top ; row top (0-239) 2620 movff WREG,win_top ; row top (0-239)
2580 2621
2581 incf waitms_temp,F 2622 incf waitms_temp,F
2582 incf waitms_temp,F 2623 incf waitms_temp,F
2594 call PLED_box 2635 call PLED_box
2595 2636
2596 decfsz wait_temp,F 2637 decfsz wait_temp,F
2597 bra PLED_tissue_saturation_graph3 2638 bra PLED_tissue_saturation_graph3
2598 2639
2599 ; Draw He Tissues 2640 ;---- Draw He Tissues ----------------------------------------------------
2600 lfsr FSR2, char_O_tissue_saturation+.016 ; He 2641 lfsr FSR2, char_O_tissue_saturation+.016 ; He
2601 movlw d'16' 2642 movlw d'16'
2602 movwf wait_temp ; 16 tissues 2643 movwf wait_temp ; 16 tissues
2603 clrf waitms_temp ; Row offset 2644 clrf waitms_temp ; Row offset
2604
2605 ; movlw .1
2606 ; movff WREG,win_height ; row bottom (0-239)
2607 ; movlw .100
2608 ; movff WREG,win_leftx2 ; column left (0-159)
2609 ; call PLED_standard_color
2610 2645
2611 PLED_tissue_saturation_graph2: 2646 PLED_tissue_saturation_graph2:
2612 2647
2613 movlw .86 2648 movlw .120-.33 ; surfmode : 33pix above bottom border
2649 btfsc divemode
2650 movlw .239-.33 ; divemode
2614 addwf waitms_temp,W 2651 addwf waitms_temp,W
2615 movff WREG,win_top ; row top (0-239) 2652 movff WREG,win_top ; row top (0-239)
2616 2653
2617 incf waitms_temp,F 2654 incf waitms_temp,F
2618 incf waitms_temp,F 2655 incf waitms_temp,F
2630 call PLED_box 2667 call PLED_box
2631 2668
2632 decfsz wait_temp,F 2669 decfsz wait_temp,F
2633 bra PLED_tissue_saturation_graph2 2670 bra PLED_tissue_saturation_graph2
2634 2671
2635 ; Draw Text 2672 ;---- Draw N2/He Text ----------------------------------------------------
2636 WIN_LEFT .84 2673 movlw .82+2 ; surfmode: 2pix right of left border
2637 WIN_TOP .32 2674 btfsc divemode
2675 movlw .90+2 ; divemode
2676 movff WREG,win_leftx2
2677
2678 movlw .25+7 ; surfmode: 7pix below top border
2679 btfsc divemode
2680 movlw .169+7 ; divemode
2681 movff WREG,win_top
2638 STRCPY_PRINT "N2" 2682 STRCPY_PRINT "N2"
2639 2683
2640 WIN_TOP .90 2684 movlw .120-.30 ; surfmode: 30pix above bottom border
2685 btfsc divemode
2686 movlw .239-.30 ; divemode
2687 movff WREG,win_top
2641 STRCPY_PRINT "He" 2688 STRCPY_PRINT "He"
2689
2690 ;---- Draw scale and O2[16]% ---------------------------------------------
2691 btfsc divemode
2692 return
2642 2693
2643 movff char_O_gtissue_no,wait_temp ; used as temp 2694 movff char_O_gtissue_no,wait_temp ; used as temp
2644 2695
2645 lfsr FSR1,char_O_tissue_saturation+0 2696 lfsr FSR1,char_O_tissue_saturation+0
2646 incf wait_temp,F ; make 1-16 of 0-15 2697 incf wait_temp,F ; make 1-16 of 0-15
2648 PLED_tissue_saturation_graph4: ; point to leading tissue... 2699 PLED_tissue_saturation_graph4: ; point to leading tissue...
2649 movff POSTINC1,lo ; copy/overwrite to lo register 2700 movff POSTINC1,lo ; copy/overwrite to lo register
2650 decfsz wait_temp,F ; count until zero 2701 decfsz wait_temp,F ; count until zero
2651 bra PLED_tissue_saturation_graph4 ;loop 2702 bra PLED_tissue_saturation_graph4 ;loop
2652 2703
2653 lfsr FSR2,letter
2654 output_8
2655 STRCAT "% "
2656
2657 WIN_TOP .62 2704 WIN_TOP .62
2658 WIN_FONT FT_SMALL 2705 WIN_FONT FT_SMALL
2659 call word_processor 2706 lfsr FSR2,letter
2660 bcf leftbind 2707 bsf leftbind
2661 2708 output_8
2662 ; Draw Scale 2709 bcf leftbind
2710
2711 STRCAT_PRINT "% "
2712
2713 ;---- Draw Scale ---------------------------------------------------------
2663 WIN_BOX_STD .73, .74, .121, .157 2714 WIN_BOX_STD .73, .74, .121, .157
2664 WIN_BOX_STD .61, .84, .121, .122 2715 WIN_BOX_STD .61, .84, .121, .122
2665 WIN_BOX_STD .65, .80, .130, .131 2716 WIN_BOX_STD .65, .80, .130, .131
2666 WIN_BOX_STD .65, .80, .139, .140 2717 WIN_BOX_STD .65, .80, .139, .140
2667 WIN_BOX_STD .65, .80, .148, .149 2718 WIN_BOX_STD .65, .80, .148, .149
2668 WIN_BOX_STD .61, .84, .157, .158 2719 WIN_BOX_STD .61, .84, .157, .158
2669 return 2720 return
2721
2722 ;=============================================================================
2670 2723
2671 PLED_startupscreen1: 2724 PLED_startupscreen1:
2672 call PLED_topline_box 2725 call PLED_topline_box
2673 WIN_INVERT .1 ; Init new Wordprocessor 2726 WIN_INVERT .1 ; Init new Wordprocessor
2674 DISPLAYTEXT d'3' ; "HeinrichsWeikamp" 2727 DISPLAYTEXT d'3' ; "HeinrichsWeikamp"