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

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

Changes:

  • XTIDECFG: Fixed a bug from r459 where the menu option for selection of default boot drive would be missing if the BIOS had been built without MODULE_HOTKEYS. The menu option is now visible if either or both of MODULE_HOTKEYS and MODULE_BOOT_MENU is available.
  • BIOS: Disabled ATA-ID validation by adding a new define (NO_ATAID_VALIDATION) and making it the default for all builds since at least two WD Caviar drive models are incompatible with it.
  • Fixed the "No Fixed Disk Present in FDISK"-bug introduced in r551 which means the Tiny build now works without including MODULE_DRIVEXLATE.
  • Fixed a bug from r528 where pressing hotkey F6 would not initiate detection of serial drives.
  • Fixed a bug from r186 in DisplayFormatCompressed.asm where the boot menu would print the IRQ in hexadecimal format when it should be in decimal format.
  • Optimizations and fixes.
File size: 9.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-2013 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  6
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_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_MenuitemBootMnuStngsDefaultBootDrive:
90istruc MENUITEM
91    at  MENUITEM.fnActivate,        dw  Menuitem_ActivateHexInputForMenuitemInDSSI
92    at  MENUITEM.fnFormatValue,     dw  MenuitemPrint_WriteHexValueStringToBufferInESDIfromItemInDSSI
93    at  MENUITEM.szName,            dw  g_szItemBootDrive
94    at  MENUITEM.szQuickInfo,       dw  g_szNfoBootDrive
95    at  MENUITEM.szHelp,            dw  g_szHelpBootDrive
96    at  MENUITEM.bFlags,            db  FLG_MENUITEM_BYTEVALUE
97    at  MENUITEM.bType,             db  TYPE_MENUITEM_HEX
98    at  MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,        dw  ROMVARS.bBootDrv
99    at  MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,              dw  g_szDlgBootDrive
100    at  MENUITEM.itemValue + ITEM_VALUE.wMinValue,                  dw  0
101    at  MENUITEM.itemValue + ITEM_VALUE.wMaxValue,                  dw  0FFh
102iend
103
104g_MenuitemBootMnuStngsSelectionTimeout:
105istruc MENUITEM
106    at  MENUITEM.fnActivate,        dw  Menuitem_ActivateUnsignedInputForMenuitemInDSSI
107    at  MENUITEM.fnFormatValue,     dw  MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
108    at  MENUITEM.szName,            dw  g_szItemBootTimeout
109    at  MENUITEM.szQuickInfo,       dw  g_szNfoBootTimeout
110    at  MENUITEM.szHelp,            dw  g_szHelpBootTimeout
111    at  MENUITEM.bFlags,            db  NULL
112    at  MENUITEM.bType,             db  TYPE_MENUITEM_UNSIGNED
113    at  MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,        dw  ROMVARS.wBootTimeout
114    at  MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,              dw  g_szDlgBootTimeout
115    at  MENUITEM.itemValue + ITEM_VALUE.wMinValue,                  dw  2
116    at  MENUITEM.itemValue + ITEM_VALUE.wMaxValue,                  dw  1092
117iend
118
119
120g_rgwChoiceToValueLookupForEnableBootMenu:
121    dw  FALSE
122    dw  BOOT_MENU_DEFAULT_TIMEOUT
123
124g_rgwChoiceToValueLookupForDisplayModes:
125    dw  DEFAULT_TEXT_MODE
126    dw  CGA_TEXT_MODE_BW40
127    dw  CGA_TEXT_MODE_CO40
128    dw  CGA_TEXT_MODE_BW80
129    dw  CGA_TEXT_MODE_CO80
130    dw  MDA_TEXT_MODE
131g_rgszValueToStringLookupForDisplayModes:
132    dw  g_szValueBootDispModeBW40
133    dw  g_szValueBootDispModeCO40
134    dw  g_szValueBootDispModeBW80
135    dw  g_szValueBootDispModeCO80
136    dw  g_szValueBootDispModeDefault
137    dw  NULL
138    dw  NULL
139    dw  g_szValueBootDispModeMono
140
141g_rgszValueToStringLookupForFloppyDrives:
142    dw  g_szValueBootFloppyDrvsAuto
143    dw  g_szValueBootFloppyDrvs1
144    dw  g_szValueBootFloppyDrvs2
145    dw  g_szValueBootFloppyDrvs3
146    dw  g_szValueBootFloppyDrvs4
147
148
149; Section containing code
150SECTION .text
151
152;--------------------------------------------------------------------
153; BootMenuSettingsMenu_EnterMenuOrModifyItemVisibility
154;   Parameters:
155;       SS:BP:  Menu handle
156;   Returns:
157;       Nothing
158;   Corrupts registers:
159;       All, except BP
160;--------------------------------------------------------------------
161ALIGN JUMP_ALIGN
162BootMenuSettingsMenu_EnterMenuOrModifyItemVisibility:
163    push    cs
164    pop     ds
165    call    Buffers_GetRomvarsFlagsToAX
166    call    .EnableOrDisableScanForSerialDrives
167    call    .EnableOrDisableDefaultBootDrive
168    call    .EnableOrDisableBootMenuSelectionTimeout
169    mov     si, g_MenupageForBootMenuSettingsMenu
170    jmp     Menupage_ChangeToNewMenupageInDSSI
171
172
173;--------------------------------------------------------------------
174; .EnableOrDisableScanForSerialDrives
175;   Parameters:
176;       AX:     ROMVARS.wFlags
177;       SS:BP:  Menu handle
178;   Returns:
179;       Nothing
180;   Corrupts registers:
181;       BX
182;--------------------------------------------------------------------
183ALIGN JUMP_ALIGN
184.EnableOrDisableScanForSerialDrives:
185    mov     bx, g_MenuitemBootMenuSerialScanDetect
186    test    ax, FLG_ROMVARS_MODULE_SERIAL
187    jmp     SHORT .DisableMenuitemFromCSBXifZFset
188
189
190;--------------------------------------------------------------------
191; .EnableOrDisableDefaultBootDrive
192;   Parameters:
193;       AX:     ROMVARS.wFlags
194;       SS:BP:  Menu handle
195;   Returns:
196;       Nothing
197;   Corrupts registers:
198;       BX
199;--------------------------------------------------------------------
200ALIGN JUMP_ALIGN
201.EnableOrDisableDefaultBootDrive:
202    mov     bx, g_MenuitemBootMnuStngsDefaultBootDrive
203    test    ax, FLG_ROMVARS_MODULE_HOTKEYS | FLG_ROMVARS_MODULE_BOOT_MENU
204    jmp     SHORT .DisableMenuitemFromCSBXifZFset
205
206
207;--------------------------------------------------------------------
208; .EnableOrDisableBootMenuSelectionTimeout
209;   Parameters:
210;       AX:     ROMVARS.wFlags
211;       SS:BP:  Menu handle
212;   Returns:
213;       Nothing
214;   Corrupts registers:
215;       BX
216;--------------------------------------------------------------------
217ALIGN JUMP_ALIGN
218.EnableOrDisableBootMenuSelectionTimeout:
219    mov     bx, g_MenuitemBootMnuStngsSelectionTimeout
220    test    ax, FLG_ROMVARS_MODULE_BOOT_MENU
221.DisableMenuitemFromCSBXifZFset:
222    jz      SHORT .DisableMenuitemFromCSBX
223    ; Fall to .EnableMenuitemFromCSBX
224
225
226;--------------------------------------------------------------------
227; .EnableMenuitemFromCSBX
228; .DisableMenuitemFromCSBX
229;   Parameters:
230;       CS:BX:  Ptr to MENUITEM
231;   Returns:
232;       Nothing
233;   Corrupts registers:
234;       Nothing
235;--------------------------------------------------------------------
236ALIGN JUMP_ALIGN
237.EnableMenuitemFromCSBX:
238    jmp     EnableMenuitemFromCSBX
239
240ALIGN JUMP_ALIGN
241.DisableMenuitemFromCSBX:
242    jmp     DisableMenuitemFromCSBX
243
244
245;--------------------------------------------------------------------
246; MENUITEM value reader functions
247;   Parameters:
248;       AX:     Value from MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset
249;       DS:SI:  Ptr to MENUITEM
250;       ES:DI:  Ptr to value variable
251;   Returns:
252;       AX:     Value with possible modifications
253;   Corrupts registers:
254;       Nothing
255;--------------------------------------------------------------------
256ALIGN JUMP_ALIGN
257ValueReaderForEnableBootMenu:
258    test    ax, ax
259    jz      SHORT .NoNeedToModify
260    mov     ax, TRUE<<1
261.NoNeedToModify:
262    ret
Note: See TracBrowser for help on using the repository browser.