Mercurial > public > hwos_code
annotate src/menu_processor.asm @ 622:02d1386429a6
0x60 added for (future) option to change logbook offset via PC/Bluetooth
author | heinrichsweikamp |
---|---|
date | Wed, 10 Apr 2019 10:51:07 +0200 |
parents | e76a87e087ef |
children | c40025d8e750 |
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 | |
619 | 111 WIN_TINY .40,.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 | |
612 | 358 btfsc enable_screen_dumps ; screendump enabled? |
359 bra menu_line_loop ; loop and skip the COMM mode | |
360 | |
582 | 361 btfsc vusb_in ; USB plugged in? |
604 | 362 call comm_mode ; YES - start COMM mode |
363 | |
364 bra menu_line_loop ; loop | |
365 | |
0 | 366 |
367 ;---- Move to menu's next line | |
368 next_line_menu: | |
582 | 369 btfss divemode ; not in divemode |
370 call speed_fastest | |
604 | 371 bcf switch_left ; avoid looping |
372 incf selected_item,F ; select next item | |
373 movf selected_item,W ; index == max ? | |
582 | 374 cpfseq item_max |
604 | 375 bra menu_vertical_1 ; NO - redraw cursor |
376 clrf selected_item ; YES - restart for item 0 | |
377 bra menu_vertical_1 ; then redraw cursor | |
0 | 378 |
582 | 379 global do_line_menu |
0 | 380 do_line_menu: |
604 | 381 btfss divemode ; in divemode? |
382 call speed_fastest ; NO | |
383 ; bcf switch_right ; avoid looping | |
384 decf menupos1,W ; menu_processor needs 0-5 | |
582 | 385 btfsc divemode ; only in divemode |
386 movwf selected_item | |
604 | 387 movf selected_item,W ; read selected descriptor |
582 | 388 rcall menu_read_item |
604 | 389 movf value_type,W ; switch on data type |
582 | 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 | |
604 | 397 bra menu_line_loop_pre3 ; else do nothing |
0 | 398 |
399 ;---- CALL | |
400 menu_do_line_call: | |
604 | 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... | |
0 | 404 |
405 ;---- Call option specific increment subroutine | |
406 menu_do_line_option: | |
604 | 407 movff option_item+0,FSR0L ; get option handle |
582 | 408 movff option_item+1,FSR0H |
409 call option_inc ; increment | |
604 | 410 movff selected_item,PRODL ; pass selection to callback. |
582 | 411 rcall menu_text_call |
604 | 412 bra menu_vertical_2 ; redraw all lines |
0 | 413 |
414 ;----------------------------------------------------------------------------- | |
415 | |
416 menu_draw_lines_divemode: | |
582 | 417 movlw dm_menu_item1_row |
418 movff WREG,win_top | |
419 movlw dm_menu_item1_column | |
420 movff WREG,win_leftx2 | |
421 clrf start_item | |
604 | 422 movff item_max,menupos4 ; copy item_max for divemode cursor routine |
582 | 423 bra menu_draw_lines_2 |
0 | 424 |
425 menu_draw_lines: | |
582 | 426 btfsc divemode ; in divemode? |
604 | 427 bra menu_draw_lines_divemode ; YES |
428 btfsc menu_flags,0 ; Dynamic title? | |
429 rcall menu_processor_title ; YES - redraw it then | |
430 MENU_LINE_FONT MENU_LEFT, 0 ; init start position/font | |
582 | 431 movff menu_center,win_top ; computed in menu block. |
0 | 432 |
582 | 433 ; Does the menu have more than 6 lines ? |
434 movf item_max,W | |
435 addlw -(MENU_LINES_MAX+1) ; (max - 7) | |
436 bnn menu_draw_long_menu ; bra if (max >= 7) | |
437 clrf start_item | |
438 bra menu_draw_lines_2 | |
0 | 439 |
440 menu_draw_long_menu: | |
604 | 441 movf selected_item,W ; start at selected-6 |
582 | 442 addlw -(MENU_LINES_MAX-1) |
604 | 443 btfsc STATUS,N ; is this < 0 ? |
444 clrf WREG ; YES - start from top instead | |
582 | 445 movwf start_item |
0 | 446 |
447 menu_draw_lines_2: | |
582 | 448 movff start_item, menu_item |
0 | 449 |
450 menu_draw_lines_1: | |
604 | 451 call TFT_standard_color ; restore color after disabled lines |
582 | 452 movf menu_item,W |
453 rcall menu_read_item | |
604 | 454 movf value_type,W ; switch on data type |
582 | 455 bz menu_draw_line_call |
456 dcfsnz WREG | |
457 bra menu_draw_line_string | |
458 dcfsnz WREG | |
459 bra menu_draw_line_option | |
460 dcfsnz WREG | |
461 bra menu_draw_line_dynamic | |
462 bra menu_draw_line_none | |
0 | 463 |
464 menu_draw_line_string: | |
604 | 465 movff text_item+0,TBLPTRL ; read not-translated string from PROM |
582 | 466 movff text_item+1,TBLPTRH |
604 | 467 call strcpy_prom ; copy in buffer |
582 | 468 bra menu_draw_line_none |
0 | 469 |
582 | 470 menu_draw_line_call: |
604 | 471 movff text_item+0,FSR1L ; read string from PROM |
582 | 472 movff text_item+1,FSR1H |
604 | 473 call strcpy_text ; copy in buffer |
582 | 474 bra menu_draw_line_none |
475 | |
0 | 476 menu_draw_line_option: |
604 | 477 movff text_item+0,FSR1L ; read string from PROM |
582 | 478 movff text_item+1,FSR1H |
604 | 479 call strcpy_text ; copy in buffer |
480 movff option_item+0,FSR0L ; retrieve option handle | |
582 | 481 movff option_item+1,FSR0H |
604 | 482 btfss settime_setdate ; not in Time/Date menu |
582 | 483 call option_draw |
484 bra menu_draw_line_none | |
0 | 485 |
486 menu_draw_line_dynamic: | |
582 | 487 lfsr FSR2,buffer |
604 | 488 movff menu_item,PRODL ; pass item to callback |
489 rcall menu_text_call ; push return address | |
582 | 490 bra menu_draw_line_none |
0 | 491 |
492 ; Computed goto to pointer inside dynamic_item: | |
493 menu_text_call: | |
604 | 494 movf dynamic_item+0,W ; check if callback is NULL |
582 | 495 iorwf dynamic_item+1,W |
496 iorwf dynamic_item+2,W | |
497 btfsc STATUS,Z | |
604 | 498 return ; YES - don't call it |
499 movff dynamic_item+2,PCLATU ; prepare... | |
582 | 500 movff dynamic_item+1,PCLATH |
501 movf dynamic_item+0,W | |
604 | 502 movwf PCL ; ...and jump |
0 | 503 |
504 menu_draw_line_none: | |
604 | 505 btfsc divemode ; in divemode? |
506 bra menu_draw_line_none_divemode ; YES | |
582 | 507 movlw MENU_LINE_MAX_LENGTH |
604 | 508 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (Total string length in #WREG) |
582 | 509 clrf WREG |
604 | 510 movff WREG,buffer+MENU_LINE_MAX_LENGTH ; NO - make sure won't be longer than MENU_LINE_MAX_LENGTH ch |
582 | 511 call aa_wordprocessor |
604 | 512 bcf win_invert ; clear flag for inverted output by default |
513 movlw MENU_HEIGHT ; NO - move to next line | |
582 | 514 addwf win_top,F |
515 incf menu_item,F ; inc loop counter | |
604 | 516 movf start_item,W ; first line (scrolled) |
582 | 517 subwf menu_item,W ; current - first |
604 | 518 xorlw MENU_LINES_MAX ; already done 6 lines? |
582 | 519 btfsc STATUS,Z |
520 return ; YES | |
0 | 521 menu_draw_line_none2: |
604 | 522 movf menu_item,W ; done item_max lines? |
582 | 523 xorwf item_max,W |
524 btfss STATUS,Z | |
604 | 525 bra menu_draw_lines_1 ; NO - loop... |
582 | 526 return |
0 | 527 |
528 menu_draw_line_none_divemode: | |
582 | 529 movlw .10 |
604 | 530 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (Total string length in #WREG) |
582 | 531 clrf WREG |
532 movff WREG,buffer+.10 | |
604 | 533 call aa_wordprocessor ; draw the line |
582 | 534 banksel common |
604 | 535 bcf win_invert ; reset invert flag |
582 | 536 banksel win_top |
537 movlw .24 ; divemode menu spacing | |
538 addwf win_top,F | |
539 incf menu_item,F ; inc loop counter | |
540 movlw .3 | |
604 | 541 cpfseq menu_item ; at pos 4? |
542 bra menu_draw_line_none2 ; NO | |
582 | 543 movlw dm_menu_item4_row |
604 | 544 movff WREG,win_top ; reset row |
582 | 545 movlw dm_menu_item4_column |
604 | 546 movff WREG,win_leftx2 ; new column |
547 bra menu_draw_line_none2 ; done | |
0 | 548 |
549 ;----------------------------------------------------------------------------- | |
550 ; Put a mark in front of the current line | |
551 menu_draw_selected_line: | |
604 | 552 clrf timeout_counter2 ; reset timeout |
553 WIN_BOX_BLACK .34,.221,MENU_LEFT-8,MENU_LEFT-2 ; clear left column | |
582 | 554 call TFT_standard_color |
604 | 555 WIN_SMALL MENU_LEFT-8, 0 ; arrow symbol only in small font |
556 movf start_item,W ; first line (scrolled) | |
582 | 557 subwf selected_item,W ; selected - first |
558 mullw MENU_HEIGHT ; 30 pixel by line | |
559 movf PRODL,W ; result | |
560 addwf menu_center,W ; added to first line | |
561 movwf win_top ; and stored to pos. | |
562 STRCPY_PRINT "\xb7" ; print cursor | |
563 return | |
0 | 564 |
582 | 565 END |