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