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 | g_MenuitemBootMnuStngsSwapBootDriveNumbers:
|
---|
137 | istruc MENUITEM
|
---|
138 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
|
---|
139 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
|
---|
140 | at MENUITEM.szName, dw g_szItemBootSwap
|
---|
141 | at MENUITEM.szQuickInfo, dw g_szNfoBootSwap
|
---|
142 | at MENUITEM.szHelp, dw g_szHelpBootSwap
|
---|
143 | at MENUITEM.bFlags, db FLG_MENUITEM_FLAGVALUE
|
---|
144 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE
|
---|
145 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw ROMVARS.wFlags
|
---|
146 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgBootSwap
|
---|
147 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szMultichoiceBooleanFlag
|
---|
148 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForFlagBooleans
|
---|
149 | at MENUITEM.itemValue + ITEM_VALUE.wValueBitmask, dw FLG_ROMVARS_DRVXLAT
|
---|
150 | iend
|
---|
151 |
|
---|
152 |
|
---|
153 | g_rgwChoiceToValueLookupForEnableBootMenu:
|
---|
154 | dw FALSE
|
---|
155 | dw BOOT_MENU_DEFAULT_TIMEOUT
|
---|
156 |
|
---|
157 | g_rgwChoiceToValueLookupForDisplayModes:
|
---|
158 | dw DEFAULT_TEXT_MODE
|
---|
159 | dw CGA_TEXT_MODE_BW40
|
---|
160 | dw CGA_TEXT_MODE_CO40
|
---|
161 | dw CGA_TEXT_MODE_BW80
|
---|
162 | dw CGA_TEXT_MODE_CO80
|
---|
163 | dw MDA_TEXT_MODE
|
---|
164 | g_rgszValueToStringLookupForDisplayModes:
|
---|
165 | dw g_szValueBootDispModeBW40
|
---|
166 | dw g_szValueBootDispModeCO40
|
---|
167 | dw g_szValueBootDispModeBW80
|
---|
168 | dw g_szValueBootDispModeCO80
|
---|
169 | dw g_szValueBootDispModeDefault
|
---|
170 | dw NULL
|
---|
171 | dw NULL
|
---|
172 | dw g_szValueBootDispModeMono
|
---|
173 |
|
---|
174 | g_rgszValueToStringLookupForFloppyDrives:
|
---|
175 | dw g_szValueBootFloppyDrvsAuto
|
---|
176 | dw g_szValueBootFloppyDrvs1
|
---|
177 | dw g_szValueBootFloppyDrvs2
|
---|
178 | dw g_szValueBootFloppyDrvs3
|
---|
179 | dw g_szValueBootFloppyDrvs4
|
---|
180 |
|
---|
181 |
|
---|
182 | ; Section containing code
|
---|
183 | SECTION .text
|
---|
184 |
|
---|
185 | ;--------------------------------------------------------------------
|
---|
186 | ; BootMenuSettingsMenu_EnterMenuOrModifyItemVisibility
|
---|
187 | ; Parameters:
|
---|
188 | ; SS:BP: Menu handle
|
---|
189 | ; Returns:
|
---|
190 | ; Nothing
|
---|
191 | ; Corrupts registers:
|
---|
192 | ; All, except BP
|
---|
193 | ;--------------------------------------------------------------------
|
---|
194 | ALIGN JUMP_ALIGN
|
---|
195 | BootMenuSettingsMenu_EnterMenuOrModifyItemVisibility:
|
---|
196 | push cs
|
---|
197 | pop ds
|
---|
198 | call EnableOrDisableBootMenuSettings
|
---|
199 | mov si, g_MenupageForBootMenuSettingsMenu
|
---|
200 | jmp Menupage_ChangeToNewMenupageInDSSI
|
---|
201 |
|
---|
202 |
|
---|
203 | ;--------------------------------------------------------------------
|
---|
204 | ; EnableOrDisableBootMenuSettings
|
---|
205 | ; Parameters:
|
---|
206 | ; SS:BP: Menu handle
|
---|
207 | ; Returns:
|
---|
208 | ; Nothing
|
---|
209 | ; Corrupts registers:
|
---|
210 | ; AX, BX
|
---|
211 | ;--------------------------------------------------------------------
|
---|
212 | ALIGN JUMP_ALIGN
|
---|
213 | EnableOrDisableBootMenuSettings:
|
---|
214 | mov bx, [cs:g_MenuitemBootMnuStngsEnableBootMenu+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
|
---|
215 | call Buffers_GetRomvarsValueToAXfromOffsetInBX
|
---|
216 | test ax, ax
|
---|
217 | mov al, FLG_MENUITEM_VISIBLE
|
---|
218 | jz SHORT .DisableBootMenuSettings
|
---|
219 |
|
---|
220 | ; Enable boot menu related
|
---|
221 | or [g_MenuitemBootMnuStngsDefaultBootDrive+MENUITEM.bFlags], al
|
---|
222 | or [g_MenuitemBootMnuStngsSelectionTimeout+MENUITEM.bFlags], al
|
---|
223 | or [g_MenuitemBootMnuStngsSwapBootDriveNumbers+MENUITEM.bFlags], al
|
---|
224 | ret
|
---|
225 |
|
---|
226 | .DisableBootMenuSettings:
|
---|
227 | not ax
|
---|
228 | and [g_MenuitemBootMnuStngsDefaultBootDrive+MENUITEM.bFlags], al
|
---|
229 | and [g_MenuitemBootMnuStngsSelectionTimeout+MENUITEM.bFlags], al
|
---|
230 | and [g_MenuitemBootMnuStngsSwapBootDriveNumbers+MENUITEM.bFlags], al
|
---|
231 | ret
|
---|
232 |
|
---|
233 |
|
---|
234 | ;--------------------------------------------------------------------
|
---|
235 | ; MENUITEM value reader functions
|
---|
236 | ; Parameters:
|
---|
237 | ; AX: Value from MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset
|
---|
238 | ; DS:SI: Ptr to MENUITEM
|
---|
239 | ; ES:DI: Ptr to value variable
|
---|
240 | ; Returns:
|
---|
241 | ; AX: Value with possible modifications
|
---|
242 | ; Corrupts registers:
|
---|
243 | ; Nothing
|
---|
244 | ;--------------------------------------------------------------------
|
---|
245 | ALIGN JUMP_ALIGN
|
---|
246 | ValueReaderForEnableBootMenu:
|
---|
247 | test ax, ax
|
---|
248 | jz SHORT .NoNeedToModify
|
---|
249 | mov ax, TRUE<<1
|
---|
250 | .NoNeedToModify:
|
---|
251 | ret
|
---|