Mercurial > public > hwos_code
comparison src/simulator.asm @ 132:ec0b1e829399
Bugfix: Start dive mode simulator in correct depth
author | heinrichsweikamp |
---|---|
date | Tue, 08 Jul 2014 11:39:00 +0200 |
parents | c61b7a4e317c |
children | 9a637c9bb19a |
comparison
equal
deleted
inserted
replaced
131:35b9da423de6 | 132:ec0b1e829399 |
---|---|
707 bcf pressure_refresh | 707 bcf pressure_refresh |
708 btfss pressure_refresh ; Wait for sensor | 708 btfss pressure_refresh ; Wait for sensor |
709 bra $-2 | 709 bra $-2 |
710 | 710 |
711 bsf simulatormode_active ; Set Flag | 711 bsf simulatormode_active ; Set Flag |
712 movlw LOW simulator_start_depth | 712 ; Compute dive ambient conditions |
713 movff WREG,rel_pressure+0 | 713 banksel char_I_bottom_depth |
714 movlw HIGH simulator_start_depth | 714 movf char_I_bottom_depth,W |
715 movff WREG,rel_pressure+1 ; Set Depth | 715 mullw .100 |
716 | 716 movff PRODL,rel_pressure+0 |
717 movlw LOW (simulator_start_depth+.1000) | 717 movff PRODH,rel_pressure+1 |
718 movff WREG,sim_pressure+0 | 718 movlw LOW(.1000) |
719 movlw HIGH (simulator_start_depth+.1000) | 719 addwf PRODL,W |
720 movff WREG,sim_pressure+1 ; Set Depth | 720 movff WREG,sim_pressure+0 |
721 movlw HIGH(.1000) | |
722 addwfc PRODH,W | |
723 movff WREG,sim_pressure+1 | |
721 | 724 |
722 bsf divemode | 725 bsf divemode |
723 goto diveloop ; Switch into Divemode! | 726 goto diveloop ; Switch into Divemode! |
724 | 727 |
725 | 728 |