Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 121:e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
author | JeanDo |
---|---|
date | Sun, 26 Dec 2010 23:49:11 +0100 |
parents | f24137eb85de |
children | 6a94f96e9cea |
comparison
equal
deleted
inserted
replaced
119:f24137eb85de | 121:e0f29e20bd24 |
---|---|
1293 call PLED_standard_color | 1293 call PLED_standard_color |
1294 | 1294 |
1295 call word_processor | 1295 call word_processor |
1296 return | 1296 return |
1297 | 1297 |
1298 ;----------------------------------------------------------------------------- | |
1299 ; Set color to grey when gas is inactive | |
1300 ; Inputs: WREG : gas# (0..4) | |
1301 ; Trashes: lo | |
1302 ; New v1.44se | |
1303 PLED_grey_inactive_gas: | |
1304 movwf lo ; copy gas number 0-4 | |
1305 incf lo,F ; 1-5 | |
1306 | |
1307 read_int_eeprom d'33' ; Get First gas (1-5) | |
1308 movf EEDATA,W | |
1309 subwf lo,W ; Compare with current | |
1310 bz PLED_white_gas ; First is always on. | |
1311 | |
1312 movlw .28-1 ; Depth for gas# is at idx+28 | |
1313 addwf lo,W | |
1314 movwf EEADR ; address in EEPROM. | |
1315 call read_eeprom ; Read depth | |
1316 clrf WREG | |
1317 cpfsgt EEDATA ; is depth > 0 ? | |
1318 bra PLED_grey_gas | |
1319 | |
1320 read_int_eeprom d'27' ; read flag register | |
1321 PLED_grey_inactive_gas1: | |
1322 rrcf EEDATA ; roll flags into carry | |
1323 decfsz lo,F ; max. 5 times... | |
1324 bra PLED_grey_inactive_gas1 | |
1325 | |
1326 bnc PLED_grey_gas ; test carry | |
1327 | |
1328 PLED_white_gas: | |
1329 GETCUSTOM8 d'35' ;movlw color_white | |
1330 goto PLED_set_color ; grey out inactive gases! | |
1331 | |
1332 PLED_grey_gas: | |
1333 movlw color_grey | |
1334 goto PLED_set_color ; grey out inactive gases! | |
1335 | |
1336 ;----------------------------------------------------------------------------- | |
1337 | |
1298 PLED_pre_dive_screen: ;Display Pre-Dive Screen | 1338 PLED_pre_dive_screen: ;Display Pre-Dive Screen |
1299 ; movlw .0 | 1339 ; movlw .0 |
1300 ; movff WREG,box_temp+0 ; Data | 1340 ; movff WREG,box_temp+0 ; Data |
1301 ; movlw .25 | 1341 ; movlw .25 |
1302 ; movff WREG,box_temp+1 ; row top (0-239) | 1342 ; movff WREG,box_temp+1 ; row top (0-239) |
1348 movwf POSTINC2 | 1388 movwf POSTINC2 |
1349 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM | 1389 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM |
1350 call read_eeprom ; get byte (stored in EEDATA) | 1390 call read_eeprom ; get byte (stored in EEDATA) |
1351 movff EEDATA,lo ; copy to lo | 1391 movff EEDATA,lo ; copy to lo |
1352 output_8 ; outputs into Postinc2! | 1392 output_8 ; outputs into Postinc2! |
1353 | 1393 |
1354 read_int_eeprom d'27' ; read flag register | 1394 decf hi,W ; Gas # in 0..4 |
1355 movff hi,lo ; copy gas number | 1395 call PLED_grey_inactive_gas |
1356 PLED_pre_dive_screen2_loop1: | 1396 |
1357 rrcf EEDATA ; roll flags into carry | |
1358 decfsz lo,F ; max. 5 times... | |
1359 bra PLED_pre_dive_screen2_loop1 | |
1360 | |
1361 btfsc STATUS,C ; test carry | |
1362 bra PLED_pre_dive_white | |
1363 | |
1364 movlw color_grey | |
1365 call PLED_set_color ; grey out inactive gases! | |
1366 bra PLED_pre_dive_color_done | |
1367 | |
1368 PLED_pre_dive_white: | |
1369 call PLED_standard_color | |
1370 | |
1371 PLED_pre_dive_color_done: | |
1372 read_int_eeprom d'33' ; Read start gas (1-5) | 1397 read_int_eeprom d'33' ; Read start gas (1-5) |
1373 movf EEDATA,W | 1398 movf EEDATA,W |
1374 cpfseq hi ; Current Gas the active gas? | 1399 cpfseq hi ; Current Gas the active gas? |
1375 bra PLED_pre_dive_screen2a | 1400 bra PLED_pre_dive_screen2a |
1376 bra PLED_pre_dive_screen2b | 1401 bra PLED_pre_dive_screen2b |
1381 WIN_LEFT .90 | 1406 WIN_LEFT .90 |
1382 movff waitms_temp,win_top ; Set Row | 1407 movff waitms_temp,win_top ; Set Row |
1383 call word_processor ; No, display gas | 1408 call word_processor ; No, display gas |
1384 | 1409 |
1385 PLED_pre_dive_screen2b: | 1410 PLED_pre_dive_screen2b: |
1386 call PLED_standard_color | |
1387 | |
1388 movlw d'5' ; list all four (remaining) gases | 1411 movlw d'5' ; list all four (remaining) gases |
1389 cpfseq hi ; All gases shown? | 1412 cpfseq hi ; All gases shown? |
1390 bra PLED_pre_dive_screen2_loop ; No | 1413 bra PLED_pre_dive_screen2_loop ; No |
1391 | 1414 |
1392 return ; No, return (OC mode) | 1415 return ; No, return (OC mode) |