1 | ; File name : ConfigurationMenu.asm
|
---|
2 | ; Project name : XTIDE Univeral BIOS Configurator
|
---|
3 | ; Created date : 21.4.2010
|
---|
4 | ; Last update : 2.5.2010
|
---|
5 | ; Author : Tomi Tilli
|
---|
6 | ; Description : XTIDE Universal BIOS configuration menu.
|
---|
7 |
|
---|
8 | ; Section containing initialized data
|
---|
9 | SECTION .data
|
---|
10 |
|
---|
11 | ; -Back to previous menu
|
---|
12 | ; +Primary IDE
|
---|
13 | ; ...
|
---|
14 | ; +Last IDE
|
---|
15 | ; +Boot Menu settings
|
---|
16 | ; Boot loader type (None, Simple, Menu)
|
---|
17 | ; Late Initialization (N)
|
---|
18 | ; Maximize Disk Size (Y)
|
---|
19 | ; Full Operating Mode (Y)
|
---|
20 | ; KiB to steal from base RAM (1)
|
---|
21 | ; Number of IDE controllers (5)
|
---|
22 |
|
---|
23 | ALIGN WORD_ALIGN
|
---|
24 | g_MenuPageCfg:
|
---|
25 | istruc MENUPAGE
|
---|
26 | at MENUPAGE.bItemCnt, db 13
|
---|
27 | iend
|
---|
28 | istruc MENUPAGEITEM ; Back to previous menu
|
---|
29 | at MENUPAGEITEM.fnActivate, dw MainPageItem_ActivateLeaveSubmenu
|
---|
30 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
|
---|
31 | at MENUPAGEITEM.szName, dw g_szPreviousMenu
|
---|
32 | at MENUPAGEITEM.szInfo, dw g_szNfoCfgBack
|
---|
33 | at MENUPAGEITEM.szHelp, dw g_szNfoCfgBack
|
---|
34 | at MENUPAGEITEM.bFlags, db FLG_MENUPAGEITEM_VISIBLE
|
---|
35 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_BACK
|
---|
36 | iend
|
---|
37 | g_MenuPageItemCfgIde1:
|
---|
38 | istruc MENUPAGEITEM ; Primary IDE
|
---|
39 | at MENUPAGEITEM.fnActivate, dw ConfigurationMenu_ActivateIdeController
|
---|
40 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
|
---|
41 | at MENUPAGEITEM.pValue, dw g_cfgVars+CFGVARS.rgbEepromBuffers+ROMVARS.ideVars0
|
---|
42 | at MENUPAGEITEM.pSubMenuPage, dw g_MenuPageIdeVars
|
---|
43 | at MENUPAGEITEM.szName, dw g_szItemCfgIde1
|
---|
44 | at MENUPAGEITEM.szInfo, dw g_szNfoCfgIde
|
---|
45 | at MENUPAGEITEM.szHelp, dw g_szNfoCfgIde
|
---|
46 | at MENUPAGEITEM.bFlags, db FLG_MENUPAGEITEM_VISIBLE
|
---|
47 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_NEXT
|
---|
48 | iend
|
---|
49 | g_MenuPageItemCfgIde2:
|
---|
50 | istruc MENUPAGEITEM
|
---|
51 | at MENUPAGEITEM.fnActivate, dw ConfigurationMenu_ActivateIdeController
|
---|
52 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
|
---|
53 | at MENUPAGEITEM.pValue, dw g_cfgVars+CFGVARS.rgbEepromBuffers+ROMVARS.ideVars1
|
---|
54 | at MENUPAGEITEM.pSubMenuPage, dw g_MenuPageIdeVars
|
---|
55 | at MENUPAGEITEM.szName, dw g_szItemCfgIde2
|
---|
56 | at MENUPAGEITEM.szInfo, dw g_szNfoCfgIde
|
---|
57 | at MENUPAGEITEM.szHelp, dw g_szNfoCfgIde
|
---|
58 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_NEXT
|
---|
59 | iend
|
---|
60 | g_MenuPageItemCfgIde3:
|
---|
61 | istruc MENUPAGEITEM
|
---|
62 | at MENUPAGEITEM.fnActivate, dw ConfigurationMenu_ActivateIdeController
|
---|
63 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
|
---|
64 | at MENUPAGEITEM.pValue, dw g_cfgVars+CFGVARS.rgbEepromBuffers+ROMVARS.ideVars2
|
---|
65 | at MENUPAGEITEM.pSubMenuPage, dw g_MenuPageIdeVars
|
---|
66 | at MENUPAGEITEM.szName, dw g_szItemCfgIde3
|
---|
67 | at MENUPAGEITEM.szInfo, dw g_szNfoCfgIde
|
---|
68 | at MENUPAGEITEM.szHelp, dw g_szNfoCfgIde
|
---|
69 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_NEXT
|
---|
70 | iend
|
---|
71 | g_MenuPageItemCfgIde4:
|
---|
72 | istruc MENUPAGEITEM
|
---|
73 | at MENUPAGEITEM.fnActivate, dw ConfigurationMenu_ActivateIdeController
|
---|
74 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
|
---|
75 | at MENUPAGEITEM.pValue, dw g_cfgVars+CFGVARS.rgbEepromBuffers+ROMVARS.ideVars3
|
---|
76 | at MENUPAGEITEM.pSubMenuPage, dw g_MenuPageIdeVars
|
---|
77 | at MENUPAGEITEM.szName, dw g_szItemCfgIde4
|
---|
78 | at MENUPAGEITEM.szInfo, dw g_szNfoCfgIde
|
---|
79 | at MENUPAGEITEM.szHelp, dw g_szNfoCfgIde
|
---|
80 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_NEXT
|
---|
81 | iend
|
---|
82 | g_MenuPageItemCfgIde5:
|
---|
83 | istruc MENUPAGEITEM
|
---|
84 | at MENUPAGEITEM.fnActivate, dw ConfigurationMenu_ActivateIdeController
|
---|
85 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
|
---|
86 | at MENUPAGEITEM.pValue, dw g_cfgVars+CFGVARS.rgbEepromBuffers+ROMVARS.ideVars4
|
---|
87 | at MENUPAGEITEM.pSubMenuPage, dw g_MenuPageIdeVars
|
---|
88 | at MENUPAGEITEM.szName, dw g_szItemCfgIde5
|
---|
89 | at MENUPAGEITEM.szInfo, dw g_szNfoCfgIde
|
---|
90 | at MENUPAGEITEM.szHelp, dw g_szNfoCfgIde
|
---|
91 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_NEXT
|
---|
92 | iend
|
---|
93 | g_MenuPageItemCfgBootMenu:
|
---|
94 | istruc MENUPAGEITEM ; Boot menu settings
|
---|
95 | at MENUPAGEITEM.fnActivate, dw MainPageItem_ActivateSubmenu
|
---|
96 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
|
---|
97 | at MENUPAGEITEM.pSubMenuPage, dw g_MenuPageBootMenu
|
---|
98 | at MENUPAGEITEM.szName, dw g_szItemCfgBootMenu
|
---|
99 | at MENUPAGEITEM.szInfo, dw g_szNfoCfgBootMenu
|
---|
100 | at MENUPAGEITEM.szHelp, dw g_szNfoCfgBootMenu
|
---|
101 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_NEXT
|
---|
102 | iend
|
---|
103 | istruc MENUPAGEITEM ; Boot Loader type
|
---|
104 | at MENUPAGEITEM.fnActivate, dw ConfigurationMenu_ActivateBootLoaderType
|
---|
105 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_LookupString
|
---|
106 | at MENUPAGEITEM.pValue, dw g_cfgVars+CFGVARS.rgbEepromBuffers+ROMVARS.bBootLdrType
|
---|
107 | at MENUPAGEITEM.pSubMenuPage, dw g_MenuPageBootLoaderType
|
---|
108 | at MENUPAGEITEM.rgszLookup, dw g_rgszBootLoaderValueToString
|
---|
109 | at MENUPAGEITEM.szName, dw g_szItemCfgBootLoader
|
---|
110 | at MENUPAGEITEM.szInfo, dw g_szNfoCfgBootLoader
|
---|
111 | at MENUPAGEITEM.szHelp, dw g_szNfoCfgBootLoader
|
---|
112 | at MENUPAGEITEM.bFlags, db FLG_MENUPAGEITEM_VISIBLE
|
---|
113 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_NEXT
|
---|
114 | iend
|
---|
115 | istruc MENUPAGEITEM ; Late initialization
|
---|
116 | at MENUPAGEITEM.fnActivate, dw MenuPageItem_GetBoolFromUser
|
---|
117 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
|
---|
118 | at MENUPAGEITEM.pValue, dw g_cfgVars+CFGVARS.rgbEepromBuffers+ROMVARS.wFlags
|
---|
119 | at MENUPAGEITEM.wValueMask, dw FLG_ROMVARS_LATE
|
---|
120 | at MENUPAGEITEM.szName, dw g_szItemCfgLateInit
|
---|
121 | at MENUPAGEITEM.szInfo, dw g_szNfoCfgLateInit
|
---|
122 | at MENUPAGEITEM.szHelp, dw g_szHelpCfgLateInit
|
---|
123 | at MENUPAGEITEM.szDialog, dw g_szDlgCfgLateInit
|
---|
124 | at MENUPAGEITEM.bFlags, db FLG_MENUPAGEITEM_VISIBLE
|
---|
125 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_FLAG
|
---|
126 | iend
|
---|
127 | istruc MENUPAGEITEM ; Maximize disk size
|
---|
128 | at MENUPAGEITEM.fnActivate, dw MenuPageItem_GetBoolFromUser
|
---|
129 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
|
---|
130 | at MENUPAGEITEM.pValue, dw g_cfgVars+CFGVARS.rgbEepromBuffers+ROMVARS.wFlags
|
---|
131 | at MENUPAGEITEM.wValueMask, dw FLG_ROMVARS_MAXSIZE
|
---|
132 | at MENUPAGEITEM.szName, dw g_szItemCfgMaxSize
|
---|
133 | at MENUPAGEITEM.szInfo, dw g_szNfoCfgMaxSize
|
---|
134 | at MENUPAGEITEM.szHelp, dw g_szHelpCfgMaxSize
|
---|
135 | at MENUPAGEITEM.szDialog, dw g_szDlgCfgMaxSize
|
---|
136 | at MENUPAGEITEM.bFlags, db FLG_MENUPAGEITEM_VISIBLE
|
---|
137 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_FLAG
|
---|
138 | iend
|
---|
139 | istruc MENUPAGEITEM ; Full operating mode
|
---|
140 | at MENUPAGEITEM.fnActivate, dw ConfigurationMenu_ActivateFullMode
|
---|
141 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
|
---|
142 | at MENUPAGEITEM.pValue, dw g_cfgVars+CFGVARS.rgbEepromBuffers+ROMVARS.wFlags
|
---|
143 | at MENUPAGEITEM.wValueMask, dw FLG_ROMVARS_FULLMODE
|
---|
144 | at MENUPAGEITEM.szName, dw g_szItemCfgFullMode
|
---|
145 | at MENUPAGEITEM.szInfo, dw g_szNfoCfgFullMode
|
---|
146 | at MENUPAGEITEM.szHelp, dw g_szHelpCfgFullMode
|
---|
147 | at MENUPAGEITEM.szDialog, dw g_szDlgCfgFullMode
|
---|
148 | at MENUPAGEITEM.bFlags, db FLG_MENUPAGEITEM_VISIBLE
|
---|
149 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_FLAG
|
---|
150 | iend
|
---|
151 | g_MenuPageItemCfgStealRam:
|
---|
152 | istruc MENUPAGEITEM ; kiB to steal from base RAM
|
---|
153 | at MENUPAGEITEM.fnActivate, dw MenuPageItem_GetByteFromUser
|
---|
154 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
|
---|
155 | at MENUPAGEITEM.pValue, dw g_cfgVars+CFGVARS.rgbEepromBuffers+ROMVARS.bStealSize
|
---|
156 | at MENUPAGEITEM.wValueMin, dw 1
|
---|
157 | at MENUPAGEITEM.wValueMax, dw 255
|
---|
158 | at MENUPAGEITEM.szName, dw g_szItemCfgStealSize
|
---|
159 | at MENUPAGEITEM.szInfo, dw g_szNfoCfgStealSize
|
---|
160 | at MENUPAGEITEM.szHelp, dw g_szHelpCfgStealSize
|
---|
161 | at MENUPAGEITEM.szDialog, dw g_szDlgCfgStealSize
|
---|
162 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_UNSIGNED_BYTE
|
---|
163 | iend
|
---|
164 | g_MenuPageItemCfgIdeCnt:
|
---|
165 | istruc MENUPAGEITEM ; Number of IDE controllers
|
---|
166 | at MENUPAGEITEM.fnActivate, dw ConfigurationMenu_ActivateControllerCount
|
---|
167 | at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
|
---|
168 | at MENUPAGEITEM.pValue, dw g_cfgVars+CFGVARS.rgbEepromBuffers+ROMVARS.bIdeCnt
|
---|
169 | at MENUPAGEITEM.wValueMin, dw 1
|
---|
170 | at MENUPAGEITEM.wValueMax, dw 5
|
---|
171 | at MENUPAGEITEM.szName, dw g_szItemCfgIdeCnt
|
---|
172 | at MENUPAGEITEM.szInfo, dw g_szNfoCfgIdeCnt
|
---|
173 | at MENUPAGEITEM.szHelp, dw g_szNfoCfgIdeCnt
|
---|
174 | at MENUPAGEITEM.szDialog, dw g_szDlgCfgIdeCnt
|
---|
175 | at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_UNSIGNED_BYTE
|
---|
176 | iend
|
---|
177 |
|
---|
178 |
|
---|
179 | ; Section containing code
|
---|
180 | SECTION .text
|
---|
181 |
|
---|
182 | ;--------------------------------------------------------------------
|
---|
183 | ; ConfigurationMenu_ActivateIdeController
|
---|
184 | ; Parameters:
|
---|
185 | ; DS:SI Ptr to MENUPAGE
|
---|
186 | ; DS:DI Ptr to MENUPAGEITEM
|
---|
187 | ; SS:BP: Ptr to MENUVARS
|
---|
188 | ; Returns:
|
---|
189 | ; CF: Set if menuitem changed
|
---|
190 | ; Cleared if no changes
|
---|
191 | ; Corrupts registers:
|
---|
192 | ; AX, BX, CX, DX
|
---|
193 | ;--------------------------------------------------------------------
|
---|
194 | ALIGN JUMP_ALIGN
|
---|
195 | ConfigurationMenu_ActivateIdeController:
|
---|
196 | mov ax, [di+MENUPAGEITEM.pValue] ; AX=Offset to IDEVARS
|
---|
197 | call IdeControllerMenu_SetIdevarsOffset
|
---|
198 | call IdeControllerMenu_SetMenuitemVisibility
|
---|
199 | jmp MainPageItem_ActivateSubmenu
|
---|
200 |
|
---|
201 |
|
---|
202 | ;--------------------------------------------------------------------
|
---|
203 | ; ConfigurationMenu_ActivateFullMode
|
---|
204 | ; Parameters:
|
---|
205 | ; DS:SI Ptr to MENUPAGE
|
---|
206 | ; DS:DI Ptr to MENUPAGEITEM
|
---|
207 | ; SS:BP: Ptr to MENUVARS
|
---|
208 | ; Returns:
|
---|
209 | ; CF: Set if menuitem changed
|
---|
210 | ; Cleared if no changes
|
---|
211 | ; Corrupts registers:
|
---|
212 | ; AX, BX, CX, DX
|
---|
213 | ;--------------------------------------------------------------------
|
---|
214 | ALIGN JUMP_ALIGN
|
---|
215 | ConfigurationMenu_ActivateFullMode:
|
---|
216 | call MenuPageItem_GetBoolFromUser
|
---|
217 | jc SHORT ConfigurationMenu_SetMenuitemVisibilityAndDrawChanges
|
---|
218 | ret
|
---|
219 |
|
---|
220 |
|
---|
221 | ;--------------------------------------------------------------------
|
---|
222 | ; ConfigurationMenu_ActivateControllerCount
|
---|
223 | ; Parameters:
|
---|
224 | ; DS:SI Ptr to MENUPAGE
|
---|
225 | ; DS:DI Ptr to MENUPAGEITEM
|
---|
226 | ; SS:BP: Ptr to MENUVARS
|
---|
227 | ; Returns:
|
---|
228 | ; CF: Set if user data inputted succesfully
|
---|
229 | ; Cleared if cancel
|
---|
230 | ; Corrupts registers:
|
---|
231 | ; AX, BX, CX, DX
|
---|
232 | ;--------------------------------------------------------------------
|
---|
233 | ALIGN JUMP_ALIGN
|
---|
234 | ConfigurationMenu_ActivateControllerCount:
|
---|
235 | call MenuPageItem_GetByteFromUser
|
---|
236 | jc SHORT ConfigurationMenu_SetMenuitemVisibilityAndDrawChanges
|
---|
237 | ret
|
---|
238 |
|
---|
239 |
|
---|
240 | ;--------------------------------------------------------------------
|
---|
241 | ; ConfigurationMenu_ActivateBootLoaderType
|
---|
242 | ; Parameters:
|
---|
243 | ; DS:SI Ptr to MENUPAGE
|
---|
244 | ; DS:DI Ptr to MENUPAGEITEM
|
---|
245 | ; SS:BP: Ptr to MENUVARS
|
---|
246 | ; Returns:
|
---|
247 | ; CF: Set if user data inputted succesfully
|
---|
248 | ; Cleared if cancel
|
---|
249 | ; Corrupts registers:
|
---|
250 | ; AX, BX, CX, DX
|
---|
251 | ;--------------------------------------------------------------------
|
---|
252 | ALIGN JUMP_ALIGN
|
---|
253 | ConfigurationMenu_ActivateBootLoaderType:
|
---|
254 | call MainPageItem_ActivateSubmenuForGettingLookupValue
|
---|
255 | jc SHORT ConfigurationMenu_SetMenuitemVisibilityAndDrawChanges
|
---|
256 | ret
|
---|
257 |
|
---|
258 |
|
---|
259 | ;--------------------------------------------------------------------
|
---|
260 | ; ConfigurationMenu_SetMenuitemVisibilityAndDrawChanges
|
---|
261 | ; Parameters:
|
---|
262 | ; DS:SI: Ptr to MENUPAGE
|
---|
263 | ; SS:BP: Ptr to MENUVARS
|
---|
264 | ; Returns:
|
---|
265 | ; CF: Cleared since no need to draw changes
|
---|
266 | ; Corrupts registers:
|
---|
267 | ; AX, BX, CX, DX
|
---|
268 | ;--------------------------------------------------------------------
|
---|
269 | ALIGN JUMP_ALIGN
|
---|
270 | ConfigurationMenu_SetMenuitemVisibilityAndDrawChanges:
|
---|
271 | call ConfigurationMenu_SetMenuitemVisibility
|
---|
272 | call MenuPage_InvalidateItemCount
|
---|
273 | clc ; No need to redraw Full Mode menuitem
|
---|
274 | ret
|
---|
275 |
|
---|
276 |
|
---|
277 | ;--------------------------------------------------------------------
|
---|
278 | ; Enables or disables menuitems based on current configuration.
|
---|
279 | ;
|
---|
280 | ; ConfigurationMenu_SetMenuitemVisibility
|
---|
281 | ; Parameters:
|
---|
282 | ; DS: CS
|
---|
283 | ; Returns:
|
---|
284 | ; Nothing
|
---|
285 | ; Corrupts registers:
|
---|
286 | ; BX, CX
|
---|
287 | ;--------------------------------------------------------------------
|
---|
288 | ALIGN JUMP_ALIGN
|
---|
289 | ConfigurationMenu_SetMenuitemVisibility:
|
---|
290 | call ConfigurationMenu_SetBootMenuVisibility
|
---|
291 | call ConfigurationMenu_SetFullModeVisibility
|
---|
292 | jmp SHORT ConfigurationMenu_SetControllerCountVisibility
|
---|
293 |
|
---|
294 | ALIGN JUMP_ALIGN
|
---|
295 | ConfigurationMenu_SetBootMenuVisibility:
|
---|
296 | cmp BYTE [g_cfgVars+CFGVARS.rgbEepromBuffers+ROMVARS.bBootLdrType], BOOTLOADER_TYPE_MENU
|
---|
297 | jne SHORT .DisableBootMenuSettings
|
---|
298 | or BYTE [g_MenuPageItemCfgBootMenu+MENUPAGEITEM.bFlags], FLG_MENUPAGEITEM_VISIBLE
|
---|
299 | ret
|
---|
300 | ALIGN JUMP_ALIGN
|
---|
301 | .DisableBootMenuSettings:
|
---|
302 | and BYTE [g_MenuPageItemCfgBootMenu+MENUPAGEITEM.bFlags], ~FLG_MENUPAGEITEM_VISIBLE
|
---|
303 | ret
|
---|
304 |
|
---|
305 | ALIGN JUMP_ALIGN
|
---|
306 | ConfigurationMenu_SetFullModeVisibility:
|
---|
307 | test WORD [g_cfgVars+CFGVARS.rgbEepromBuffers+ROMVARS.wFlags], FLG_ROMVARS_FULLMODE
|
---|
308 | jz SHORT .DisableFullModeMenuitems
|
---|
309 | or BYTE [g_MenuPageItemCfgStealRam+MENUPAGEITEM.bFlags], FLG_MENUPAGEITEM_VISIBLE
|
---|
310 | or BYTE [g_MenuPageItemCfgIdeCnt+MENUPAGEITEM.bFlags], FLG_MENUPAGEITEM_VISIBLE
|
---|
311 | ret
|
---|
312 | ALIGN JUMP_ALIGN
|
---|
313 | .DisableFullModeMenuitems:
|
---|
314 | and BYTE [g_MenuPageItemCfgStealRam+MENUPAGEITEM.bFlags], ~FLG_MENUPAGEITEM_VISIBLE
|
---|
315 | and BYTE [g_MenuPageItemCfgIdeCnt+MENUPAGEITEM.bFlags], ~FLG_MENUPAGEITEM_VISIBLE
|
---|
316 | ret
|
---|
317 |
|
---|
318 | ALIGN JUMP_ALIGN
|
---|
319 | ConfigurationMenu_SetControllerCountVisibility:
|
---|
320 | call ConfigurationMenu_HideAdditionalIdeControllers
|
---|
321 | jmp SHORT ConfigurationMenu_ShowAdditionalIdeControllers
|
---|
322 |
|
---|
323 | ;--------------------------------------------------------------------
|
---|
324 | ; Hides all additional (not primary) IDE controller menuitems.
|
---|
325 | ;
|
---|
326 | ; ConfigurationMenu_HideAdditionalIdeControllers
|
---|
327 | ; Parameters:
|
---|
328 | ; DS: CS
|
---|
329 | ; Returns:
|
---|
330 | ; Nothing
|
---|
331 | ; Corrupts registers:
|
---|
332 | ; BX, CX
|
---|
333 | ;--------------------------------------------------------------------
|
---|
334 | ALIGN JUMP_ALIGN
|
---|
335 | ConfigurationMenu_HideAdditionalIdeControllers:
|
---|
336 | mov bx, g_MenuPageItemCfgIde2+MENUPAGEITEM.bFlags
|
---|
337 | mov cx, CNT_MAX_CTRLS-1
|
---|
338 | ALIGN JUMP_ALIGN
|
---|
339 | .FlagLoop:
|
---|
340 | and BYTE [bx], ~FLG_MENUPAGEITEM_VISIBLE
|
---|
341 | add bx, MENUPAGEITEM_size
|
---|
342 | loop .FlagLoop
|
---|
343 | ret
|
---|
344 |
|
---|
345 | ;--------------------------------------------------------------------
|
---|
346 | ; Sets all additional (after primary) IDE controller menuitems visible.
|
---|
347 | ;
|
---|
348 | ; ConfigurationMenu_ShowAdditionalIdeControllers
|
---|
349 | ; Parameters:
|
---|
350 | ; DS: CS
|
---|
351 | ; Returns:
|
---|
352 | ; Nothing
|
---|
353 | ; Corrupts registers:
|
---|
354 | ; BX, CX
|
---|
355 | ;--------------------------------------------------------------------
|
---|
356 | ALIGN JUMP_ALIGN
|
---|
357 | ConfigurationMenu_ShowAdditionalIdeControllers:
|
---|
358 | call ConfigurationMenu_GetNumberOfIdeControllers
|
---|
359 | dec cx ; First always visible
|
---|
360 | jcxz .Return
|
---|
361 | mov bx, g_MenuPageItemCfgIde2+MENUPAGEITEM.bFlags
|
---|
362 | ALIGN JUMP_ALIGN
|
---|
363 | .FlagLoop:
|
---|
364 | or BYTE [bx], FLG_MENUPAGEITEM_VISIBLE
|
---|
365 | add bx, MENUPAGEITEM_size
|
---|
366 | loop .FlagLoop
|
---|
367 | .Return:
|
---|
368 | ret
|
---|
369 |
|
---|
370 | ;--------------------------------------------------------------------
|
---|
371 | ; Returns number of IDE controllers to set visible.
|
---|
372 | ;
|
---|
373 | ; ConfigurationMenu_GetNumberOfIdeControllers
|
---|
374 | ; Parameters:
|
---|
375 | ; DS: CS
|
---|
376 | ; Returns:
|
---|
377 | ; CX: Number of selected IDE controllers
|
---|
378 | ; Corrupts registers:
|
---|
379 | ; Nothing
|
---|
380 | ;--------------------------------------------------------------------
|
---|
381 | ALIGN JUMP_ALIGN
|
---|
382 | ConfigurationMenu_GetNumberOfIdeControllers:
|
---|
383 | test WORD [g_cfgVars+CFGVARS.rgbEepromBuffers+ROMVARS.wFlags], FLG_ROMVARS_FULLMODE
|
---|
384 | jz SHORT .ReturnOneControllerForLiteMode
|
---|
385 | eMOVZX cx, BYTE [g_cfgVars+CFGVARS.rgbEepromBuffers+ROMVARS.bIdeCnt]
|
---|
386 | ret
|
---|
387 | ALIGN JUMP_ALIGN
|
---|
388 | .ReturnOneControllerForLiteMode:
|
---|
389 | mov cx, 1
|
---|
390 | ret
|
---|