annotate src/menu_processor.inc @ 637:cdff88f5a4a0

Battery menu for OSTC plus
author heinrichsweikamp
date Sun, 17 May 2020 09:34:18 +0200
parents 4050675965ea
children 7d8a4c60ec1a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
3 ; File menu_processor.inc * combined next generation V3.09.5
0
heinrichsweikamp
parents:
diff changeset
4 ;
275
653a3ab08062 rename into hwOS
heinrichsweikamp
parents: 169
diff changeset
5 ; Routines to handle all OSTC graphic/text menus.
0
heinrichsweikamp
parents:
diff changeset
6 ;
heinrichsweikamp
parents:
diff changeset
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
heinrichsweikamp
parents:
diff changeset
8 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
9 ; HISTORY
heinrichsweikamp
parents:
diff changeset
10 ; 2011-05-30 : [jDG] Creation.
heinrichsweikamp
parents:
diff changeset
11
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
12
0
heinrichsweikamp
parents:
diff changeset
13
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
14 ; Menu Parameters
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
15 ; NOTE: needs to be identical in .inc and .asm files!
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
16 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
17 #define MENU_LINES_MAX_SURF .7 ; max number of lines per screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
18 #define MENU_LINES_MAX_DIVE .6 ; max number of lines per dive mode menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
19 #define MENU_HEIGHT_SURF .27 ; spacing between menu items in surface mode (pixel)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
20 #define MENU_VCENTER .125 ; vertical center position of menu items
0
heinrichsweikamp
parents:
diff changeset
21
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
22
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
23 ; Menu Processor Functions
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
24 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
25 extern menu_processor_reset ; push current menu item (cursor position) to the stack
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
26 extern menu_processor_pop ; pull current menu item (cursor position) from the stack
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
27 extern menu_processor_double_pop ; pull previous menu item (cursor position) from the stack
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
28
169
dcf3e08f31ac CHANGE: Improve internal logbook usability
heinrichsweikamp
parents: 0
diff changeset
29
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
30 ; Encoding Format for Menu Item Types
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
31 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
32 ; 1st word with code1 2nd word with code2 item_type Type Functionality
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
33 ; ------------------------------------------------------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
34 ; tttt tttt tttt ttt0 cccc cccc cccc ccc0 0 MENU_DYNAMIC Call Item with dynamic Title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
35 ; ~--~ tttt tttt ttt1 cccc cccc cccc ccc0 1 MENU_CALL Call Item with fixed Title (multi-lingual)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
36 ; ~--~ tttt tttt ttt1 ~000 cccc cccc ccc1 2 MENU_OPT_INC Option Increment with fixed multi-lingual Title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
37 ; ~--~ tttt tttt ttt1 ~001 cccc cccc ccc1 2 MENU_OPT_INCS as before, but stops at max value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
38 ; ~--~ tttt tttt ttt1 ~011 cccc cccc ccc1 2 MENU_OPT_DECS as before, but decrement (only stop at min avail)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
39 ; ~--~ tttt tttt ttt1 ~100 cccc cccc ccc1 2 MENU_GRP_INC Option Increment for an Option out of an Option Group
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
40 ; ~--~ tttt tttt ttt1 ~101 cccc cccc ccc1 2 MENU_GRP_INCS as before, but stops at max value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
41 ; ~--~ tttt tttt ttt1 ~111 cccc cccc ccc1 2 MENU_GRP_DECS as before, but decrement (only stop at min avail)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
42 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
43 ; t : Address Bits: title_func_addr or title_text_addr | Attention: title_func_addr and
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
44 ; c : Address Bits: item_func_addr or option_addr | item_func_addr must be within 0x0xxxx
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
45 ; - : unused, reads as zero
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
46 ; ~ : unused, reads as one (part of the real program memory address shining through)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
47 ; 0/1: fixed Bit Values making up Menu Item Type Encoding
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
48
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
49
0
heinrichsweikamp
parents:
diff changeset
50
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
51 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
52 ; Open a Dive Mode Menu Block
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
53 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
54 ; nb_items number of menu items that will follow
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
55 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
56 MENU_BEGIN_DIVE MACRO nb_items
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
57
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
58 items_target set nb_items
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
59 items_count set 0
0
heinrichsweikamp
parents:
diff changeset
60
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
61 ; check number of menu items
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
62 IF nb_items <= 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
63 Error "Zero items in menu ", x
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
64 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
65 IF nb_items > MENU_LINES_MAX_DIVE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
66 Error "too many items in menu", x
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
67 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
68
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
69 ; store code for menu execution
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
70 extern menu_processor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
71 call menu_processor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
72
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
73 ; store menu header data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
74 db nb_items, 0x00 ; number of items, encoding for no menu titel
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
75
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
76 ENDM
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
77
0
heinrichsweikamp
parents:
diff changeset
78
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
79 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
80 ; Open a Surface Mode Menu Block with leading empty Item Lines
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
81 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
82 ; title_text_addr address of multi-lingual menu title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
83 ; offset number of empty menu items to start with
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
84 ; nb_items number of active menu items that will follow
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
85 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
86 MENU_BEGIN_OFFSET MACRO title_text_addr, nb_items, offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
87
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
88 items_target set nb_items
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
89 items_count set 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
90
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
91 ; check number of menu items
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
92 IF nb_items <= 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
93 Error "Zero items in menu ", x
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
94 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
95 IFNDEF scrolling_menu_enabled
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
96 IF (nb_items + offset) > MENU_LINES_MAX_SURF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
97 Error "too many items in menu", x
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
98 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
99 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
100
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
101 ; compute vertical start position of 1st menu item
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
102 IF nb_items > MENU_LINES_MAX_SURF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
103 local vertical_start_pos = ( MENU_VCENTER - (MENU_HEIGHT_SURF/2) * MENU_LINES_MAX_SURF )
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
104 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
105 local vertical_start_pos = ( MENU_VCENTER - (MENU_HEIGHT_SURF/2) * nb_items ) + (MENU_HEIGHT_SURF/2 * offset)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
106 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
107
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
108 ; store code for menu execution
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
109 extern title_text_addr ; 2 byte address of multi-lingual title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
110 extern menu_processor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
111 call menu_processor
0
heinrichsweikamp
parents:
diff changeset
112
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
113 ; store menu header data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
114 db nb_items, vertical_start_pos ; number of items, vertical start position 1st item
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
115 db low(title_text_addr), high(title_text_addr) ; address of multi-lingual title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
116
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
117 ENDM
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
118
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
119
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
120
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
121 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
122 ; Open a Surface Mode Menu Block
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
123 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
124 ; title_text_addr address of multi-lingual menu title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
125 ; nb_items number of active menu items that will follow
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
126 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
127 MENU_BEGIN MACRO title_text_addr, nb_items
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
128 MENU_BEGIN_OFFSET title_text_addr, nb_items,0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
129 endm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
130
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
131
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
132 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
133 ; Call Item with dynamic Title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
134 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
135 ; title_func_addr address of the function to generate the line title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
136 ; item_func_addr address of the function to be executed on line selection
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
137 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
138 MENU_DYNAMIC MACRO title_func_addr, item_func_addr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
139
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
140 items_count set items_count+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
141
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
142 ;extern title_func_addr ; 2 byte address of dynamic title function
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
143 ;extern item_func_addr ; 2 byte address of item function
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
144
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
145 local code1 = 0x0000 ; dynamic title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
146 local code2 = 0x0000 ; call function
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
147
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
148 db low(title_func_addr + code1), high(title_func_addr + code1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
149 db low(item_func_addr + code2), high(item_func_addr + code2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
150
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
151 ENDM
0
heinrichsweikamp
parents:
diff changeset
152
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
153
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
154 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
155 ; Call Item with fixed multi-lingual Title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
156 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
157 ; title_text_addr address of multi-lingual item text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
158 ; item_func_addr address of the function to be executed on line selection
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
159 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
160 MENU_CALL MACRO title_text_addr, item_func_addr
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
161
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
162 items_count set items_count+1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
163
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
164 extern title_text_addr ; 2 byte address of multi-lingual title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
165 ;extern item_func_addr ; 2 byte address of item function
0
heinrichsweikamp
parents:
diff changeset
166
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
167 local code1 = 0x0001 ; static multi-lingual title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
168 local code2 = 0x0000 ; call function
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
169
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
170 db low(title_text_addr + code1), high(title_text_addr + code1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
171 db low(item_func_addr + code2), high(item_func_addr + code2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
172
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
173 ENDM
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
174
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
175
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
176 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
177 ; Option Increment Item with fixed multi-lingual Title, wrap-around after max
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
178 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
179 ; title_text_addr address of multi-lingual item text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
180 ; option_addr address of option to be incremented on line selection
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
181 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
182 MENU_OPT_INC MACRO title_text_addr, option_addr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
183
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
184 items_count set items_count+1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
185
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
186 extern title_text_addr ; 2 byte address of multi-lingual title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
187 extern option_addr ; 2 byte address of option definition data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
188
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
189 local code1 = 0x0001 ; static multi-lingual title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
190 local code2 = 0x0001 ; option increment with wrap-around after max
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
191
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
192 db low(title_text_addr + code1), high(title_text_addr + code1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
193 db low(option_addr + code2), high(option_addr + code2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
194
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
195 ENDM
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
196
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
197
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
198 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
199 ; Option Increment Item with fixed multi-lingual Title, stop at max value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
200 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
201 ; title_text_addr address of multi-lingual item text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
202 ; option_addr address of option to be incremented on line selection
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
203 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
204 MENU_OPT_INCS MACRO title_text_addr, option_addr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
205
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
206 items_count set items_count+1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
207
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
208 extern title_text_addr ; 2 byte address of multi-lingual title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
209 extern option_addr ; 2 byte address of option definition data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
210
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
211 local code1 = 0x0001 ; static multi-lingual title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
212 local code2 = 0x1001 ; option increment with stop at max value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
213
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
214 db low(title_text_addr + code1), high(title_text_addr + code1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
215 db low(option_addr + code2), high(option_addr + code2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
216
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
217 ENDM
0
heinrichsweikamp
parents:
diff changeset
218
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
219
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
220 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
221 ; Option Increment Item for an Option out of an Option Group, with fixed multi-lingual Title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
222 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
223 ; title_text_addr address of multi-lingual item text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
224 ; option_addr base address of the option group
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
225 ; gaslist_gas offset of the selected option to be incremented within the group (normal variable)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
226 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
227 MENU_GRP_INC MACRO title_text_addr, option_addr
0
heinrichsweikamp
parents:
diff changeset
228
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
229 items_count set items_count+1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
230
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
231 extern title_text_addr ; 2 byte address of multi-lingual title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
232 extern option_addr ; 2 byte address of option definition data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
233
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
234 local code1 = 0x0001 ; static multi-lingual title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
235 local code2 = 0x4001 ; option increment, group member, wrap-around after max value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
236
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
237 db low(title_text_addr + code1), high(title_text_addr + code1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
238 db low(option_addr + code2), high(option_addr + code2)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
239
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
240 ENDM
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
241
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
242
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
243 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
244 ; Option Increment Item for an Option out of an Option Group, with fixed multi-lingual Title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
245 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
246 ; title_text_addr address of multi-lingual item text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
247 ; option_addr base address of the option group
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
248 ; gaslist_gas offset of the selected option to be incremented within the group (normal variable)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
249 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
250 MENU_GRP_INCS MACRO title_text_addr, option_addr
0
heinrichsweikamp
parents:
diff changeset
251
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
252 items_count set items_count+1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
253
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
254 extern title_text_addr ; 2 byte address of multi-lingual title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
255 extern option_addr ; 2 byte address of option definition data
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
256
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
257 local code1 = 0x0001 ; static multi-lingual title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
258 local code2 = 0x5001 ; option increment, group member, stop at max value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
259
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
260 db low(title_text_addr + code1), high(title_text_addr + code1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
261 db low(option_addr + code2), high(option_addr + code2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
262
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
263 ENDM
0
heinrichsweikamp
parents:
diff changeset
264
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
265
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
266 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
267 ; Option Decrement Item with fixed multi-lingual Title, stop at min value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
268 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
269 ; title_text_addr address of multi-lingual item text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
270 ; option_addr address of option to be incremented on line selection
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
271 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
272 MENU_OPT_DECS MACRO title_text_addr, option_addr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
273
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
274 items_count set items_count+1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
275
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
276 extern title_text_addr ; 2 byte address of multi-lingual title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
277 extern option_addr ; 2 byte address of option definition data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
278
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
279 local code1 = 0x0001 ; static multi-lingual title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
280 local code2 = 0x3001 ; option decrement, stop at min value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
281
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
282 db low(title_text_addr + code1), high(title_text_addr + code1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
283 db low(option_addr + code2), high(option_addr + code2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
284
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
285 ENDM
0
heinrichsweikamp
parents:
diff changeset
286
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
287
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
288 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
289 ; Option Decrement Item for an Option out of an Option Group, with fixed multi-lingual Title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
290 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
291 ; title_text_addr address of multi-lingual item text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
292 ; option_addr base address of the option group
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
293 ; gaslist_gas offset of the selected option to be decremented within the group (normal variable)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
294 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
295 MENU_GRP_DECS MACRO title_text_addr, option_addr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
296
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
297 items_count set items_count+1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
298
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
299 extern title_text_addr ; 2 byte address of multi-lingual title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
300 extern option_addr ; 2 byte address of option definition data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
301
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
302 local code1 = 0x0001 ; static multi-lingual title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
303 local code2 = 0x7001 ; option decrement, group member, stop at min value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
304
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
305 db low(title_text_addr + code1), high(title_text_addr + code1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
306 db low(option_addr + code2), high(option_addr + code2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
307
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
308 ENDM
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
309
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
310
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
311 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
312 ; Close a Menu Block
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
313 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
314 MENU_END MACRO
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
315
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
316 IF items_count != items_target
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
317 Error "menu items count mismatch", x
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
318 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
319
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
320 ENDM
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
321
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
322
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
323 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
324