comparison code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 607:227eaded4e1b

Small layout change for mainscreen
author heinrichsweikamp
date Thu, 12 Jul 2012 19:39:00 +0200
parents f3735da18809
children 85e8e1501fd8
comparison
equal deleted inserted replaced
606:4f43aee67da0 607:227eaded4e1b
1264 call word_processor 1264 call word_processor
1265 rcall PLED_active_better_gas ; show *, if required 1265 rcall PLED_active_better_gas ; show *, if required
1266 call PLED_standard_color ; Back to normal (if O2<21 and He=0) 1266 call PLED_standard_color ; Back to normal (if O2<21 and He=0)
1267 return 1267 return
1268 1268
1269 PLED_display_decotype_surface:
1270 WIN_LEFT .85
1271 WIN_FONT FT_SMALL
1272 WIN_INVERT .0 ; Init new Wordprocessor
1273 call PLED_standard_color
1274
1275 clrf EEADRH
1276 read_int_eeprom d'34' ; Read deco data
1277 tstfsz EEDATA
1278 bra show_decotype_surface2
1279
1280 ;EEDATA=0
1281 ;ZH-L16-OC
1282 WIN_TOP .125
1283 STRCPY_PRINT TXT_OC_O1
1284
1285 WIN_TOP .150
1286 STRCPY_PRINT TXT_OC_C1
1287 return
1288
1289 show_decotype_surface2:
1290 decf EEDATA,F
1291 tstfsz EEDATA
1292 bra show_decotype_surface3
1293 ;EEDATA=1
1294 ;Gauge
1295 return
1296
1297 show_decotype_surface3:
1298 decf EEDATA,F
1299 tstfsz EEDATA
1300 bra show_decotype_surface4
1301 ;EEDATA=2
1302 ;ZH-L16-CC
1303 WIN_TOP .125
1304 call PLED_standard_color
1305
1306 STRCPY_PRINT TXT_CC_C1_1
1307
1308 WIN_TOP .150
1309 #IF TXT_CC_C1_1 == TXT_CC_C2_1
1310 call word_processor ; Twice the same string.
1311 #ELSE
1312 STRCPY_PRINT TXT_CC_C2_1
1313 #ENDIF
1314 return
1315
1316 show_decotype_surface4:
1317 decf EEDATA,F
1318 tstfsz EEDATA
1319 bra show_decotype_surface5
1320 ;EEDATA=3
1321 ;Apnoe
1322 return
1323
1324 show_decotype_surface5:
1325 decf EEDATA,F
1326 tstfsz EEDATA
1327 bra show_decotype_surface6
1328 ;EEDATA=4
1329 show_decotype_surface5_2:
1330 ;EEDATA=5
1331 ;ZH16-GF OC or ZH16-GF CC
1332 WIN_TOP .125
1333 STRCPY_PRINT TXT_GF_G1
1334
1335 WIN_TOP .150
1336 STRCPY_PRINT TXT_GF_F1
1337 return
1338
1339 show_decotype_surface6:
1340 decf EEDATA,F
1341 tstfsz EEDATA
1342 bra show_decotype_surface7
1343 bra show_decotype_surface5_2
1344 show_decotype_surface7:
1345 ;EEDATA=6:
1346 ;pSCR-GF
1347 WIN_TOP .125
1348 STRCPY_PRINT TXT_PSCR_P1
1349
1350 WIN_TOP .150
1351 STRCPY_PRINT TXT_PSCR_S1
1352 return
1353
1354
1355 ;----------------------------------------------------------------------------- 1269 ;-----------------------------------------------------------------------------
1356 ; Set color to grey when gas is inactive 1270 ; Set color to grey when gas is inactive
1357 ; Inputs: WREG : gas# (0..4) 1271 ; Inputs: WREG : gas# (0..4)
1358 ; Trashes: lo 1272 ; Trashes: lo
1359 ; New v1.44se 1273 ; New v1.44se
1542 clrf hi 1456 clrf hi
1543 output_16dp d'3' ; outputs into Postinc2! 1457 output_16dp d'3' ; outputs into Postinc2!
1544 bcf leftbind 1458 bcf leftbind
1545 1459
1546 STRCAT_PRINT TXT_BAR3 1460 STRCAT_PRINT TXT_BAR3
1547 bra PLED_active_gas_surfmode_exit 1461 return ; Done.
1548 1462
1549 PLED_active_gas_surfmode2: 1463 PLED_active_gas_surfmode2:
1550 WIN_TOP .130 1464 WIN_TOP .130
1551 WIN_LEFT .100 1465 WIN_LEFT .100
1552 WIN_FONT FT_MEDIUM 1466 WIN_FONT FT_MEDIUM
1553 WIN_INVERT .0 ; Init new Wordprocessor 1467 WIN_INVERT .0 ; Init new Wordprocessor
1554 call PLED_standard_color 1468 call PLED_standard_color
1555
1556 1469
1557 read_int_eeprom d'33' ; Read byte (stored in EEDATA) 1470 read_int_eeprom d'33' ; Read byte (stored in EEDATA)
1558 movff EEDATA,active_gas ; Read start gas (1-5) 1471 movff EEDATA,active_gas ; Read start gas (1-5)
1559 1472
1560 decf active_gas,W ; Gas 0-4 1473 decf active_gas,W ; Gas 0-4
1589 subfwb lo,F ; =% O2 1502 subfwb lo,F ; =% O2
1590 1503
1591 movff char_I_He_ratio,hi ; Copy into Bank1 register 1504 movff char_I_He_ratio,hi ; Copy into Bank1 register
1592 1505
1593 movlw d'21' 1506 movlw d'21'
1594 cpfseq lo ; Air? (O2=21%) 1507 cpfseq lo ; Air? (O2=21%)
1595 bra PLED_active_gas_surfmode4 ; No! 1508 bra PLED_active_gas_surfmode4 ; No!
1596 tstfsz hi ; Air? (He=0%) 1509 tstfsz hi ; Air? (He=0%)
1597 bra PLED_active_gas_surfmode4 ; No! 1510 bra PLED_active_gas_surfmode4 ; No!
1598 1511
1599 ; Yes, display "Air" instead of 21/0 1512 ; Yes, display "Air" instead of 21/0
1600 DISPLAYTEXTH d'265' ;"Air ", y-scale=2 1513 DISPLAYTEXTH d'265' ;"Air ", y-scale=2
1601 bra PLED_active_gas_surfmode_exit 1514 return ; Done.
1602 1515
1603 PLED_active_gas_surfmode4: 1516 PLED_active_gas_surfmode4:
1604 lfsr FSR2,letter 1517 lfsr FSR2,letter
1605 bsf leftbind ; left orientated output 1518 bsf leftbind ; left orientated output
1606 output_99 ; O2 ratio is still in "lo" 1519 output_99 ; O2 ratio is still in "lo"
1520 movff char_I_He_ratio,lo ; copy He ratio into lo
1521 tstfsz lo ; He>0?
1522 bra PLED_active_gas_surfmode5 ; Yes.
1523 bra PLED_active_gas_surfmode6 ; No, skip He
1524 PLED_active_gas_surfmode5:
1607 PUTC '/' 1525 PUTC '/'
1608 movff char_I_He_ratio,lo ; copy He ratio into lo
1609 output_99 1526 output_99
1527 PLED_active_gas_surfmode6:
1610 bcf leftbind 1528 bcf leftbind
1611 call word_processor 1529 call word_processor
1612 ; bra PLED_active_gas_surfmode_exit 1530
1613 PLED_active_gas_surfmode_exit: 1531 rcall PLED_mainscreen_show_nx
1614 ; WIN_FRAME_BLACK .122, .175, .82, .159 1532 tstfsz lo ; He>0?
1615 return 1533 rcall PLED_mainscreen_show_tx ; Yes
1534 return ; Done.
1535
1536 PLED_mainscreen_show_tx:
1537 WIN_LEFT .85
1538 WIN_FONT FT_SMALL
1539 WIN_INVERT .0 ; Init new Wordprocessor
1540 WIN_TOP .127
1541
1542 STRCPY_PRINT TXT_TX1
1543 WIN_TOP .148
1544 STRCPY_PRINT TXT_TX2
1545 return
1546 PLED_mainscreen_show_nx:
1547 WIN_LEFT .85
1548 WIN_TOP .127
1549 WIN_FONT FT_SMALL
1550 WIN_INVERT .0 ; Init new Wordprocessor
1551
1552 STRCPY_PRINT TXT_NX1
1553 WIN_TOP .148
1554 STRCPY_PRINT TXT_NX2
1555 return
1556
1616 1557
1617 PLED_confirmbox: 1558 PLED_confirmbox:
1618 WIN_BOX_BLACK .68, .146, .34, .101 ;top, bottom, left, right 1559 WIN_BOX_BLACK .68, .146, .34, .101 ;top, bottom, left, right
1619 WIN_FRAME_STD .70, .144, .35, .100 1560 WIN_FRAME_STD .70, .144, .35, .100
1620 1561
2479 else 2420 else
2480 call PLED_standard_color 2421 call PLED_standard_color
2481 endif 2422 endif
2482 2423
2483 lfsr FSR2,letter 2424 lfsr FSR2,letter
2484 OUTPUTTEXTH d'262' ; "OSTC " 2425 read_int_eeprom d'34' ; Read deco data
2485 clrf EEADRH 2426 tstfsz EEDATA
2486 clrf EEADR ; Get Serial number LOW 2427 bra show_decotype_mainscreen2
2487 call read_eeprom ; read byte 2428 OUTPUTTEXT .101 ; ZH-L16 OC =0
2488 movff EEDATA,lo 2429 bra show_decotype_mainscreen8 ; Done.
2489 incf EEADR,F ; Get Serial number HIGH 2430 show_decotype_mainscreen2:
2490 call read_eeprom ; read byte 2431 decfsz EEDATA,F
2491 movff EEDATA,hi 2432 bra show_decotype_mainscreen3
2492 2433 OUTPUTTEXT .102 ; Gauge =1
2493 bsf leftbind 2434 bra show_decotype_mainscreen8 ; Done.
2494 output_16 2435 show_decotype_mainscreen3:
2436 decfsz EEDATA,F
2437 bra show_decotype_mainscreen4
2438 OUTPUTTEXT .104 ; ZH-L16 CC =2
2439 bra show_decotype_mainscreen8 ; Done.
2440 show_decotype_mainscreen4:
2441 decfsz EEDATA,F
2442 bra show_decotype_mainscreen5
2443 OUTPUTTEXT .138 ; Apnoe =3
2444 bra show_decotype_mainscreen8 ; Done.
2445 show_decotype_mainscreen5:
2446 decfsz EEDATA,F
2447 bra show_decotype_mainscreen6
2448 OUTPUTTEXT .152 ; L16-GF OC =4
2449 bra show_decotype_mainscreen8 ; Done.
2450 show_decotype_mainscreen6:
2451 decfsz EEDATA,F
2452 bra show_decotype_mainscreen7
2453 OUTPUTTEXT .236 ; L16-GF CC =5
2454 bra show_decotype_mainscreen8 ; Done.
2455 show_decotype_mainscreen7:
2456 decfsz EEDATA,F
2457 bra show_decotype_mainscreen8 ; Done.
2458 OUTPUTTEXT .226 ; pSCR-GF =6
2459 show_decotype_mainscreen8:
2495 STRCAT " \x90\x91 V" ; Scribble logo... 2460 STRCAT " \x90\x91 V" ; Scribble logo...
2496 movlw softwareversion_x 2461 movlw softwareversion_x
2497 movwf lo 2462 movwf lo
2498 bsf leftbind 2463 bsf leftbind
2499 output_8 2464 output_8
3787 3752
3788 PLED_custom_text: 3753 PLED_custom_text:
3789 read_int_eeprom d'64' 3754 read_int_eeprom d'64'
3790 movlw d'1' 3755 movlw d'1'
3791 cpfseq EEDATA ; Custom text active? 3756 cpfseq EEDATA ; Custom text active?
3792 bra PLED_clear_custom_text ; No, Delete row 3757 bra PLED_custom_text_serial ; No, show serial instead
3793 WIN_TOP .200 3758 WIN_TOP .200
3794 WIN_LEFT .0 3759 WIN_LEFT .0
3795 WIN_FONT FT_SMALL 3760 WIN_FONT FT_SMALL
3796 WIN_INVERT .0 ; Init new Wordprocessor 3761 WIN_INVERT .0 ; Init new Wordprocessor
3797 call PLED_divemask_color ; Set Color for Divemode mask 3762 call PLED_divemask_color ; Set Color for Divemode mask
3823 PLED_get_custom_letter: 3788 PLED_get_custom_letter:
3824 movff lo,EEADR ; Address for next custom text letter 3789 movff lo,EEADR ; Address for next custom text letter
3825 call read_eeprom ; Read letter 3790 call read_eeprom ; Read letter
3826 return 3791 return
3827 3792
3828 PLED_clear_custom_text: 3793 PLED_custom_text_serial:
3829 movlw d'24'
3830 movwf temp1
3831 WIN_TOP .200 3794 WIN_TOP .200
3832 WIN_LEFT .0 3795 WIN_LEFT .50
3833 call PLED_display_clear_common_y1 3796 WIN_FONT FT_SMALL
3797 WIN_INVERT .0 ; Init new Wordprocessor
3798 call PLED_divemask_color ; Set Color for Divemode mask
3799
3800 lfsr FSR2,letter
3801 OUTPUTTEXTH d'262' ; "OSTC "
3802 clrf EEADRH
3803 clrf EEADR ; Get Serial number LOW
3804 call read_eeprom ; read byte
3805 movff EEDATA,lo
3806 incf EEADR,F ; Get Serial number HIGH
3807 call read_eeprom ; read byte
3808 movff EEDATA,hi
3809 bsf leftbind
3810 output_16
3811 call word_processor
3812 call PLED_standard_color
3834 return 3813 return
3835 3814
3836 PLED_simdata_screen: ;Display Pre-Dive Screen 3815 PLED_simdata_screen: ;Display Pre-Dive Screen
3837 ; List active gases/Setpoints 3816 ; List active gases/Setpoints
3838 btfsc FLAG_const_ppO2_mode ; in ppO2 mode? 3817 btfsc FLAG_const_ppO2_mode ; in ppO2 mode?