comparison code_part1/OSTC_code_asm_part1/simulator.asm @ 225:2dc4a7340510

BUGFIX Gas usage for unsorted gas list. + Fix detection of saturation (6553.5 l). + Better handling of unsorted gas list.
author JeanDo
date Thu, 03 Mar 2011 15:52:16 +0100
parents 49c90c5d9603
children 85ea09d3b9d8
comparison
equal deleted inserted replaced
224:49c90c5d9603 225:2dc4a7340510
238 simulator_show_decoplan5_0: 238 simulator_show_decoplan5_0:
239 btfss display_see_deco 239 btfss display_see_deco
240 bra simulator_show_decoplan4 240 bra simulator_show_decoplan4
241 bcf display_see_deco ; clear flag 241 bcf display_see_deco ; clear flag
242 242
243 ; Re-read gas change depth, from the unsorted list.
244 movlw .27 ; Active flags.
245 movwf EEADR
246 clrf EEADRH
247 call read_eeprom
248 movff EEDATA,waitms_temp ; Save activity flags.
249 incf EEADR,F ; 28 == Gas#1's change depth.
250
251 lfsr FSR2,char_I_deco_gas_change
252 movlw 5
253 movwf wait_temp
254
255 simulator_show_decoplan5_4:
256 call read_eeprom
257 incf EEADR,F
258
259 rrcf waitms_temp ; Roll acticity to cary.
260 btfss STATUS,C
261 clrf EEDATA ; If not active, set depth=0
262
263 movff EEDATA,POSTINC2 ; Write that in depth array.
264 decfsz wait_temp
265 bra simulator_show_decoplan5_4
266
267 ; Compute gas consumption for each tank.
243 call deco_gas_volumes 268 call deco_gas_volumes
244 movlb 1 269 movlb 1
245 270
271 ; Display results
246 call PLED_clear_divemode_menu ; Clear right part. 272 call PLED_clear_divemode_menu ; Clear right part.
247 273
248 movlw d'10' 274 movlw d'10'
249 movwf waitms_temp ; Row for gas list is .10+.25 275 movwf waitms_temp ; Row for gas list is .10+.25
250 clrf wait_temp ; Gas counter 276 clrf wait_temp ; Gas counter
264 movf lo,W ; Null ? 290 movf lo,W ; Null ?
265 iorwf hi,W 291 iorwf hi,W
266 bz simulator_show_decoplan5_1 ; Skip printing. 292 bz simulator_show_decoplan5_1 ; Skip printing.
267 293
268 movf lo,W ; == 65535 (saturated ?) 294 movf lo,W ; == 65535 (saturated ?)
269 iorwf hi,W 295 andwf hi,W
270 incf WREG 296 incf WREG
271 bnz simulator_show_decoplan5_2 297 bnz simulator_show_decoplan5_2
272 call PLED_warnings_color 298 call PLED_warnings_color
273 STRCPY "> " 299 STRCPY "> "
274 bra simulator_show_decoplan5_3 300 bra simulator_show_decoplan5_3