comparison code_part1/OSTC_code_asm_part1/simulator.asm @ 33:6e5db85382a2

Speedy simulator! New Deco code test 1
author heinrichsweikamp
date Tue, 25 May 2010 17:37:26 +0200
parents a776039bda63
children 5dbdc08e5460
comparison
equal deleted inserted replaced
32:a776039bda63 33:6e5db85382a2
108 movlw d'3' 108 movlw d'3'
109 movwf menupos 109 movwf menupos
110 bra menu_simulator2 110 bra menu_simulator2
111 111
112 simulator_startdive: 112 simulator_startdive:
113 ; Descent to -3m depth 113 ; Descent to -15m depth
114 ; Set standalone_simulator flag (Displays Simulator menu during simulation by pressing ENTER button) 114 ; Set standalone_simulator flag (Displays Simulator menu during simulation by pressing ENTER button)
115 ; Clear standalone_simulator after (any) dive 115 ; Clear standalone_simulator after (any) dive
116 bsf simulatormode_active ; normal simulator mode 116 bsf simulatormode_active ; normal simulator mode
117 bsf standalone_simulator ; Standalone Simulator active 117 bsf standalone_simulator ; Standalone Simulator active
118 118
235 call simulator_save_tissue_data ; Stores 32 floats "pre_tissue" into bank3 235 call simulator_save_tissue_data ; Stores 32 floats "pre_tissue" into bank3
236 236
237 WIN_INVERT .1 237 WIN_INVERT .1
238 DISPLAYTEXT .12 ;" Wait.." 238 DISPLAYTEXT .12 ;" Wait.."
239 WIN_INVERT .0 239 WIN_INVERT .0
240
241 movlw d'255'
242 movff WREG,char_O_deco_status ; Reset Deco module
243 240
244 simulator_calc_deco_loop1: 241 simulator_calc_deco_loop1:
245 242
246 ; movlw .011 243 ; movlw .011
247 ; call PLED_SetColumn 244 ; call PLED_SetColumn
254 ; bcf leftbind 251 ; bcf leftbind
255 ; movlw ' ' 252 ; movlw ' '
256 ; movwf POSTINC2 253 ; movwf POSTINC2
257 ;call word_processor 254 ;call word_processor
258 255
256
259 call divemode_check_decogases ; Checks for decogases and sets the gases 257 call divemode_check_decogases ; Checks for decogases and sets the gases
260 call divemode_prepare_flags_for_deco 258 call divemode_prepare_flags_for_deco
261 259
262 call deco_main_calc_hauptroutine ; calc_tissue 260 call deco_main_calc_hauptroutine ; calc_tissue
263 movlb b'00000001' ; rambank 1 selected 261 movlb b'00000001' ; rambank 1 selected
266 tstfsz deco_status ; deco_status=0 if decompression calculation done 264 tstfsz deco_status ; deco_status=0 if decompression calculation done
267 bra simulator_calc_deco_loop1 ; Not finished 265 bra simulator_calc_deco_loop1 ; Not finished
268 266
269 movlw d'1' 267 movlw d'1'
270 movff WREG,char_I_step_is_1min ; 1 minute mode 268 movff WREG,char_I_step_is_1min ; 1 minute mode
271 movff WREG,unused_x24B
272 269
273 movlw d'255' 270 movlw d'255'
274 movff WREG,char_O_deco_status ; Reset Deco module 271 movff WREG,char_O_deco_status ; Reset Deco module
275 272
276
277 simulator_calc_deco_loop2: 273 simulator_calc_deco_loop2:
278 call PLED_simulator_data 274 call PLED_simulator_data
279 275
280 btg LED_red 276 btg LED_red
281 277
289 decfsz logbook_temp1,F 285 decfsz logbook_temp1,F
290 bra simulator_calc_deco_loop2 286 bra simulator_calc_deco_loop2
291 287
292 movlw d'0' 288 movlw d'0'
293 movff WREG,char_I_step_is_1min ; 2 second deco mode 289 movff WREG,char_I_step_is_1min ; 2 second deco mode
294 movff WREG,unused_x24B 290 ; movff WREG,unused_x24B
295 291
296 movlw d'255' 292 movlw d'255'
297 movff WREG,char_O_deco_status ; Reset Deco module 293 movff WREG,char_O_deco_status ; Reset Deco module
298 294
299 movff char_O_deco_status,deco_status ; 295 ; movff char_O_deco_status,deco_status ;
300 tstfsz deco_status ; deco_status=0 if decompression calculation done 296 ; tstfsz deco_status ; deco_status=0 if decompression calculation done
301 bra simulator_calc_deco2 ; Not finished 297 bra simulator_calc_deco2 ; Not finished
302 298
303 simulator_calc_deco3: 299 simulator_calc_deco3:
304 bsf LED_red 300 bsf LED_red
305 301