comparison code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 592:cda5b45b953f

NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
author heinrichsweikamp
date Mon, 28 May 2012 17:54:43 +0200
parents 1b021a280e15
children f3735da18809
comparison
equal deleted inserted replaced
591:2966548fbe70 592:cda5b45b953f
857 STRCAT_PRINT TXT_METER1 857 STRCAT_PRINT TXT_METER1
858 858
859 bcf leftbind 859 bcf leftbind
860 return 860 return
861 861
862 PLED_show_cf32_cf33_cf62_cf63: ; Display GF_LOW, GF_HIGH, pSCR ratio and drop in the customview field
863 WIN_TOP .25
864 WIN_LEFT .90
865 WIN_FONT FT_SMALL
866 WIN_INVERT .0 ; Init new Wordprocessor
867 call PLED_standard_color
868 GETCUSTOM8 d'32' ; GF_lo
869 movwf lo
870 STRCPY TXT_GFLO6
871 bsf leftbind
872 output_8
873 STRCAT_PRINT "%"
874
875 WIN_TOP .50
876 GETCUSTOM8 d'33' ; GF_hi
877 movwf lo
878 STRCPY TXT_GFHI6
879 bsf leftbind
880 output_8
881 STRCAT_PRINT "%"
882
883 WIN_TOP .75
884 lfsr FSR2,letter
885 GETCUSTOM8 d'62' ; O2 Drop in percent
886 movwf lo
887 bsf leftbind
888 output_8
889
890 STRCAT "% 1/"
891 GETCUSTOM8 d'63' ; Counter lung ratio in 1/X
892 movwf lo
893 output_8
894 bcf leftbind
895 STRCAT_PRINT ""
896 return
897
898
899
862 PLED_show_cf32_cf33_cf29:; Display GF_LOW, GF_HIGH and last deco in the customview field 900 PLED_show_cf32_cf33_cf29:; Display GF_LOW, GF_HIGH and last deco in the customview field
863 WIN_TOP .25 901 WIN_TOP .25
864 WIN_LEFT .90 902 WIN_LEFT .90
865 WIN_FONT FT_SMALL 903 WIN_FONT FT_SMALL
866 WIN_INVERT .0 ; Init new Wordprocessor 904 WIN_INVERT .0 ; Init new Wordprocessor
1038 movff WREG,letter+5 ; collision with sat graphs 1076 movff WREG,letter+5 ; collision with sat graphs
1039 call word_processor 1077 call word_processor
1040 return 1078 return
1041 1079
1042 PLED_show_ppO2: ; Show ppO2 (ppO2 stored in xC) 1080 PLED_show_ppO2: ; Show ppO2 (ppO2 stored in xC)
1043 GETCUSTOM8 d'61' ; Show pSCR ppO2?
1044 decfsz WREG,F ; WREG=1?
1045 bra PLED_show_ppO2a ; No
1046 return ; Do not display ppO2 in pSCR Mode
1047
1048 PLED_show_ppO2a:
1049 ostc_debug 't' ; Sends debug-information to screen if debugmode active 1081 ostc_debug 't' ; Sends debug-information to screen if debugmode active
1050 WIN_TOP .117 1082 WIN_TOP .117
1051 WIN_LEFT .0 1083 WIN_LEFT .0
1052 WIN_FONT FT_SMALL 1084 WIN_FONT FT_SMALL
1053 PLED_color_code warn_ppo2 ; Color-code output (ppO2 stored in xC) 1085 PLED_color_code warn_ppo2 ; Color-code output (ppO2 stored in xC)
1195 clrf EEADRH 1227 clrf EEADRH
1196 read_int_eeprom d'34' ; Read deco data 1228 read_int_eeprom d'34' ; Read deco data
1197 tstfsz EEDATA 1229 tstfsz EEDATA
1198 bra show_decotype_surface2 1230 bra show_decotype_surface2
1199 1231
1200 ;ZH-L16 1232 ;EEDATA=0
1233 ;ZH-L16-OC
1201 WIN_TOP .125 1234 WIN_TOP .125
1202 STRCPY_PRINT TXT_OC_O1 1235 STRCPY_PRINT TXT_OC_O1
1203 1236
1204 WIN_TOP .150 1237 WIN_TOP .150
1205 STRCPY_PRINT TXT_OC_C1 1238 STRCPY_PRINT TXT_OC_C1
1207 1240
1208 show_decotype_surface2: 1241 show_decotype_surface2:
1209 decf EEDATA,F 1242 decf EEDATA,F
1210 tstfsz EEDATA 1243 tstfsz EEDATA
1211 bra show_decotype_surface3 1244 bra show_decotype_surface3
1212 ; Gauge 1245 ;EEDATA=1
1246 ;Gauge
1213 return 1247 return
1214 1248
1215 show_decotype_surface3: 1249 show_decotype_surface3:
1216 decf EEDATA,F 1250 decf EEDATA,F
1217 tstfsz EEDATA 1251 tstfsz EEDATA
1218 bra show_decotype_surface4 1252 bra show_decotype_surface4
1219 ; const. ppO2 1253 ;EEDATA=2
1254 ;ZH-L16-CC
1220 WIN_TOP .125 1255 WIN_TOP .125
1221 call PLED_standard_color 1256 call PLED_standard_color
1222 1257
1223 STRCPY_PRINT TXT_CC_C1_1 1258 STRCPY_PRINT TXT_CC_C1_1
1224 1259
1232 1267
1233 show_decotype_surface4: 1268 show_decotype_surface4:
1234 decf EEDATA,F 1269 decf EEDATA,F
1235 tstfsz EEDATA 1270 tstfsz EEDATA
1236 bra show_decotype_surface5 1271 bra show_decotype_surface5
1237 ; Apnoe 1272 ;EEDATA=3
1273 ;Apnoe
1238 return 1274 return
1239 1275
1240 show_decotype_surface5: 1276 show_decotype_surface5:
1241 show_decotype_surface6:
1242 decf EEDATA,F 1277 decf EEDATA,F
1243 tstfsz EEDATA 1278 tstfsz EEDATA
1244 bra show_decotype_surface6 1279 bra show_decotype_surface6
1245 ; Multi-GF OC 1280 ;EEDATA=4
1281 show_decotype_surface5_2:
1282 ;EEDATA=5
1283 ;ZH16-GF OC or ZH16-GF CC
1246 WIN_TOP .125 1284 WIN_TOP .125
1247 STRCPY_PRINT TXT_GF_G1 1285 STRCPY_PRINT TXT_GF_G1
1248 1286
1249 WIN_TOP .150 1287 WIN_TOP .150
1250 STRCPY_PRINT TXT_GF_F1 1288 STRCPY_PRINT TXT_GF_F1
1251 return 1289 return
1290
1291 show_decotype_surface6:
1292 decf EEDATA,F
1293 tstfsz EEDATA
1294 bra show_decotype_surface7
1295 bra show_decotype_surface5_2
1296 show_decotype_surface7:
1297 ;EEDATA=6:
1298 ;pSCR-GF
1299 WIN_TOP .125
1300 STRCPY_PRINT TXT_PSCR_P1
1301
1302 WIN_TOP .150
1303 STRCPY_PRINT TXT_PSCR_S1
1304 return
1305
1252 1306
1253 ;----------------------------------------------------------------------------- 1307 ;-----------------------------------------------------------------------------
1254 ; Set color to grey when gas is inactive 1308 ; Set color to grey when gas is inactive
1255 ; Inputs: WREG : gas# (0..4) 1309 ; Inputs: WREG : gas# (0..4)
1256 ; Trashes: lo 1310 ; Trashes: lo
3374 PLED_show_@5_wait: 3428 PLED_show_@5_wait:
3375 STRCPY_PRINT "--- " 3429 STRCPY_PRINT "--- "
3376 return 3430 return
3377 3431
3378 ;============================================================================= 3432 ;=============================================================================
3379 ; Display pSCR ppO2 3433
3380 ; (Pressure[mbar]*char_I_O2_ratio)-(100-char_I_O2_ratio)*CF61*CF62*10 3434 compute_pscr_ppo2:
3381 PLED_show_pSCR_ppO2: 3435 ; (Pressure[mbar]*char_I_O2_ratio)-(100-char_I_O2_ratio)*CF61*CF62*10
3382 WIN_FONT FT_SMALL
3383 WIN_LEFT .160-.63 ; 9 chars aligned right.
3384 WIN_TOP .170
3385 call PLED_divemask_color ; Set Color for Divemode mask
3386 lfsr FSR2,letter
3387 OUTPUTTEXTH .266 ; "pSCR Info"
3388 call word_processor ; pCCR
3389
3390 movff char_I_O2_ratio,WREG 3436 movff char_I_O2_ratio,WREG
3391 sublw .100 ; 100-char_I_O2_ratio -> WREG 3437 sublw .100 ; 100-char_I_O2_ratio -> WREG
3392 mullw .10 ; (100-char_I_O2_ratio)*10 -> PROD:2 3438 mullw .10 ; (100-char_I_O2_ratio)*10 -> PROD:2
3393 movff PRODL,xA+0 3439 movff PRODL,xA+0
3394 movff PRODH,xA+1 3440 movff PRODH,xA+1
3427 ; reload result from lo:hi 3473 ; reload result from lo:hi
3428 movff lo,sub_b+0 3474 movff lo,sub_b+0
3429 movff hi,sub_b+1 3475 movff hi,sub_b+1
3430 3476
3431 call subU16 ;sub_c = sub_a - sub_b (with UNSIGNED values) 3477 call subU16 ;sub_c = sub_a - sub_b (with UNSIGNED values)
3478 return
3479
3480 ; Display pSCR ppO2
3481 PLED_show_pSCR_ppO2:
3482 WIN_FONT FT_SMALL
3483 WIN_LEFT .160-.63 ; 9 chars aligned right.
3484 WIN_TOP .170
3485 call PLED_divemask_color ; Set Color for Divemode mask
3486 lfsr FSR2,letter
3487 OUTPUTTEXTH .266 ; "pSCR Info"
3488 call word_processor ; pCCR
3489
3490 rcall compute_pscr_ppo2 ; pSCR ppO2 into sub_c:2
3432 3491
3433 WIN_FONT FT_SMALL 3492 WIN_FONT FT_SMALL
3434 WIN_LEFT .95 3493 WIN_LEFT .95
3435 WIN_TOP .192 3494 WIN_TOP .192
3436 lfsr FSR2,letter 3495 lfsr FSR2,letter