comparison code_part1/OSTC_code_asm_part1/pled_outputs.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 2907b42c195b
comparison
equal deleted inserted replaced
123:6a94f96e9cea 124:4f9f477bb452
17 17
18 18
19 ; routines for display outputs 19 ; routines for display outputs
20 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com 20 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com
21 ; written: 15/01/05 21 ; written: 15/01/05
22 ; last updated: 06/06/08 22 ;
23 ; History:
24 ; 2008-06-06 [MH] last updated
25 ; 2010-12-31 [jDG] Multi-page display for GF decoplan
26 ;
23 ; known bugs: 27 ; known bugs:
24 ; ToDo: More comments 28 ; ToDo: More comments
25 29
26 PLED_divemask_color: 30 PLED_divemask_color:
27 GETCUSTOM8 d'36' ; Divemask output color 31 GETCUSTOM8 d'36' ; Divemask output color
429 433
430 WIN_FONT FT_SMALL 434 WIN_FONT FT_SMALL
431 return 435 return
432 436
433 PLED_display_deko_mask: 437 PLED_display_deko_mask:
434 rcall PLED_clear_decoarea 438 rcall PLED_clear_decoarea
435 ; total deco time word 439 ; total deco time word
436 call PLED_divemask_color ; Set Color for Divemode mask 440 call PLED_divemask_color ; Set Color for Divemode mask
437 DISPLAYTEXT d'85' ; TTS 441 DISPLAYTEXT d'85' ; TTS
438 call PLED_standard_color 442 call PLED_standard_color
439 return 443 return
440 444
441 PLED_display_deko: 445 PLED_display_deko:
442 btfsc menubit ; Divemode menu active? 446 btfsc menubit ; Divemode menu active?
443 bra PLED_display_deko1 ; Yes, do not display deco, only GF (if required) 447 bra PLED_display_deko1 ; Yes, do not display deco, only GF (if required)
444 448
1164 ; list three SP in Gaslist 1168 ; list three SP in Gaslist
1165 movlw d'35' ; 36 = current SP position in EEPROM 1169 movlw d'35' ; 36 = current SP position in EEPROM
1166 movwf wait_temp ; here: stores eeprom address for gas list 1170 movwf wait_temp ; here: stores eeprom address for gas list
1167 movlw d'0' 1171 movlw d'0'
1168 movwf waitms_temp ; here: stores row for gas list 1172 movwf waitms_temp ; here: stores row for gas list
1169 clrf temp6 ; here: SP counter 1173 clrf decoplan_index ; here: SP counter
1170 1174
1171 PLED_pre_dive_screen3_loop: 1175 PLED_pre_dive_screen3_loop:
1172 incf wait_temp,F ; EEPROM address 1176 incf wait_temp,F ; EEPROM address
1173 incf temp6,F ; Increase SP 1177 incf decoplan_index,F ; Increase SP
1174 1178
1175 movlw d'25' 1179 movlw d'25'
1176 addwf waitms_temp,F ; Increase row 1180 addwf waitms_temp,F ; Increase row
1177 WIN_LEFT .90 1181 WIN_LEFT .90
1178 movff waitms_temp,win_top ; Set Row 1182 movff waitms_temp,win_top ; Set Row
1179 1183
1180 STRCPY "SP" 1184 STRCPY "SP"
1181 movff temp6,lo ; copy gas number 1185 movff decoplan_index,lo ; copy gas number
1182 output_8 ; display gas number 1186 output_8 ; display gas number
1183 STRCAT ": " 1187 STRCAT ": "
1184 movff wait_temp, EEADR; SP #hi position 1188 movff wait_temp, EEADR; SP #hi position
1185 call read_eeprom ; get byte (stored in EEDATA) 1189 call read_eeprom ; get byte (stored in EEDATA)
1186 movff EEDATA,lo ; copy to lo 1190 movff EEDATA,lo ; copy to lo
1187 clrf hi 1191 clrf hi
1188 output_16dp d'3' ; outputs into Postinc2! 1192 output_16dp d'3' ; outputs into Postinc2!
1189 call word_processor 1193 call word_processor
1190 1194
1191 movlw d'3' ; list all three SP 1195 movlw d'3' ; list all three SP
1192 cpfseq temp6 ; All gases shown? 1196 cpfseq decoplan_index ; All gases shown?
1193 bra PLED_pre_dive_screen3_loop ;no 1197 bra PLED_pre_dive_screen3_loop ;no
1194 1198
1195 read_int_eeprom d'33' ; Read byte (stored in EEDATA) 1199 read_int_eeprom d'33' ; Read byte (stored in EEDATA)
1196 movff EEDATA,active_gas ; Read start gas (1-5) 1200 movff EEDATA,active_gas ; Read start gas (1-5)
1197 decf active_gas,W ; Gas 0-4 1201 decf active_gas,W ; Gas 0-4
2110 DISPLAYTEXT .125 ; He + 2114 DISPLAYTEXT .125 ; He +
2111 DISPLAYTEXT .126 ; He - 2115 DISPLAYTEXT .126 ; He -
2112 return 2116 return
2113 2117
2114 PLED_divemode_simulator_mask: 2118 PLED_divemode_simulator_mask:
2115 DISPLAYTEXT .254 ; Close 2119 call PLED_standard_color
2116 DISPLAYTEXT .250 ; + 1m 2120 DISPLAYTEXT .254 ; Close
2117 DISPLAYTEXT .251 ; - 1m 2121 DISPLAYTEXT .250 ; + 1m
2118 DISPLAYTEXT .252 ; +10m 2122 DISPLAYTEXT .251 ; - 1m
2119 DISPLAYTEXT .253 ; -10m 2123 DISPLAYTEXT .252 ; +10m
2120 return 2124 DISPLAYTEXT .253 ; -10m
2125 return
2121 2126
2122 ;----------------------------------------------------------------------------- 2127 ;-----------------------------------------------------------------------------
2123 ; Draw the bar graph used for deco stops (decoplan in simulator or dive). 2128 ; Draw a stop of the deco plan (simulator or dive).
2124 ; Inputs: lo = minutes. range 1..many. 2129 ; Inputs: lo = depth. Range 3m...93m
2125 PLED_decoplan_bargraph: 2130 ; hi = minutes. range 1'..240'.
2126 ; Common bargraph setup: 2131 ; win_top = line to draw on screen.
2127 movf hi,W ; hi+1 --> top (bank safe !) 2132 ; Trashed: hi, lo, win_height, win_leftx2, win_width, win_color*,
2128 incf WREG 2133 ; WREG, PROD, TBLPTR TABLAT.
2129 movff WREG,win_top 2134
2130 movlw d'18'+1 ; 19 --> height (bank safe !) 2135 PLED_decoplan_show_stop:
2131 movff WREG,win_height 2136 ;---- Print depth ----------------------------------------------------
2132 movlw .122 2137 WIN_LEFT .100
2133 movff WREG,win_leftx2 ; column left (0-159) 2138 call PLED_standard_color
2134 2139 lfsr FSR2,letter
2135 ; Draw used area (lo = minutes): 2140 bsf leftbind
2136 call PLED_standard_color 2141 output_8 ; outputs into Postinc2!
2137 movlw d'16' ; Limit length (16min) 2142 STRCAT_PRINT "m "
2138 cpfslt lo 2143
2139 movwf lo 2144 ;---- Print duration -------------------------------------------------
2140 movff lo,win_width ; Bar width 2145 WIN_LEFT .140
2141 tstfsz lo ; Skip 0-size bar... 2146 lfsr FSR2,letter
2142 call PLED_box 2147
2143 2148 movf lo,W ; Swap hi & lo
2144 ; Clear unused area: 2149 movff hi,lo
2145 movlw .0 2150 movwf hi
2146 movff WREG,win_color1 2151
2147 movff WREG,win_color2 2152 output_8 ; Allow up to 240'
2148 movlw .122 ; (width+left-1)+1 2153 STRCAT_PRINT "' " ; 1 to 3 chars for depth.
2149 addwf lo,W 2154
2150 movff WREG,win_leftx2 ; --> left 2155 movf lo,W ; Swap back hi & lo
2151 movf lo,W 2156 movff hi,lo
2152 sublw .16 ; 16-left --> width 2157 movwf hi
2153 movff WREG,win_width 2158
2154 tstfsz WREG ; Skip 0-size bar. 2159 ;---------------------------------------------------------------------
2155 goto PLED_box 2160 ; Draw the bar graph used for deco stops (decoplan in simulator or dive).
2161 movff win_top,WREG ; Increment win_top (BANK SAFE)
2162 incf WREG
2163 movff WREG,win_top
2164 movlw d'18'+1 ; 19 --> height (bank safe !)
2165 movff WREG,win_height
2166 movlw .122
2167 movff WREG,win_leftx2 ; column left (0-159)
2168
2169 ; Draw used area (lo = minutes):
2170 call PLED_standard_color
2171 movlw d'16' ; Limit length (16min)
2172 cpfslt hi
2173 movwf hi
2174 movff hi,win_width ; Bar width
2175 tstfsz hi ; Skip 0-size bar...
2176 call PLED_box
2177
2178 ; Clear unused area:
2179 movlw .0
2180 movff WREG,win_color1
2181 movff WREG,win_color2
2182 movlw .122 ; (width+left-1)+1
2183 addwf hi,W
2184 movff WREG,win_leftx2 ; --> left
2185 movf hi,W
2186 sublw .16 ; 16-left --> width
2187 movff WREG,win_width
2188 tstfsz WREG ; Skip 0-size bar.
2189 call PLED_box
2190
2191 ; Restore win_top
2192 movff win_top,WREG ; decf win_top (BANK SAFE)
2193 decf WREG
2194 movff WREG,win_top
2195 return
2156 2196
2157 ;----------------------------------------------------------------------------- 2197 ;-----------------------------------------------------------------------------
2158 PLED_decoplan_delete_gf: ; Delete unused rows (GF model) 2198 ; Clear unused area belw last stop
2159 PLED_decoplan_delete: ; Delete unused rows (OC model) 2199 ; Inputs: win_top : last used area...
2160 movlw .171 2200 PLED_decoplan_clear_bottom:
2161 PLED_decoplan_delete_common: 2201 movff win_top,WREG ; Get back from bank0
2162 movff hi,win_top ; row top (0-239) 2202 btfsc divemode ; In dive mode ?
2163 subwf hi,W 2203 sublw .170 ; Yes: bottom row in divemode
2164 negf WREG 2204 btfss divemode ; In dive mode ?
2165 movff WREG,win_height 2205 sublw .240 ; No: bottom row in planning
2166 movlw .100 2206 movff WREG,win_height
2167 movff WREG,win_leftx2 ; column left (0-159) 2207
2168 movlw .60 2208 WIN_LEFT .82 ; Full divemenu width
2169 movff WREG,win_width ; area width (right-left+1, 0-159) 2209 movlw .160-.82+1
2170 2210 movff WREG,win_width
2171 clrf WREG ; BG color is black. 2211
2172 movff WREG,win_color1 2212 clrf WREG ; Fill with black
2173 movff WREG,win_color2 2213 movff WREG,win_color1
2174 2214 movff WREG,win_color2
2175 bsf last_ceiling_gf_shown ; Set flag 2215
2176 goto PLED_box 2216 goto PLED_box
2177 2217
2178 ;----------------------------------------------------------------------------- 2218 ;-----------------------------------------------------------------------------
2179 PLED_decoplan_gf_page_current: 2219 ; Display the decoplan (simulator or divemode) for GF model
2180 movlw d'0' 2220 ; Inputs: char_O_deco_table (array of stop times, in minutes)
2181 cpfseq temp8 2221 ; decoplan_page = page number. Displays 5 stop by page.
2182 bra PLED_decoplan_gf_page2 ; =1: Dispplay Page 2 2222 ;
2183 bra PLED_decoplan_gf_page1 ; =0, Display Page 1 2223 decoplan_index equ apnoe_mins ; within each page
2184 2224 decoplan_gindex equ apnoe_secs ; global index
2185 PLED_decoplan_gf_page1: 2225 decoplan_last equ apnoe_max_pressure ; Depth of last stop (CF#29)
2186 ostc_debug 'n' ; Sends debug-information to screen if debugmode active 2226 decoplan_max equ apnoe_max_pressure+1; Number of lines per page. 7 in planning, 5 in diving.
2187 2227
2188 movff char_O_array_decodepth+0,lo ; Get Depth 2228 PLED_decoplan_gf:
2189 tstfsz lo 2229 ostc_debug 'n' ; Sends debug-information to screen if debugmode active
2190 bra PLED_decoplan_gf_page1x 2230
2191 ; No Deco, show "no Deco" 2231 WIN_INVERT 0
2192 DISPLAYTEXT d'239' ;"No Deco" 2232
2193 return 2233 ;---- Is there deco stops ? ------------------------------------------
2194 2234 lfsr FSR1,char_O_deco_table
2195 PLED_decoplan_gf_page2: 2235 movlw .1
2196 ; temp7 holds last displayed depth 2236 movf PLUSW1,W ; char_O_deco_table[1] --> WREG
2197 ; temp5 list entry 2237 bnz PLED_decoplan_gf_1
2198 movff temp5,temp9 ; save 2238
2199 movff temp7,temp10 ; save 2239 ;---- No Deco --------------------------------------------------------
2200 movlw .231 2240 call PLED_standard_color
2201 movwf temp6 ; row 2241 DISPLAYTEXT d'239' ;"No Deco"
2202 PLED_decoplan_gf_page2y: 2242 bsf last_ceiling_gf_shown
2203 movlw d'3' 2243 return
2204 addwf temp7,F ; Add 3m for next stop 2244
2205 movlw d'25' 2245 PLED_decoplan_gf_1:
2206 addwf temp6,F 2246 GETCUSTOM8 d'29' ; Last decostop depth, in m
2207 incf temp5,F 2247 movwf decoplan_last ; --> decoplan_last
2208 call PLED_decoplan_show_stop_gf 2248
2209 movlw d'15' ; the next 8 Stops... 2249 movlw .8 ; 8 lines/page in decoplan
2210 cpfseq temp5 2250 btfsc divemode
2211 bra PLED_decoplan_gf_page2y 2251 movlw .6 ; 6 lines/page in divemode.
2212 movff temp9,temp5 ; restore 2252 movwf decoplan_max
2213 movff temp10,temp7 ; restore 2253
2214 bsf last_ceiling_gf_shown ; Set flag 2254 movlw .1
2215 return 2255 movwf decoplan_index ; Start with index = 1
2216 2256 clrf WREG
2217 PLED_decoplan_gf_page1x: 2257 movff WREG,win_top ; and row = 0
2218 clrf temp8 ; Page 0-3 of deco list 2258
2219 GETCUSTOM8 d'29' ; Last Deco in m 2259 ; Read stop parameters, indexed by decoplan_index and decoplan_page
2220 movwf temp7 ; Start with last stop 2260 movf decoplan_page,W ; decoplan_gindex = 6*decoplan_page + decoplan_index
2221 clrf temp5 2261 mulwf decoplan_max
2222 movlw .231 2262 movf decoplan_index,W
2223 movwf temp6 ; row 2263 addwf PRODL,W
2224 2264 movwf decoplan_gindex ; --> decoplan_gindex
2225 ; Show last stop manually 2265
2226 movlw d'25' 2266 bcf last_ceiling_gf_shown ; Not finished yet...
2227 addwf temp6,F 2267
2228 incf temp5,F 2268 PLED_decoplan_gf_2:
2229 call PLED_decoplan_show_stop_gf 2269 btfsc decoplan_gindex,5 ; Reached table length (32) ?
2230 GETCUSTOM8 d'29' ; Last Deco in m 2270 bra PLED_decoplan_gf_99 ; YES: finished...
2231 movwf temp7 ; Last deco 2271
2232 movlw d'4' 2272 ; Compute new depth
2233 cpfslt temp7 ; >=3m? 2273 movf decoplan_gindex,W ; depth = 3 * (global index)
2234 bra PLED_decoplan_gf_page1x_next_6m 2274 mullw .3 ; --> PROD
2235 2275 movf decoplan_last,W ; depth < decoplan_last (CF#29) ?
2236 movlw d'3' 2276 cpfslt PRODL
2237 movwf temp7 2277 movf PRODL,W ; NO: take depth, else keep decoplan_last.
2238 bra PLED_decoplan_gf_page1y 2278 movwf lo ; --> lo
2239 2279
2240 PLED_decoplan_gf_page1x_next_6m: 2280 ; Read deepest depth from other bank.
2241 movlw d'6' 2281 movff char_O_array_decodepth,WREG
2242 movwf temp7 2282 xorwf lo,W ; This is last stop ?
2243 incf temp5,F 2283 btfsc STATUS,Z
2244 PLED_decoplan_gf_page1y: 2284 bsf last_ceiling_gf_shown ; YES: mark for latter...
2245 movlw d'3' 2285
2246 addwf temp7,F ; Add 3m for next stop 2286 ; Read stop duration
2247 movlw d'25' 2287 movf decoplan_gindex,W ; index
2248 addwf temp6,F 2288 movff PLUSW1,hi ; char_O_deco_table[index] --> hi
2249 incf temp5,F 2289 movf hi,W ; time = zero ?
2250 call PLED_decoplan_show_stop_gf 2290 bz PLED_decoplan_gf_4 ; Do not display it: continue.
2251 movlw d'7' ; the next 7 Stops... 2291
2252 cpfseq temp5 2292 ; Display the stop line
2253 bra PLED_decoplan_gf_page1y 2293 call PLED_decoplan_show_stop
2254 return 2294
2255 2295 ; Next
2256 2296 movff win_top,WREG ; row: += 24
2257 PLED_decoplan_show_stop_gf: 2297 addlw .24
2258 bsf leftbind 2298 movff WREG,win_top
2259 WIN_LEFT .100 2299 incf decoplan_index,F ; local index += 1
2260 call PLED_standard_color 2300 PLED_decoplan_gf_4:
2261 movff temp6,win_top 2301 incf decoplan_gindex,F ; global index += 1
2262 movff temp6,hi ; copy for PLED_decoplan_bargraph 2302
2263 2303 btfsc last_ceiling_gf_shown ; Last one done ?
2264 movff char_O_array_decodepth+0,WREG ; Ceiling 2304 bra PLED_decoplan_gf_99 ; YES: finished...
2265 cpfslt temp7 ; Ceiling already displayed? 2305
2266 goto PLED_decoplan_delete_gf ; Yes, quit display and RETURN 2306 ; Max number of lines/page reached ?
2267 movff temp7,lo ; Decodepth 2307 incf decoplan_max,W ; index+1 == max+1 ?
2268 2308 cpfseq decoplan_index
2269 lfsr FSR2,letter 2309 bra PLED_decoplan_gf_2 ; NO: loop
2270 output_99x ; outputs into Postinc2! 2310
2271 STRCAT_PRINT "m" 2311 ; Check if next stop if end-of-list ?
2272 2312 movlw .3 ; Next stop is lo + 3m
2273 PUTC ' ' 2313 addwf lo,W
2274 WIN_LEFT .140 2314 xorwf decoplan_last,W ; == last stop ?
2275 movff temp6,win_top 2315 bz PLED_decoplan_gf_99 ; End of list...
2276 lfsr FSR1,0x0E0+1 ; Gf_decolist_copy 2316
2277 movf temp5,W ; number of entry 2317 ; Display the message "more..."
2278 movff PLUSW1,lo ; Stop length 2318 rcall PLED_decoplan_clear_bottom ; Clear from next line
2279 incf lo,F ; add one dummy minute 2319
2280 lfsr FSR2,letter 2320 WIN_LEFT .130 - 7*3
2281 output_99x ; outputs into Postinc2! 2321 call PLED_standard_color
2282 STRCAT_PRINT "'" 2322 STRCPY_PRINT "more..."
2283 2323 bcf last_ceiling_gf_shown ; More page to display...
2284 rcall PLED_decoplan_bargraph ; draws a box representing the decotime (stored in lo...) for this depth 2324 return
2285 return 2325
2286 2326 PLED_decoplan_gf_99:
2287 2327 bsf last_ceiling_gf_shown ; Nothing more in table to display.
2288 PLED_decoplan: ; display the Decoplan 2328 rcall PLED_decoplan_clear_bottom ; Clear from next line
2289 ostc_debug 'n' ; Sends debug-information to screen if debugmode active 2329 return
2290 2330
2291 movff char_O_array_decodepth+0,lo ; Get Depth 2331 ;-----------------------------------------------------------------------------
2292 tstfsz lo 2332 ; Display the decoplan (simulator or divemode) for ZHL-16c model
2293 bra PLED_decoplan1 2333 PLED_decoplan:
2294 ; No Deco, show "no Deco" 2334 ostc_debug 'n' ; Sends debug-information to screen if debugmode active
2295 DISPLAYTEXT d'239' ;"No Deco" 2335
2296 return 2336 WIN_INVERT 0
2337
2338 ;---- Is there deco information --------------------------------------
2339 lfsr FSR0,char_O_array_decodepth
2340 lfsr FSR1,char_O_array_decotime
2341
2342 movf INDF0,W
2343 bnz PLED_decoplan1
2344
2345 ;---- No Deco --------------------------------------------------------
2346 call PLED_standard_color
2347 DISPLAYTEXT d'239' ;"No Deco"
2348 bsf last_ceiling_gf_shown
2349 return
2297 2350
2298 PLED_decoplan1: 2351 PLED_decoplan1:
2299 setf temp5 2352 GETCUSTOM8 d'29' ; Last decostop depth, in m
2300 movlw .231 2353 movwf decoplan_last ; --> decoplan_last
2301 movwf temp6 ; row 2354
2355 movlw .6 ; Max 6 lines in all modes.
2356 movwf decoplan_max
2357
2358 clrf decoplan_index ; Starts with index = 0
2359 clrf WREG
2360 movff WREG,win_top ; and row = 0
2361
2302 PLED_decoplan2: 2362 PLED_decoplan2:
2303 movlw d'25' 2363 ; Read stop parameters, indexed by decoplan_index
2304 addwf temp6,F 2364 movf decoplan_index,W
2305 incf temp5,F 2365 movff PLUSW0,lo ; array_decodepth[index]
2306 call PLED_decoplan_show_stop 2366 movff PLUSW1,hi ; array_decotime[index]
2307 movlw d'5' ; 6 Stops... 2367
2308 cpfseq temp5 2368 ; 0 time == end-of-table.
2309 bra PLED_decoplan2 2369 movf hi,w
2310 return 2370 bz PLED_decoplan_0
2311 2371
2312 PLED_decoplan_show_stop: 2372 call PLED_decoplan_show_stop
2313 bsf leftbind 2373
2314 WIN_LEFT .100 2374 movff win_top,WREG ; row += 24
2315 call PLED_standard_color 2375 addlw .24
2316 movff temp6,win_top 2376 movff WREG,win_top
2317 movff temp6,hi ; copy for PLED_decoplan_bargraph 2377 incf decoplan_index,F ; index += 1
2318 2378
2319 lfsr FSR1,char_O_array_decodepth 2379 ; 6 Stops max...
2320 movf temp5,W ; number of entry 2380 movf decoplan_max,W
2321 movff PLUSW1,lo 2381 cpfseq decoplan_index
2322 movf lo,w 2382 bra PLED_decoplan2
2323 btfsc STATUS,Z ; =0 2383
2324 goto PLED_decoplan_delete ; Yes, quit display 2384 ;---- Additional time in the decoplan ? ------------------------------
2325 2385 movf decoplan_max,W ; Read array_decotime[6]
2326 lfsr FSR2,letter 2386 movf PLUSW1,W ; set Z flag
2327 output_8 ; outputs into Postinc2! 2387 movwf lo ; and copy to lo
2328 STRCAT_PRINT "m " 2388 btfsc STATUS,Z ; Zero: nothing to add.
2329 2389 return
2330 WIN_LEFT .140 2390
2331 movff temp6,win_top 2391 WIN_LEFT .100
2332 2392 call PLED_standard_color
2333 lfsr FSR1,char_O_array_decotime;+0 2393
2334 movf temp5,W ; number of entry 2394 STRCPY "add:"
2335 movff PLUSW1,lo 2395 output_8
2336 2396 STRCAT_PRINT "'"
2337 lfsr FSR2,letter 2397 return
2338 output_99x ; outputs into Postinc2! 2398
2339 STRCAT_PRINT "'" 2399 PLED_decoplan_0:
2340 2400 ;---- Plan not finished to compute ? ---------------------------------
2341 rcall PLED_decoplan_bargraph ; draws a box representing the decotime (stored in lo...) for this depth 2401 decf decoplan_index,W
2342 return 2402 movf PLUSW0,W ; array_decodepth[index-1]
2343 2403 subwf decoplan_last,W ; == last stop depth ?
2344 2404 bz PLED_decoplan_99
2405
2406 WIN_LEFT .100
2407 call PLED_standard_color
2408 STRCPY_PRINT "..."
2409
2410 PLED_decoplan_99:
2411 return
2412
2413 ;-----------------------------------------------------------------------------
2345 PLED_gas_list: 2414 PLED_gas_list:
2346 ostc_debug 'm' ; Sends debug-information to screen if debugmode active 2415 ostc_debug 'm' ; Sends debug-information to screen if debugmode active
2347 2416
2348 WIN_LEFT .100 2417 WIN_LEFT .100
2349 WIN_FONT FT_SMALL 2418 WIN_FONT FT_SMALL
2412 ; list three SP in Gaslist 2481 ; list three SP in Gaslist
2413 movlw d'35' ; 36 = current SP position in EEPROM 2482 movlw d'35' ; 36 = current SP position in EEPROM
2414 movwf wait_temp ; here: stores eeprom address for gas list 2483 movwf wait_temp ; here: stores eeprom address for gas list
2415 movlw d'231' 2484 movlw d'231'
2416 movwf waitms_temp ; here: stores row for gas list 2485 movwf waitms_temp ; here: stores row for gas list
2417 clrf temp5 ; here: SP counter 2486 clrf decoplan_index ; here: SP counter
2418 2487
2419 PLED_splist_loop: 2488 PLED_splist_loop:
2420 incf wait_temp,F ; EEPROM address 2489 incf wait_temp,F ; EEPROM address
2421 incf temp5,F ; Increase SP 2490 incf decoplan_index,F ; Increase SP
2422 2491
2423 movlw d'25' 2492 movlw d'25'
2424 addwf waitms_temp,F ; Increase row 2493 addwf waitms_temp,F ; Increase row
2425 movff waitms_temp,win_top ; Set Row 2494 movff waitms_temp,win_top ; Set Row
2426 WIN_LEFT .100 2495 WIN_LEFT .100
2427 2496
2428 STRCPY "SP" 2497 STRCPY "SP"
2429 movff temp5,lo ; copy gas number 2498 movff decoplan_index,lo ; copy gas number
2430 output_8 ; display gas number 2499 output_8 ; display gas number
2431 PUTC ':' 2500 PUTC ':'
2432 movff wait_temp, EEADR; SP #hi position 2501 movff wait_temp, EEADR; SP #hi position
2433 call read_eeprom ; get byte (stored in EEDATA) 2502 call read_eeprom ; get byte (stored in EEDATA)
2434 movff EEDATA,lo ; copy to lo 2503 movff EEDATA,lo ; copy to lo
2435 clrf hi 2504 clrf hi
2436 output_16dp d'3' ; outputs into Postinc2! 2505 output_16dp d'3' ; outputs into Postinc2!
2437 call word_processor 2506 call word_processor
2438 2507
2439 movlw d'3' ; list all three SP 2508 movlw d'3' ; list all three SP
2440 cpfseq temp5 ; All gases shown? 2509 cpfseq decoplan_index ; All gases shown?
2441 bra PLED_splist_loop ; No 2510 bra PLED_splist_loop ; No
2442 2511
2443 bcf leftbind 2512 bcf leftbind
2444 return ; no, return 2513 return ; no, return
2445 2514
2980 ; list three SP in Gaslist 3049 ; list three SP in Gaslist
2981 movlw d'35' ; 36 = current SP position in EEPROM 3050 movlw d'35' ; 36 = current SP position in EEPROM
2982 movwf wait_temp ; here: stores eeprom address for gas list 3051 movwf wait_temp ; here: stores eeprom address for gas list
2983 movlw d'10' 3052 movlw d'10'
2984 movwf waitms_temp ; here: stores row for gas list 3053 movwf waitms_temp ; here: stores row for gas list
2985 clrf temp6 ; here: SP counter 3054 clrf decoplan_index ; here: SP counter
2986 3055
2987 PLED_simdata_screen3_loop: 3056 PLED_simdata_screen3_loop:
2988 incf wait_temp,F ; EEPROM address 3057 incf wait_temp,F ; EEPROM address
2989 incf temp6,F ; Increase SP 3058 incf decoplan_index,F ; Increase SP
2990 3059
2991 movlw d'25' 3060 movlw d'25'
2992 addwf waitms_temp,F ; Increase row 3061 addwf waitms_temp,F ; Increase row
2993 WIN_LEFT .0 3062 WIN_LEFT .0
2994 movff waitms_temp,win_top ; Set Row 3063 movff waitms_temp,win_top ; Set Row
2995 3064
2996 STRCPY "SP" 3065 STRCPY "SP"
2997 movff temp6,lo ; copy gas number 3066 movff decoplan_index,lo ; copy gas number
2998 output_8 ; display gas number 3067 output_8 ; display gas number
2999 STRCAT ": " 3068 STRCAT ": "
3000 movff wait_temp, EEADR; SP #hi position 3069 movff wait_temp, EEADR; SP #hi position
3001 call read_eeprom ; get byte (stored in EEDATA) 3070 call read_eeprom ; get byte (stored in EEDATA)
3002 movff EEDATA,lo ; copy to lo 3071 movff EEDATA,lo ; copy to lo
3003 clrf hi 3072 clrf hi
3004 output_16dp d'3' ; outputs into Postinc2! 3073 output_16dp d'3' ; outputs into Postinc2!
3005 call word_processor 3074 call word_processor
3006 3075
3007 movlw d'3' ; list all three SP 3076 movlw d'3' ; list all three SP
3008 cpfseq temp6 ; All gases shown? 3077 cpfseq decoplan_index ; All gases shown?
3009 bra PLED_simdata_screen3_loop ;no 3078 bra PLED_simdata_screen3_loop ;no
3010 3079
3011 read_int_eeprom d'33' ; Read byte (stored in EEDATA) 3080 read_int_eeprom d'33' ; Read byte (stored in EEDATA)
3012 movff EEDATA,active_gas ; Read start gas (1-5) 3081 movff EEDATA,active_gas ; Read start gas (1-5)
3013 decf active_gas,W ; Gas 0-4 3082 decf active_gas,W ; Gas 0-4