Mercurial > public > hwos_code
comparison src/gaslist.asm @ 560:b7eb98dbd800
bump to 2.96beta (REFACTORED VERSION)
author | heinrichsweikamp |
---|---|
date | Wed, 31 Jan 2018 19:39:37 +0100 |
parents | 9a17b1db095b |
children | b455b31ce022 |
comparison
equal
deleted
inserted
replaced
559:9cb967d844f0 | 560:b7eb98dbd800 |
---|---|
1 ;============================================================================= | 1 ;============================================================================= |
2 ; | 2 ; |
3 ; File gaslist.asm | 3 ; File gaslist.asm ## V2.95 |
4 ; | 4 ; |
5 ; Managing OSTC gas list | 5 ; Managing OSTC gas list |
6 ; | 6 ; |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. |
8 ;============================================================================= | 8 ;============================================================================= |
56 | 56 |
57 ;============================================================================= | 57 ;============================================================================= |
58 ; Append current mix to current string (For divemode) | 58 ; Append current mix to current string (For divemode) |
59 ; Input: FSR2 : Current string position. | 59 ; Input: FSR2 : Current string position. |
60 ; Output: Text appended into buffer pointed by FSR2. | 60 ; Output: Text appended into buffer pointed by FSR2. |
61 global gaslist_strcat_gasx | 61 global gaslist_strcat_gas6 |
62 gaslist_strcat_gasx: ; Show current O2/He mix | 62 gaslist_strcat_gas6: ; Show current O2/He mix |
63 STRCAT_TEXT tGas | 63 STRCAT_TEXT tGas |
64 STRCAT ": " | 64 STRCAT ": " |
65 movff char_I_O2_ratio,lo | 65 movff gas6_O2_ratio,lo |
66 movff char_I_He_ratio,hi | 66 movff gas6_He_ratio,hi |
67 goto customview_show_mix ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2, and RETURN | 67 goto customview_show_mix ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2, and RETURN |
68 | 68 |
69 global gaslist_show_type | 69 global gaslist_show_type |
70 extern tGasDisabled | 70 extern tGasDisabled |
71 extern tDilDisabled | 71 extern tDilDisabled |
554 movf gaslist_gas,W | 554 movf gaslist_gas,W |
555 movff gaslist_O2,PLUSW1 ; And write back to opt_gas_O2_ratio[WREG] | 555 movff gaslist_O2,PLUSW1 ; And write back to opt_gas_O2_ratio[WREG] |
556 return | 556 return |
557 | 557 |
558 ;---------------------------------------------------------------------------- | 558 ;---------------------------------------------------------------------------- |
559 ; Compute MOD from opt_ppO2_max/opt_ppO2_max_deco and current O2 Ratio. | 559 ; Compute MOD from char_I_ppO2_max/char_I_ppO2_max_deco and current O2 Ratio. |
560 ; | 560 ; |
561 ; Input: gaslist_gas = current gas index. | 561 ; Input: gaslist_gas = current gas index. |
562 ; opt_gas_O2_ratio[gaslist_gas] = current O2 ratio | 562 ; opt_gas_O2_ratio[gaslist_gas] = current O2 ratio |
563 ; Output: WREG = MOD [m] | 563 ; Output: WREG = MOD [m] |
564 ; | 564 ; |
576 | 576 |
577 movf gaslist_gas,W ; Read current gas O2 ratio | 577 movf gaslist_gas,W ; Read current gas O2 ratio |
578 lfsr FSR1,opt_gas_type ; 0=Disabled, 1=First, 2=Travel, 3=Deco for OC gases and 0=Disabled, 1=First, 2=Normal for diluents | 578 lfsr FSR1,opt_gas_type ; 0=Disabled, 1=First, 2=Travel, 3=Deco for OC gases and 0=Disabled, 1=First, 2=Normal for diluents |
579 movff PLUSW1,xA+0 ; xA+0 used as temp here -> holds type | 579 movff PLUSW1,xA+0 ; xA+0 used as temp here -> holds type |
580 | 580 |
581 movff opt_ppO2_max_deco,xB+1 ; xB+1 used as temp here | 581 movff char_I_ppO2_max_deco,xB+1 ; xB+1 used as temp here |
582 movlw .3 | 582 movlw .3 |
583 cpfseq xA+0 ; Deco? | 583 cpfseq xA+0 ; Deco? |
584 movff opt_ppO2_max,xB+1 ; No, overwrite with travel/bottom max | 584 movff char_I_ppO2_max,xB+1 ; No, overwrite with travel/bottom max |
585 movf xB+1,W ; Result in WREG | 585 movf xB+1,W ; Result in WREG |
586 | 586 |
587 clrf xB+1 ; Clear for div16x16 | 587 clrf xB+1 ; Clear for div16x16 |
588 mullw .10 | 588 mullw .10 |
589 movff PRODL,xA+0 | 589 movff PRODL,xA+0 |
597 | 597 |
598 gaslist_calc_mod_divemode: | 598 gaslist_calc_mod_divemode: |
599 extern TFT_color_code1 | 599 extern TFT_color_code1 |
600 movwf hi ; Copy O2% | 600 movwf hi ; Copy O2% |
601 movlw warn_gas_in_gaslist | 601 movlw warn_gas_in_gaslist |
602 call TFT_color_code1 ; Color-code current row in Gaslist (%O2 in hi), opt_ppO2_max/opt_ppO2_max_deco as threshold | 602 call TFT_color_code1 ; Color-code current row in Gaslist (%O2 in hi), char_I_ppO2_max/char_I_ppO2_max_deco as threshold |
603 return | 603 return |
604 ;---------------------------------------------------------------------------- | 604 ;---------------------------------------------------------------------------- |
605 | 605 |
606 global gaslist_ppo2 | 606 global gaslist_ppo2 |
607 gaslist_ppo2: | 607 gaslist_ppo2: |