[59] | 1 | ; Project name : XTIDE Universal BIOS Configurator v2
|
---|
| 2 | ; Description : "Boot Menu Settings" menu structs and functions.
|
---|
| 3 |
|
---|
[376] | 4 | ;
|
---|
[399] | 5 | ; XTIDE Universal BIOS and Associated Tools
|
---|
[376] | 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.
|
---|
[399] | 12 | ;
|
---|
[376] | 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
|
---|
[399] | 16 | ; GNU General Public License for more details.
|
---|
[376] | 17 | ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
---|
[399] | 18 | ;
|
---|
[376] | 19 |
|
---|
[59] | 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
|
---|
[403] | 28 | at MENUPAGE.wMenuitems, dw 6
|
---|
[59] | 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 |
|
---|
[144] | 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 |
|
---|
[59] | 57 | g_MenuitemBootMnuStngsFloppyDrives:
|
---|
| 58 | istruc MENUITEM
|
---|
[108] | 59 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
|
---|
[59] | 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
|
---|
[108] | 65 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE
|
---|
[59] | 66 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw ROMVARS.bMinFddCnt
|
---|
| 67 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgBootFloppyDrvs
|
---|
[108] | 68 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szMultichoiceBootFloppyDrvs
|
---|
[199] | 69 | at MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup, dw NULL
|
---|
[59] | 70 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForFloppyDrives
|
---|
| 71 | iend
|
---|
| 72 |
|
---|
[399] | 73 | g_MenuitemBootMenuSerialScanDetect:
|
---|
[290] | 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
|
---|
[403] | 80 | at MENUITEM.bFlags, db FLG_MENUITEM_FLAGVALUE
|
---|
[290] | 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_MenuitemBootMnuStngsDefaultBootDrive:
|
---|
| 90 | istruc 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
|
---|
[403] | 96 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE | FLG_MENUITEM_BYTEVALUE
|
---|
[290] | 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
|
---|
| 102 | iend
|
---|
| 103 |
|
---|
[59] | 104 | g_MenuitemBootMnuStngsSelectionTimeout:
|
---|
| 105 | istruc 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
|
---|
[290] | 111 | at MENUITEM.bFlags, db NULL
|
---|
[59] | 112 | at MENUITEM.bType, db TYPE_MENUITEM_UNSIGNED
|
---|
[136] | 113 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw ROMVARS.wBootTimeout
|
---|
[59] | 114 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgBootTimeout
|
---|
[290] | 115 | at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 2
|
---|
[136] | 116 | at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 1092
|
---|
[59] | 117 | iend
|
---|
| 118 |
|
---|
| 119 |
|
---|
[290] | 120 | g_rgwChoiceToValueLookupForEnableBootMenu:
|
---|
| 121 | dw FALSE
|
---|
| 122 | dw BOOT_MENU_DEFAULT_TIMEOUT
|
---|
| 123 |
|
---|
[144] | 124 | g_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
|
---|
| 131 | g_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 |
|
---|
[59] | 141 | g_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
|
---|
| 150 | SECTION .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 | ;--------------------------------------------------------------------
|
---|
| 161 | ALIGN JUMP_ALIGN
|
---|
| 162 | BootMenuSettingsMenu_EnterMenuOrModifyItemVisibility:
|
---|
| 163 | push cs
|
---|
| 164 | pop ds
|
---|
[290] | 165 | call EnableOrDisableBootMenuSettings
|
---|
[403] | 166 | call EnableOrDisableSerialSettings
|
---|
[59] | 167 | mov si, g_MenupageForBootMenuSettingsMenu
|
---|
| 168 | jmp Menupage_ChangeToNewMenupageInDSSI
|
---|
[290] | 169 |
|
---|
| 170 |
|
---|
| 171 | ;--------------------------------------------------------------------
|
---|
| 172 | ; EnableOrDisableBootMenuSettings
|
---|
| 173 | ; Parameters:
|
---|
| 174 | ; SS:BP: Menu handle
|
---|
| 175 | ; Returns:
|
---|
| 176 | ; Nothing
|
---|
| 177 | ; Corrupts registers:
|
---|
| 178 | ; AX, BX
|
---|
| 179 | ;--------------------------------------------------------------------
|
---|
| 180 | ALIGN JUMP_ALIGN
|
---|
| 181 | EnableOrDisableBootMenuSettings:
|
---|
[403] | 182 | mov bx, ROMVARS.wFlags
|
---|
[290] | 183 | call Buffers_GetRomvarsValueToAXfromOffsetInBX
|
---|
[403] | 184 | test ax, FLG_ROMVARS_MODULE_BOOT_MENU
|
---|
[290] | 185 | mov al, FLG_MENUITEM_VISIBLE
|
---|
| 186 | jz SHORT .DisableBootMenuSettings
|
---|
| 187 |
|
---|
| 188 | ; Enable boot menu related
|
---|
| 189 | or [g_MenuitemBootMnuStngsSelectionTimeout+MENUITEM.bFlags], al
|
---|
| 190 | ret
|
---|
| 191 |
|
---|
| 192 | .DisableBootMenuSettings:
|
---|
| 193 | not ax
|
---|
| 194 | and [g_MenuitemBootMnuStngsSelectionTimeout+MENUITEM.bFlags], al
|
---|
[399] | 195 | ret
|
---|
[290] | 196 |
|
---|
| 197 |
|
---|
| 198 | ;--------------------------------------------------------------------
|
---|
[403] | 199 | ; EnableOrDisableSerialSettings
|
---|
| 200 | ; Parameters:
|
---|
| 201 | ; SS:BP: Menu handle
|
---|
| 202 | ; Returns:
|
---|
| 203 | ; Nothing
|
---|
| 204 | ; Corrupts registers:
|
---|
| 205 | ; AX, BX
|
---|
| 206 | ;--------------------------------------------------------------------
|
---|
| 207 | EnableOrDisableSerialSettings:
|
---|
| 208 | mov bx, ROMVARS.wFlags
|
---|
| 209 | call Buffers_GetRomvarsValueToAXfromOffsetInBX
|
---|
| 210 | test ax, FLG_ROMVARS_MODULE_SERIAL
|
---|
| 211 | mov al, FLG_MENUITEM_VISIBLE
|
---|
| 212 | jz SHORT .DisableSerialSettings
|
---|
| 213 |
|
---|
| 214 | ; Enable serial related
|
---|
| 215 | or [g_MenuitemBootMenuSerialScanDetect+MENUITEM.bFlags], al
|
---|
| 216 | ret
|
---|
| 217 |
|
---|
| 218 | .DisableSerialSettings:
|
---|
| 219 | not ax
|
---|
| 220 | and [g_MenuitemBootMenuSerialScanDetect+MENUITEM.bFlags], al
|
---|
| 221 | ret
|
---|
| 222 |
|
---|
| 223 |
|
---|
| 224 | ;--------------------------------------------------------------------
|
---|
[290] | 225 | ; MENUITEM value reader functions
|
---|
| 226 | ; Parameters:
|
---|
| 227 | ; AX: Value from MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset
|
---|
| 228 | ; DS:SI: Ptr to MENUITEM
|
---|
| 229 | ; ES:DI: Ptr to value variable
|
---|
| 230 | ; Returns:
|
---|
| 231 | ; AX: Value with possible modifications
|
---|
| 232 | ; Corrupts registers:
|
---|
| 233 | ; Nothing
|
---|
| 234 | ;--------------------------------------------------------------------
|
---|
| 235 | ALIGN JUMP_ALIGN
|
---|
| 236 | ValueReaderForEnableBootMenu:
|
---|
| 237 | test ax, ax
|
---|
| 238 | jz SHORT .NoNeedToModify
|
---|
| 239 | mov ax, TRUE<<1
|
---|
| 240 | .NoNeedToModify:
|
---|
| 241 | ret
|
---|