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