Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/simulator.asm @ 200:0a3ca358c684
BUGFIX clear decotable at begin of simulator mode.
+ minor P2_deco cleanups and comments.
author | JeanDo |
---|---|
date | Mon, 14 Feb 2011 23:15:40 +0100 |
parents | f15e804ff67f |
children | 49c90c5d9603 |
comparison
equal
deleted
inserted
replaced
199:f5e9db793dd3 | 200:0a3ca358c684 |
---|---|
146 bcf menubit | 146 bcf menubit |
147 bcf switch_left | 147 bcf switch_left |
148 bcf switch_right | 148 bcf switch_right |
149 | 149 |
150 call simulator_save_tissue_data ; Stores 32 floats "pre_tissue" into bank3 | 150 call simulator_save_tissue_data ; Stores 32 floats "pre_tissue" into bank3 |
151 | |
152 movlw d'3' ; Begin of deco cycle (reset table). | |
153 movff WREG,char_O_deco_status ; Reset Deco module. | |
151 | 154 |
152 bsf divemode ; Set divemode flag | 155 bsf divemode ; Set divemode flag |
153 ostc_debug 'P' ; Sends debug-information to screen if debugmode active | 156 ostc_debug 'P' ; Sends debug-information to screen if debugmode active |
154 goto diveloop ; Start Divemode | 157 goto diveloop ; Start Divemode |
155 | 158 |
242 call diveloop_boot ; configure gases, etc. | 245 call diveloop_boot ; configure gases, etc. |
243 | 246 |
244 bsf simulatormode_active ; normal simulator mode | 247 bsf simulatormode_active ; normal simulator mode |
245 bsf standalone_simulator ; Standalone Simulator active | 248 bsf standalone_simulator ; Standalone Simulator active |
246 | 249 |
247 movff logbook_temp1,logbook_temp3 ; store bottom time | 250 movff logbook_temp1,logbook_temp3 ; store bottom time. |
248 | 251 |
249 movff logbook_temp2,xA+0 ; Bottom depth. | 252 movff logbook_temp2,xA+0 ; Bottom depth. |
250 clrf xA+1 | 253 clrf xA+1 |
251 movlw d'100' | 254 movlw d'100' |
252 movwf xB+0 | 255 movwf xB+0 |
271 DISPLAYTEXT .12 ; "Wait..." | 274 DISPLAYTEXT .12 ; "Wait..." |
272 WIN_INVERT .0 | 275 WIN_INVERT .0 |
273 | 276 |
274 call divemode_check_decogases ; Checks for decogases and sets the gases | 277 call divemode_check_decogases ; Checks for decogases and sets the gases |
275 call divemode_prepare_flags_for_deco | 278 call divemode_prepare_flags_for_deco |
276 movlw d'0' ; Begin of deco cycle (init sim tissues) | 279 movlw d'3' ; Begin of deco cycle (reset table). |
277 movff WREG,char_O_deco_status ; Reset Deco module. | 280 movff WREG,char_O_deco_status ; Reset Deco module. |
278 | 281 |
279 simulator_calc_deco_loop1: | 282 simulator_calc_deco_loop1: |
280 call deco_calc_hauptroutine ; calc_tissue | 283 call deco_calc_hauptroutine ; calc_tissue |
281 movlb b'00000001' ; rambank 1 selected | 284 movlb b'00000001' ; rambank 1 selected |
303 | 306 |
304 movlw d'0' | 307 movlw d'0' |
305 movff WREG,char_I_step_is_1min ; 2 second deco mode | 308 movff WREG,char_I_step_is_1min ; 2 second deco mode |
306 | 309 |
307 simulator_calc_deco2: | 310 simulator_calc_deco2: |
311 btg LED_red | |
312 | |
308 call divemode_check_decogases ; Checks for decogases and sets the gases | 313 call divemode_check_decogases ; Checks for decogases and sets the gases |
309 call divemode_prepare_flags_for_deco | 314 call divemode_prepare_flags_for_deco |
310 | 315 |
311 call deco_calc_hauptroutine ; calc_tissue | 316 call deco_calc_hauptroutine ; calc_tissue |
312 movlb b'00000001' ; rambank 1 selected | 317 movlb b'00000001' ; rambank 1 selected |
327 WAITMS d'250' | 332 WAITMS d'250' |
328 WAITMS d'250' ; Wait for Pressure Sensor to get real pressure again... | 333 WAITMS d'250' ; Wait for Pressure Sensor to get real pressure again... |
329 | 334 |
330 bcf LED_red | 335 bcf LED_red |
331 | 336 |
332 movlw d'1' | |
333 movwf logbook_temp1 ; Bottom time>0! | |
334 | |
335 movlw d'5' ; Pre-Set Cursor to "Show Decoplan" | 337 movlw d'5' ; Pre-Set Cursor to "Show Decoplan" |
336 movwf menupos | 338 movwf menupos |
337 movff logbook_temp3,logbook_temp1 ; restore bottom time | 339 movff logbook_temp3,logbook_temp1 ; restore bottom time. |
338 bra menu_simulator1 ; Done. | 340 bra menu_simulator1 ; Done. |
339 | 341 |
340 | 342 |
341 simulator_save_tissue_data: | 343 simulator_save_tissue_data: |
342 bsf restore_deco_data ; Set restore flag | 344 bsf restore_deco_data ; Set restore flag |