Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/menu_gassetup.asm @ 123:6a94f96e9cea
The big cleanup, again.
author | JeanDo |
---|---|
date | Thu, 30 Dec 2010 23:45:20 +0100 |
parents | e0f29e20bd24 |
children | f5e9db793dd3 |
comparison
equal
deleted
inserted
replaced
122:3003a8040b78 | 123:6a94f96e9cea |
---|---|
53 movlw d'30' | 53 movlw d'30' |
54 addwf waitms_temp,F ; Increase row | 54 addwf waitms_temp,F ; Increase row |
55 movf waitms_temp,W ; Load row into WREG | 55 movf waitms_temp,W ; Load row into WREG |
56 movff WREG,win_top | 56 movff WREG,win_top |
57 lfsr FSR2,letter | 57 lfsr FSR2,letter |
58 movlw 'G' | 58 PUTC 'G' |
59 movwf POSTINC2 | |
60 movff decodata+0,lo | 59 movff decodata+0,lo |
61 incf lo,F | 60 incf lo,F |
62 bsf leftbind | 61 bsf leftbind |
63 output_99 | 62 output_99 |
64 movlw ':' | 63 PUTC ':' |
65 movwf POSTINC2 | |
66 | 64 |
67 movf decodata+0,W | 65 movf decodata+0,W |
68 call PLED_grey_inactive_gas ; Sets Greyvalue for inactive gases | 66 call PLED_grey_inactive_gas ; Sets Greyvalue for inactive gases |
69 call word_processor | 67 call word_processor |
70 WIN_LEFT .40 | 68 WIN_LEFT .40 |
76 movwf EEADR | 74 movwf EEADR |
77 call read_eeprom ; Get current startgas 1-5 # into EEDATA | 75 call read_eeprom ; Get current startgas 1-5 # into EEDATA |
78 decf EEDATA,W ; 0-4 | 76 decf EEDATA,W ; 0-4 |
79 cpfseq decodata+0 ; =current displayed gas #? | 77 cpfseq decodata+0 ; =current displayed gas #? |
80 bra menu_gassetup_Tx ; no, do not display * | 78 bra menu_gassetup_Tx ; no, do not display * |
81 movlw '*' ; display * | 79 PUTC '*' ; display * |
82 movwf POSTINC2 | |
83 | 80 |
84 ; New v1.44se | 81 ; New v1.44se |
85 menu_gassetup_Tx: | 82 menu_gassetup_Tx: |
86 movf decodata+0,W | 83 movf decodata+0,W |
87 call PLED_grey_inactive_gas ; Sets Greyvalue for inactive gases | 84 call PLED_grey_inactive_gas ; Sets Greyvalue for inactive gases |
105 call gassetup_write_Tx | 102 call gassetup_write_Tx |
106 movff wait_temp, EEADR ; Gas %O2 - Set address in internal EEPROM | 103 movff wait_temp, EEADR ; Gas %O2 - Set address in internal EEPROM |
107 call read_eeprom ; O2 value | 104 call read_eeprom ; O2 value |
108 movff EEDATA,lo | 105 movff EEDATA,lo |
109 output_8 | 106 output_8 |
110 movlw '/' | 107 PUTC '/' |
111 movwf POSTINC2 | |
112 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM | 108 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM |
113 call read_eeprom ; He value | 109 call read_eeprom ; He value |
114 movff EEDATA,lo | 110 movff EEDATA,lo |
115 output_8 | 111 output_8 |
116 bra menu_gassetup_list0 | 112 bra menu_gassetup_list0 |
133 output_8 | 129 output_8 |
134 bra menu_gassetup_list0 | 130 bra menu_gassetup_list0 |
135 | 131 |
136 ; New v1.44se | 132 ; New v1.44se |
137 menu_gassetup_O2: | 133 menu_gassetup_O2: |
138 movlw 'O' | 134 STRCAT "O2 " |
139 movwf POSTINC2 | |
140 movlw '2' | |
141 movwf POSTINC2 | |
142 movlw ' ' | |
143 movwf POSTINC2 | |
144 output_8 | 135 output_8 |
145 bra menu_gassetup_list0 | 136 bra menu_gassetup_list0 |
146 | 137 |
147 ; New v1.44se | 138 ; New v1.44se |
148 menu_gassetup_Air: | 139 menu_gassetup_Air: |
149 cpfseq lo ; o2 = 21% | 140 cpfseq lo ; o2 = 21% |
150 call menu_gassetup_Err | 141 call menu_gassetup_Err |
151 | 142 |
152 movlw 'A' | 143 STRCAT "AIR " |
153 movwf POSTINC2 | |
154 movlw 'I' | |
155 movwf POSTINC2 | |
156 movlw 'R' | |
157 movwf POSTINC2 | |
158 movlw ' ' | |
159 movwf POSTINC2 | |
160 output_8 | 144 output_8 |
161 bra menu_gassetup_list0 | 145 bra menu_gassetup_list0 |
162 | 146 |
163 ; New v1.44se | 147 ; New v1.44se |
164 menu_gassetup_Err: | 148 menu_gassetup_Err: |
165 movlw 'E' | 149 STRCAT "ERR " |
166 movwf POSTINC2 | |
167 movlw 'R' | |
168 movwf POSTINC2 | |
169 movlw 'R' | |
170 movwf POSTINC2 | |
171 movlw ' ' | |
172 movwf POSTINC2 | |
173 output_8 | 150 output_8 |
174 | 151 |
175 ; Changed v1.44se | 152 ; Changed v1.44se |
176 menu_gassetup_list0: | 153 menu_gassetup_list0: |
177 movf decodata+0,W | 154 movf decodata+0,W |
181 WIN_LEFT .105 | 158 WIN_LEFT .105 |
182 movf waitms_temp,W ; Load row into WREG | 159 movf waitms_temp,W ; Load row into WREG |
183 movff WREG,win_top | 160 movff WREG,win_top |
184 lfsr FSR2,letter | 161 lfsr FSR2,letter |
185 | 162 |
186 movlw ' ' | 163 STRCAT " in " |
187 movwf POSTINC2 | |
188 movlw 'i' | |
189 movwf POSTINC2 | |
190 movlw 'n' | |
191 movwf POSTINC2 | |
192 movlw ' ' | |
193 movwf POSTINC2 | |
194 movf decodata+0,W ; read current value | 164 movf decodata+0,W ; read current value |
195 addlw d'28' ; offset in memory | 165 addlw d'28' ; offset in memory |
196 movwf EEADR | 166 movwf EEADR |
197 call read_eeprom ; Low-value | 167 call read_eeprom ; Low-value |
198 movff EEDATA,lo | 168 movff EEDATA,lo |
199 output_8 | 169 output_8 |
200 movlw 'm' | 170 PUTC 'm' |
201 movwf POSTINC2 | |
202 movf decodata+0,W | 171 movf decodata+0,W |
203 call PLED_grey_inactive_gas ; Sets Greyvalue for inactive gases | 172 call PLED_grey_inactive_gas ; Sets Greyvalue for inactive gases |
204 call word_processor | 173 call word_processor |
205 | 174 |
206 call PLED_standard_color | 175 call PLED_standard_color |
330 | 299 |
331 rcall gassetup_title_bar2 ; Displays the title bar with the current Gas info | 300 rcall gassetup_title_bar2 ; Displays the title bar with the current Gas info |
332 | 301 |
333 WIN_TOP .65 | 302 WIN_TOP .65 |
334 WIN_LEFT .20 | 303 WIN_LEFT .20 |
335 lfsr FSR2,letter | 304 |
336 movlw 'O' | 305 STRCPY "O2: " |
337 movwf POSTINC2 | |
338 movlw '2' | |
339 movwf POSTINC2 | |
340 movlw ':' | |
341 movwf POSTINC2 | |
342 movlw ' ' | |
343 movwf POSTINC2 | |
344 | 306 |
345 movf divemins+0,W | 307 movf divemins+0,W |
346 addlw 0x06 | 308 addlw 0x06 |
347 movwf EEADR | 309 movwf EEADR |
348 call read_eeprom ; O2 value | 310 call read_eeprom ; O2 value |
349 movff EEDATA,lo | 311 movff EEDATA,lo |
350 output_8 | 312 output_8 |
351 movlw '%' | 313 STRCAT "% (MOD:" |
352 movwf POSTINC2 | |
353 movlw ' ' | |
354 movwf POSTINC2 | |
355 movlw '(' | |
356 movwf POSTINC2 | |
357 movlw 'M' | |
358 movwf POSTINC2 | |
359 movlw 'O' | |
360 movwf POSTINC2 | |
361 movlw 'D' | |
362 movwf POSTINC2 | |
363 movlw ':' | |
364 movwf POSTINC2 | |
365 | 314 |
366 ; Show MOD in m | 315 ; Show MOD in m |
367 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG | 316 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG |
368 mullw d'10' | 317 mullw d'10' |
369 movff PRODL,xA+0 | 318 movff PRODL,xA+0 |
381 movff xC+0,lo | 330 movff xC+0,lo |
382 movlw d'0' | 331 movlw d'0' |
383 subwfb xC+1,F | 332 subwfb xC+1,F |
384 movff xC+1,hi | 333 movff xC+1,hi |
385 output_16 | 334 output_16 |
386 movlw 'm' | 335 STRCAT_PRINT "m) " |
387 movwf POSTINC2 | |
388 movlw ')' | |
389 movwf POSTINC2 | |
390 movlw ' ' | |
391 movwf POSTINC2 | |
392 movlw ' ' | |
393 movwf POSTINC2 | |
394 call word_processor | |
395 | 336 |
396 WIN_TOP .95 | 337 WIN_TOP .95 |
397 lfsr FSR2,letter | 338 STRCPY "He: " |
398 movlw 'H' | |
399 movwf POSTINC2 | |
400 movlw 'e' | |
401 movwf POSTINC2 | |
402 movlw ':' | |
403 movwf POSTINC2 | |
404 movlw ' ' | |
405 movwf POSTINC2 | |
406 movf divemins+0,W | 339 movf divemins+0,W |
407 addlw 0x07 | 340 addlw 0x07 |
408 movwf EEADR | 341 movwf EEADR |
409 call read_eeprom ; He value | 342 call read_eeprom ; He value |
410 movff EEDATA,lo | 343 movff EEDATA,lo |
411 output_8 | 344 output_8 |
412 movlw '%' | 345 STRCAT "% (END:" |
413 movwf POSTINC2 | |
414 movlw ' ' | |
415 movwf POSTINC2 | |
416 movlw '(' | |
417 movwf POSTINC2 | |
418 movlw 'E' | |
419 movwf POSTINC2 | |
420 movlw 'N' | |
421 movwf POSTINC2 | |
422 movlw 'D' | |
423 movwf POSTINC2 | |
424 movlw ':' | |
425 movwf POSTINC2 | |
426 | 346 |
427 ; Show END in m | 347 ; Show END in m |
428 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG | 348 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG |
429 mullw d'10' | 349 mullw d'10' |
430 movff PRODL,xA+0 | 350 movff PRODL,xA+0 |
471 movff xC+0,lo | 391 movff xC+0,lo |
472 movlw d'0' | 392 movlw d'0' |
473 subwfb xC+1,F | 393 subwfb xC+1,F |
474 movff xC+1,hi | 394 movff xC+1,hi |
475 output_16 | 395 output_16 |
476 movlw 'm' | 396 STRCAT_PRINT "m) " |
477 movwf POSTINC2 | |
478 movlw ')' | |
479 movwf POSTINC2 | |
480 movlw ' ' | |
481 movwf POSTINC2 | |
482 movlw ' ' | |
483 movwf POSTINC2 | |
484 | |
485 call word_processor | |
486 | 397 |
487 WIN_TOP .125 | 398 WIN_TOP .125 |
488 lfsr FSR2,letter | 399 STRCPY "+/-: " |
489 movlw '+' | |
490 movwf POSTINC2 | |
491 movlw '/' | |
492 movwf POSTINC2 | |
493 movlw '-' | |
494 movwf POSTINC2 | |
495 movlw ':' | |
496 movwf POSTINC2 | |
497 movlw ' ' | |
498 movwf POSTINC2 | |
499 movlw '+' | 400 movlw '+' |
500 btfsc first_FA | 401 btfsc first_FA |
501 movlw '-' | 402 movlw '-' |
502 movwf POSTINC2 | 403 movwf POSTINC2 |
503 call word_processor | 404 call word_processor |
509 addlw 0x04 | 410 addlw 0x04 |
510 movwf EEADR | 411 movwf EEADR |
511 call read_eeprom ; Default O2 value | 412 call read_eeprom ; Default O2 value |
512 movff EEDATA,lo | 413 movff EEDATA,lo |
513 output_8 | 414 output_8 |
514 movlw '/' | 415 PUTC '/' |
515 movwf POSTINC2 | |
516 movf divemins+0,W | 416 movf divemins+0,W |
517 addlw 0x05 | 417 addlw 0x05 |
518 movwf EEADR | 418 movwf EEADR |
519 call read_eeprom ; Default He value | 419 call read_eeprom ; Default He value |
520 movff EEDATA,lo | 420 movff EEDATA,lo |
521 output_8 | 421 output_8 |
522 movlw ' ' | 422 STRCAT_PRINT " " |
523 movwf POSTINC2 | |
524 movlw ' ' | |
525 movwf POSTINC2 | |
526 call word_processor | |
527 | 423 |
528 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! | 424 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! |
529 call PLED_menu_cursor | 425 call PLED_menu_cursor |
530 | 426 |
531 gassetup_loop: | 427 gassetup_loop: |
772 | 668 |
773 OUTPUTTEXT .96 ; Yes | 669 OUTPUTTEXT .96 ; Yes |
774 bra active_gas_display_end | 670 bra active_gas_display_end |
775 | 671 |
776 active_gas_display_no: | 672 active_gas_display_no: |
777 movlw ' ' ; three spaces instead of "Yes" | 673 STRCAT " " ; three spaces instead of "Yes" |
778 movwf POSTINC2 | |
779 movlw ' ' | |
780 movwf POSTINC2 | |
781 movlw ' ' | |
782 movwf POSTINC2 | |
783 | 674 |
784 active_gas_display_end: | 675 active_gas_display_end: |
785 call word_processor | 676 call word_processor |
786 | 677 |
787 WIN_TOP .95 | 678 WIN_TOP .95 |
788 WIN_LEFT .20 | 679 WIN_LEFT .20 |
789 lfsr FSR2,letter | 680 lfsr FSR2,letter |
790 OUTPUTTEXT .88 ; First Gas? | 681 OUTPUTTEXT .88 ; First Gas? |
791 movlw ' ' | 682 PUTC ' ' |
792 movwf POSTINC2 | |
793 | 683 |
794 movlw d'33' | 684 movlw d'33' |
795 movwf EEADR | 685 movwf EEADR |
796 call read_eeprom ; Get current startgas 1-5 # into EEDATA | 686 call read_eeprom ; Get current startgas 1-5 # into EEDATA |
797 decf EEDATA,W ; 0-4 | 687 decf EEDATA,W ; 0-4 |
800 | 690 |
801 OUTPUTTEXT .96 ; Yes | 691 OUTPUTTEXT .96 ; Yes |
802 bra menu_firstgas1 | 692 bra menu_firstgas1 |
803 | 693 |
804 menu_firstgas0: | 694 menu_firstgas0: |
805 movlw ' ' | 695 STRCAT " " ; 3 spaces. |
806 movwf POSTINC2 | |
807 movlw ' ' | |
808 movwf POSTINC2 | |
809 movlw ' ' | |
810 movwf POSTINC2 | |
811 | 696 |
812 menu_firstgas1: | 697 menu_firstgas1: |
813 call word_processor | 698 call word_processor |
814 | 699 |
815 WIN_TOP .125 | 700 WIN_TOP .125 |
983 OUTPUTTEXT .95 ; Gas# | 868 OUTPUTTEXT .95 ; Gas# |
984 movff decodata+0,lo | 869 movff decodata+0,lo |
985 incf lo,F | 870 incf lo,F |
986 bsf leftbind | 871 bsf leftbind |
987 output_99 | 872 output_99 |
988 movlw ':' | 873 STRCAT_PRINT ": " |
989 movwf POSTINC2 | |
990 movlw ' ' | |
991 movwf POSTINC2 | |
992 call word_processor | |
993 | 874 |
994 WIN_TOP .2 | 875 WIN_TOP .2 |
995 WIN_LEFT .50 | 876 WIN_LEFT .50 |
996 lfsr FSR2,letter | 877 lfsr FSR2,letter |
997 | 878 |
1012 addlw 0x06 | 893 addlw 0x06 |
1013 movwf EEADR | 894 movwf EEADR |
1014 call read_eeprom ; O2 value | 895 call read_eeprom ; O2 value |
1015 movff EEDATA,lo | 896 movff EEDATA,lo |
1016 output_8 ; Write O2 | 897 output_8 ; Write O2 |
1017 movlw '/' | 898 PUTC '/' |
1018 movwf POSTINC2 | |
1019 movf divemins+0,W | 899 movf divemins+0,W |
1020 addlw 0x07 | 900 addlw 0x07 |
1021 movwf EEADR | 901 movwf EEADR |
1022 call read_eeprom ; He value | 902 call read_eeprom ; He value |
1023 movff EEDATA,lo | 903 movff EEDATA,lo |
1045 output_8 | 925 output_8 |
1046 bra gassetup_title_bar7 | 926 bra gassetup_title_bar7 |
1047 | 927 |
1048 ; New v1.44se | 928 ; New v1.44se |
1049 gassetup_title_bar4: | 929 gassetup_title_bar4: |
1050 movlw 'O' | 930 STRCAT "O2 " |
1051 movwf POSTINC2 | |
1052 movlw '2' | |
1053 movwf POSTINC2 | |
1054 movlw ' ' | |
1055 movwf POSTINC2 | |
1056 output_8 | 931 output_8 |
1057 bra gassetup_title_bar7 | 932 bra gassetup_title_bar7 |
1058 | 933 |
1059 ; New v1.44se | 934 ; New v1.44se |
1060 gassetup_title_bar5: | 935 gassetup_title_bar5: |
1061 cpfseq lo ; o2 = 21% | 936 cpfseq lo ; o2 = 21% |
1062 bra gassetup_title_bar6 | 937 bra gassetup_title_bar6 |
1063 | 938 |
1064 movlw 'A' | 939 STRCAT "AIR " |
1065 movwf POSTINC2 | |
1066 movlw 'I' | |
1067 movwf POSTINC2 | |
1068 movlw 'R' | |
1069 movwf POSTINC2 | |
1070 movlw ' ' | |
1071 movwf POSTINC2 | |
1072 output_8 | 940 output_8 |
1073 bra gassetup_title_bar7 | 941 bra gassetup_title_bar7 |
1074 | 942 |
1075 ; New v1.44se | 943 ; New v1.44se |
1076 gassetup_title_bar6: ; ERROR | 944 gassetup_title_bar6: ; ERROR |
1077 movlw 'E' | 945 STRCAT "ERR " |
1078 movwf POSTINC2 | |
1079 movlw 'R' | |
1080 movwf POSTINC2 | |
1081 movlw 'R' | |
1082 movwf POSTINC2 | |
1083 movlw ' ' | |
1084 movwf POSTINC2 | |
1085 output_8 | 946 output_8 |
1086 bra gassetup_title_bar7 | 947 bra gassetup_title_bar7 |
1087 | 948 |
1088 gassetup_title_bar7: | 949 gassetup_title_bar7: |
1089 movlw ' ' | 950 STRCAT " in " |
1090 movwf POSTINC2 | |
1091 movlw 'i' | |
1092 movwf POSTINC2 | |
1093 movlw 'n' | |
1094 movwf POSTINC2 | |
1095 movlw ' ' | |
1096 movwf POSTINC2 | |
1097 movf decodata+0,W ; read current value | 951 movf decodata+0,W ; read current value |
1098 addlw d'28' ; offset in memory | 952 addlw d'28' ; offset in memory |
1099 movwf EEADR | 953 movwf EEADR |
1100 call read_eeprom ; Low-value | 954 call read_eeprom ; Low-value |
1101 movff EEDATA,lo | 955 movff EEDATA,lo |
1102 output_8 | 956 output_8 |
1103 movlw 'm' | 957 STRCAT_PRINT "m " |
1104 movwf POSTINC2 | 958 |
1105 movlw ' ' | |
1106 movwf POSTINC2 | |
1107 | |
1108 call word_processor | |
1109 WIN_INVERT .0 ; Init new Wordprocessor | 959 WIN_INVERT .0 ; Init new Wordprocessor |
1110 return | 960 return |
1111 | 961 |
1112 ; New v1.44se | 962 ; New v1.44se |
1113 gassetup_write_Nx: | 963 gassetup_write_Nx: |
1114 movlw 'N' | 964 STRCAT "NX " |
1115 movwf POSTINC2 | |
1116 movlw 'X' | |
1117 movwf POSTINC2 | |
1118 movlw ' ' | |
1119 movwf POSTINC2 | |
1120 return | 965 return |
1121 | 966 |
1122 ; New v1.44se | 967 ; New v1.44se |
1123 gassetup_write_Tx: | 968 gassetup_write_Tx: |
1124 movlw 'T' | 969 STRCAT "TX " |
1125 movwf POSTINC2 | |
1126 movlw 'X' | |
1127 movwf POSTINC2 | |
1128 movlw ' ' | |
1129 movwf POSTINC2 | |
1130 return | 970 return |
1131 | 971 |
1132 gassetup_show_ppO2: | 972 gassetup_show_ppO2: |
1133 movf divemins+0,W | 973 movf divemins+0,W |
1134 addlw 0x06 | 974 addlw 0x06 |