Mercurial > public > hwos_code
annotate src/menu_processor.asm @ 173:3de05d9b7716
minor
author | heinrichsweikamp |
---|---|
date | Wed, 01 Oct 2014 10:31:53 +0200 |
parents | dcf3e08f31ac |
children | d097e10b383b |
rev | line source |
---|---|
0 | 1 ;============================================================================= |
2 ; | |
3 ; File menu_processor.asm | |
4 ; | |
5 ; Routines to handle all OSTC3 graphic/text menus. | |
6 ; | |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | |
8 ;============================================================================= | |
9 ; HISTORY | |
10 ; 2012-11-02 : [jDG] Cleanup for OSTC3: removed icons. Added scrolling. | |
11 ; But need a font with lower/upper alpha chars... | |
12 | |
13 #include "convert.inc" | |
14 #include "ostc3.inc" | |
15 #include "strings.inc" | |
16 #include "tft.inc" | |
17 #include "varargs.inc" | |
18 #include "wait.inc" | |
19 #include "start.inc" | |
20 #include "surfmode.inc" | |
21 #include "divemode.inc" | |
22 #include "tft_outputs.inc" | |
23 #include "eeprom_rs232.inc" | |
62 | 24 #include "adc_lightsensor.inc" |
113 | 25 #include "calibrate.inc" |
0 | 26 |
27 ;NOTE: should be idenric in .inc and .asm ! | |
28 #define MENU_LINES_MAX .7 ; Number of lines per screen? | |
29 #define MENU_TITLE_FONT WIN_STD ; Font should contains lower/UPPER alpha | |
30 #define MENU_LINE_FONT WIN_SMALL ; Font should contains lower/UPPER alpha | |
31 #define MENU_LEFT .20 ; Position of first menu item | |
32 #define MENU_HEIGHT .27 ; Spacing between menu lines. | |
33 #define MENU_VCENTER .125 ; Position on screen. | |
34 #define MENU_LINE_MAX_LENGTH .20 ; Length in characters | |
35 | |
36 ; Other needed references | |
37 extern aa_wordprocessor,option_inc,option_draw,comm_mode | |
38 | |
39 | |
40 ;============================================================================= | |
41 ; Temporary data. | |
42 | |
43 CBLOCK tmp+0x20 ; Reserved space for options.asm | |
44 menu_flags ; Various flags for menu: | |
45 ; bit 0 :dynamic menu | |
46 menu_item ; Index of the current item. | |
47 start_item ; Index of the first item (scrolling) | |
48 item_max ; Number of items in menu. | |
49 selected_item ; Index of the current item. | |
50 value_type ; Type for vertical menu. | |
51 dynamic_item:3 ; Callback addr | |
52 menu_block:3 ; Address of the menu block (ie. item 0) | |
53 menu_title:3 ; text or proc for dynamic menu. | |
54 menu_center ; centering for line menu. | |
55 proc_item:3 ; Address of the current proc. | |
56 text_item:2 ; Address of the current text. | |
57 ; Reserved to tmp+0x35 | |
58 ENDC | |
59 | |
60 #define option_item proc_item | |
61 | |
62 basic CODE | |
63 ;============================================================================= | |
64 ; menu handler. | |
65 ; | |
66 ; Input: TBLPTR = addr of menu block. | |
67 global menu_processor | |
68 menu_processor: | |
69 banksel common ; Bank1 | |
70 btfss divemode ; Not in divemode | |
71 call speed_fastest ; Make it quick ! | |
72 | |
73 ;---- Read menu block ------------------------------------------------ | |
74 VARARGS_BEGIN ; Read inline PROM data | |
75 clrf STKPTR ; Never return, anyway... | |
76 VARARGS_GET8 item_max ; Get number of items | |
77 VARARGS_GET8 menu_flags ; Get flags | |
78 VARARGS_GET24 menu_title ; Get pointer to menu title | |
79 VARARGS_GET8 menu_center ; Vertical position | |
80 movff TBLPTRL, menu_block+0 ; Save base address for menu_read_item | |
81 movff TBLPTRH, menu_block+1 | |
82 movff TBLPTRU, menu_block+2 | |
83 | |
84 extern TFT_clear_divemode_menu | |
85 btfss divemode ; In divemode? | |
86 bra menu_processor0 ; No | |
87 | |
88 movlw .1 | |
89 cpfsgt menupos ; only if menupos=1... | |
90 call TFT_clear_divemode_menu ; ... Clear the menu! | |
91 bra menu_processor1 ; Yes, skip some lines here | |
92 | |
93 menu_processor0: | |
94 ;---- draw menu title ------------------------------------------------ | |
95 clrf CCP1CON ; stop PWM | |
96 bcf PORTC,2 ; Pull PWM out to GND | |
97 call TFT_ClearScreen | |
98 rcall menu_processor_title | |
169
dcf3e08f31ac
CHANGE: Improve internal logbook usability
heinrichsweikamp
parents:
125
diff
changeset
|
99 rcall menu_processor_bottom_line |
0 | 100 |
169
dcf3e08f31ac
CHANGE: Improve internal logbook usability
heinrichsweikamp
parents:
125
diff
changeset
|
101 menu_processor1: |
dcf3e08f31ac
CHANGE: Improve internal logbook usability
heinrichsweikamp
parents:
125
diff
changeset
|
102 movlw FT_SMALL |
dcf3e08f31ac
CHANGE: Improve internal logbook usability
heinrichsweikamp
parents:
125
diff
changeset
|
103 movff WREG, win_font |
dcf3e08f31ac
CHANGE: Improve internal logbook usability
heinrichsweikamp
parents:
125
diff
changeset
|
104 |
dcf3e08f31ac
CHANGE: Improve internal logbook usability
heinrichsweikamp
parents:
125
diff
changeset
|
105 ;---- Select menu type ----------------------------------------------- |
dcf3e08f31ac
CHANGE: Improve internal logbook usability
heinrichsweikamp
parents:
125
diff
changeset
|
106 bra menu_vertical |
dcf3e08f31ac
CHANGE: Improve internal logbook usability
heinrichsweikamp
parents:
125
diff
changeset
|
107 |
dcf3e08f31ac
CHANGE: Improve internal logbook usability
heinrichsweikamp
parents:
125
diff
changeset
|
108 global menu_processor_bottom_line |
dcf3e08f31ac
CHANGE: Improve internal logbook usability
heinrichsweikamp
parents:
125
diff
changeset
|
109 menu_processor_bottom_line: |
0 | 110 ;---- Draw bottomline ------------------------------------------------ |
111 TEXT_TINY .5, .240-.16, tNext | |
112 TEXT_TINY .160-6*5, .240-.16, tEnter | |
113 | |
76 | 114 WIN_COLOR color_greenish |
115 ; Serial and Firmware Version | |
116 WIN_TINY .57,.240-.16 | |
117 STRCPY "#" | |
118 call TFT_cat_serial | |
119 STRCAT " v" | |
120 call TFT_cat_firmware | |
121 STRCAT_PRINT "" | |
122 call TFT_standard_color | |
169
dcf3e08f31ac
CHANGE: Improve internal logbook usability
heinrichsweikamp
parents:
125
diff
changeset
|
123 return |
0 | 124 |
125 ;============================================================================= | |
126 ; (re-)draw menu title. | |
127 ; | |
128 menu_processor_title: | |
125 | 129 WIN_BOX_BLACK .2,.23,.0,.160 ; Clear Menu title |
130 MENU_TITLE_FONT .0, .2 ; Menu title positionning | |
131 | |
0 | 132 btfss menu_flags,0 ; Static or dynmic title ? |
133 bra menu_processor_static_title | |
134 | |
135 rcall menu_processor_call_title ; add gas, detail and color. | |
136 bra menu_processor_title_1 | |
137 | |
138 menu_processor_static_title: | |
139 movff menu_title+0,FSR1L ; Just copy string. | |
140 movff menu_title+1,FSR1H | |
141 call strcpy_text | |
142 | |
143 menu_processor_title_1: | |
144 WIN_COLOR color_greenish | |
145 movf FSR2L,W ; Get title length | |
146 mullw .9 ; Convert to half pixels | |
147 bcf STATUS,C ; Clear carry | |
148 rrcf PRODL ; /2 | |
149 movf PRODL,W ; Back to WREG | |
150 sublw .80 ; 80 - width | |
151 movwf win_leftx2 ; Aligned to center. | |
152 | |
153 call aa_wordprocessor | |
50 | 154 call TFT_standard_color |
0 | 155 return |
156 | |
157 ;============================================================================= | |
158 ; Call dynamic proc for menu title: | |
159 | |
160 menu_processor_call_title: | |
161 movff menu_title+2,PCLATU ; Just execute computed goto. | |
162 movff menu_title+1,PCLATH | |
163 movf menu_title+0,W | |
164 movwf PCL | |
165 | |
166 ;============================================================================= | |
167 ; Restart with first icon/line selected. | |
168 global menu_processor_reset | |
169 menu_processor_reset: | |
170 banksel common | |
171 lfsr FSR2,menustack | |
172 clrf POSTINC2 | |
173 clrf POSTINC2 | |
174 clrf POSTINC2 | |
175 clrf POSTINC2 | |
176 clrf POSTINC2 | |
177 clrf selected_item | |
178 return | |
179 | |
180 global menu_processor_pop | |
181 menu_processor_pop: | |
182 movff menustack+0,selected_item | |
183 movff menustack+1,menustack+0 | |
184 movff menustack+2,menustack+1 | |
185 movff menustack+3,menustack+2 | |
186 movff menustack+4,menustack+3 | |
187 return | |
188 | |
189 menu_processor_push: | |
190 movff menustack+3,menustack+4 | |
191 movff menustack+2,menustack+3 | |
192 movff menustack+1,menustack+2 | |
193 movff menustack+0,menustack+1 | |
194 movff selected_item,menustack+0 | |
195 clrf selected_item | |
196 return | |
197 | |
198 ;---- Execute menu selection ------------------------------------------------- | |
199 do_menu_item: | |
200 bcf switch_right ; Avoid loops. | |
201 call speed_normal ; Back to normal speed. | |
202 | |
203 movf selected_item,W ; Reread proc address from table. | |
204 rcall menu_read_item ; (destroy PROD) | |
205 | |
206 movff selected_item,PRODL ; Pass along selected line | |
207 | |
208 rcall menu_processor_push ; Remember where we get from. (clears selected_item) | |
209 | |
210 movff proc_item+2,PCLATU ; Then execute computed goto. | |
211 movff proc_item+1,PCLATH | |
212 movf proc_item+0,W | |
213 movwf PCL | |
214 | |
215 ;============================================================================= | |
216 ; Get current item from table. | |
217 ; | |
218 ; Input : Item number in WREG, menu_block. | |
219 ; | |
220 ; Output: icon_large, text_item, proc_item 16bits pointers. | |
221 ; | |
222 ; Trashed: PROD, WREG | |
223 menu_read_item: | |
224 mullw .10 ; 10 bytes per item. | |
225 movf PRODL,W ; Then do a 24bits add | |
226 addwf menu_block+0,W ; with menu_block, and | |
227 movwf TBLPTRL ; setup TBLPTR | |
228 movf PRODH,W | |
229 addwfc menu_block+1,W | |
230 movwf TBLPTRH | |
231 movlw 0 | |
232 addwfc menu_block+2,W | |
233 movwf TBLPTRU | |
234 | |
235 VARARGS_GET8 value_type ; Read 10 bytes of item data | |
236 VARARGS_GET24 dynamic_item | |
237 VARARGS_GET24 proc_item | |
238 VARARGS_GET8 WREG ; Skip dummy byte | |
239 VARARGS_GET16 text_item | |
240 | |
241 return | |
242 | |
243 ;============================================================================= | |
244 ; Vertical menu : set of line/value to choose from. | |
245 ; Entry point to update lines already shown. | |
246 ; | |
247 global menu_vertical | |
248 menu_vertical: | |
249 btfss divemode ; Not in divemode | |
250 clrf timeout_counter2 ; Reset timeout | |
251 | |
252 menu_vertical_2: | |
253 rcall menu_draw_lines ; Always re-draw whole menu | |
254 | |
255 movlw CCP1CON_VALUE ; See ostc3.inc | |
256 btfss divemode ; Not in divemode | |
257 movwf CCP1CON ; Power-on backlight | |
258 | |
259 menu_vertical_1: | |
260 movf selected_item,W ; Get current item data | |
261 rcall menu_read_item | |
262 movf proc_item+0,W ; Check if pro address is NULL ? | |
263 iorwf proc_item+1,W | |
264 bz next_line_menu ; YES: not selectable ! | |
265 | |
266 btfss divemode ; Not in divemode | |
267 rcall menu_draw_selected_line | |
268 | |
50 | 269 btfsc in_color_menu ; =1: In the color scheme menu |
270 call TFT_show_color_schemes ; Yes, update the color schemes | |
271 | |
0 | 272 extern rtc_set_rtc |
273 btfss settime_setdate ; In the Set Time or Set Date menu? | |
274 bra menu_line_loop_pre2 ; no, skip all following | |
275 | |
276 movff month,lo ; new month | |
277 dcfsnz lo,F | |
278 movlw .31 | |
279 dcfsnz lo,F | |
280 movlw .28 | |
281 dcfsnz lo,F | |
282 movlw .31 | |
283 dcfsnz lo,F | |
284 movlw .30 | |
285 dcfsnz lo,F | |
286 movlw .31 | |
287 dcfsnz lo,F | |
288 movlw .30 | |
289 dcfsnz lo,F | |
290 movlw .31 | |
291 dcfsnz lo,F | |
292 movlw .31 | |
293 dcfsnz lo,F | |
294 movlw .30 | |
295 dcfsnz lo,F | |
296 movlw .31 | |
297 dcfsnz lo,F | |
298 movlw .30 | |
299 dcfsnz lo,F | |
300 movlw .31 | |
301 cpfsgt day ; day ok? | |
302 bra menu_line_loop_pre1 ; OK! | |
303 movlw .1 ; not OK, set to 1st | |
304 movwf day | |
305 | |
306 menu_line_loop_pre1: | |
307 btfsc switch_right ; Enter pressed? | |
308 call rtc_set_rtc ; Yes, update mins,sec,hours,day,month and year to rtc module | |
309 call TFT_show_time_date_menu ; Update clock | |
310 | |
311 menu_line_loop_pre2: | |
312 bcf switch_right | |
313 bcf switch_left | |
314 btfss divemode ; Not in Divemode | |
315 call speed_normal | |
316 | |
317 menu_line_loop_pre3: | |
318 extern divemode_option0_return | |
319 btfsc divemode ; In divemode? | |
320 goto divemode_option0_return ; Yes, return to it | |
321 | |
322 menu_line_loop: | |
323 btfsc switch_right | |
324 bra do_line_menu ; Type dependent | |
325 btfsc switch_left | |
326 bra next_line_menu | |
327 | |
113 | 328 btfss quarter_second_update ; 1/4 second? |
329 bra menu_line_loop1 ; Not yet... | |
330 | |
331 call compute_ppo2 ; compute mv_sensorX and ppo2_sensorX arrays | |
332 btfsc menu_show_sensors2 ; In the "Calibrate" menu? | |
333 call TFT_menu_hud2 ; Yes, update mV data | |
334 bcf quarter_second_update ; Clear flag | |
335 | |
336 menu_line_loop1: | |
0 | 337 btfss onesecupdate ; New second |
338 bra menu_line_loop2 ; not yet... | |
339 | |
340 call timeout_surfmode ; timeout | |
341 call set_dive_modes ; check, if divemode must be entered | |
113 | 342 call get_battery_voltage ; gets battery voltage |
0 | 343 |
344 btfsc settime_setdate ; In the Set Time or Set Date menu? | |
345 call TFT_show_time_date_menu ; Yes, update clock | |
113 | 346 |
0 | 347 btfsc menu_show_sensors ; In the "Sensors" menu? |
348 call TFT_menu_hud ; Yes, update HUD data | |
349 | |
350 bcf onesecupdate ; one second updates done | |
351 | |
352 menu_line_loop2: | |
353 btfsc sleepmode ; Timeout? | |
354 goto restart ; Yes, back to surfacemode | |
355 btfsc divemode | |
356 goto restart ; Enter Divemode if required | |
357 | |
358 btfsc enable_screen_dumps ; =1: Ignore vin_usb, wait for "l" command (Screen dump) | |
359 bra menu_line_loop3 | |
360 btfsc vusb_in ; USB plugged in? | |
113 | 361 call comm_mode ; Start COMM mode |
0 | 362 bra menu_line_loop4 |
363 menu_line_loop3: | |
364 btfss vusb_in ; USB (still) plugged in? | |
365 bcf enable_screen_dumps ; No, clear flag | |
366 call rs232_get_byte | |
367 btfsc rs232_recieve_overflow | |
368 bra menu_line_loop4 | |
369 movlw "l" | |
370 cpfseq RCREG1 | |
371 bra menu_line_loop4 | |
372 call TFT_dump_screen ; Dump the screen contents | |
373 menu_line_loop4: | |
374 | |
375 bra menu_line_loop | |
376 | |
377 ;---- Move to menu's next line | |
378 next_line_menu: | |
379 btfss divemode ; not in divemode | |
380 call speed_fastest | |
381 bcf switch_left ; Avoid looping. | |
382 | |
383 incf selected_item,F ; Select next item. | |
384 movf selected_item,W ; Index == max ? | |
385 cpfseq item_max | |
386 bra menu_vertical_1 ; NO: redraw cursor. | |
387 | |
388 clrf selected_item ; YES: restart for item 0. | |
389 bra menu_vertical_1 ; Then redraw cursor. | |
390 | |
391 global do_line_menu | |
392 do_line_menu: | |
393 btfss divemode ; not in divemode | |
394 call speed_fastest | |
395 ; bcf switch_right ; Avoid looping. | |
396 | |
397 decf menupos,W ; menu_processor needs 0-5... | |
398 btfsc divemode ; only in divemode | |
399 movwf selected_item | |
400 | |
401 movf selected_item,W ; Read selected descriptor | |
402 rcall menu_read_item | |
403 | |
404 movf value_type,W ; Switch on data type | |
405 bz menu_do_line_call ; CALL | |
406 dcfsnz WREG | |
407 bra menu_do_line_call ; STRING: do as call | |
408 dcfsnz WREG | |
409 bra menu_do_line_option ; OPTION | |
410 dcfsnz WREG | |
411 bra menu_do_line_call ; DYNAMIC: do as call | |
412 bra menu_line_loop_pre3 ; else do nothing... | |
413 | |
414 ;---- CALL | |
415 menu_do_line_call: | |
416 rcall do_menu_item ; Same as icon menu: calculated goto. | |
417 rcall menu_processor_pop ; Back to same line, | |
418 bra menu_vertical ; Then continue into menu... | |
419 | |
420 ;---- Call option specific increment subroutine | |
421 menu_do_line_option: | |
422 movff option_item+0,FSR0L ; Get option handle | |
423 movff option_item+1,FSR0H | |
424 call option_inc ; increment | |
425 | |
426 movff selected_item,PRODL ; Pass selection to callback. | |
427 rcall menu_text_call | |
428 bra menu_vertical_2 ; redraw all lines... | |
429 | |
430 ;----------------------------------------------------------------------------- | |
431 | |
432 menu_draw_lines_divemode: | |
433 movlw divemode_menu_item1_row | |
434 movff WREG,win_top | |
435 movlw divemode_menu_item1_column | |
436 movff WREG,win_leftx2 | |
437 clrf start_item | |
438 movff item_max,menupos4 ; Copy item_max for divemode cursor routine | |
439 bra menu_draw_lines_2 | |
440 | |
441 menu_draw_lines: | |
442 btfsc divemode ; in divemode? | |
443 bra menu_draw_lines_divemode ; Yes | |
444 | |
445 btfsc menu_flags,0 ; Dynamic title ? | |
446 rcall menu_processor_title ; YES: redraw it then. | |
447 | |
448 MENU_LINE_FONT MENU_LEFT, 0 ; Init start position/font | |
449 movff menu_center,win_top ; computed in menu block. | |
450 | |
451 ; Does the menu have more than 6 lines ? | |
452 movf item_max,W | |
453 addlw -(MENU_LINES_MAX+1) ; (max - 7) | |
454 bnn menu_draw_long_menu ; bra if (max >= 7) | |
455 | |
456 clrf start_item | |
457 bra menu_draw_lines_2 | |
458 | |
459 menu_draw_long_menu: | |
460 movf selected_item,W ; Start at selected-6 | |
461 addlw -(MENU_LINES_MAX-1) | |
462 btfsc STATUS,N ; This is <0 ? | |
463 clrf WREG ; YES: start from top instead. | |
464 movwf start_item | |
465 | |
466 menu_draw_lines_2: | |
467 movff start_item, menu_item | |
468 | |
469 menu_draw_lines_1: | |
50 | 470 call TFT_standard_color ; Restore color after disabled lines. |
0 | 471 |
472 movf menu_item,W | |
473 rcall menu_read_item | |
474 | |
475 movf value_type,W ; Switch on data type | |
476 bz menu_draw_line_call | |
477 dcfsnz WREG | |
478 bra menu_draw_line_string | |
479 dcfsnz WREG | |
480 bra menu_draw_line_option | |
481 dcfsnz WREG | |
482 bra menu_draw_line_dynamic | |
483 bra menu_draw_line_none | |
484 | |
485 menu_draw_line_string: | |
486 movff text_item+0,TBLPTRL ; Read not-translated string from PROM. | |
487 movff text_item+1,TBLPTRH | |
488 call strcpy_prom ; Copy in buffer | |
489 bra menu_draw_line_none | |
490 | |
491 menu_draw_line_call: | |
492 movff text_item+0,FSR1L ; Read string from PROM. | |
493 movff text_item+1,FSR1H | |
494 call strcpy_text ; Copy in buffer | |
495 | |
496 bra menu_draw_line_none | |
497 | |
498 menu_draw_line_option: | |
499 movff text_item+0,FSR1L ; Read string from PROM. | |
500 movff text_item+1,FSR1H | |
501 call strcpy_text ; Copy in buffer | |
502 | |
503 movff option_item+0,FSR0L ; Retrieve option handle. | |
504 movff option_item+1,FSR0H | |
68 | 505 btfss settime_setdate ; Not in Time/Date menu... |
0 | 506 call option_draw |
507 bra menu_draw_line_none | |
508 | |
509 menu_draw_line_dynamic: | |
510 lfsr FSR2,buffer | |
511 movff menu_item,PRODL ; Pass item to callback. | |
512 rcall menu_text_call ; Push return address. | |
513 bra menu_draw_line_none | |
514 | |
515 ; Computed goto to pointer inside dynamic_item: | |
516 menu_text_call: | |
517 movf dynamic_item+0,W ; Check if callback is NULL | |
518 iorwf dynamic_item+1,W | |
519 iorwf dynamic_item+2,W | |
520 btfsc STATUS,Z | |
521 return ; YES: don't call it. | |
522 | |
523 movff dynamic_item+2,PCLATU ; Prepare... | |
524 movff dynamic_item+1,PCLATH | |
525 movf dynamic_item+0,W | |
526 movwf PCL ; And jump ! | |
527 | |
528 menu_draw_line_none: | |
529 extern TFT_fillup_with_spaces | |
530 | |
531 btfsc divemode ; In divemode? | |
532 bra menu_draw_line_none_divemode ; Yes | |
533 | |
534 movlw MENU_LINE_MAX_LENGTH | |
535 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) | |
536 clrf WREG | |
537 movff WREG,buffer+MENU_LINE_MAX_LENGTH;No ; Make sure won't be longer than MENU_LINE_MAX_LENGTH ch | |
538 call aa_wordprocessor | |
539 movlw MENU_HEIGHT ; No, Move to next line | |
540 addwf win_top,F | |
541 incf menu_item,F ; inc loop counter | |
542 | |
543 movf start_item,W ; First line (scrolled) | |
544 subwf menu_item,W ; current - first | |
545 xorlw MENU_LINES_MAX ; Already done 6 lines ? | |
546 btfsc STATUS,Z | |
547 return ; YES | |
548 menu_draw_line_none2: | |
549 movf menu_item,W ; Done item_max lines ? | |
550 xorwf item_max,W | |
551 btfss STATUS,Z | |
552 bra menu_draw_lines_1 ; No: loop... | |
553 return | |
554 | |
555 menu_draw_line_none_divemode: | |
556 movlw .10 | |
557 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG) | |
558 clrf WREG | |
559 movff WREG,buffer+.10 | |
560 | |
561 call aa_wordprocessor ; Draw the line! | |
562 | |
563 movlw .0 | |
564 movff WREG,win_invert ; Reset invert flag | |
565 | |
566 movlw .24 ; Divemode menu spacing | |
567 addwf win_top,F | |
568 incf menu_item,F ; inc loop counter | |
569 | |
570 movlw .3 | |
571 cpfseq menu_item ; At pos 4? | |
572 bra menu_draw_line_none2 ; No | |
573 | |
574 movlw divemode_menu_item4_row | |
575 movff WREG,win_top ; Reset row | |
576 movlw divemode_menu_item4_column | |
577 movff WREG,win_leftx2 ; New column | |
578 bra menu_draw_line_none2 ; Done. | |
579 | |
580 ;----------------------------------------------------------------------------- | |
581 ; Put a mark in front of the current line | |
582 menu_draw_selected_line: | |
583 clrf timeout_counter2 ; Reset timeout | |
584 WIN_BOX_BLACK .34,.221,MENU_LEFT-8,MENU_LEFT-2 ; Clear left column | |
585 | |
50 | 586 call TFT_standard_color |
0 | 587 WIN_SMALL MENU_LEFT-8, 0 ; Arrow symbol only in small font |
588 movf start_item,W ; First line (scrolled) | |
589 subwf selected_item,W ; selected - first | |
590 mullw MENU_HEIGHT ; 30 pixel by line | |
591 movf PRODL,W ; result | |
592 addwf menu_center,W ; added to first line | |
593 movwf win_top ; and stored to pos. | |
594 STRCPY_PRINT "\xb7" ; print cursor | |
595 | |
596 return | |
597 | |
598 END |