comparison src/divemenu_tree.asm @ 564:54346c651b6a

bring digital S8 HUD back to life...
author heinrichsweikamp
date Mon, 05 Feb 2018 17:59:55 +0100
parents b7eb98dbd800
children 2b8ef780cfa8
comparison
equal deleted inserted replaced
563:f4faff954816 564:54346c651b6a
133 133
134 134
135 do_switch_sensor: ; entry point when coming from switch to sensor 135 do_switch_sensor: ; entry point when coming from switch to sensor
136 movlw .1 ; Switch to Sensor 136 movlw .1 ; Switch to Sensor
137 movff WREG,opt_ccr_mode ; =0: Fixed SP (CCR) / calculated (pSCR), =1: Sensor, =2: Auto SP 137 movff WREG,opt_ccr_mode ; =0: Fixed SP (CCR) / calculated (pSCR), =1: Sensor, =2: Auto SP
138 ; enable all sensors
139 bsf use_O2_sensor1
140 bsf use_O2_sensor2
141 bsf use_O2_sensor3
138 bra do_switch_sp_com ; continue with common part 142 bra do_switch_sp_com ; continue with common part
139 143
140 do_switch_sp: ; entry point when coming from manual setpoint selection (CCR) 144 do_switch_sp: ; entry point when coming from manual setpoint selection (CCR)
141 decf menupos,W ; 1-5 -> 0-4 145 decf menupos,W ; 1-5 -> 0-4
142 lfsr FSR1,char_I_setpoint_cbar 146 lfsr FSR1,char_I_setpoint_cbar
360 movwf menupos ; Set to 1st option: use sensors 364 movwf menupos ; Set to 1st option: use sensors
361 do_divemode_sensor_loop: 365 do_divemode_sensor_loop:
362 MENU_BEGIN tGaslist, .6 366 MENU_BEGIN tGaslist, .6
363 MENU_CALL tDivemenu_UseSensor, do_switch_sensor 367 MENU_CALL tDivemenu_UseSensor, do_switch_sensor
364 MENU_CALL tBack, do_divemode_splist 368 MENU_CALL tBack, do_divemode_splist
365 MENU_CALL tExit, do_continue_main_divemenu 369 MENU_CALL tExit, do_exit_divemode_menu
366 MENU_CALL tDiveHudMask1, do_toggle_sensor 370 MENU_CALL tDiveHudMask1, do_toggle_sensor
367 MENU_CALL tDiveHudMask2, do_toggle_sensor 371 MENU_CALL tDiveHudMask2, do_toggle_sensor
368 MENU_CALL tDiveHudMask3, do_toggle_sensor 372 MENU_CALL tDiveHudMask3, do_toggle_sensor
369 MENU_END 373 MENU_END
370 374
379 MENU_CALL tDiveHudMask2, do_toggle_sensor 383 MENU_CALL tDiveHudMask2, do_toggle_sensor
380 MENU_CALL tDiveHudMask3, do_toggle_sensor 384 MENU_CALL tDiveHudMask3, do_toggle_sensor
381 MENU_END 385 MENU_END
382 386
383 do_toggle_sensor: 387 do_toggle_sensor:
388 movff menupos,lo ; backup position
384 decf menupos,f ; 4, 5, 6 -> 3, 4, 5 389 decf menupos,f ; 4, 5, 6 -> 3, 4, 5
385 decf menupos,f ; 3, 4, 5 -> 2, 3, 4 390 decf menupos,f ; 3, 4, 5 -> 2, 3, 4
386 decf menupos,f ; 2, 3, 4 -> 1, 2, 3 391 decf menupos,f ; 2, 3, 4 -> 1, 2, 3
387 dcfsnz menupos ; 1, 2, 3 -> 0, 1, 2 392 dcfsnz menupos ; 1, 2, 3 -> 0, 1, 2
388 btg use_O2_sensor1 ; = 393 btg use_O2_sensor1 ; =
389 dcfsnz menupos ; 0, 1, 2 -> -1, 0, 1 394 dcfsnz menupos ; 0, 1, 2 -> -1, 0, 1
390 btg use_O2_sensor2 ; = 395 btg use_O2_sensor2 ; =
391 dcfsnz menupos ; -1,0, 1 -> -2,-1, 0 396 dcfsnz menupos ; -1,0, 1 -> -2,-1, 0
392 btg use_O2_sensor3 ; = 397 btg use_O2_sensor3 ; =
393 movlw .1 398 movff lo,menupos ; reload position
394 movwf menupos
395 bra do_divemode_sensor_loop 399 bra do_divemode_sensor_loop
396 400
397 401
398 END 402 END