Mercurial > public > hwos_code
annotate src/menu_processor.asm @ 610:2ce43f09586e
Mod for new pcb designs
author | heinrichsweikamp |
---|---|
date | Wed, 09 Jan 2019 18:35:20 +0100 |
parents | d866684249bd |
children | 6dd6b37da7c8 |
rev | line source |
---|---|
0 | 1 ;============================================================================= |
2 ; | |
604 | 3 ; File menu_processor.asm REFACTORED VERSION V2.99d |
0 | 4 ; |
275 | 5 ; Routines to handle all hwOS graphic/text menus. |
0 | 6 ; |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | |
8 ;============================================================================= | |
9 ; HISTORY | |
275 | 10 ; 2012-11-02 : [jDG] Cleanup for hwOS: removed icons. Added scrolling. |
582 | 11 ; But need a font with lower/upper alpha chars... |
0 | 12 |
604 | 13 #include "hwos.inc" |
0 | 14 #include "convert.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" |
604 | 25 #include "i2c.inc" |
229 | 26 |
0 | 27 |
604 | 28 ; NOTE: needs to be identical in .inc and .asm ! |
29 #define MENU_LINES_MAX .7 ; number of lines per screen? | |
30 #define MENU_TITLE_FONT WIN_STD ; font needs to contain lower and UPPER chars | |
31 #define MENU_LINE_FONT WIN_SMALL ; font needs to contain lower and UPPER chars | |
32 #define MENU_LEFT .20 ; position of first menu item | |
33 #define MENU_HEIGHT .27 ; spacing between menu lines | |
34 #define MENU_VCENTER .125 ; position on screen | |
35 #define MENU_LINE_MAX_LENGTH .20 ; length in characters | |
582 | 36 #define option_item proc_item |
0 | 37 |
38 ; Other needed references | |
582 | 39 extern aa_wordprocessor |
40 extern option_inc | |
41 extern option_draw | |
42 extern comm_mode | |
43 extern TFT_clear_divemode_menu | |
44 extern TFT_divemask_color | |
45 extern rtc_set_rtc | |
46 extern divemode_option0_return | |
47 extern TFT_fillup_with_spaces | |
0 | 48 |
49 | |
604 | 50 menu_proc CODE |
0 | 51 |
52 ;============================================================================= | |
53 ; menu handler. | |
54 ; | |
55 ; Input: TBLPTR = addr of menu block. | |
582 | 56 global menu_processor |
0 | 57 menu_processor: |
604 | 58 banksel common ; bank 1 |
59 btfss divemode ; in divemode? | |
60 call speed_fastest ; NO - make it quick | |
582 | 61 ;---- Read menu block ------------------------------------------------ |
604 | 62 VARARGS_BEGIN ; read inline PROM data |
63 clrf STKPTR ; never return from here | |
64 VARARGS_GET8 item_max ; get number of items | |
65 VARARGS_GET8 menu_flags ; get flags | |
66 VARARGS_GET24 menu_title ; get pointer to menu title | |
67 VARARGS_GET8 menu_center ; vertical position | |
68 movff TBLPTRL, menu_block+0 ; save base address for menu_read_item | |
582 | 69 movff TBLPTRH, menu_block+1 |
70 movff TBLPTRU, menu_block+2 | |
604 | 71 btfss divemode ; in divemode? |
72 bra menu_processor0 ; NO | |
73 ; Required for menus with less entries than the calling menu but not so nice when setting up gas 6.... mH | |
582 | 74 movlw .1 |
75 cpfsgt menupos1 ; only if menupos1 = 1... | |
604 | 76 call TFT_clear_divemode_menu ; ... clear the menu! |
582 | 77 ; Draw one frame around the divemode menu |
78 call TFT_divemask_color | |
79 WIN_FRAME_COLOR16 dm_menu_row, dm_menu_lower, dm_menu_left ,dm_menu_right ; top, bottom, left, right | |
80 call TFT_standard_color | |
0 | 81 |
604 | 82 bra menu_processor1 ; skip next code segment in divemode |
0 | 83 |
84 menu_processor0: | |
582 | 85 ;---- draw menu title ------------------------------------------------ |
86 clrf CCP1CON ; stop PWM | |
604 | 87 bcf PORTC,2 ; pull PWM out to GND |
582 | 88 call TFT_ClearScreen |
89 rcall menu_processor_title | |
90 rcall menu_processor_bottom_line | |
0 | 91 |
169
dcf3e08f31ac
CHANGE: Improve internal logbook usability
heinrichsweikamp
parents:
125
diff
changeset
|
92 menu_processor1: |
582 | 93 movlw FT_SMALL |
94 movff WREG, win_font | |
169
dcf3e08f31ac
CHANGE: Improve internal logbook usability
heinrichsweikamp
parents:
125
diff
changeset
|
95 |
582 | 96 ;---- Select menu type ----------------------------------------------- |
97 bra menu_vertical | |
0 | 98 |
604 | 99 |
100 ;============================================================================= | |
101 ; draw menu bottom line | |
102 ; | |
103 global menu_processor_bottom_line,menu_processor_bottom_line_comm | |
582 | 104 menu_processor_bottom_line: |
105 ;---- Draw bottom line ----------------------------------------------- | |
106 TEXT_TINY .5, .240-.16, tNext | |
107 TEXT_TINY .160-.6*.6, .240-.16, tEnter | |
108 WIN_COLOR color_greenish | |
604 | 109 menu_processor_bottom_line_comm: |
110 ; Serial Number and Firmware Version | |
608 | 111 WIN_TINY .32,.240-.16 |
582 | 112 STRCPY "#" |
113 call TFT_cat_serial | |
114 STRCAT " v" | |
115 call TFT_cat_firmware | |
608 | 116 STRCAT " " |
604 | 117 call TFT_cat_beta_release |
582 | 118 STRCAT_PRINT "" |
119 call TFT_standard_color | |
120 bcf win_invert | |
121 return | |
0 | 122 |
123 ;============================================================================= | |
604 | 124 ; (re-)draw menu title |
0 | 125 ; |
582 | 126 menu_processor_title: |
604 | 127 WIN_BOX_BLACK .2,.23,.0,.159 ; clear menu title |
128 MENU_TITLE_FONT .0, .2 ; menu title positioning | |
129 btfss menu_flags,0 ; static or dynamic title? | |
130 bra menu_processor_static_title ; static title | |
131 rcall menu_processor_call_title ; dynamic title - add gas, detail and color | |
582 | 132 bra menu_processor_title_1 |
0 | 133 |
582 | 134 menu_processor_static_title: |
604 | 135 movff menu_title+0,FSR1L ; just copy string |
582 | 136 movff menu_title+1,FSR1H |
137 call strcpy_text | |
0 | 138 |
139 menu_processor_title_1: | |
582 | 140 WIN_COLOR color_greenish |
604 | 141 movf FSR2L,W ; get title length |
142 mullw .9 ; convert to half pixels | |
143 bcf STATUS,C ; clear carry | |
582 | 144 rrcf PRODL ; /2 |
604 | 145 movf PRODL,W ; back to WREG |
582 | 146 sublw .80 ; 80 - width |
604 | 147 movwf win_leftx2 ; aligned to center |
148 movlw .0 ; string termination code | |
149 movff WREG,buffer+.17 ; limit to 17 chars (std font max.) | |
582 | 150 call aa_wordprocessor |
151 call TFT_standard_color | |
152 return | |
0 | 153 |
154 ;============================================================================= | |
155 ; Call dynamic proc for menu title: | |
156 | |
157 menu_processor_call_title: | |
604 | 158 movff menu_title+2,PCLATU ; execute computed goto |
582 | 159 movff menu_title+1,PCLATH |
160 movf menu_title+0,W | |
161 movwf PCL | |
162 | |
0 | 163 ;============================================================================= |
604 | 164 ; Restart with first icon/line selected |
165 ; | |
582 | 166 global menu_processor_reset |
0 | 167 menu_processor_reset: |
582 | 168 banksel menustack |
169 lfsr FSR2,menustack | |
170 clrf POSTINC2 | |
171 clrf POSTINC2 | |
172 clrf POSTINC2 | |
173 clrf POSTINC2 | |
174 clrf POSTINC2 | |
175 banksel common | |
176 clrf selected_item | |
177 return | |
0 | 178 |
582 | 179 global menu_processor_pop |
0 | 180 menu_processor_pop: |
582 | 181 movff menustack+0,selected_item |
182 movff menustack+1,menustack+0 | |
183 movff menustack+2,menustack+1 | |
184 movff menustack+3,menustack+2 | |
185 movff menustack+4,menustack+3 | |
186 return | |
187 | |
188 global menu_processor_double_pop | |
189 menu_processor_double_pop: | |
190 movff menustack+1,selected_item | |
191 movff menustack+2,menustack+0 | |
192 movff menustack+3,menustack+1 | |
193 movff menustack+4,menustack+2 | |
194 return | |
0 | 195 |
196 menu_processor_push: | |
582 | 197 movff menustack+3,menustack+4 |
198 movff menustack+2,menustack+3 | |
199 movff menustack+1,menustack+2 | |
200 movff menustack+0,menustack+1 | |
201 movff selected_item,menustack+0 | |
202 clrf selected_item | |
203 return | |
0 | 204 |
205 ;---- Execute menu selection ------------------------------------------------- | |
206 do_menu_item: | |
604 | 207 bcf switch_right ; avoid loops |
208 call speed_normal ; back to normal speed | |
209 movf selected_item,W ; reread proc address from table | |
210 rcall menu_read_item ; (destroys PROD) | |
211 movff selected_item,PRODL ; pass along selected line | |
212 rcall menu_processor_push ; remember where we got from (clears selected_item) | |
213 movff proc_item+2,PCLATU ; then execute computed goto | |
582 | 214 movff proc_item+1,PCLATH |
215 movf proc_item+0,W | |
216 movwf PCL | |
0 | 217 |
218 ;============================================================================= | |
219 ; Get current item from table. | |
220 ; | |
604 | 221 ; Input : Item number in WREG, menu_block. |
222 ; Output : icon_large, text_item, proc_item 16bits pointers. | |
223 ; Trashed: PROD, WREG | |
0 | 224 ; |
225 menu_read_item: | |
604 | 226 mullw .10 ; 10 bytes per item |
227 movf PRODL,W ; then do a 24 bits add | |
582 | 228 addwf menu_block+0,W ; with menu_block, and |
229 movwf TBLPTRL ; setup TBLPTR | |
230 movf PRODH,W | |
231 addwfc menu_block+1,W | |
232 movwf TBLPTRH | |
233 movlw 0 | |
234 addwfc menu_block+2,W | |
235 movwf TBLPTRU | |
604 | 236 VARARGS_GET8 value_type ; read 10 bytes of item data |
582 | 237 VARARGS_GET24 dynamic_item |
238 VARARGS_GET24 proc_item | |
604 | 239 VARARGS_GET8 WREG ; skip dummy byte |
582 | 240 VARARGS_GET16 text_item |
0 | 241 |
582 | 242 return |
0 | 243 |
244 ;============================================================================= | |
604 | 245 ; Vertical menu - set of line/value to choose from, |
246 ; entry point to update lines already shown | |
0 | 247 ; |
582 | 248 global menu_vertical |
0 | 249 menu_vertical: |
604 | 250 btfss divemode ; in divemode? |
251 clrf timeout_counter2 ; NO - reset timeout | |
0 | 252 |
253 menu_vertical_2: | |
604 | 254 rcall menu_draw_lines ; always re-draw whole menu |
255 movlw CCP1CON_VALUE ; see hwos.inc | |
256 btfss divemode ; in divemode? | |
257 movwf CCP1CON ; NO - power-on backlight | |
0 | 258 |
259 menu_vertical_1: | |
604 | 260 movf selected_item,W ; get current item data |
582 | 261 rcall menu_read_item |
604 | 262 movf proc_item+0,W ; check if proc address is NULL |
582 | 263 iorwf proc_item+1,W |
604 | 264 bz next_line_menu ; YES - not selectable |
265 btfss divemode ; in divemode? | |
266 rcall menu_draw_selected_line ; NO | |
267 btfsc in_color_menu ; in the color scheme menu? | |
268 call TFT_show_color_schemes ; YES - update the color schemes | |
269 btfss settime_setdate ; in the set time or set date menu? | |
270 bra menu_line_loop_pre2 ; NO - skip all following | |
582 | 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? | |
604 | 297 bra menu_line_loop_pre1 ; YES |
298 movlw .1 ; NO - set to 1st | |
582 | 299 movwf day |
0 | 300 |
301 menu_line_loop_pre1: | |
604 | 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 | |
0 | 305 |
306 menu_line_loop_pre2: | |
582 | 307 bcf switch_right |
308 bcf switch_left | |
604 | 309 btfss divemode ; in divemode? |
310 call speed_normal ; NO | |
0 | 311 |
312 menu_line_loop_pre3: | |
604 | 313 btfsc divemode ; in divemode? |
314 goto divemode_option0_return ; Yes - return to it | |
0 | 315 |
316 menu_line_loop: | |
582 | 317 btfsc switch_right |
604 | 318 bra do_line_menu ; type dependent |
582 | 319 btfsc switch_left |
320 bra next_line_menu | |
321 btfss quarter_second_update ; 1/4 second? | |
604 | 322 bra menu_line_loop1 ; NO - not yet... |
323 btfsc menu_update_sensor_mv ; in the "Calibrate" menu? | |
324 call TFT_menu_calibrate ; YES - update mV data | |
325 bcf quarter_second_update ; clear flag | |
113 | 326 |
327 menu_line_loop1: | |
604 | 328 btfss onesecupdate ; new second? |
329 bra menu_line_loop2 ; NO - not yet... | |
330 | |
331 IFDEF _rx_functions | |
332 btfsc FLAG_tr_enabled ; TR functions enabled? | |
333 call I2C_get_tankdata ; YES - get new tank data | |
334 btfsc menu_update_tank_pres ; in tank setup menu? | |
335 call TFT_menu_tank_pres ; YES - update tank press | |
336 ENDIF | |
337 | |
582 | 338 call timeout_surfmode ; timeout on timeout_counter2 |
604 | 339 call set_dive_modes ; check if divemode must be entered |
582 | 340 call get_battery_voltage ; gets battery voltage |
604 | 341 btfsc settime_setdate ; in the set time or set date menu? |
342 call TFT_show_time_date_menu ; YES - update clock | |
582 | 343 bcf onesecupdate ; one second updates done |
0 | 344 |
345 menu_line_loop2: | |
604 | 346 btfsc sleepmode ; timeout? |
347 goto restart ; YES - back to surfacemode | |
582 | 348 btfsc divemode |
604 | 349 goto restart ; enter divemode if required |
350 | |
351 IFDEF _screendump | |
352 btfsc enable_screen_dumps ; screendump enabled? | |
353 call TFT_dump_screen_check ; YES - check if requested and do it | |
354 ELSE | |
355 btfsc disable_comm_mode ; COMM mode disabled (happens during new battery procedure)? | |
356 bra menu_line_loop ; YES - loop | |
357 ENDIF | |
358 | |
582 | 359 btfsc vusb_in ; USB plugged in? |
604 | 360 call comm_mode ; YES - start COMM mode |
361 | |
362 bra menu_line_loop ; loop | |
363 | |
0 | 364 |
365 ;---- Move to menu's next line | |
366 next_line_menu: | |
582 | 367 btfss divemode ; not in divemode |
368 call speed_fastest | |
604 | 369 bcf switch_left ; avoid looping |
370 incf selected_item,F ; select next item | |
371 movf selected_item,W ; index == max ? | |
582 | 372 cpfseq item_max |
604 | 373 bra menu_vertical_1 ; NO - redraw cursor |
374 clrf selected_item ; YES - restart for item 0 | |
375 bra menu_vertical_1 ; then redraw cursor | |
0 | 376 |
582 | 377 global do_line_menu |
0 | 378 do_line_menu: |
604 | 379 btfss divemode ; in divemode? |
380 call speed_fastest ; NO | |
381 ; bcf switch_right ; avoid looping | |
382 decf menupos1,W ; menu_processor needs 0-5 | |
582 | 383 btfsc divemode ; only in divemode |
384 movwf selected_item | |
604 | 385 movf selected_item,W ; read selected descriptor |
582 | 386 rcall menu_read_item |
604 | 387 movf value_type,W ; switch on data type |
582 | 388 bz menu_do_line_call ; CALL |
389 dcfsnz WREG | |
390 bra menu_do_line_call ; STRING: do as call | |
391 dcfsnz WREG | |
392 bra menu_do_line_option ; OPTION | |
393 dcfsnz WREG | |
394 bra menu_do_line_call ; DYNAMIC: do as call | |
604 | 395 bra menu_line_loop_pre3 ; else do nothing |
0 | 396 |
397 ;---- CALL | |
398 menu_do_line_call: | |
604 | 399 rcall do_menu_item ; same as icon menu: calculated goto |
400 rcall menu_processor_pop ; back to same line, | |
401 bra menu_vertical ; then continue into menu... | |
0 | 402 |
403 ;---- Call option specific increment subroutine | |
404 menu_do_line_option: | |
604 | 405 movff option_item+0,FSR0L ; get option handle |
582 | 406 movff option_item+1,FSR0H |
407 call option_inc ; increment | |
604 | 408 movff selected_item,PRODL ; pass selection to callback. |
582 | 409 rcall menu_text_call |
604 | 410 bra menu_vertical_2 ; redraw all lines |
0 | 411 |
412 ;----------------------------------------------------------------------------- | |
413 | |
414 menu_draw_lines_divemode: | |
582 | 415 movlw dm_menu_item1_row |
416 movff WREG,win_top | |
417 movlw dm_menu_item1_column | |
418 movff WREG,win_leftx2 | |
419 clrf start_item | |
604 | 420 movff item_max,menupos4 ; copy item_max for divemode cursor routine |
582 | 421 bra menu_draw_lines_2 |
0 | 422 |
423 menu_draw_lines: | |
582 | 424 btfsc divemode ; in divemode? |
604 | 425 bra menu_draw_lines_divemode ; YES |
426 btfsc menu_flags,0 ; Dynamic title? | |
427 rcall menu_processor_title ; YES - redraw it then | |
428 MENU_LINE_FONT MENU_LEFT, 0 ; init start position/font | |
582 | 429 movff menu_center,win_top ; computed in menu block. |
0 | 430 |
582 | 431 ; Does the menu have more than 6 lines ? |
432 movf item_max,W | |
433 addlw -(MENU_LINES_MAX+1) ; (max - 7) | |
434 bnn menu_draw_long_menu ; bra if (max >= 7) | |
435 clrf start_item | |
436 bra menu_draw_lines_2 | |
0 | 437 |
438 menu_draw_long_menu: | |
604 | 439 movf selected_item,W ; start at selected-6 |
582 | 440 addlw -(MENU_LINES_MAX-1) |
604 | 441 btfsc STATUS,N ; is this < 0 ? |
442 clrf WREG ; YES - start from top instead | |
582 | 443 movwf start_item |
0 | 444 |
445 menu_draw_lines_2: | |
582 | 446 movff start_item, menu_item |
0 | 447 |
448 menu_draw_lines_1: | |
604 | 449 call TFT_standard_color ; restore color after disabled lines |
582 | 450 movf menu_item,W |
451 rcall menu_read_item | |
604 | 452 movf value_type,W ; switch on data type |
582 | 453 bz menu_draw_line_call |
454 dcfsnz WREG | |
455 bra menu_draw_line_string | |
456 dcfsnz WREG | |
457 bra menu_draw_line_option | |
458 dcfsnz WREG | |
459 bra menu_draw_line_dynamic | |
460 bra menu_draw_line_none | |
0 | 461 |
462 menu_draw_line_string: | |
604 | 463 movff text_item+0,TBLPTRL ; read not-translated string from PROM |
582 | 464 movff text_item+1,TBLPTRH |
604 | 465 call strcpy_prom ; copy in buffer |
582 | 466 bra menu_draw_line_none |
0 | 467 |
582 | 468 menu_draw_line_call: |
604 | 469 movff text_item+0,FSR1L ; read string from PROM |
582 | 470 movff text_item+1,FSR1H |
604 | 471 call strcpy_text ; copy in buffer |
582 | 472 bra menu_draw_line_none |
473 | |
0 | 474 menu_draw_line_option: |
604 | 475 movff text_item+0,FSR1L ; read string from PROM |
582 | 476 movff text_item+1,FSR1H |
604 | 477 call strcpy_text ; copy in buffer |
478 movff option_item+0,FSR0L ; retrieve option handle | |
582 | 479 movff option_item+1,FSR0H |
604 | 480 btfss settime_setdate ; not in Time/Date menu |
582 | 481 call option_draw |
482 bra menu_draw_line_none | |
0 | 483 |
484 menu_draw_line_dynamic: | |
582 | 485 lfsr FSR2,buffer |
604 | 486 movff menu_item,PRODL ; pass item to callback |
487 rcall menu_text_call ; push return address | |
582 | 488 bra menu_draw_line_none |
0 | 489 |
490 ; Computed goto to pointer inside dynamic_item: | |
491 menu_text_call: | |
604 | 492 movf dynamic_item+0,W ; check if callback is NULL |
582 | 493 iorwf dynamic_item+1,W |
494 iorwf dynamic_item+2,W | |
495 btfsc STATUS,Z | |
604 | 496 return ; YES - don't call it |
497 movff dynamic_item+2,PCLATU ; prepare... | |
582 | 498 movff dynamic_item+1,PCLATH |
499 movf dynamic_item+0,W | |
604 | 500 movwf PCL ; ...and jump |
0 | 501 |
502 menu_draw_line_none: | |
604 | 503 btfsc divemode ; in divemode? |
504 bra menu_draw_line_none_divemode ; YES | |
582 | 505 movlw MENU_LINE_MAX_LENGTH |
604 | 506 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (Total string length in #WREG) |
582 | 507 clrf WREG |
604 | 508 movff WREG,buffer+MENU_LINE_MAX_LENGTH ; NO - make sure won't be longer than MENU_LINE_MAX_LENGTH ch |
582 | 509 call aa_wordprocessor |
604 | 510 bcf win_invert ; clear flag for inverted output by default |
511 movlw MENU_HEIGHT ; NO - move to next line | |
582 | 512 addwf win_top,F |
513 incf menu_item,F ; inc loop counter | |
604 | 514 movf start_item,W ; first line (scrolled) |
582 | 515 subwf menu_item,W ; current - first |
604 | 516 xorlw MENU_LINES_MAX ; already done 6 lines? |
582 | 517 btfsc STATUS,Z |
518 return ; YES | |
0 | 519 menu_draw_line_none2: |
604 | 520 movf menu_item,W ; done item_max lines? |
582 | 521 xorwf item_max,W |
522 btfss STATUS,Z | |
604 | 523 bra menu_draw_lines_1 ; NO - loop... |
582 | 524 return |
0 | 525 |
526 menu_draw_line_none_divemode: | |
582 | 527 movlw .10 |
604 | 528 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (Total string length in #WREG) |
582 | 529 clrf WREG |
530 movff WREG,buffer+.10 | |
604 | 531 call aa_wordprocessor ; draw the line |
582 | 532 banksel common |
604 | 533 bcf win_invert ; reset invert flag |
582 | 534 banksel win_top |
535 movlw .24 ; divemode menu spacing | |
536 addwf win_top,F | |
537 incf menu_item,F ; inc loop counter | |
538 movlw .3 | |
604 | 539 cpfseq menu_item ; at pos 4? |
540 bra menu_draw_line_none2 ; NO | |
582 | 541 movlw dm_menu_item4_row |
604 | 542 movff WREG,win_top ; reset row |
582 | 543 movlw dm_menu_item4_column |
604 | 544 movff WREG,win_leftx2 ; new column |
545 bra menu_draw_line_none2 ; done | |
0 | 546 |
547 ;----------------------------------------------------------------------------- | |
548 ; Put a mark in front of the current line | |
549 menu_draw_selected_line: | |
604 | 550 clrf timeout_counter2 ; reset timeout |
551 WIN_BOX_BLACK .34,.221,MENU_LEFT-8,MENU_LEFT-2 ; clear left column | |
582 | 552 call TFT_standard_color |
604 | 553 WIN_SMALL MENU_LEFT-8, 0 ; arrow symbol only in small font |
554 movf start_item,W ; first line (scrolled) | |
582 | 555 subwf selected_item,W ; selected - first |
556 mullw MENU_HEIGHT ; 30 pixel by line | |
557 movf PRODL,W ; result | |
558 addwf menu_center,W ; added to first line | |
559 movwf win_top ; and stored to pos. | |
560 STRCPY_PRINT "\xb7" ; print cursor | |
561 return | |
0 | 562 |
582 | 563 END |