1 | ; Project name : XTIDE Universal BIOS Configurator v2
|
---|
2 | ; Description : "Boot Menu Settings" menu structs and functions.
|
---|
3 |
|
---|
4 | ;
|
---|
5 | ; XTIDE Universal BIOS and Associated Tools
|
---|
6 | ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
|
---|
7 | ;
|
---|
8 | ; This program is free software; you can redistribute it and/or modify
|
---|
9 | ; it under the terms of the GNU General Public License as published by
|
---|
10 | ; the Free Software Foundation; either version 2 of the License, or
|
---|
11 | ; (at your option) any later version.
|
---|
12 | ;
|
---|
13 | ; This program is distributed in the hope that it will be useful,
|
---|
14 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
15 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
16 | ; GNU General Public License for more details.
|
---|
17 | ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
---|
18 | ;
|
---|
19 |
|
---|
20 | ; Section containing initialized data
|
---|
21 | SECTION .data
|
---|
22 |
|
---|
23 | ALIGN WORD_ALIGN
|
---|
24 | g_MenupageForBootMenuSettingsMenu:
|
---|
25 | istruc MENUPAGE
|
---|
26 | at MENUPAGE.fnEnter, dw BootMenuSettingsMenu_EnterMenuOrModifyItemVisibility
|
---|
27 | at MENUPAGE.fnBack, dw ConfigurationMenu_EnterMenuOrModifyItemVisibility
|
---|
28 | at MENUPAGE.wMenuitems, dw 8
|
---|
29 | iend
|
---|
30 |
|
---|
31 | g_MenuitemBootMnuStngsBackToConfigurationMenu:
|
---|
32 | istruc MENUITEM
|
---|
33 | at MENUITEM.fnActivate, dw ConfigurationMenu_EnterMenuOrModifyItemVisibility
|
---|
34 | at MENUITEM.szName, dw g_szItemBackToCfgMenu
|
---|
35 | at MENUITEM.szQuickInfo, dw g_szNfoIdeBackToCfgMenu
|
---|
36 | at MENUITEM.szHelp, dw g_szNfoIdeBackToCfgMenu
|
---|
37 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE
|
---|
38 | at MENUITEM.bType, db TYPE_MENUITEM_PAGEBACK
|
---|
39 | iend
|
---|
40 |
|
---|
41 | g_MenuitemBootMnuStngsDisplayMode:
|
---|
42 | istruc MENUITEM
|
---|
43 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
|
---|
44 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromUnshiftedItemInDSSI
|
---|
45 | at MENUITEM.szName, dw g_szItemBootDispMode
|
---|
46 | at MENUITEM.szQuickInfo, dw g_szNfoDispMode
|
---|
47 | at MENUITEM.szHelp, dw g_szNfoDispMode
|
---|
48 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE
|
---|
49 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE
|
---|
50 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw ROMVARS.wDisplayMode
|
---|
51 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgBootDispMode
|
---|
52 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szMultichoiceBootDispMode
|
---|
53 | at MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup, dw g_rgwChoiceToValueLookupForDisplayModes
|
---|
54 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForDisplayModes
|
---|
55 | iend
|
---|
56 |
|
---|
57 | g_MenuitemBootMnuStngsFloppyDrives:
|
---|
58 | istruc MENUITEM
|
---|
59 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
|
---|
60 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromUnshiftedItemInDSSI
|
---|
61 | at MENUITEM.szName, dw g_szItemBootFloppyDrvs
|
---|
62 | at MENUITEM.szQuickInfo, dw g_szNfoBootFloppyDrvs
|
---|
63 | at MENUITEM.szHelp, dw g_szHelpBootFloppyDrvs
|
---|
64 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE | FLG_MENUITEM_BYTEVALUE
|
---|
65 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE
|
---|
66 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw ROMVARS.bMinFddCnt
|
---|
67 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgBootFloppyDrvs
|
---|
68 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szMultichoiceBootFloppyDrvs
|
---|
69 | at MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup, dw NULL
|
---|
70 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForFloppyDrives
|
---|
71 | iend
|
---|
72 |
|
---|
73 | g_MenuitemBootMenuSerialScanDetect:
|
---|
74 | istruc MENUITEM
|
---|
75 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
|
---|
76 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
|
---|
77 | at MENUITEM.szName, dw g_szItemSerialDetect
|
---|
78 | at MENUITEM.szQuickInfo, dw g_szNfoSerialDetect
|
---|
79 | at MENUITEM.szHelp, dw g_szHelpSerialDetect
|
---|
80 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE | FLG_MENUITEM_FLAGVALUE
|
---|
81 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE
|
---|
82 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw ROMVARS.wFlags
|
---|
83 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgSerialDetect
|
---|
84 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szMultichoiceBooleanFlag
|
---|
85 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForFlagBooleans
|
---|
86 | at MENUITEM.itemValue + ITEM_VALUE.wValueBitmask, dw FLG_ROMVARS_SERIAL_SCANDETECT
|
---|
87 | iend
|
---|
88 |
|
---|
89 | g_MenuitemBootMnuStngsEnableBootMenu:
|
---|
90 | istruc MENUITEM
|
---|
91 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
|
---|
92 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
|
---|
93 | at MENUITEM.szName, dw g_szItemBootEnableMenu
|
---|
94 | at MENUITEM.szQuickInfo, dw g_szNfoBootEnableMenu
|
---|
95 | at MENUITEM.szHelp, dw g_szNfoBootEnableMenu
|
---|
96 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE | FLG_MENUITEM_MODIFY_MENU
|
---|
97 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE
|
---|
98 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw ROMVARS.wfDisplayBootMenu
|
---|
99 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgBootEnableMenu
|
---|
100 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szMultichoiceBooleanFlag
|
---|
101 | at MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup, dw g_rgwChoiceToValueLookupForEnableBootMenu
|
---|
102 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForFlagBooleans
|
---|
103 | at MENUITEM.itemValue + ITEM_VALUE.fnValueReader, dw ValueReaderForEnableBootMenu
|
---|
104 | iend
|
---|
105 |
|
---|
106 | g_MenuitemBootMnuStngsDefaultBootDrive:
|
---|
107 | istruc MENUITEM
|
---|
108 | at MENUITEM.fnActivate, dw Menuitem_ActivateHexInputForMenuitemInDSSI
|
---|
109 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteHexValueStringToBufferInESDIfromItemInDSSI
|
---|
110 | at MENUITEM.szName, dw g_szItemBootDrive
|
---|
111 | at MENUITEM.szQuickInfo, dw g_szNfoBootDrive
|
---|
112 | at MENUITEM.szHelp, dw g_szHelpBootDrive
|
---|
113 | at MENUITEM.bFlags, db FLG_MENUITEM_BYTEVALUE
|
---|
114 | at MENUITEM.bType, db TYPE_MENUITEM_HEX
|
---|
115 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw ROMVARS.bBootDrv
|
---|
116 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgBootDrive
|
---|
117 | at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 0
|
---|
118 | at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 0FFh
|
---|
119 | iend
|
---|
120 |
|
---|
121 | g_MenuitemBootMnuStngsSelectionTimeout:
|
---|
122 | istruc MENUITEM
|
---|
123 | at MENUITEM.fnActivate, dw Menuitem_ActivateUnsignedInputForMenuitemInDSSI
|
---|
124 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
|
---|
125 | at MENUITEM.szName, dw g_szItemBootTimeout
|
---|
126 | at MENUITEM.szQuickInfo, dw g_szNfoBootTimeout
|
---|
127 | at MENUITEM.szHelp, dw g_szHelpBootTimeout
|
---|
128 | at MENUITEM.bFlags, db NULL
|
---|
129 | at MENUITEM.bType, db TYPE_MENUITEM_UNSIGNED
|
---|
130 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw ROMVARS.wBootTimeout
|
---|
131 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgBootTimeout
|
---|
132 | at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 2
|
---|
133 | at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 1092
|
---|
134 | iend
|
---|
135 |
|
---|
136 | %if 0 ; *FIXME*
|
---|
137 | g_MenuitemBootMnuStngsSwapBootDriveNumbers:
|
---|
138 | istruc MENUITEM
|
---|
139 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
|
---|
140 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
|
---|
141 | at MENUITEM.szName, dw g_szItemBootSwap
|
---|
142 | at MENUITEM.szQuickInfo, dw g_szNfoBootSwap
|
---|
143 | at MENUITEM.szHelp, dw g_szHelpBootSwap
|
---|
144 | at MENUITEM.bFlags, db FLG_MENUITEM_FLAGVALUE
|
---|
145 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE
|
---|
146 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw ROMVARS.wFlags
|
---|
147 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgBootSwap
|
---|
148 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szMultichoiceBooleanFlag
|
---|
149 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForFlagBooleans
|
---|
150 | at MENUITEM.itemValue + ITEM_VALUE.wValueBitmask, dw FLG_ROMVARS_DRVXLAT
|
---|
151 | iend
|
---|
152 | %endif
|
---|
153 |
|
---|
154 |
|
---|
155 | g_rgwChoiceToValueLookupForEnableBootMenu:
|
---|
156 | dw FALSE
|
---|
157 | dw BOOT_MENU_DEFAULT_TIMEOUT
|
---|
158 |
|
---|
159 | g_rgwChoiceToValueLookupForDisplayModes:
|
---|
160 | dw DEFAULT_TEXT_MODE
|
---|
161 | dw CGA_TEXT_MODE_BW40
|
---|
162 | dw CGA_TEXT_MODE_CO40
|
---|
163 | dw CGA_TEXT_MODE_BW80
|
---|
164 | dw CGA_TEXT_MODE_CO80
|
---|
165 | dw MDA_TEXT_MODE
|
---|
166 | g_rgszValueToStringLookupForDisplayModes:
|
---|
167 | dw g_szValueBootDispModeBW40
|
---|
168 | dw g_szValueBootDispModeCO40
|
---|
169 | dw g_szValueBootDispModeBW80
|
---|
170 | dw g_szValueBootDispModeCO80
|
---|
171 | dw g_szValueBootDispModeDefault
|
---|
172 | dw NULL
|
---|
173 | dw NULL
|
---|
174 | dw g_szValueBootDispModeMono
|
---|
175 |
|
---|
176 | g_rgszValueToStringLookupForFloppyDrives:
|
---|
177 | dw g_szValueBootFloppyDrvsAuto
|
---|
178 | dw g_szValueBootFloppyDrvs1
|
---|
179 | dw g_szValueBootFloppyDrvs2
|
---|
180 | dw g_szValueBootFloppyDrvs3
|
---|
181 | dw g_szValueBootFloppyDrvs4
|
---|
182 |
|
---|
183 |
|
---|
184 | ; Section containing code
|
---|
185 | SECTION .text
|
---|
186 |
|
---|
187 | ;--------------------------------------------------------------------
|
---|
188 | ; BootMenuSettingsMenu_EnterMenuOrModifyItemVisibility
|
---|
189 | ; Parameters:
|
---|
190 | ; SS:BP: Menu handle
|
---|
191 | ; Returns:
|
---|
192 | ; Nothing
|
---|
193 | ; Corrupts registers:
|
---|
194 | ; All, except BP
|
---|
195 | ;--------------------------------------------------------------------
|
---|
196 | ALIGN JUMP_ALIGN
|
---|
197 | BootMenuSettingsMenu_EnterMenuOrModifyItemVisibility:
|
---|
198 | push cs
|
---|
199 | pop ds
|
---|
200 | call EnableOrDisableBootMenuSettings
|
---|
201 | mov si, g_MenupageForBootMenuSettingsMenu
|
---|
202 | jmp Menupage_ChangeToNewMenupageInDSSI
|
---|
203 |
|
---|
204 |
|
---|
205 | ;--------------------------------------------------------------------
|
---|
206 | ; EnableOrDisableBootMenuSettings
|
---|
207 | ; Parameters:
|
---|
208 | ; SS:BP: Menu handle
|
---|
209 | ; Returns:
|
---|
210 | ; Nothing
|
---|
211 | ; Corrupts registers:
|
---|
212 | ; AX, BX
|
---|
213 | ;--------------------------------------------------------------------
|
---|
214 | ALIGN JUMP_ALIGN
|
---|
215 | EnableOrDisableBootMenuSettings:
|
---|
216 | mov bx, [cs:g_MenuitemBootMnuStngsEnableBootMenu+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
|
---|
217 | call Buffers_GetRomvarsValueToAXfromOffsetInBX
|
---|
218 | test ax, ax
|
---|
219 | mov al, FLG_MENUITEM_VISIBLE
|
---|
220 | jz SHORT .DisableBootMenuSettings
|
---|
221 |
|
---|
222 | ; Enable boot menu related
|
---|
223 | or [g_MenuitemBootMnuStngsDefaultBootDrive+MENUITEM.bFlags], al
|
---|
224 | or [g_MenuitemBootMnuStngsSelectionTimeout+MENUITEM.bFlags], al
|
---|
225 | ; or [g_MenuitemBootMnuStngsSwapBootDriveNumbers+MENUITEM.bFlags], al
|
---|
226 | ret
|
---|
227 |
|
---|
228 | .DisableBootMenuSettings:
|
---|
229 | not ax
|
---|
230 | and [g_MenuitemBootMnuStngsDefaultBootDrive+MENUITEM.bFlags], al
|
---|
231 | and [g_MenuitemBootMnuStngsSelectionTimeout+MENUITEM.bFlags], al
|
---|
232 | ; and [g_MenuitemBootMnuStngsSwapBootDriveNumbers+MENUITEM.bFlags], al
|
---|
233 | ret
|
---|
234 |
|
---|
235 |
|
---|
236 | ;--------------------------------------------------------------------
|
---|
237 | ; MENUITEM value reader functions
|
---|
238 | ; Parameters:
|
---|
239 | ; AX: Value from MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset
|
---|
240 | ; DS:SI: Ptr to MENUITEM
|
---|
241 | ; ES:DI: Ptr to value variable
|
---|
242 | ; Returns:
|
---|
243 | ; AX: Value with possible modifications
|
---|
244 | ; Corrupts registers:
|
---|
245 | ; Nothing
|
---|
246 | ;--------------------------------------------------------------------
|
---|
247 | ALIGN JUMP_ALIGN
|
---|
248 | ValueReaderForEnableBootMenu:
|
---|
249 | test ax, ax
|
---|
250 | jz SHORT .NoNeedToModify
|
---|
251 | mov ax, TRUE<<1
|
---|
252 | .NoNeedToModify:
|
---|
253 | ret
|
---|