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