# HG changeset patch # User heinrichsweikamp # Date 1303199673 -7200 # Node ID f8f865c70a0d53024572f85862f719284edb1305 # Parent ce6f861d4e3ee11b4b09061a77fa2852a3a13869 no more sorted gaslist... diff -r ce6f861d4e3e -r f8f865c70a0d code_part1/OSTC_code_asm_part1/changelog.txt --- a/code_part1/OSTC_code_asm_part1/changelog.txt Tue Apr 19 07:37:56 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/changelog.txt Tue Apr 19 09:54:33 2011 +0200 @@ -1,5 +1,8 @@ New in 1.87 beta: BETA Version - Do NOT use for diving! +CHANGE: Runtime simulator faster +BUGFIX: "Active?" list in Divemode + New in 1.86 beta: BETA Version - Do NOT use for diving! diff -r ce6f861d4e3e -r f8f865c70a0d code_part1/OSTC_code_asm_part1/divemode.asm --- a/code_part1/OSTC_code_asm_part1/divemode.asm Tue Apr 19 07:37:56 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/divemode.asm Tue Apr 19 09:54:33 2011 +0200 @@ -335,9 +335,9 @@ divemode_check_decogases: ; CALLed from Simulator ; Copy active gases to char_I_deco_N2_ratio and char_I_deco_He_ratio - read_int_eeprom d'97' ; Read He ratio + read_int_eeprom d'5' ; Read He ratio movff EEDATA,char_I_deco_He_ratio+4 ; And copy into hold register - read_int_eeprom d'96' ; Read O2 ratio + read_int_eeprom d'4' ; Read O2 ratio movff char_I_deco_He_ratio+4, wait_temp ; copy into bank1 register bsf STATUS,C ; movlw d'100' ; 100% @@ -345,9 +345,9 @@ subfwb EEDATA,F ; minus O2 movff EEDATA, char_I_deco_N2_ratio+4; = N2! - read_int_eeprom d'101' ; Read He ratio + read_int_eeprom d'9' ; Read He ratio movff EEDATA,char_I_deco_He_ratio+3 ; And copy into hold register - read_int_eeprom d'100' ; Read O2 ratio + read_int_eeprom d'8' ; Read O2 ratio movff char_I_deco_He_ratio+3, wait_temp ; copy into bank1 register bsf STATUS,C ; movlw d'100' ; 100% @@ -355,9 +355,9 @@ subfwb EEDATA,F ; minus O2 movff EEDATA, char_I_deco_N2_ratio+3; = N2! - read_int_eeprom d'105' ; Read He ratio + read_int_eeprom d'13' ; Read He ratio movff EEDATA,char_I_deco_He_ratio+2 ; And copy into hold register - read_int_eeprom d'104' ; Read O2 ratio + read_int_eeprom d'12' ; Read O2 ratio movff char_I_deco_He_ratio+2, wait_temp ; copy into bank1 register bsf STATUS,C ; movlw d'100' ; 100% @@ -365,9 +365,9 @@ subfwb EEDATA,F ; minus O2 movff EEDATA, char_I_deco_N2_ratio+2; = N2! - read_int_eeprom d'109' ; Read He ratio + read_int_eeprom d'17' ; Read He ratio movff EEDATA,char_I_deco_He_ratio+1 ; And copy into hold register - read_int_eeprom d'108' ; Read O2 ratio + read_int_eeprom d'16' ; Read O2 ratio movff char_I_deco_He_ratio+1, wait_temp ; copy into bank1 register bsf STATUS,C ; movlw d'100' ; 100% @@ -375,9 +375,9 @@ subfwb EEDATA,F ; minus O2 movff EEDATA, char_I_deco_N2_ratio+1; = N2! - read_int_eeprom d'113' ; Read He ratio + read_int_eeprom d'21' ; Read He ratio movff EEDATA,char_I_deco_He_ratio+0; And copy into hold register - read_int_eeprom d'112' ; Read O2 ratio + read_int_eeprom d'20' ; Read O2 ratio movff char_I_deco_He_ratio+0, wait_temp ; copy into bank1 register bsf STATUS,C ; movlw d'100' ; 100% @@ -385,32 +385,108 @@ subfwb EEDATA,F ; minus O2 movff EEDATA, char_I_deco_N2_ratio+0; = N2! -; Now, set change depth. Inactive gases have depth=0! - read_int_eeprom d'118' ; read gas_change_depth Gas1 + read_int_eeprom d'28' ; read gas_change_depth Gas1 btfss sorted_gaslist_active,0 ; Apply depth? clrf EEDATA ; No, clear! movff EEDATA,char_I_deco_gas_change+4 ; Yes! - read_int_eeprom d'119' ; read gas_change_depth Gas2 + read_int_eeprom d'29' ; read gas_change_depth Gas2 btfss sorted_gaslist_active,1 ; Apply depth? clrf EEDATA ; No, clear! movff EEDATA,char_I_deco_gas_change+3 ; Yes! - read_int_eeprom d'120' ; read gas_change_depth Gas3 + read_int_eeprom d'30' ; read gas_change_depth Gas3 btfss sorted_gaslist_active,2 ; Apply depth? clrf EEDATA ; No, clear! movff EEDATA,char_I_deco_gas_change+2 ; Yes! - read_int_eeprom d'121' ; read gas_change_depth Gas4 + read_int_eeprom d'31' ; read gas_change_depth Gas4 btfss sorted_gaslist_active,3 ; Apply depth? clrf EEDATA ; No, clear! movff EEDATA,char_I_deco_gas_change+1 ; Yes! - read_int_eeprom d'122' ; read gas_change_depth Gas5 + read_int_eeprom d'32' ; read gas_change_depth Gas5 btfss sorted_gaslist_active,4 ; Apply depth? clrf EEDATA ; No, clear! movff EEDATA,char_I_deco_gas_change+0 ; Yes! + +; read_int_eeprom d'97' ; Read He ratio +; movff EEDATA,char_I_deco_He_ratio+4 ; And copy into hold register +; read_int_eeprom d'96' ; Read O2 ratio +; movff char_I_deco_He_ratio+4, wait_temp ; copy into bank1 register +; bsf STATUS,C ; +; movlw d'100' ; 100% +; subfwb wait_temp,W ; minus He +; subfwb EEDATA,F ; minus O2 +; movff EEDATA, char_I_deco_N2_ratio+4; = N2! +; +; read_int_eeprom d'101' ; Read He ratio +; movff EEDATA,char_I_deco_He_ratio+3 ; And copy into hold register +; read_int_eeprom d'100' ; Read O2 ratio +; movff char_I_deco_He_ratio+3, wait_temp ; copy into bank1 register +; bsf STATUS,C ; +; movlw d'100' ; 100% +; subfwb wait_temp,W ; minus He +; subfwb EEDATA,F ; minus O2 +; movff EEDATA, char_I_deco_N2_ratio+3; = N2! +; +; read_int_eeprom d'105' ; Read He ratio +; movff EEDATA,char_I_deco_He_ratio+2 ; And copy into hold register +; read_int_eeprom d'104' ; Read O2 ratio +; movff char_I_deco_He_ratio+2, wait_temp ; copy into bank1 register +; bsf STATUS,C ; +; movlw d'100' ; 100% +; subfwb wait_temp,W ; minus He +; subfwb EEDATA,F ; minus O2 +; movff EEDATA, char_I_deco_N2_ratio+2; = N2! +; +; read_int_eeprom d'109' ; Read He ratio +; movff EEDATA,char_I_deco_He_ratio+1 ; And copy into hold register +; read_int_eeprom d'108' ; Read O2 ratio +; movff char_I_deco_He_ratio+1, wait_temp ; copy into bank1 register +; bsf STATUS,C ; +; movlw d'100' ; 100% +; subfwb wait_temp,W ; minus He +; subfwb EEDATA,F ; minus O2 +; movff EEDATA, char_I_deco_N2_ratio+1; = N2! +; +; read_int_eeprom d'113' ; Read He ratio +; movff EEDATA,char_I_deco_He_ratio+0; And copy into hold register +; read_int_eeprom d'112' ; Read O2 ratio +; movff char_I_deco_He_ratio+0, wait_temp ; copy into bank1 register +; bsf STATUS,C ; +; movlw d'100' ; 100% +; subfwb wait_temp,W ; minus He +; subfwb EEDATA,F ; minus O2 +; movff EEDATA, char_I_deco_N2_ratio+0; = N2! +; +; Now, set change depth. Inactive gases have depth=0! +; read_int_eeprom d'118' ; read gas_change_depth Gas1 +; btfss sorted_gaslist_active,0 ; Apply depth? +; clrf EEDATA ; No, clear! +; movff EEDATA,char_I_deco_gas_change+4 ; Yes! +; +; read_int_eeprom d'119' ; read gas_change_depth Gas2 +; btfss sorted_gaslist_active,1 ; Apply depth? +; clrf EEDATA ; No, clear! +; movff EEDATA,char_I_deco_gas_change+3 ; Yes! +; +; read_int_eeprom d'120' ; read gas_change_depth Gas3 +; btfss sorted_gaslist_active,2 ; Apply depth? +; clrf EEDATA ; No, clear! +; movff EEDATA,char_I_deco_gas_change+2 ; Yes! +; +; read_int_eeprom d'121' ; read gas_change_depth Gas4 +; btfss sorted_gaslist_active,3 ; Apply depth? +; clrf EEDATA ; No, clear! +; movff EEDATA,char_I_deco_gas_change+1 ; Yes! +; +; read_int_eeprom d'122' ; read gas_change_depth Gas5 +; btfss sorted_gaslist_active,4 ; Apply depth? +; clrf EEDATA ; No, clear! +; movff EEDATA,char_I_deco_gas_change+0 ; Yes! + ; Debugger ; call enable_rs232 ; movff char_I_deco_He_ratio+4,TXREG @@ -946,7 +1022,8 @@ call div16x16 ; compute depth in full m -> result in xC+0 check_gas_change1: ; check gas1 - read_int_eeprom d'27' ; read flag register +; read_int_eeprom d'27' ; read flag register + movff sorted_gaslist_active,EEDATA ; Get flag register btfss EEDATA,0 ; check active flag bra check_gas_change2 ; skip inactive gases! movlw d'1' @@ -967,7 +1044,8 @@ bsf better_gas_available ;=1: A better gas is available and a gas change is advised in divemode check_gas_change2: ; check gas2 - read_int_eeprom d'27' ; read flag register +; read_int_eeprom d'27' ; read flag register + movff sorted_gaslist_active,EEDATA ; Get flag register btfss EEDATA,1 ; check active flag bra check_gas_change3 ; skip inactive gases! movlw d'2' @@ -988,7 +1066,8 @@ bsf better_gas_available ;=1: A better gas is available and a gas change is advised in divemode check_gas_change3: ; check gas3 - read_int_eeprom d'27' ; read flag register +; read_int_eeprom d'27' ; read flag register + movff sorted_gaslist_active,EEDATA ; Get flag register btfss EEDATA,2 ; check active flag bra check_gas_change4 ; skip inactive gases! movlw d'3' @@ -1009,7 +1088,8 @@ bsf better_gas_available ;=1: A better gas is available and a gas change is advised in divemode check_gas_change4: ; check gas4 - read_int_eeprom d'27' ; read flag register +; read_int_eeprom d'27' ; read flag register + movff sorted_gaslist_active,EEDATA ; Get flag register btfss EEDATA,3 ; check active flag bra check_gas_change5 ; skip inactive gases! movlw d'4' @@ -1030,7 +1110,8 @@ bsf better_gas_available ;=1: A better gas is available and a gas change is advised in divemode check_gas_change5: ; check gas5 - read_int_eeprom d'27' ; read flag register +; read_int_eeprom d'27' ; read flag register + movff sorted_gaslist_active,EEDATA ; Get flag register btfss EEDATA,4 ; check active flag bra check_gas_change6 ; skip inactive gases! movlw d'5' @@ -1775,24 +1856,31 @@ movff EEDATA, char_I_N2_ratio ; = N2! ; Configure sorted_gaslist_active flag register - clrf sorted_gaslist_active ; Clear all flags - read_int_eeprom d'118' ; read gas_change_depth Gas1 - tstfsz EEDATA ; =0m? - bsf sorted_gaslist_active,0 ; No, Set Flag for Gas1 + read_int_eeprom d'27' + movff EEDATA, sorted_gaslist_active + return - read_int_eeprom d'119' ; read gas_change_depth Gas2 - tstfsz EEDATA ; =0m? - bsf sorted_gaslist_active,1 ; No, Set Flag for Gas2 - read_int_eeprom d'120' ; read gas_change_depth Gas3 - tstfsz EEDATA ; =0m? - bsf sorted_gaslist_active,2 ; No, Set Flag for Gas3 - - read_int_eeprom d'121' ; read gas_change_depth Gas4 - tstfsz EEDATA ; =0m? - bsf sorted_gaslist_active,3 ; No, Set Flag for Gas4 - - read_int_eeprom d'122' ; read gas_change_depth Gas5 - tstfsz EEDATA ; =0m? - bsf sorted_gaslist_active,4 ; No, Set Flag for Gas5 - return +; +; clrf sorted_gaslist_active ; Clear all flags +; read_int_eeprom d'118' ; read gas_change_depth Gas1 +; tstfsz EEDATA ; =0m? +; bsf sorted_gaslist_active,0 ; No, Set Flag for Gas1 +; +; read_int_eeprom d'119' ; read gas_change_depth Gas2 +; tstfsz EEDATA ; =0m? +; bsf sorted_gaslist_active,1 ; No, Set Flag for Gas2 +; +; read_int_eeprom d'120' ; read gas_change_depth Gas3 +; tstfsz EEDATA ; =0m? +; bsf sorted_gaslist_active,2 ; No, Set Flag for Gas3 +; +; read_int_eeprom d'121' ; read gas_change_depth Gas4 +; tstfsz EEDATA ; =0m? +; bsf sorted_gaslist_active,3 ; No, Set Flag for Gas4 +; +; read_int_eeprom d'122' ; read gas_change_depth Gas5 +; tstfsz EEDATA ; =0m? +; bsf sorted_gaslist_active,4 ; No, Set Flag for Gas5 +; return +; \ No newline at end of file diff -r ce6f861d4e3e -r f8f865c70a0d code_part1/OSTC_code_asm_part1/divemode_menu.asm --- a/code_part1/OSTC_code_asm_part1/divemode_menu.asm Tue Apr 19 07:37:56 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/divemode_menu.asm Tue Apr 19 09:54:33 2011 +0200 @@ -686,6 +686,11 @@ btfss dekostop_active call PLED_display_ndl_mask ; Clear deco data, display nostop time + btfsc dekostop_active + call PLED_display_deko ; Update deco display at once + btfss dekostop_active + call PLED_display_ndl ; Update NDL display at once + timeout_divemenu2a: bcf menubit bcf premenu ; Yes, clear flags and menu, display dive time and mask again diff -r ce6f861d4e3e -r f8f865c70a0d code_part1/OSTC_code_asm_part1/menu_gassetup.asm --- a/code_part1/OSTC_code_asm_part1/menu_gassetup.asm Tue Apr 19 07:37:56 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/menu_gassetup.asm Tue Apr 19 09:54:33 2011 +0200 @@ -1013,6 +1013,9 @@ ;============================================================================= gassetup_sort_gaslist: ; Sorts Gaslist according to change depth + return ; No sort test + + ; EEPROM Locations of Gaslist ; Gas1: ; O2 Default:4 diff -r ce6f861d4e3e -r f8f865c70a0d code_part1/OSTC_code_asm_part1/pled_outputs.asm --- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm Tue Apr 19 07:37:56 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm Tue Apr 19 09:54:33 2011 +0200 @@ -436,7 +436,6 @@ movff char_O_nullzeit,lo ; NDL in minutes output_8 STRCAT_PRINT "'" - WIN_FONT FT_SMALL return @@ -457,7 +456,6 @@ bra PLED_display_deko1 ; Yes, do not display deco, only GF (if required) ostc_debug 'y' ; Sends debug-information to screen if debugmode active -; deco stop word WIN_TOP .80 WIN_LEFT .94 WIN_FONT FT_MEDIUM @@ -2539,7 +2537,8 @@ WIN_FONT FT_SMALL bsf leftbind - movlw d'92' +; movlw d'92' ; old sorted list + movlw d'2' movwf wait_temp ; here: stores eeprom address for gas list movlw d'0' movwf waitms_temp ; here: stores row for gas list @@ -2566,7 +2565,8 @@ output_8 ; outputs into Postinc2! PUTC '@' - movlw d'117' +; movlw d'117' ; old sorted list + movlw d'27' addwf hi,W movwf EEADR ; Point to Change depth @@ -2640,8 +2640,9 @@ decf EEADR,F ; Gas #hi: %O2 - Set address in internal EEPROM call read_eeprom ; get byte (stored in EEDATA) PLED_color_code warn_gas_in_gaslist ; Color-code output (%O2 in "EEDATA") -; Check if gas needs to be greyed-out (inactive) - read_int_eeprom d'27' ; read flag register +; Check if gas needs to be greyed-out (inactive) + movff sorted_gaslist_active, EEDATA ; Work with sorted list +; read_int_eeprom d'27' ; read flag register movff hi,lo ; copy gas number PLED_gas_list_loop1: rrcf EEDATA ; roll flags into carry