source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm @ 399

Last change on this file since 399 was 399, checked in by krille_n_@…, 12 years ago

Changes:

  • Added Power Management (Standby Timer) support to the BIOS and made it part of an optional module (MODULE_FEATURE_SETS). The total amount of ROM space used by this feature is 37 bytes. UNTESTED
  • Size optimizations (mostly inlining of procedures) and fixed a few bugs in AH9h_HInit.asm:
    1. DPT_ATA.bInitError would be cleared only if MODULE_SERIAL was not defined.
    2. The FLG_INITERROR_FAILED_TO_SET_BLOCK_MODE flag could never be set.
    3. InitializeBlockMode could potentially loop forever if there was an error.
  • Removed some odd looking code in .PushResetStatus in BootMenuPrintCfg.asm
  • Made some changes to XTIDECFG so it can be built.
File size: 10.6 KB
Line 
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
21SECTION .data
22
23ALIGN WORD_ALIGN
24g_MenupageForBootMenuSettingsMenu:
25istruc MENUPAGE
26    at  MENUPAGE.fnEnter,           dw  BootMenuSettingsMenu_EnterMenuOrModifyItemVisibility
27    at  MENUPAGE.fnBack,            dw  ConfigurationMenu_EnterMenuOrModifyItemVisibility
28    at  MENUPAGE.wMenuitems,        dw  8
29iend
30
31g_MenuitemBootMnuStngsBackToConfigurationMenu:
32istruc 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
39iend
40
41g_MenuitemBootMnuStngsDisplayMode:
42istruc 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
55iend
56
57g_MenuitemBootMnuStngsFloppyDrives:
58istruc 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
71iend
72
73g_MenuitemBootMenuSerialScanDetect:
74istruc 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
87iend
88
89g_MenuitemBootMnuStngsEnableBootMenu:
90istruc 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
104iend
105
106g_MenuitemBootMnuStngsDefaultBootDrive:
107istruc 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
119iend
120
121g_MenuitemBootMnuStngsSelectionTimeout:
122istruc 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
134iend
135
136%if 0   ; *FIXME*
137g_MenuitemBootMnuStngsSwapBootDriveNumbers:
138istruc 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
151iend
152%endif
153
154
155g_rgwChoiceToValueLookupForEnableBootMenu:
156    dw  FALSE
157    dw  BOOT_MENU_DEFAULT_TIMEOUT
158
159g_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
166g_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
176g_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
185SECTION .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;--------------------------------------------------------------------
196ALIGN JUMP_ALIGN
197BootMenuSettingsMenu_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;--------------------------------------------------------------------
214ALIGN JUMP_ALIGN
215EnableOrDisableBootMenuSettings:
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;--------------------------------------------------------------------
247ALIGN JUMP_ALIGN
248ValueReaderForEnableBootMenu:
249    test    ax, ax
250    jz      SHORT .NoNeedToModify
251    mov     ax, TRUE<<1
252.NoNeedToModify:
253    ret
Note: See TracBrowser for help on using the repository browser.