annotate src/menu_processor.inc @ 643:7d8a4c60ec1a

3.15 release
author heinrichsweikamp
date Mon, 24 May 2021 18:40:53 +0200
parents 4050675965ea
children 75e90cd0c2c3
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 ;
643
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 634
diff changeset
56 MENU_BEGIN_DIVE MACRO title_text_addr, nb_items
634
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
643
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 634
diff changeset
70 extern title_text_addr ; 2 byte address of multi-lingual title text
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
71 extern menu_processor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
72 call menu_processor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
73
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
74 ; store menu header data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
75 db nb_items, 0x00 ; number of items, encoding for no menu titel
643
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 634
diff changeset
76 db low(title_text_addr), high(title_text_addr) ; address of multi-lingual title text
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
77 ENDM
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
78
0
heinrichsweikamp
parents:
diff changeset
79
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
80 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
81 ; Open a Surface Mode Menu Block with leading empty Item Lines
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
82 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
83 ; title_text_addr address of multi-lingual menu title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
84 ; offset number of empty menu items to start with
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
85 ; nb_items number of active menu items that will follow
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
86 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
87 MENU_BEGIN_OFFSET MACRO title_text_addr, nb_items, offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
88
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
89 items_target set nb_items
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
90 items_count set 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
91
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
92 ; check number of menu items
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
93 IF nb_items <= 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
94 Error "Zero items in menu ", x
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
95 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
96 IFNDEF scrolling_menu_enabled
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
97 IF (nb_items + offset) > MENU_LINES_MAX_SURF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
98 Error "too many items in menu", x
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
99 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
100 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
101
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
102 ; compute vertical start position of 1st menu item
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
103 IF nb_items > MENU_LINES_MAX_SURF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
104 local vertical_start_pos = ( MENU_VCENTER - (MENU_HEIGHT_SURF/2) * MENU_LINES_MAX_SURF )
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
105 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
106 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
107 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
108
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
109 ; store code for menu execution
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
110 extern title_text_addr ; 2 byte address of multi-lingual title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
111 extern menu_processor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
112 call menu_processor
0
heinrichsweikamp
parents:
diff changeset
113
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
114 ; store menu header data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
115 db nb_items, vertical_start_pos ; number of items, vertical start position 1st item
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
116 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
117
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
118 ENDM
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 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
123 ; Open a Surface Mode Menu Block
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
124 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
125 ; title_text_addr address of multi-lingual menu title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
126 ; nb_items number of active menu items that will follow
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
127 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
128 MENU_BEGIN MACRO title_text_addr, nb_items
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
129 MENU_BEGIN_OFFSET title_text_addr, nb_items,0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
130 endm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
131
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
132
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
133 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
134 ; Call Item with dynamic Title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
135 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
136 ; title_func_addr address of the function to generate the line title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
137 ; item_func_addr address of the function to be executed on line selection
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
138 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
139 MENU_DYNAMIC MACRO title_func_addr, item_func_addr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
140
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
141 items_count set items_count+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
142
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
143 ;extern title_func_addr ; 2 byte address of dynamic title function
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
144 ;extern item_func_addr ; 2 byte address of item function
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
145
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
146 local code1 = 0x0000 ; dynamic title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
147 local code2 = 0x0000 ; call function
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
148
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
149 db low(title_func_addr + code1), high(title_func_addr + code1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
150 db low(item_func_addr + code2), high(item_func_addr + code2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
151
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
152 ENDM
0
heinrichsweikamp
parents:
diff changeset
153
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
154
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
155 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
156 ; Call Item with fixed multi-lingual Title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
157 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
158 ; title_text_addr address of multi-lingual item text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
159 ; item_func_addr address of the function to be executed on line selection
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
160 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
161 MENU_CALL MACRO title_text_addr, item_func_addr
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
162
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
163 items_count set items_count+1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
164
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
165 extern title_text_addr ; 2 byte address of multi-lingual title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
166 ;extern item_func_addr ; 2 byte address of item function
0
heinrichsweikamp
parents:
diff changeset
167
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
168 local code1 = 0x0001 ; static multi-lingual title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
169 local code2 = 0x0000 ; call function
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
170
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
171 db low(title_text_addr + code1), high(title_text_addr + code1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
172 db low(item_func_addr + code2), high(item_func_addr + code2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
173
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
174 ENDM
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
175
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
176
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
177 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
178 ; Option Increment Item with fixed multi-lingual Title, wrap-around after max
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
179 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
180 ; title_text_addr address of multi-lingual item text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
181 ; option_addr address of option to be incremented on line selection
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
182 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
183 MENU_OPT_INC MACRO title_text_addr, option_addr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
184
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
185 items_count set items_count+1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
186
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
187 extern title_text_addr ; 2 byte address of multi-lingual title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
188 extern option_addr ; 2 byte address of option definition data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
189
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
190 local code1 = 0x0001 ; static multi-lingual title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
191 local code2 = 0x0001 ; option increment with wrap-around after max
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
192
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
193 db low(title_text_addr + code1), high(title_text_addr + code1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
194 db low(option_addr + code2), high(option_addr + code2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
195
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
196 ENDM
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 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
200 ; Option Increment Item with fixed multi-lingual Title, stop at max value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
201 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
202 ; title_text_addr address of multi-lingual item text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
203 ; option_addr address of option to be incremented on line selection
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
204 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
205 MENU_OPT_INCS MACRO title_text_addr, option_addr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
206
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
207 items_count set items_count+1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
208
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
209 extern title_text_addr ; 2 byte address of multi-lingual title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
210 extern option_addr ; 2 byte address of option definition data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
211
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
212 local code1 = 0x0001 ; static multi-lingual title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
213 local code2 = 0x1001 ; option increment with stop at max value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
214
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
215 db low(title_text_addr + code1), high(title_text_addr + code1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
216 db low(option_addr + code2), high(option_addr + code2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
217
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
218 ENDM
0
heinrichsweikamp
parents:
diff changeset
219
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
220
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
221 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
222 ; 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
223 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
224 ; title_text_addr address of multi-lingual item text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
225 ; option_addr base address of the option group
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
226 ; 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
227 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
228 MENU_GRP_INC MACRO title_text_addr, option_addr
0
heinrichsweikamp
parents:
diff changeset
229
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
230 items_count set items_count+1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
231
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
232 extern title_text_addr ; 2 byte address of multi-lingual title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
233 extern option_addr ; 2 byte address of option definition data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
234
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
235 local code1 = 0x0001 ; static multi-lingual title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
236 local code2 = 0x4001 ; option increment, group member, wrap-around after max value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
237
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
238 db low(title_text_addr + code1), high(title_text_addr + code1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
239 db low(option_addr + code2), high(option_addr + code2)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
240
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
241 ENDM
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 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
245 ; 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
246 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
247 ; title_text_addr address of multi-lingual item text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
248 ; option_addr base address of the option group
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
249 ; 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
250 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
251 MENU_GRP_INCS MACRO title_text_addr, option_addr
0
heinrichsweikamp
parents:
diff changeset
252
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
253 items_count set items_count+1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
254
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
255 extern title_text_addr ; 2 byte address of multi-lingual title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
256 extern option_addr ; 2 byte address of option definition data
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
257
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
258 local code1 = 0x0001 ; static multi-lingual title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
259 local code2 = 0x5001 ; option increment, group member, stop at max value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
260
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
261 db low(title_text_addr + code1), high(title_text_addr + code1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
262 db low(option_addr + code2), high(option_addr + code2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
263
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
264 ENDM
0
heinrichsweikamp
parents:
diff changeset
265
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
266
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
267 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
268 ; Option Decrement Item with fixed multi-lingual Title, stop at min value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
269 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
270 ; title_text_addr address of multi-lingual item text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
271 ; option_addr address of option to be incremented on line selection
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
272 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
273 MENU_OPT_DECS MACRO title_text_addr, option_addr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
274
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
275 items_count set items_count+1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
276
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
277 extern title_text_addr ; 2 byte address of multi-lingual title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
278 extern option_addr ; 2 byte address of option definition data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
279
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
280 local code1 = 0x0001 ; static multi-lingual title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
281 local code2 = 0x3001 ; option decrement, stop at min value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
282
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
283 db low(title_text_addr + code1), high(title_text_addr + code1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
284 db low(option_addr + code2), high(option_addr + code2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
285
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
286 ENDM
0
heinrichsweikamp
parents:
diff changeset
287
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
288
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
289 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
290 ; 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
291 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
292 ; title_text_addr address of multi-lingual item text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
293 ; option_addr base address of the option group
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
294 ; 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
295 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
296 MENU_GRP_DECS MACRO title_text_addr, option_addr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
297
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
298 items_count set items_count+1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
299
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
300 extern title_text_addr ; 2 byte address of multi-lingual title text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
301 extern option_addr ; 2 byte address of option definition data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
302
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
303 local code1 = 0x0001 ; static multi-lingual title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
304 local code2 = 0x7001 ; option decrement, group member, stop at min value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
305
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
306 db low(title_text_addr + code1), high(title_text_addr + code1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
307 db low(option_addr + code2), high(option_addr + code2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
308
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
309 ENDM
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 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
313 ; Close a Menu Block
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
314 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 275
diff changeset
315 MENU_END MACRO
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
316
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
317 IF items_count != items_target
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
318 Error "menu items count mismatch", x
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
319 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
320
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
321 ENDM
634
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 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 623
diff changeset
325