comparison code_part1/OSTC_code_asm_part1/divemode_menu.asm @ 236:3dbeacf42e9e

BUGFIX missing deko init in reboot code. + Typo in ppN2 name.
author JeanDo
date Sat, 19 Mar 2011 15:15:17 +0100
parents 448478ceccea
children a728b4a1b660
comparison
equal deleted inserted replaced
235:ade0848c8b8b 236:3dbeacf42e9e
332 332
333 divemode_menu_simulator_common: 333 divemode_menu_simulator_common:
334 call PLED_divemode_simulator_mask ; Redraw Simualtor mask 334 call PLED_divemode_simulator_mask ; Redraw Simualtor mask
335 335
336 ; Check limits (130m and 0m) 336 ; Check limits (130m and 0m)
337 movlw LOW d'14000' 337 movlw LOW d'14000' ; Compare to 14bar=14000mbar (130m).
338 movwf sub_a+0 338 subwf sim_pressure+0,W
339 movlw HIGH d'14000' 339 movlw HIGH d'14000'
340 movwf sub_a+1 340 subwfb sim_pressure+1,W
341 movff sim_pressure+0,sub_b+0 341 bnc divemode_menu_simulator_common2 ; No-carry = borrow = not deeper
342 movff sim_pressure+1,sub_b+1 342
343 call sub16 ; sub_c = sub_a - sub_b
344 btfss neg_flag
345 bra divemode_menu_simulator_common2
346 ; Too deep, limit to 130m 343 ; Too deep, limit to 130m
347 movlw LOW d'14000' 344 movlw LOW d'14000'
348 movwf sim_pressure+0 345 movwf sim_pressure+0
349 movlw HIGH d'14000' 346 movlw HIGH d'14000'
350 movwf sim_pressure+1 347 movwf sim_pressure+1
351 return 348 return
352 349
353 divemode_menu_simulator_common2: 350 divemode_menu_simulator_common2:
354 movlw LOW d'1000' 351 movlw LOW d'1000' ; Compare to 1bar == 0m == 1000 mbar.
355 movwf sub_a+0 352 subwf sim_pressure+0,W
356 movlw HIGH d'1000' 353 movlw HIGH d'1000'
357 movwf sub_a+1 354 subwfb sim_pressure+1,W
358 movff sim_pressure+0,sub_b+0 355 btfsc STATUS,C ; No-carry = borrow = not deeper.
359 movff sim_pressure+1,sub_b+1 356 return ; Deeper than 0m == Ok.
360 call sub16 ; sub_c = sub_a - sub_b 357
361 btfsc neg_flag
362 return
363 ; Too shallow, limit to 1m 358 ; Too shallow, limit to 1m
364 movlw LOW d'1000' 359 movlw LOW d'1000'
365 movwf sim_pressure+0 360 movwf sim_pressure+0
366 movlw HIGH d'1000' 361 movlw HIGH d'1000'
367 movwf sim_pressure+1 362 movwf sim_pressure+1
379 divemode_menu_simulator_p10: 374 divemode_menu_simulator_p10:
380 movlw LOW d'1000' 375 movlw LOW d'1000'
381 addwf sim_pressure+0,F 376 addwf sim_pressure+0,F
382 movlw HIGH d'1000' 377 movlw HIGH d'1000'
383 addwfc sim_pressure+1,F 378 addwfc sim_pressure+1,F
379
384 movlw d'4' 380 movlw d'4'
385 movwf menupos ; reset cursor 381 movwf menupos ; reset cursor
386 bra divemode_menu_simulator_common 382 bra divemode_menu_simulator_common
387 383
388 divemode_menu_simulator_p1: 384 divemode_menu_simulator_p1: