comparison src/divemode.asm @ 608:d866684249bd

work on 2.99 stable
author heinrichsweikamp
date Mon, 07 Jan 2019 21:13:43 +0100
parents 8b250afb8bdd
children c40025d8e750
comparison
equal deleted inserted replaced
607:c5151a490d88 608:d866684249bd
68 call speed_normal 68 call speed_normal
69 call diveloop_boot ; boot tasks for all modes 69 call diveloop_boot ; boot tasks for all modes
70 70
71 ; startup tasks for all modes 71 ; startup tasks for all modes
72 call TFT_boot ; initialize TFT (includes clear screen) 72 call TFT_boot ; initialize TFT (includes clear screen)
73 movlw CCP1CON_VALUE ; See hwos.inc
74 movwf CCP1CON ; Power-on backlight
75
73 bsf FLAG_TFT_divemode_mask ; request display of dive mode mask 76 bsf FLAG_TFT_divemode_mask ; request display of dive mode mask
74 77
75 movff customview_divemode,menupos3; reload last custom view 78 movff customview_divemode,menupos3; reload last custom view
76 bsf redraw_custview_mask ; request redraw of last custom view 79 bsf redraw_custview_mask ; request redraw of last custom view
77 80
1467 get_first_gas_to_WREG: ; gets first gas (1-5) into WREG 1470 get_first_gas_to_WREG: ; gets first gas (1-5) into WREG
1468 lfsr FSR1,opt_gas_type ; point to gas types 1471 lfsr FSR1,opt_gas_type ; point to gas types
1469 clrf lo ; start with gas 0 1472 clrf lo ; start with gas 0
1470 get_first_gas_to_WREG2: 1473 get_first_gas_to_WREG2:
1471 movf lo,W 1474 movf lo,W
1472 movf PLUSW1,W ; get type of gas #lo 1475 movf PLUSW1,W ; get type of gas #lo (0=Disabled, 1=First, 2=Travel, 3=Deco)
1473 sublw .1 ; it is = 1 (First Gas) 1476 sublw .1 ; it is = 1 (First Gas)
1474 bz get_first_gas_to_WREG3 ; found the first gas! 1477 bz get_first_gas_to_WREG3 ; found the first gas!
1475 incf lo,F ; ++ 1478 incf lo,F ; ++
1476 movlw NUM_GAS+1 1479 movlw NUM_GAS+1
1477 cpfseq lo ; all done? 1480 cpfseq lo ; all done?
1478 bra get_first_gas_to_WREG2 ; NO - not yet 1481 bra get_first_gas_to_WREG2 ; NO - not yet
1479 ; no first gas found, use #1 1482 ; no first gas found, use #1
1480 movlw .0 1483 movlw .1 ; coding of First gas
1481 movff WREG,opt_gas_type+0 ; set gas 1 to First 1484 movff WREG,opt_gas_type+0 ; set gas 1 to First
1482 incf WREG,W ; 0 -> 1
1483 return 1485 return
1484 get_first_gas_to_WREG3: 1486 get_first_gas_to_WREG3:
1485 movf lo,W ; put into WREG 1487 movf lo,W ; put into WREG
1486 incf WREG,W ; 0-4 -> 1-5 1488 incf WREG,W ; 0-4 -> 1-5
1487 return ; done 1489 return ; done
1490 get_first_dil_to_WREG: ; gets first dil (1-5) into WREG 1492 get_first_dil_to_WREG: ; gets first dil (1-5) into WREG
1491 lfsr FSR1,opt_dil_type ; point to dil types 1493 lfsr FSR1,opt_dil_type ; point to dil types
1492 clrf lo ; start with dil 0 1494 clrf lo ; start with dil 0
1493 get_first_dil_to_WREG2: 1495 get_first_dil_to_WREG2:
1494 movf lo,W 1496 movf lo,W
1495 movf PLUSW1,W ; get type of Dil #lo 1497 movf PLUSW1,W ; get type of Dil #lo (0=Disabled, 1=First, 2=Normal)
1496 sublw .1 ; it is = 1 (First Dil) 1498 sublw .1 ; it is = 1 (First Dil)
1497 bz get_first_dil_to_WREG3 ; found the first dil! 1499 bz get_first_dil_to_WREG3 ; found the first dil!
1498 incf lo,F ; ++ 1500 incf lo,F ; ++
1499 movlw NUM_GAS+1 1501 movlw NUM_GAS+1
1500 cpfseq lo ; all done? 1502 cpfseq lo ; all done?
1501 bra get_first_dil_to_WREG2 ; NO - not yet 1503 bra get_first_dil_to_WREG2 ; NO - not yet
1502 ; no first dil found, use #1 1504 ; no first dil found, use #1
1503 movlw .0 1505 movlw .1 ; coding of First Dil
1504 movff WREG,opt_dil_type+0 ; set dil 1 to First 1506 movff WREG,opt_dil_type+0 ; set dil 1 to First
1505 incf WREG,W ; 0 -> 1
1506 return 1507 return
1507 get_first_dil_to_WREG3: 1508 get_first_dil_to_WREG3:
1508 movf lo,W ; Put into WREG 1509 movf lo,W ; Put into WREG
1509 incf WREG,W ; 0-4 -> 1-5 1510 incf WREG,W ; 0-4 -> 1-5
1510 return ; done 1511 return ; done