comparison code_part1/OSTC_code_asm_part1/menu_gassetup.asm @ 199:f5e9db793dd3

Minor missing translations + MOD/END/EAD in translation table. + ON/OFF (French). + Desat in logbook. + Set date/time menu positionning. + Simulator menu positionning.
author JeanDo
date Mon, 14 Feb 2011 17:23:08 +0100
parents 6a94f96e9cea
children 8dbcc26878d3
comparison
equal deleted inserted replaced
198:1d98f30ed44e 199:f5e9db793dd3
297 bcf menubit2 297 bcf menubit2
298 bcf menubit3 298 bcf menubit3
299 299
300 rcall gassetup_title_bar2 ; Displays the title bar with the current Gas info 300 rcall gassetup_title_bar2 ; Displays the title bar with the current Gas info
301 301
302 WIN_TOP .65
303 WIN_LEFT .20 302 WIN_LEFT .20
304 303 WIN_TOP .65
305 STRCPY "O2: " 304 STRCPY "O2: "
306 305
307 movf divemins+0,W 306 movf divemins+0,W
308 addlw 0x06 307 addlw 0x06
309 movwf EEADR 308 movwf EEADR
310 call read_eeprom ; O2 value 309 call read_eeprom ; O2 value
311 movff EEDATA,lo 310 movff EEDATA,lo
312 output_8 311 output_8
313 STRCAT "% (MOD:" 312 STRCAT_PRINT "% "
314 313
315 ; Show MOD in m 314 ; Show MOD in m
316 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG 315 WIN_LEFT .90
316 lfsr FSR2, letter
317 OUTPUTTEXTH .297 ; MOD:
318
319 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG
317 mullw d'10' 320 mullw d'10'
318 movff PRODL,xA+0 321 movff PRODL,xA+0
319 movff PRODH,xA+1 ; ppO2 in [0.01Bar] * 10 322 movff PRODH,xA+1 ; ppO2 in [0.01Bar] * 10
320 323
321 movf divemins+0,W 324 movf divemins+0,W
322 addlw 0x06 325 addlw 0x06
323 movwf EEADR 326 movwf EEADR
324 call read_eeprom ; O2 value 327 call read_eeprom ; O2 value
325 movff EEDATA,xB+0 328 movff EEDATA,xB+0
326 clrf xB+1 329 clrf xB+1
327 call div16x16 ;xA/xB=xC with xA as remainder 330 call div16x16 ; xA/xB=xC with xA as remainder
328 movlw d'10' 331 movlw d'10'
329 subwf xC+0,F ; Subtract 10m... 332 subwf xC+0,F ; Subtract 10m...
330 movff xC+0,lo 333 movff xC+0,lo
331 movlw d'0' 334 movlw d'0'
332 subwfb xC+1,F 335 subwfb xC+1,F
333 movff xC+1,hi 336 movff xC+1,hi
334 output_16 337 output_16
335 STRCAT_PRINT "m) " 338 STRCAT_PRINT "m "
336 339
340 WIN_LEFT .20
337 WIN_TOP .95 341 WIN_TOP .95
338 STRCPY "He: " 342 STRCPY "He: "
339 movf divemins+0,W 343 movf divemins+0,W
340 addlw 0x07 344 addlw 0x07
341 movwf EEADR 345 movwf EEADR
342 call read_eeprom ; He value 346 call read_eeprom ; He value
343 movff EEDATA,lo 347 movff EEDATA,lo
344 output_8 348 output_8
345 STRCAT "% (END:" 349 STRCAT_PRINT "% "
346 350
347 ; Show END in m 351 ; Show END in m
348 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG 352 lfsr FSR2, letter
353 WIN_LEFT .90
354 OUTPUTTEXTH .298 ; END:
355 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG
349 mullw d'10' 356 mullw d'10'
350 movff PRODL,xA+0 357 movff PRODL,xA+0
351 movff PRODH,xA+1 ; ppO2 in [0.01Bar] * 10 358 movff PRODH,xA+1 ; ppO2 in [0.01Bar] * 10
352 movf divemins+0,W 359 movf divemins+0,W
353 addlw 0x06 360 addlw 0x06
354 movwf EEADR 361 movwf EEADR
355 call read_eeprom ; O2 value 362 call read_eeprom ; O2 value
356 movff EEDATA,xB+0 363 movff EEDATA,xB+0
357 clrf xB+1 364 clrf xB+1
358 call div16x16 ;xA/xB=xC with xA as remainder 365 call div16x16 ; xA/xB=xC with xA as remainder
359 movlw d'10' 366 movlw d'10'
360 subwf xC+0,F ; Subtract 10m... 367 subwf xC+0,F ; Subtract 10m...
361 movff xC+0,lo 368 movff xC+0,lo
362 movlw d'0' 369 movlw d'0'
363 subwfb xC+1,F 370 subwfb xC+1,F
364 movff xC+1,hi ; lo:hi holding MOD in meters 371 movff xC+1,hi ; lo:hi holding MOD in meters
365 movlw d'10' 372 movlw d'10'
366 addwf lo,F 373 addwf lo,F
367 movlw d'0' 374 movlw d'0'
368 addwfc hi,F ; lo:hi holding MOD+10m 375 addwfc hi,F ; lo:hi holding MOD+10m
369 376
370 movf divemins+0,W 377 movf divemins+0,W
371 addlw 0x07 378 addlw 0x07
372 movwf EEADR 379 movwf EEADR
373 call read_eeprom ; He value in % -> EEDATA 380 call read_eeprom ; He value in % -> EEDATA
374 movlw d'100' 381 movlw d'100'
375 movwf xA+0 382 movwf xA+0
376 movf EEDATA,W ; He value in % -> EEDATA 383 movf EEDATA,W ; He value in % -> EEDATA
377 subwf xA+0,F ; xA+0 = 100 - He Value in % 384 subwf xA+0,F ; xA+0 = 100 - He Value in %
378 clrf xA+1 385 clrf xA+1
379 movff lo,xB+0 386 movff lo,xB+0
380 movff hi,xB+1 ; Copy MOD+10 387 movff hi,xB+1 ; Copy MOD+10
381 call mult16x16 ;xA*xB=xC 388 call mult16x16 ; xA*xB=xC
382 movff xC+0,xA+0 389 movff xC+0,xA+0
383 movff xC+1,xA+1 390 movff xC+1,xA+1
384 movlw d'100' 391 movlw d'100'
385 movwf xB+0 392 movwf xB+0
386 clrf xB+1 393 clrf xB+1
387 call div16x16 ;xA/xB=xC with xA as remainder 394 call div16x16 ; xA/xB=xC with xA as remainder
388 ; xC:2 = ((MOD+10) * 100 - HE Value in %) / 100 395 ; xC:2 = ((MOD+10) * 100 - HE Value in %) / 100
389 movlw d'10' 396 movlw d'10'
390 subwf xC+0,F ; Subtract 10m... 397 subwf xC+0,F ; Subtract 10m...
391 movff xC+0,lo 398 movff xC+0,lo
392 movlw d'0' 399 movlw d'0'
393 subwfb xC+1,F 400 subwfb xC+1,F
394 movff xC+1,hi 401 movff xC+1,hi
395 output_16 402 output_16
396 STRCAT_PRINT "m) " 403 STRCAT_PRINT "m "
397 404
405 WIN_LEFT .20
398 WIN_TOP .125 406 WIN_TOP .125
399 STRCPY "+/-: " 407 STRCPY "+/-: "
400 movlw '+' 408 movlw '+'
401 btfsc first_FA 409 btfsc first_FA
402 movlw '-' 410 movlw '-'
403 movwf POSTINC2 411 movwf POSTINC2
404 call word_processor 412 call word_processor
405 413
406 WIN_TOP .155 414 WIN_TOP .155
407 lfsr FSR2,letter 415 lfsr FSR2,letter
408 OUTPUTTEXT .89 ; Default: 416 OUTPUTTEXT .89 ; Default:
409 movf divemins+0,W 417 movf divemins+0,W
410 addlw 0x04 418 addlw 0x04
411 movwf EEADR 419 movwf EEADR
412 call read_eeprom ; Default O2 value 420 call read_eeprom ; Default O2 value
413 movff EEDATA,lo 421 movff EEDATA,lo
414 output_8 422 output_8
415 PUTC '/' 423 PUTC '/'
416 movf divemins+0,W 424 movf divemins+0,W
417 addlw 0x05 425 addlw 0x05
418 movwf EEADR 426 movwf EEADR
419 call read_eeprom ; Default He value 427 call read_eeprom ; Default He value
420 movff EEDATA,lo 428 movff EEDATA,lo
421 output_8 429 output_8
422 STRCAT_PRINT " " 430 STRCAT_PRINT " "
423 431
424 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! 432 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!