Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/simulator.asm @ 124:4f9f477bb452
Rewrite display of decoplan:
* Common stuff
- fix clearing bottom of list, for fleecker-free updates.
- fix "Wait..." topline_box while computing deco in planning
- fix 'No Deco" std color and mark last page.
- Allow stops up to 240'
* ZHL-16c model:
- 6 lines max (sim or dive)
- Print exceed stops as "add: ddd'"
* GF model
- 6 lines in divemode, 8 in planning.
- any suitable number of pages.
- "more..." when not the last page displayed.
- fix displaying special depth for last stop (CF#29).
- fix 0-time stops: just skip display.
- fix end of list when reached the deepest stop.
- fix no need to buffer decoplan twice.
author | JeanDo |
---|---|
date | Sat, 01 Jan 2011 01:57:50 +0100 |
parents | 6a94f96e9cea |
children | 3fd7d304a0fe |
comparison
equal
deleted
inserted
replaced
123:6a94f96e9cea | 124:4f9f477bb452 |
---|---|
152 bsf divemode ; Set divemode flag | 152 bsf divemode ; Set divemode flag |
153 ostc_debug 'P' ; Sends debug-information to screen if debugmode active | 153 ostc_debug 'P' ; Sends debug-information to screen if debugmode active |
154 goto diveloop ; Start Divemode | 154 goto diveloop ; Start Divemode |
155 | 155 |
156 simulator_show_decoplan: | 156 simulator_show_decoplan: |
157 call PLED_ClearScreen | 157 call PLED_ClearScreen |
158 call PLED_simdata_screen | 158 call PLED_simdata_screen |
159 call divemode_copy_decolist ;copy gf_decolist (0x250:.32) to gf_decolist_copy (0x0E0:.32) | 159 call divemenu_see_decoplan |
160 call divemenu_see_decoplan | 160 |
161 | 161 ; Display TTS, if any... |
162 WIN_LEFT .0 | 162 movff char_O_ascenttime,WREG |
163 WIN_TOP .160 | 163 iorwf WREG |
164 call PLED_standard_color | 164 bz simulator_decoplan_notts |
165 | 165 |
166 STRCPY "TTS: " | 166 WIN_LEFT .0 |
167 movff char_O_ascenttime,lo | 167 WIN_TOP .160 |
168 bcf leftbind | 168 call PLED_standard_color |
169 output_8 | 169 |
170 STRCAT_PRINT "' " | 170 STRCPY "TTS: " |
171 | 171 movff char_O_ascenttime,lo |
172 ;call enable_rs232 | 172 bcf leftbind |
173 ; lfsr FSR0,0x250 | 173 output_8 |
174 ; movlw 0x20 | 174 STRCAT_PRINT "'" |
175 ; movwf wait_temp | 175 simulator_decoplan_notts: |
176 ;xy: ; Clear Deco list | 176 |
177 ; movff POSTINC0,TXREG | 177 WIN_INVERT .1 ; Init new Wordprocessor |
178 ; call rs232_wait_tx | 178 DISPLAYTEXT .188 ; Sim. Results: |
179 ; decfsz wait_temp,F | 179 WIN_INVERT .0 ; Init new Wordprocessor |
180 ; bra xy | |
181 ; movff char_O_array_decodepth+0,TXREG | |
182 ; | |
183 | |
184 | |
185 WIN_INVERT .1 ; Init new Wordprocessor | |
186 DISPLAYTEXT .188 ; Sim. Results: | |
187 WIN_INVERT .0 ; Init new Wordprocessor | |
188 | 180 |
189 simulator_show_decoplan1: | 181 simulator_show_decoplan1: |
190 bcf switch_left | 182 bcf switch_left |
191 bcf switch_right | 183 bcf switch_right |
192 simulator_show_decoplan2: | 184 simulator_show_decoplan2: |
222 | 214 |
223 bcf display_see_deco ; clear flag | 215 bcf display_see_deco ; clear flag |
224 bra simulator_show_decoplan4 ; Quit | 216 bra simulator_show_decoplan4 ; Quit |
225 | 217 |
226 simulator_show_decoplan5_1: | 218 simulator_show_decoplan5_1: |
227 incf temp8,F | 219 incf decoplan_page,F |
228 btfsc last_ceiling_gf_shown ; last ceiling shown? | 220 btfsc last_ceiling_gf_shown ; last ceiling shown? |
229 bra simulator_show_decoplan5_0 ; All done, clear and return | 221 bra simulator_show_decoplan5_0 ; All done, clear and return |
230 | 222 |
231 call PLED_decoplan_gf_page_current ; Re-Draw Current page of GF Decoplan | 223 call PLED_decoplan_gf ; Re-Draw Current page of GF Decoplan |
232 bra simulator_show_decoplan1 | 224 bra simulator_show_decoplan1 |
233 | 225 |
234 simulator_show_decoplan4: | 226 simulator_show_decoplan4: |
235 movlw d'5' | 227 movlw d'5' |
236 movwf menupos | 228 movwf menupos |
267 movff sim_pressure+0,amb_pressure+0 ; override readings with simulator values | 259 movff sim_pressure+0,amb_pressure+0 ; override readings with simulator values |
268 movff sim_pressure+1,amb_pressure+1 | 260 movff sim_pressure+1,amb_pressure+1 |
269 | 261 |
270 call simulator_save_tissue_data ; Stores 32 floats "pre_tissue" into bank3 | 262 call simulator_save_tissue_data ; Stores 32 floats "pre_tissue" into bank3 |
271 | 263 |
264 call PLED_topline_box | |
272 WIN_INVERT .1 | 265 WIN_INVERT .1 |
273 DISPLAYTEXT .12 ;" Wait.." | 266 DISPLAYTEXT .12 ;" Wait.." |
274 WIN_INVERT .0 | 267 WIN_INVERT .0 |
275 | 268 |
276 simulator_calc_deco_loop1: | 269 simulator_calc_deco_loop1: |
278 call divemode_prepare_flags_for_deco | 271 call divemode_prepare_flags_for_deco |
279 | 272 |
280 call deco_calc_hauptroutine ; calc_tissue | 273 call deco_calc_hauptroutine ; calc_tissue |
281 movlb b'00000001' ; rambank 1 selected | 274 movlb b'00000001' ; rambank 1 selected |
282 | 275 |
283 movff char_O_deco_status,deco_status ; | 276 movff char_O_deco_status,WREG |
284 tstfsz deco_status ; deco_status=0 if decompression calculation done | 277 tstfsz WREG ; deco_status=0 if decompression calculation done |
285 bra simulator_calc_deco_loop1 ; Not finished | 278 bra simulator_calc_deco_loop1 ; Not finished |
286 | 279 |
287 movlw d'1' | 280 movlw d'1' |
288 movff WREG,char_I_step_is_1min ; 1 minute mode | 281 movff WREG,char_I_step_is_1min ; 1 minute mode |
289 | 282 |
340 call divemode_prepare_flags_for_deco | 333 call divemode_prepare_flags_for_deco |
341 | 334 |
342 call deco_calc_hauptroutine ; calc_tissue | 335 call deco_calc_hauptroutine ; calc_tissue |
343 movlb b'00000001' ; rambank 1 selected | 336 movlb b'00000001' ; rambank 1 selected |
344 | 337 |
345 movff char_O_deco_status,deco_status ; | 338 movff char_O_deco_status,WREG |
346 tstfsz deco_status ; deco_status=0 if decompression calculation done | 339 tstfsz WREG ; deco_status=0 if decompression calculation done |
347 bra simulator_calc_deco2 ; Not finished | 340 bra simulator_calc_deco2 ; Not finished |
348 bra simulator_calc_deco3 ; finished! | 341 bra simulator_calc_deco3 ; finished! |
349 | 342 |
350 | 343 |
351 simulator_save_tissue_data: | 344 simulator_save_tissue_data: |