2019-09-03 11:58:42 +02:00
/*
* refit / menu . c
* Menu functions
*
* Copyright ( c ) 2006 Christoph Pfisterer
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
*
* * Redistributions of source code must retain the above copyright
* notice , this list of conditions and the following disclaimer .
*
* * Redistributions in binary form must reproduce the above copyright
* notice , this list of conditions and the following disclaimer in the
* documentation and / or other materials provided with the
* distribution .
*
* * Neither the name of Christoph Pfisterer nor the names of the
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission .
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
* LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL ,
* SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT
* LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE ,
* DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT
* ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE .
*/
2020-04-04 14:27:02 +02:00
# include "menu.h"
2020-08-17 21:40:52 +02:00
# include <Platform.h> // Only use angled for Platform, else, xcode project won't compile
# include "../libeg/libegint.h"
2019-09-03 11:58:42 +02:00
//#include "../include/scroll_images.h"
2020-02-16 13:00:20 +01:00
2020-04-04 14:27:02 +02:00
# include "../Platform/Settings.h"
2019-09-03 11:58:42 +02:00
//#include "colors.h"
2020-03-13 14:11:58 +01:00
# include "../libeg/nanosvg.h"
# include "../libeg/FloatLib.h"
2021-02-06 18:16:46 +01:00
# include "../Platform/HdaCodecDump.h"
2020-02-29 08:30:21 +01:00
# include "menu.h"
# include "screen.h"
2020-03-12 18:45:28 +01:00
# include "../cpp_foundation/XString.h"
2020-03-18 07:39:11 +01:00
# include "../libeg/XTheme.h"
2020-03-31 18:05:34 +02:00
# include "../libeg/VectorGraphics.h" // for testSVG
2020-04-04 14:27:02 +02:00
# include "../gui/shared_with_menu.h"
2020-04-16 09:15:26 +02:00
# include "../Platform/platformdata.h"
# include "../Platform/cpu.h"
# include "../Platform/Nvram.h"
2021-02-07 15:39:03 +01:00
# include "../include/DsdtFixList.h"
2020-04-16 11:09:22 +02:00
# include "../include/Devices.h"
2021-03-28 22:13:43 +02:00
# include "../include/QuirksCodes.h"
2020-04-16 11:09:22 +02:00
# include "../Platform/boot.h"
2020-07-15 19:29:27 +02:00
# include "../Platform/Injectors.h"
2021-02-06 18:16:46 +01:00
# include "../Platform/KextList.h"
2020-08-09 17:55:30 +02:00
# include "../gui/REFIT_MENU_SCREEN.h"
2021-03-22 13:40:01 +01:00
# include "../gui/REFIT_MAINMENU_SCREEN.h"
2021-04-28 20:30:34 +02:00
# include "../Settings/Self.h"
2021-02-06 18:16:46 +01:00
# include "../Platform/VersionString.h"
2021-04-28 20:30:34 +02:00
# include "../Settings/ConfigManager.h"
# include "../Platform/CloverVersion.h"
2019-09-03 11:58:42 +02:00
2020-09-07 00:19:48 +02:00
2019-09-03 11:58:42 +02:00
# ifndef DEBUG_ALL
# define DEBUG_MENU 1
# else
# define DEBUG_MENU DEBUG_ALL
# endif
# if DEBUG_MENU == 0
# define DBG(...)
# else
# define DBG(...) DebugLog(DEBUG_MENU, __VA_ARGS__)
# endif
2020-04-10 12:04:21 +02:00
2019-09-03 11:58:42 +02:00
INTN LayoutMainMenuHeight = 376 ;
INTN LayoutAnimMoveForMenuX = 0 ;
2020-04-04 14:27:02 +02:00
//
//#define SCROLL_LINE_UP (0)
//#define SCROLL_LINE_DOWN (1)
//#define SCROLL_PAGE_UP (2)
//#define SCROLL_PAGE_DOWN (3)
//#define SCROLL_FIRST (4)
//#define SCROLL_LAST (5)
//#define SCROLL_NONE (6)
//#define SCROLL_SCROLL_DOWN (7)
//#define SCROLL_SCROLL_UP (8)
//#define SCROLL_SCROLLBAR_MOVE (9)
//
//
2019-09-03 11:58:42 +02:00
# define TEXT_CORNER_REVISION (1)
# define TEXT_CORNER_HELP (2)
# define TEXT_CORNER_OPTIMUS (3)
2020-04-04 14:27:02 +02:00
//
//#define TITLE_MAX_LEN (SVALUE_MAX_SIZE / sizeof(CHAR16) + 128)
//
//// other menu definitions
//
//#define MENU_FUNCTION_INIT (0)
//#define MENU_FUNCTION_CLEANUP (1)
//#define MENU_FUNCTION_PAINT_ALL (2)
//#define MENU_FUNCTION_PAINT_SELECTION (3)
//#define MENU_FUNCTION_PAINT_TIMEOUT (4)
//
//
//
//static CHAR16 ArrowUp[2] = { ARROW_UP, 0 };
//static CHAR16 ArrowDown[2] = { ARROW_DOWN, 0 };
//
2021-09-28 10:28:45 +02:00
//XBool MainAnime = false;
2020-04-04 14:27:02 +02:00
//
2020-03-31 17:59:35 +02:00
REFIT_MENU_ITEM_OPTIONS MenuEntryOptions ( L " Options " _XSW , 1 , 0 , ' O ' , ActionEnter ) ;
REFIT_MENU_ITEM_ABOUT MenuEntryAbout ( L " About Clover " _XSW , 1 , 0 , ' A ' , ActionEnter ) ;
REFIT_MENU_ITEM_RESET MenuEntryReset ( L " Restart Computer " _XSW , 1 , 0 , ' R ' , ActionSelect ) ;
REFIT_MENU_ITEM_SHUTDOWN MenuEntryShutdown ( L " Exit Clover " _XSW , 1 , 0 , ' U ' , ActionSelect ) ;
REFIT_MENU_ITEM_RETURN MenuEntryReturn ( L " Return " _XSW , 0 , 0 , 0 , ActionEnter ) ;
2019-09-03 11:58:42 +02:00
2021-03-22 13:40:01 +01:00
REFIT_MAINMENU_SCREEN MainMenu ( 1 , L " Main Menu " _XSW , L " Automatic boot " _XSW ) ;
2020-04-04 07:50:30 +02:00
REFIT_MENU_SCREEN AboutMenu ( 2 , L " About " _XSW , L " " _XSW ) ;
REFIT_MENU_SCREEN HelpMenu ( 3 , L " Help " _XSW , L " " _XSW ) ;
2020-05-04 20:03:25 +02:00
REFIT_MENU_SCREEN OptionMenu ( 4 , L " Options " _XSW , L " " _XSW ) ;
2019-09-03 11:58:42 +02:00
2021-09-28 10:28:45 +02:00
void FillInputs ( XBool New )
2019-09-03 11:58:42 +02:00
{
UINTN i , j ; //for loops
CHAR8 tmp [ 41 ] ;
2021-09-28 10:28:45 +02:00
// XBool bit;
2019-09-03 11:58:42 +02:00
tmp [ 40 ] = 0 ; //make it null-terminated
2020-04-04 14:27:02 +02:00
UINTN InputItemsCount = 0 ;
2019-09-03 11:58:42 +02:00
if ( New ) {
2020-08-09 17:55:30 +02:00
// InputItems = (__typeof__(InputItems))A_llocateZeroPool(130 * sizeof(INPUT_ITEM)); //XXX
InputItems = new INPUT_ITEM [ 130 ] ;
2019-09-03 11:58:42 +02:00
}
InputItems [ InputItemsCount ] . ItemType = ASString ; //0
//even though Ascii we will keep value as Unicode to convert later
2020-05-05 01:52:00 +02:00
// no need for extra space here, it is added by ApplyInputs()
2021-02-02 10:02:21 +01:00
InputItems [ InputItemsCount + + ] . SValue . takeValueFrom ( gSettings . Boot . BootArgs ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = UNIString ; //1
2021-02-11 12:41:59 +01:00
InputItems [ InputItemsCount + + ] . SValue . takeValueFrom ( gSettings . ACPI . DSDT . DsdtName ) ; // 1-> 2
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = UNIString ; //2
2021-04-03 16:42:49 +02:00
InputItems [ InputItemsCount + + ] . SValue = GlobalConfig . BlockKexts ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = RadioSwitch ; //3 - Themes chooser
InputItems [ InputItemsCount + + ] . IValue = 3 ;
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //4
2021-03-15 10:02:34 +01:00
InputItems [ InputItemsCount + + ] . BValue = GlobalConfig . DropSSDT ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //5
2021-02-11 12:41:59 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . ACPI . SSDT . Generate . GeneratePStates ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //6
2021-02-11 12:41:59 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . ACPI . SlpSmiEnable ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Decimal ; //7
2021-02-11 12:41:59 +01:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %02d " , gSettings . ACPI . SSDT . PLimitDict ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Decimal ; //8
2021-02-11 12:41:59 +01:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %02d " , gSettings . ACPI . SSDT . UnderVoltStep ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //9
2021-02-11 12:41:59 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . ACPI . SSDT . Generate . GenerateCStates ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //10
2021-03-19 16:35:01 +01:00
InputItems [ InputItemsCount + + ] . BValue = GlobalConfig . EnableC2 ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //11
2021-03-19 16:35:01 +01:00
InputItems [ InputItemsCount + + ] . BValue = GlobalConfig . EnableC4 ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //12
2021-03-19 16:35:01 +01:00
InputItems [ InputItemsCount + + ] . BValue = GlobalConfig . EnableC6 ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //13
2021-02-11 12:41:59 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . ACPI . SSDT . EnableISS ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Decimal ; //14
2021-03-19 16:35:01 +01:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %06d " , gSettings . CPU . QPI ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //15
2021-02-11 12:41:59 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . ACPI . PatchNMI ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //16
2021-03-26 10:43:15 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . Graphics . PatchVBios ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Decimal ; //17
2021-04-03 16:42:49 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%llX " , gSettings . Smbios . gPlatformFeature ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Hex ; //18
2021-03-25 15:32:56 +01:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%hX " , gSettings . SystemParameters . BacklightLevel ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Decimal ; //19
2021-03-19 16:35:01 +01:00
if ( gSettings . CPU . BusSpeed > 20000 ) {
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %06d " , gSettings . CPU . BusSpeed ) ;
2019-09-03 11:58:42 +02:00
} else {
2020-08-10 13:06:06 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %06llu " , gCPUStructure . ExternalClock ) ;
2019-09-03 11:58:42 +02:00
}
InputItemsCount = 20 ;
2021-04-28 20:30:34 +02:00
for ( i = 0 ; i < gConf . GfxPropertiesArray . size ( ) ; i + + ) {
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = ASString ; //20+i*6
2021-04-28 20:30:34 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %s " , gConf . GfxPropertiesArray [ i ] . Model . c_str ( ) ) ;
2019-09-03 11:58:42 +02:00
2021-04-28 20:30:34 +02:00
if ( gConf . GfxPropertiesArray [ i ] . Vendor = = Ati ) {
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //21+i*6
2021-03-26 10:43:15 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . Graphics . InjectAsDict . InjectATI ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = ASString ; //22+6i
2021-03-26 10:43:15 +01:00
if ( gSettings . Graphics . FBName . length ( ) > 2 ) { //fool proof: cfg_name is 3 character or more.
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %ls " , gSettings . Graphics . FBName . wc_str ( ) ) ;
2019-09-03 11:58:42 +02:00
} else {
2021-04-28 20:30:34 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %s " , gConf . GfxPropertiesArray [ i ] . Config . c_str ( ) ) ;
2019-09-03 11:58:42 +02:00
}
2021-04-28 20:30:34 +02:00
} else if ( gConf . GfxPropertiesArray [ i ] . Vendor = = Nvidia ) {
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //21+i*6
2021-03-26 10:43:15 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . Graphics . InjectAsDict . InjectNVidia ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = ASString ; //22+6i
for ( j = 0 ; j < 8 ; j + + ) {
2021-03-26 10:43:15 +01:00
snprintf ( ( CHAR8 * ) & tmp [ 2 * j ] , 3 , " %02hhX " , gSettings . Graphics . Dcfg [ j ] ) ;
2019-09-03 11:58:42 +02:00
}
2020-08-10 13:06:06 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %s " , tmp ) ;
2019-09-03 11:58:42 +02:00
2021-03-26 10:43:15 +01:00
//InputItems[InputItemsCount++].SValue = P__oolPrint(L"%08x",*(UINT64*)&gSettings.Graphics.Dcfg[0]);
2019-09-03 11:58:42 +02:00
} else /*if (gGraphics[i].Vendor == Intel) */ {
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //21+i*6
2021-03-26 10:43:15 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . Graphics . InjectAsDict . InjectIntel ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Hex ; //22+6i
2021-04-12 14:11:01 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%08X " , GlobalConfig . IgPlatform ) ;
2019-09-03 11:58:42 +02:00
// InputItemsCount += 3;
// continue;
}
InputItems [ InputItemsCount ] . ItemType = Decimal ; //23+6i
2021-03-26 10:43:15 +01:00
if ( gSettings . Graphics . VideoPorts > 0 ) {
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %02d " , gSettings . Graphics . VideoPorts ) ;
2019-09-03 11:58:42 +02:00
} else {
2021-04-28 20:30:34 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %02d " , gConf . GfxPropertiesArray [ i ] . Ports ) ;
2019-09-03 11:58:42 +02:00
}
2021-04-28 20:30:34 +02:00
if ( gConf . GfxPropertiesArray [ i ] . Vendor = = Nvidia ) {
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = ASString ; //24+6i
2021-04-11 07:18:52 +02:00
for ( j = 0 ; j < gSettings . Graphics . NVCAP . size ( ) ; j + + ) {
2021-03-26 10:43:15 +01:00
snprintf ( ( CHAR8 * ) & tmp [ 2 * j ] , 3 , " %02hhX " , gSettings . Graphics . NVCAP [ j ] ) ;
2019-09-03 11:58:42 +02:00
}
2020-08-10 13:06:06 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %s " , tmp ) ;
2019-09-03 11:58:42 +02:00
} else { //ATI and others there will be connectors
InputItems [ InputItemsCount ] . ItemType = Hex ; //24+6i
2021-04-28 20:30:34 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %08x " , gConf . GfxPropertiesArray [ i ] . Connectors ) ;
2019-09-03 11:58:42 +02:00
}
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //25+6i
2021-04-28 20:30:34 +02:00
InputItems [ InputItemsCount + + ] . BValue = gConf . GfxPropertiesArray [ i ] . LoadVBios ;
2019-09-03 11:58:42 +02:00
}
//and so on
InputItemsCount = 44 ;
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //44
2021-04-03 16:42:49 +02:00
InputItems [ InputItemsCount + + ] . BValue = GlobalConfig . KextPatchesAllowed ;
2020-05-27 20:04:31 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //45
InputItems [ InputItemsCount + + ] . BValue = gSettings . KernelAndKextPatches . EightApple ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //46
2021-03-25 15:32:56 +01:00
InputItems [ InputItemsCount + + ] . BValue = GlobalConfig . KPAppleIntelCPUPM ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //47
InputItems [ InputItemsCount + + ] . BValue = gSettings . KernelAndKextPatches . KPAppleRTC ;
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //48
2021-03-25 15:32:56 +01:00
InputItems [ InputItemsCount + + ] . BValue = GlobalConfig . KPKernelPm ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //49
2021-02-11 12:41:59 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . ACPI . FixMCFG ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Decimal ; //50
2021-03-26 10:43:15 +01:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %06d " , gSettings . Graphics . RefCLK ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = ASString ; //51 OS version if non-detected
2020-08-12 17:15:47 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %s " , NonDetected . c_str ( ) ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //52
2021-03-26 10:43:15 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . Graphics . EDID . InjectEDID ;
2019-09-03 11:58:42 +02:00
//VendorEDID & ProductEDID 53, 54
InputItems [ InputItemsCount ] . ItemType = Decimal ; //53
2021-03-26 10:43:15 +01:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%04hX " , gSettings . Graphics . EDID . VendorEDID ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Decimal ; //54
2021-03-26 10:43:15 +01:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%04hX " , gSettings . Graphics . EDID . ProductEDID ) ;
2019-09-03 11:58:42 +02:00
// ErmaC: NvidiaGeneric menu selector y/n
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //55
2021-03-26 10:43:15 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . Graphics . NvidiaGeneric ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //56
2021-03-25 15:32:56 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . SystemParameters . NvidiaWeb ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //57
2021-03-26 10:43:15 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . Devices . Audio . ResetHDA ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //58
2021-03-29 10:50:02 +02:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . Devices . Audio . AFGLowPowerState ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //59
2021-03-29 10:50:02 +02:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . Devices . Audio . HDAInjection ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Decimal ; // 60
2021-03-29 10:50:02 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %d " , gSettings . Devices . Audio . HDALayoutId ) ;
2019-09-03 11:58:42 +02:00
// syscl change here
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //61
InputItems [ InputItemsCount + + ] . BValue = gSettings . KernelAndKextPatches . KPDELLSMBIOS ;
// end of change
InputItems [ InputItemsCount ] . ItemType = Hex ; //62
2021-04-28 20:30:34 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%08X " , gSettings . Smbios . FirmwareFeatures ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Hex ; //63
2021-04-28 20:30:34 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%08X " , gSettings . Smbios . FirmwareFeaturesMask ) ;
2019-09-03 11:58:42 +02:00
// Debug for KernelAndKextPatches
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //64
InputItems [ InputItemsCount + + ] . BValue = gSettings . KernelAndKextPatches . KPDebug ;
// CSR - aka System Integrity Protection configuration
InputItems [ InputItemsCount ] . ItemType = CheckBit ; //65
2021-03-26 10:43:15 +01:00
InputItems [ InputItemsCount + + ] . IValue = gSettings . RtVariables . BooterConfig ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = CheckBit ; //66
2021-03-26 10:43:15 +01:00
InputItems [ InputItemsCount + + ] . IValue = gSettings . RtVariables . CsrActiveConfig ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = CheckBit ; //67
2021-02-11 12:41:59 +01:00
InputItems [ InputItemsCount + + ] . IValue = gSettings . ACPI . DSDT . FixDsdt ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = CheckBit ; //68
2021-04-03 16:42:49 +02:00
InputItems [ InputItemsCount + + ] . IValue = GlobalConfig . OptionsBits ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = CheckBit ; //69
2021-04-03 16:42:49 +02:00
InputItems [ InputItemsCount + + ] . IValue = GlobalConfig . FlagsBits ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Decimal ; //70
2021-03-19 21:32:42 +01:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %02lld " , gSettings . GUI . Mouse . PointerSpeed ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Decimal ; //71
2021-03-19 21:32:42 +01:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %04llu " , gSettings . GUI . Mouse . DoubleClickTime ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //72
2021-03-19 21:32:42 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . GUI . Mouse . PointerMirror ;
2019-09-03 11:58:42 +02:00
//reserve for mouse and continue
InputItemsCount = 74 ;
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //74
2021-03-29 10:50:02 +02:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . Devices . USB . USBFixOwnership ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Hex ; //75
2021-03-19 16:35:01 +01:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%04hX " , GlobalConfig . C3Latency ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Decimal ; //76
2021-04-03 16:42:49 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %02d " , GlobalConfig . EnabledCores ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Decimal ; //77
2021-03-19 16:35:01 +01:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %02d " , gSettings . CPU . SavingMode ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = ASString ; //78
2021-04-03 16:42:49 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %s " , gSettings . Smbios . ProductName . c_str ( ) ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = ASString ; //79
2021-04-28 20:30:34 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %s " , gSettings . Smbios . SystemVersion . c_str ( ) ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = ASString ; //80
2021-04-03 16:42:49 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %s " , gSettings . Smbios . SerialNr . c_str ( ) ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = ASString ; //81
2021-04-03 16:42:49 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %s " , gSettings . Smbios . BoardNumber . c_str ( ) ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = ASString ; //82
2021-04-03 16:42:49 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %s " , gSettings . Smbios . BoardSerialNumber . c_str ( ) ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Decimal ; //83
2021-04-03 16:42:49 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %d " , gSettings . Smbios . BoardType ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = ASString ; //84
2021-04-03 16:42:49 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %s " , gSettings . Smbios . BoardVersion . c_str ( ) ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Decimal ; //85
2021-04-03 16:42:49 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %d " , gSettings . Smbios . ChassisType ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = ASString ; //86
2021-10-19 19:57:27 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %s " , gSettings . Smbios . BiosVersion . c_str ( ) ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = ASString ; //87
2021-10-19 19:57:27 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %s " , gSettings . Smbios . BiosReleaseDate . c_str ( ) ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //88
2021-02-11 12:41:59 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . ACPI . SSDT . DoubleFirstState ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //89
2021-02-11 12:41:59 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . ACPI . SSDT . EnableC7 ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = RadioSwitch ; //90
InputItems [ InputItemsCount + + ] . IValue = 90 ;
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //91
InputItems [ InputItemsCount + + ] . BValue = gSettings . KernelAndKextPatches . KPKernelLapic ;
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //92
2021-03-29 10:50:02 +02:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . Devices . USB . USBInjection ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //93
2021-03-29 10:50:02 +02:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . Devices . USB . InjectClockID ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Hex ; //94
2021-03-29 10:50:02 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%08X " , gSettings . Devices . FakeID . FakeATI ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Hex ; //95
2021-03-29 10:50:02 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%08X " , gSettings . Devices . FakeID . FakeNVidia ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Hex ; //96
2021-03-29 10:50:02 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%08X " , gSettings . Devices . FakeID . FakeIntel ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Hex ; //97
2021-03-29 10:50:02 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%08X " , gSettings . Devices . FakeID . FakeLAN ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Hex ; //98
2021-03-29 10:50:02 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%08X " , gSettings . Devices . FakeID . FakeWIFI ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Hex ; //99
2021-03-29 10:50:02 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%08X " , gSettings . Devices . FakeID . FakeSATA ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Hex ; //100
2021-03-29 10:50:02 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%08X " , gSettings . Devices . FakeID . FakeXHCI ) ;
2020-07-15 19:29:27 +02:00
InputItems [ InputItemsCount ] . ItemType = CheckBit ; //101 - Quirks
2021-03-28 22:13:43 +02:00
InputItems [ InputItemsCount + + ] . IValue = gSettings . Quirks . QuirksMask ; //
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //102
2021-02-11 12:41:59 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . ACPI . DSDT . DebugDSDT ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Hex ; //103
2021-03-29 10:50:02 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%08X " , gSettings . Devices . FakeID . FakeIMEI ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Hex ; //104
2020-08-10 13:06:06 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%08X " , gSettings . KernelAndKextPatches . FakeCPUID ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //105
InputItems [ InputItemsCount + + ] . BValue = gSettings . KernelAndKextPatches . KPKernelXCPM ;
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //106
2021-03-29 10:50:02 +02:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . Devices . StringInjector ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //107
2021-03-29 10:50:02 +02:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . Devices . NoDefaultProperties ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //108
2021-04-03 16:42:49 +02:00
InputItems [ InputItemsCount + + ] . BValue = GlobalConfig . KernelPatchesAllowed ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Hex ; //109
2021-03-26 10:43:15 +01:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %01X " , gSettings . Graphics . DualLink ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //110
2021-03-26 10:43:15 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . Graphics . NvidiaNoEFI ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //111
2021-03-26 10:43:15 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . Graphics . NvidiaSingle ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = Hex ; //112
2021-03-29 10:50:02 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%04X " , gSettings . Devices . IntelMaxValue ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //113
2021-02-11 12:41:59 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . ACPI . AutoMerge ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //114
2021-03-26 10:43:15 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . Graphics . RadeonDeInit ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //115
2021-03-25 15:32:56 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . SystemParameters . NoCaches ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = RadioSwitch ; //116 - DSDT chooser
InputItems [ InputItemsCount + + ] . IValue = 116 ;
InputItems [ InputItemsCount ] . ItemType = ASString ; //117
2021-10-19 19:57:27 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %s " , gSettings . Smbios . EfiVersion . c_str ( ) ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = ASString ; //118
2021-03-26 10:43:15 +01:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %s " , gSettings . RtVariables . BooterCfgStr . c_str ( ) ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = RadioSwitch ; //119 - Audio chooser
InputItems [ InputItemsCount + + ] . IValue = 119 ;
InputItems [ InputItemsCount ] . ItemType = Decimal ; //120
2020-08-10 13:06:06 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %04d " , DefaultAudioVolume ) ;
2019-09-03 11:58:42 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //121
InputItems [ InputItemsCount + + ] . BValue = gSettings . KernelAndKextPatches . KPPanicNoKextDump ;
2020-07-15 19:29:27 +02:00
InputItems [ InputItemsCount ] . ItemType = Decimal ; //122
2021-04-11 07:18:52 +02:00
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %04hhu " , gSettings . Quirks . OcBooterQuirks . ProvideMaxSlide ) ;
2020-07-15 19:29:27 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //123
2021-03-19 21:32:42 +01:00
InputItems [ InputItemsCount + + ] . BValue = gSettings . GUI . ProvideConsoleGop ;
2021-05-19 14:11:21 +02:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //124
InputItems [ InputItemsCount + + ] . BValue = gSettings . ACPI . FixHeaders ;
2019-09-03 11:58:42 +02:00
2021-09-25 13:33:16 +02:00
InputItems [ InputItemsCount ] . ItemType = Hex ; //125
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%016llX " , gSettings . Smbios . ExtendedFirmwareFeatures ) ;
InputItems [ InputItemsCount ] . ItemType = Hex ; //126
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " 0x%016llX " , gSettings . Smbios . ExtendedFirmwareFeaturesMask ) ;
2021-10-30 10:21:39 +02:00
InputItems [ InputItemsCount ] . ItemType = Decimal ; //127
InputItems [ InputItemsCount + + ] . SValue . SWPrintf ( " %04d " , gSettings . Quirks . OcBooterQuirks . ResizeAppleGpuBars ) ;
2021-09-25 13:33:16 +02:00
2022-01-29 11:59:16 +01:00
InputItems [ InputItemsCount ] . ItemType = BoolValue ; //128
InputItems [ InputItemsCount + + ] . BValue = gSettings . Quirks . OcKernelQuirks . ProvideCurrentCpuInfo ;
2019-09-03 11:58:42 +02:00
//menu for drop table
2021-02-11 12:41:59 +01:00
if ( GlobalConfig . ACPIDropTables ) {
ACPI_DROP_TABLE * DropTable = GlobalConfig . ACPIDropTables ;
2019-09-03 11:58:42 +02:00
while ( DropTable ) {
DropTable - > MenuItem . ItemType = BoolValue ;
DropTable = DropTable - > Next ;
}
}
2021-03-23 20:59:30 +01:00
for ( size_t idx = 0 ; idx < ACPIPatchedAML . size ( ) ; + + idx ) {
ACPI_PATCHED_AML & ACPIPatchedAMLTmp = ACPIPatchedAML [ idx ] ;
ACPIPatchedAMLTmp . MenuItem . ItemType = BoolValue ;
2019-09-03 11:58:42 +02:00
}
}
2020-10-03 19:02:31 +02:00
void ApplyInputs ( void )
2019-09-03 11:58:42 +02:00
{
2021-04-28 20:30:34 +02:00
// EFI_STATUS Status = EFI_NOT_FOUND;
2021-10-18 21:06:19 +02:00
MacModel Model ;
2021-09-28 10:28:45 +02:00
XBool NeedSave = true ;
2019-09-03 11:58:42 +02:00
INTN i = 0 ;
UINTN j ;
2020-08-19 14:50:26 +02:00
2019-09-03 11:58:42 +02:00
// DBG("ApplyInputs\n");
if ( InputItems [ i ] . Valid ) {
2021-02-02 10:02:21 +01:00
gSettings . Boot . BootArgs = InputItems [ i ] . SValue ;
gSettings . Boot . BootArgs . replaceAll ( ' \\ ' , ' _ ' ) ;
2021-09-28 10:28:45 +02:00
GlobalConfig . gBootChanged = true ;
2019-09-03 11:58:42 +02:00
}
i + + ; //1
if ( InputItems [ i ] . Valid ) {
2021-02-11 12:41:59 +01:00
gSettings . ACPI . DSDT . DsdtName = InputItems [ i ] . SValue ;
2019-09-03 11:58:42 +02:00
}
i + + ; //2
if ( InputItems [ i ] . Valid ) {
2021-04-03 16:42:49 +02:00
GlobalConfig . BlockKexts = InputItems [ i ] . SValue ;
2019-09-03 11:58:42 +02:00
}
i + + ; //3
if ( InputItems [ i ] . Valid ) {
2020-03-30 10:34:16 +02:00
if ( OldChosenTheme = = 0xFFFF ) {
2021-02-02 10:02:21 +01:00
gSettings . GUI . Theme = L " embedded " _XSW ;
2020-03-30 10:34:16 +02:00
} else {
2021-02-02 10:02:21 +01:00
gSettings . GUI . Theme . takeValueFrom ( ThemeNameArray [ OldChosenTheme ] ) ;
2020-03-30 10:34:16 +02:00
}
2019-09-03 11:58:42 +02:00
//will change theme after ESC
2021-09-28 10:28:45 +02:00
GlobalConfig . gThemeChanged = true ;
2019-09-03 11:58:42 +02:00
}
i + + ; //4
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
GlobalConfig . DropSSDT = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //5
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . ACPI . SSDT . Generate . GeneratePStates = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //6
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . ACPI . SlpSmiEnable = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //7
if ( InputItems [ i ] . Valid ) {
2020-03-25 19:32:44 +01:00
// DBG("InputItems[i]: %ls\n", InputItems[i].SValue);
2021-02-11 12:41:59 +01:00
gSettings . ACPI . SSDT . PLimitDict = ( UINT8 ) ( StrDecimalToUintn ( InputItems [ i ] . SValue . wc_str ( ) ) & 0x7F ) ;
// DBG("Item 7=PLimitDict %d\n", gSettings.ACPI.SSDT.PLimitDict);
2019-09-03 11:58:42 +02:00
}
i + + ; //8
if ( InputItems [ i ] . Valid ) {
2021-02-11 12:41:59 +01:00
gSettings . ACPI . SSDT . UnderVoltStep = ( UINT8 ) ( StrDecimalToUintn ( InputItems [ i ] . SValue . wc_str ( ) ) & 0x3F ) ;
// DBG("Item 8=UnderVoltStep %d\n", gSettings.ACPI.SSDT.UnderVoltStep);
2019-09-03 11:58:42 +02:00
}
i + + ; //9
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . ACPI . SSDT . Generate . GenerateCStates = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //10
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
GlobalConfig . EnableC2 = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //11
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
GlobalConfig . EnableC4 = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //12
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
GlobalConfig . EnableC6 = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //13
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . ACPI . SSDT . EnableISS = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //14
if ( InputItems [ i ] . Valid ) {
2021-03-19 16:35:01 +01:00
gSettings . CPU . QPI = ( UINT16 ) StrDecimalToUintn ( InputItems [ i ] . SValue . wc_str ( ) ) ;
DBG ( " applied QPI=%d \n " , gSettings . CPU . QPI ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //15
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . ACPI . PatchNMI = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //16
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . Graphics . PatchVBios = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //17
if ( InputItems [ i ] . Valid ) {
2021-04-03 16:42:49 +02:00
gSettings . Smbios . gPlatformFeature = ( UINT64 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
DBG ( " applied PlatformFeature=0x%llX \n " , gSettings . Smbios . gPlatformFeature ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //18 | Download-Fritz: There is no GUI element for BacklightLevel; please revise
if ( InputItems [ i ] . Valid ) {
2021-03-25 15:32:56 +01:00
gSettings . SystemParameters . BacklightLevel = ( UINT16 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2021-09-28 10:28:45 +02:00
gSettings . SystemParameters . BacklightLevelConfig = true ;
2019-09-03 11:58:42 +02:00
}
i + + ; //19
if ( InputItems [ i ] . Valid ) {
2021-03-19 16:35:01 +01:00
gSettings . CPU . BusSpeed = ( UINT32 ) StrDecimalToUintn ( InputItems [ i ] . SValue . wc_str ( ) ) ;
DBG ( " applied BusSpeed=%d \n " , gSettings . CPU . BusSpeed ) ;
2019-09-03 11:58:42 +02:00
}
i = 19 ;
2021-04-28 20:30:34 +02:00
for ( j = 0 ; j < gConf . GfxPropertiesArrayNonConst . size ( ) ; j + + ) {
2019-09-03 11:58:42 +02:00
i + + ; //20
if ( InputItems [ i ] . Valid ) {
2021-04-28 20:30:34 +02:00
gConf . GfxPropertiesArrayNonConst [ j ] . Model = InputItems [ i ] . SValue ;
2019-09-03 11:58:42 +02:00
}
i + + ; //21
if ( InputItems [ i ] . Valid ) {
2021-04-28 20:30:34 +02:00
if ( gConf . GfxPropertiesArrayNonConst [ j ] . Vendor = = Ati ) {
2021-09-28 15:54:31 +02:00
gSettings . Graphics . InjectAsDict . InjectATI = InputItems [ i ] . BValue ! = 0 ;
2021-04-28 20:30:34 +02:00
} else if ( gConf . GfxPropertiesArrayNonConst [ j ] . Vendor = = Nvidia ) {
2021-09-28 15:54:31 +02:00
gSettings . Graphics . InjectAsDict . InjectNVidia = InputItems [ i ] . BValue ! = 0 ;
2021-04-28 20:30:34 +02:00
} else if ( gConf . GfxPropertiesArrayNonConst [ j ] . Vendor = = Intel ) {
2021-09-28 15:54:31 +02:00
gSettings . Graphics . InjectAsDict . InjectIntel = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
}
i + + ; //22
if ( InputItems [ i ] . Valid ) {
2021-04-28 20:30:34 +02:00
if ( gConf . GfxPropertiesArrayNonConst [ j ] . Vendor = = Ati ) {
2021-03-26 10:43:15 +01:00
gSettings . Graphics . FBName = InputItems [ i ] . SValue ;
2021-04-28 20:30:34 +02:00
} else if ( gConf . GfxPropertiesArrayNonConst [ j ] . Vendor = = Nvidia ) {
2021-03-26 10:43:15 +01:00
hex2bin ( InputItems [ i ] . SValue , ( UINT8 * ) & gSettings . Graphics . Dcfg [ 0 ] , sizeof ( gSettings . Graphics . Dcfg ) ) ;
2021-04-28 20:30:34 +02:00
} else if ( gConf . GfxPropertiesArrayNonConst [ j ] . Vendor = = Intel ) {
2019-09-03 11:58:42 +02:00
//ig-platform-id for Ivy+ and snb-platform-id for Sandy
2021-04-12 14:11:01 +02:00
GlobalConfig . IgPlatform = ( UINT32 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
DBG ( " applied *-platform-id=0x%X \n " , GlobalConfig . IgPlatform ) ;
2019-09-03 11:58:42 +02:00
}
}
2021-04-28 20:30:34 +02:00
if ( gConf . GfxPropertiesArrayNonConst [ j ] . Vendor = = Intel ) {
2019-09-03 11:58:42 +02:00
i + = 3 ;
continue ;
}
i + + ; //23
if ( InputItems [ i ] . Valid ) {
2021-04-28 20:30:34 +02:00
gConf . GfxPropertiesArrayNonConst [ j ] . Ports = ( UINT8 ) ( StrDecimalToUintn ( InputItems [ i ] . SValue . wc_str ( ) ) & 0x0F ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //24
if ( InputItems [ i ] . Valid ) {
2021-04-28 20:30:34 +02:00
if ( gConf . GfxPropertiesArray [ j ] . Vendor = = Nvidia ) {
2020-08-10 13:06:06 +02:00
if ( InputItems [ i ] . SValue . notEmpty ( ) ) {
2021-04-11 07:18:52 +02:00
hex2bin ( InputItems [ i ] . SValue , gSettings . Graphics . NVCAP . data ( ) , gSettings . Graphics . NVCAP . size ( ) ) ;
2019-09-03 11:58:42 +02:00
}
} else {
2021-04-28 20:30:34 +02:00
gConf . GfxPropertiesArrayNonConst [ j ] . Connectors = ( UINT32 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2021-09-28 10:28:45 +02:00
gConf . GfxPropertiesArrayNonConst [ j ] . ConnChanged = true ;
2019-09-03 11:58:42 +02:00
}
}
i + + ; //25
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gConf . GfxPropertiesArrayNonConst [ j ] . LoadVBios = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
} //end of Graphics Cards
// next number == 42
i = 44 ;
if ( InputItems [ i ] . Valid ) {
2021-09-28 10:28:45 +02:00
GlobalConfig . KextPatchesAllowed = InputItems [ i ] . BValue ! = 0 ;
GlobalConfig . gBootChanged = true ;
2019-09-03 11:58:42 +02:00
}
2020-05-27 20:04:31 +02:00
i + + ; //45
2019-09-03 11:58:42 +02:00
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . KernelAndKextPatches . EightApple = InputItems [ i ] . BValue ! = 0 ;
2021-09-28 10:28:45 +02:00
GlobalConfig . gBootChanged = true ;
2019-09-03 11:58:42 +02:00
}
i + + ; //46
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
GlobalConfig . KPAppleIntelCPUPM = InputItems [ i ] . BValue ! = 0 ;
2021-09-28 10:28:45 +02:00
GlobalConfig . gBootChanged = true ;
2019-09-03 11:58:42 +02:00
}
i + + ; //47
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . KernelAndKextPatches . KPAppleRTC = InputItems [ i ] . BValue ! = 0 ;
2021-09-28 10:28:45 +02:00
GlobalConfig . gBootChanged = true ;
2019-09-03 11:58:42 +02:00
}
i + + ; //48
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
GlobalConfig . KPKernelPm = InputItems [ i ] . BValue ! = 0 ;
2021-09-28 10:28:45 +02:00
GlobalConfig . gBootChanged = true ;
2019-09-03 11:58:42 +02:00
}
i + + ; //49
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . ACPI . FixMCFG = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //50
if ( InputItems [ i ] . Valid ) {
2021-03-26 10:43:15 +01:00
gSettings . Graphics . RefCLK = ( UINT32 ) StrDecimalToUintn ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //51
if ( InputItems [ i ] . Valid ) {
2020-08-12 17:15:47 +02:00
NonDetected = InputItems [ i ] . SValue ;
2019-09-03 11:58:42 +02:00
}
i + + ; //52
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . Graphics . EDID . InjectEDID = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //53
if ( InputItems [ i ] . Valid ) {
2021-03-26 10:43:15 +01:00
gSettings . Graphics . EDID . VendorEDID = ( UINT16 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //54
if ( InputItems [ i ] . Valid ) {
2021-03-26 10:43:15 +01:00
gSettings . Graphics . EDID . ProductEDID = ( UINT16 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //55
2021-09-28 15:54:31 +02:00
// ErmaC: NvidiaGeneric XBool(Y/N)
2019-09-03 11:58:42 +02:00
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . Graphics . NvidiaGeneric = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //56
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . SystemParameters . NvidiaWeb = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //57
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . Devices . Audio . ResetHDA = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //58
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . Devices . Audio . AFGLowPowerState = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //59
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . Devices . Audio . HDAInjection = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //60
if ( InputItems [ i ] . Valid ) {
2021-03-29 10:50:02 +02:00
gSettings . Devices . Audio . HDALayoutId = ( UINT32 ) ( StrDecimalToUintn ( InputItems [ i ] . SValue . wc_str ( ) ) ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //61
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . KernelAndKextPatches . KPDELLSMBIOS = InputItems [ i ] . BValue ! = 0 ;
2021-03-25 15:32:56 +01:00
// // yes, we do need to change gRemapSmBiosIsRequire here as well
// gRemapSmBiosIsRequire = InputItems[i].BValue;
2021-09-28 10:28:45 +02:00
GlobalConfig . gBootChanged = true ;
2019-09-03 11:58:42 +02:00
}
i + + ; //62
if ( InputItems [ i ] . Valid ) {
2021-04-28 20:30:34 +02:00
gSettings . Smbios . FirmwareFeatures = ( UINT32 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
DBG ( " applied FirmwareFeatures=0x%X \n " , gSettings . Smbios . FirmwareFeatures ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //63
if ( InputItems [ i ] . Valid ) {
2021-04-28 20:30:34 +02:00
gSettings . Smbios . FirmwareFeaturesMask = ( UINT32 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
DBG ( " applied FirmwareFeaturesMask=0x%X \n " , gSettings . Smbios . FirmwareFeaturesMask ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //64
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . KernelAndKextPatches . KPDebug = InputItems [ i ] . BValue ! = 0 ;
2021-09-28 10:28:45 +02:00
// GlobalConfig.gBootChanged = true;
2019-09-03 11:58:42 +02:00
}
// CSR
i = 65 ;
if ( InputItems [ i ] . Valid ) {
2021-03-26 10:43:15 +01:00
gSettings . RtVariables . BooterConfig = InputItems [ i ] . IValue & 0x7F ;
2019-09-03 11:58:42 +02:00
}
i + + ; //66
if ( InputItems [ i ] . Valid ) {
2021-03-26 10:43:15 +01:00
gSettings . RtVariables . CsrActiveConfig = InputItems [ i ] . IValue ;
2019-09-03 11:58:42 +02:00
}
i + + ; //67
if ( InputItems [ i ] . Valid ) {
2021-02-11 12:41:59 +01:00
gSettings . ACPI . DSDT . FixDsdt = InputItems [ i ] . IValue ;
2019-09-03 11:58:42 +02:00
}
i + + ; //68
if ( InputItems [ i ] . Valid ) {
2021-04-03 16:42:49 +02:00
GlobalConfig . OptionsBits = InputItems [ i ] . IValue ;
2019-09-03 11:58:42 +02:00
}
i + + ; //69
if ( InputItems [ i ] . Valid ) {
2021-04-03 16:42:49 +02:00
GlobalConfig . FlagsBits = InputItems [ i ] . IValue ;
2019-09-03 11:58:42 +02:00
}
i + + ; //70
if ( InputItems [ i ] . Valid ) {
INTN Minus = 0 ;
if ( InputItems [ i ] . SValue [ 0 ] = = ' - ' ) {
Minus = 1 ;
}
2021-03-19 21:32:42 +01:00
gSettings . GUI . Mouse . PointerSpeed = StrDecimalToUintn ( InputItems [ i ] . SValue . data ( Minus ) ) ;
2019-09-03 11:58:42 +02:00
if ( Minus ) {
2021-03-19 21:32:42 +01:00
gSettings . GUI . Mouse . PointerSpeed = - gSettings . GUI . Mouse . PointerSpeed ;
2019-09-03 11:58:42 +02:00
}
// DBG("Pointer Speed=%d\n", gSettings.PointerSpeed);
}
i + + ; //71
if ( InputItems [ i ] . Valid ) {
2021-03-19 21:32:42 +01:00
gSettings . GUI . Mouse . DoubleClickTime = StrDecimalToUintn ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2019-09-03 11:58:42 +02:00
// DBG("DoubleClickTime=%d ms\n", gSettings.DoubleClickTime);
}
i + + ; //72
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . GUI . Mouse . PointerMirror = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i = 74 ;
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . Devices . USB . USBFixOwnership = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //75
if ( InputItems [ i ] . Valid ) {
2021-03-19 16:35:01 +01:00
GlobalConfig . C3Latency = ( UINT16 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //76
if ( InputItems [ i ] . Valid ) {
2021-04-03 16:42:49 +02:00
GlobalConfig . EnabledCores = ( UINT8 ) StrDecimalToUintn ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //77
if ( InputItems [ i ] . Valid ) {
2021-03-19 16:35:01 +01:00
gSettings . CPU . SavingMode = ( UINT8 ) StrDecimalToUintn ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //78
if ( InputItems [ i ] . Valid ) {
2021-04-03 16:42:49 +02:00
gSettings . Smbios . ProductName = InputItems [ i ] . SValue ;
2019-09-03 11:58:42 +02:00
// let's fill all other fields based on this ProductName
// to serve as default
2021-04-03 16:42:49 +02:00
Model = GetModelFromString ( gSettings . Smbios . ProductName ) ;
2021-10-19 19:57:27 +02:00
if ( Model ! = MaxMacModel ) {
2022-05-22 20:59:22 +02:00
GlobalConfig . CurrentModel = Model ;
2021-10-19 19:57:27 +02:00
SetDMISettingsForModel ( Model , & gSettings ) ;
2019-09-03 11:58:42 +02:00
}
}
i + + ; //79
if ( InputItems [ i ] . Valid ) {
2021-04-28 20:30:34 +02:00
gSettings . Smbios . SystemVersion = InputItems [ i ] . SValue ;
2019-09-03 11:58:42 +02:00
}
i + + ; //80
if ( InputItems [ i ] . Valid ) {
2021-04-03 16:42:49 +02:00
gSettings . Smbios . SerialNr = InputItems [ i ] . SValue ;
2019-09-03 11:58:42 +02:00
}
i + + ; //81
if ( InputItems [ i ] . Valid ) {
2021-04-03 16:42:49 +02:00
gSettings . Smbios . BoardNumber = InputItems [ i ] . SValue ;
2019-09-03 11:58:42 +02:00
}
i + + ; //82
if ( InputItems [ i ] . Valid ) {
2021-04-03 16:42:49 +02:00
gSettings . Smbios . BoardSerialNumber = InputItems [ i ] . SValue ;
2019-09-03 11:58:42 +02:00
}
i + + ; //83
if ( InputItems [ i ] . Valid ) {
2021-04-03 16:42:49 +02:00
gSettings . Smbios . BoardType = ( UINT8 ) ( StrDecimalToUintn ( InputItems [ i ] . SValue . wc_str ( ) ) & 0x0F ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //84
if ( InputItems [ i ] . Valid ) {
2021-04-03 16:42:49 +02:00
gSettings . Smbios . BoardVersion = InputItems [ i ] . SValue ;
2019-09-03 11:58:42 +02:00
}
i + + ; //85
if ( InputItems [ i ] . Valid ) {
2021-04-03 16:42:49 +02:00
gSettings . Smbios . ChassisType = ( UINT8 ) ( StrDecimalToUintn ( InputItems [ i ] . SValue . wc_str ( ) ) & 0x0F ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //86
if ( InputItems [ i ] . Valid ) {
2021-10-19 19:57:27 +02:00
gSettings . Smbios . BiosVersion = InputItems [ i ] . SValue ;
2019-09-03 11:58:42 +02:00
}
i + + ; //87
if ( InputItems [ i ] . Valid ) {
2021-10-19 19:57:27 +02:00
gSettings . Smbios . BiosReleaseDate = InputItems [ i ] . SValue ;
2019-09-03 11:58:42 +02:00
}
i + + ; //88
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . ACPI . SSDT . DoubleFirstState = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //89
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . ACPI . SSDT . EnableC7 = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //90
if ( InputItems [ i ] . Valid ) {
2021-04-28 20:30:34 +02:00
// TagDict* dict;
/*Status = */ gConf . ReLoadConfig ( XStringW ( ConfigsList [ OldChosenConfig ] ) /*, &dict*/ ) ; // TODO: make a ReloadConfig, because in case of a reload, there are probably slightly different things to do.
// if (!EFI_ERROR(Status)) {
2021-09-28 10:28:45 +02:00
GlobalConfig . gBootChanged = true ;
GlobalConfig . gThemeChanged = true ;
2021-04-28 20:30:34 +02:00
// Status = GetUserSettings(dict, gSettings);
// if (gConfigDict[2]) gConfigDict[2]->FreeTag();
// gConfigDict[2] = dict;
2021-04-03 16:42:49 +02:00
// GlobalConfig.ConfigName.takeValueFrom(ConfigsList[OldChosenConfig]);
2021-04-28 20:30:34 +02:00
// }
2021-09-28 10:28:45 +02:00
FillInputs ( false ) ;
NeedSave = false ;
2019-09-03 11:58:42 +02:00
}
i + + ; //91
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . KernelAndKextPatches . KPKernelLapic = InputItems [ i ] . BValue ! = 0 ;
2021-09-28 10:28:45 +02:00
GlobalConfig . gBootChanged = true ;
2019-09-03 11:58:42 +02:00
}
i + + ; //92
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . Devices . USB . USBInjection = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //93
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . Devices . USB . InjectClockID = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //94
if ( InputItems [ i ] . Valid ) {
2021-03-29 10:50:02 +02:00
gSettings . Devices . FakeID . FakeATI = ( UINT32 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //95
if ( InputItems [ i ] . Valid ) {
2021-03-29 10:50:02 +02:00
gSettings . Devices . FakeID . FakeNVidia = ( UINT32 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //96
if ( InputItems [ i ] . Valid ) {
2021-03-29 10:50:02 +02:00
gSettings . Devices . FakeID . FakeIntel = ( UINT32 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
DBG ( " applied FakeIntel=0x%X \n " , gSettings . Devices . FakeID . FakeIntel ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //97
if ( InputItems [ i ] . Valid ) {
2021-03-29 10:50:02 +02:00
gSettings . Devices . FakeID . FakeLAN = ( UINT32 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //98
if ( InputItems [ i ] . Valid ) {
2021-03-29 10:50:02 +02:00
gSettings . Devices . FakeID . FakeWIFI = ( UINT32 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //99
if ( InputItems [ i ] . Valid ) {
2021-03-29 10:50:02 +02:00
gSettings . Devices . FakeID . FakeSATA = ( UINT32 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //100
if ( InputItems [ i ] . Valid ) {
2021-03-29 10:50:02 +02:00
gSettings . Devices . FakeID . FakeXHCI = ( UINT32 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2019-09-03 11:58:42 +02:00
}
2020-07-15 19:29:27 +02:00
i + + ; //101 - Quirks
if ( InputItems [ i ] . Valid ) {
2021-03-28 22:13:43 +02:00
gSettings . Quirks . QuirksMask = InputItems [ i ] . IValue ;
2021-04-11 07:18:52 +02:00
gSettings . Quirks . OcBooterQuirks . AvoidRuntimeDefrag = ( ( gSettings . Quirks . QuirksMask & QUIRK_DEFRAG ) ! = 0 ) ; //1
gSettings . Quirks . OcBooterQuirks . DevirtualiseMmio = ( ( gSettings . Quirks . QuirksMask & QUIRK_MMIO ) ! = 0 ) ; //0
gSettings . Quirks . OcBooterQuirks . DisableSingleUser = ( ( gSettings . Quirks . QuirksMask & QUIRK_SU ) ! = 0 ) ; //0
gSettings . Quirks . OcBooterQuirks . DisableVariableWrite = ( ( gSettings . Quirks . QuirksMask & QUIRK_VAR ) ! = 0 ) ; //0
gSettings . Quirks . OcBooterQuirks . DiscardHibernateMap = ( ( gSettings . Quirks . QuirksMask & QUIRK_HIBER ) ! = 0 ) ; //0
gSettings . Quirks . OcBooterQuirks . EnableSafeModeSlide = ( ( gSettings . Quirks . QuirksMask & QUIRK_SAFE ) ! = 0 ) ; //1
gSettings . Quirks . OcBooterQuirks . EnableWriteUnprotector = ( ( gSettings . Quirks . QuirksMask & QUIRK_UNPROT ) ! = 0 ) ; //1
gSettings . Quirks . OcBooterQuirks . ForceExitBootServices = ( ( gSettings . Quirks . QuirksMask & QUIRK_EXIT ) ! = 0 ) ; //0
gSettings . Quirks . OcBooterQuirks . ProtectMemoryRegions = ( ( gSettings . Quirks . QuirksMask & QUIRK_REGION ) ! = 0 ) ; //0
gSettings . Quirks . OcBooterQuirks . ProtectSecureBoot = ( ( gSettings . Quirks . QuirksMask & QUIRK_SECURE ) ! = 0 ) ; //0
gSettings . Quirks . OcBooterQuirks . ProtectUefiServices = ( ( gSettings . Quirks . QuirksMask & QUIRK_UEFI ) ! = 0 ) ; //0
gSettings . Quirks . OcBooterQuirks . ProvideCustomSlide = ( ( gSettings . Quirks . QuirksMask & QUIRK_CUSTOM ) ! = 0 ) ; //1
gSettings . Quirks . OcBooterQuirks . RebuildAppleMemoryMap = ( ( gSettings . Quirks . QuirksMask & QUIRK_MAP ) ! = 0 ) ; //0
gSettings . Quirks . OcBooterQuirks . SetupVirtualMap = ( ( gSettings . Quirks . QuirksMask & QUIRK_VIRT ) ! = 0 ) ; //1
gSettings . Quirks . OcBooterQuirks . SignalAppleOS = ( ( gSettings . Quirks . QuirksMask & QUIRK_OS ) ! = 0 ) ; //0
gSettings . Quirks . OcBooterQuirks . SyncRuntimePermissions = ( ( gSettings . Quirks . QuirksMask & QUIRK_PERM ) ! = 0 ) ; //1
2021-03-28 22:13:43 +02:00
DBG ( " applied Quirks mask:%x \n " , gSettings . Quirks . QuirksMask ) ; //default is 0xA861
2019-09-03 11:58:42 +02:00
}
i + + ; //102
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . ACPI . DSDT . DebugDSDT = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //103
if ( InputItems [ i ] . Valid ) {
2021-03-29 10:50:02 +02:00
gSettings . Devices . FakeID . FakeIMEI = ( UINT32 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //104
if ( InputItems [ i ] . Valid ) {
2020-08-10 13:06:06 +02:00
gSettings . KernelAndKextPatches . FakeCPUID = ( UINT32 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2020-03-25 19:32:44 +01:00
DBG ( " applied FakeCPUID=%06X \n " , gSettings . KernelAndKextPatches . FakeCPUID ) ;
2021-09-28 10:28:45 +02:00
GlobalConfig . gBootChanged = true ;
2019-09-03 11:58:42 +02:00
}
i + + ; //105
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . KernelAndKextPatches . KPKernelXCPM = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
DBG ( " applied KernelXCPM \n " ) ;
2021-09-28 10:28:45 +02:00
GlobalConfig . gBootChanged = true ;
2019-09-03 11:58:42 +02:00
}
i + + ; //106
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . Devices . StringInjector = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //107
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . Devices . NoDefaultProperties = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //108
if ( InputItems [ i ] . Valid ) {
2021-09-28 10:28:45 +02:00
GlobalConfig . KernelPatchesAllowed = InputItems [ i ] . BValue ! = 0 ;
GlobalConfig . gBootChanged = true ;
2019-09-03 11:58:42 +02:00
}
i + + ; //109
if ( InputItems [ i ] . Valid ) {
2021-03-26 10:43:15 +01:00
gSettings . Graphics . DualLink = ( UINT32 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
DBG ( " applied DualLink=%X \n " , gSettings . Graphics . DualLink ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //110
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . Graphics . NvidiaNoEFI = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //111
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . Graphics . NvidiaSingle = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //112
if ( InputItems [ i ] . Valid ) {
2021-03-29 10:50:02 +02:00
gSettings . Devices . IntelMaxValue = ( UINT16 ) StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2019-09-03 11:58:42 +02:00
}
i + + ; //113
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . ACPI . AutoMerge = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //114
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . Graphics . RadeonDeInit = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //115
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . SystemParameters . NoCaches = InputItems [ i ] . BValue ! = 0 ;
2019-09-03 11:58:42 +02:00
}
i + + ; //116
if ( InputItems [ i ] . Valid ) {
if ( OldChosenDsdt = = 0xFFFF ) {
2021-02-11 12:41:59 +01:00
gSettings . ACPI . DSDT . DsdtName = L " BIOS.aml " _XSW ;
2019-09-03 11:58:42 +02:00
} else {
2021-09-27 09:18:52 +02:00
gSettings . ACPI . DSDT . DsdtName = DsdtsList [ OldChosenDsdt ] ;
2019-09-03 11:58:42 +02:00
}
}
i + + ; //117
if ( InputItems [ i ] . Valid ) {
2021-10-19 19:57:27 +02:00
gSettings . Smbios . EfiVersion = InputItems [ i ] . SValue ;
2019-09-03 11:58:42 +02:00
}
i + + ; //118
if ( InputItems [ i ] . Valid ) {
2021-03-26 10:43:15 +01:00
gSettings . RtVariables . BooterCfgStr = InputItems [ i ] . SValue ;
2019-09-03 11:58:42 +02:00
}
i + + ; //119
if ( InputItems [ i ] . Valid ) {
EFI_DEVICE_PATH_PROTOCOL * DevicePath = NULL ;
2020-08-31 09:07:36 +02:00
int TmpIndex ;
if ( OldChosenAudio > = AudioList . size ( ) ) {
2020-06-05 14:15:31 +02:00
// DBG("crasy OldChosenAudio = %lld\n", OldChosenAudio);
2020-06-05 11:43:12 +02:00
OldChosenAudio = 0 ;
}
TmpIndex = OldChosenAudio & 0x2F ;
2020-06-05 14:15:31 +02:00
// DBG("Chosen output %u:%ls_%s\n", TmpIndex, AudioList[TmpIndex].Name,
// AudioOutputNames[AudioList[TmpIndex].Device]);
2019-09-03 11:58:42 +02:00
2020-06-05 11:43:12 +02:00
DevicePath = DevicePathFromHandle ( AudioList [ TmpIndex ] . Handle ) ;
2020-06-05 14:15:31 +02:00
// DBG("choosen sound devicepath=%ls\n", DevicePathToStr(DevicePath));
2019-09-03 11:58:42 +02:00
if ( DevicePath ! = NULL ) {
2022-04-26 00:55:56 +02:00
SetNvramVariable ( L " Clover.SoundDevice " , gEfiAppleBootGuid ,
2019-09-03 11:58:42 +02:00
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS ,
GetDevicePathSize ( DevicePath ) , ( UINT8 * ) DevicePath ) ;
2022-04-26 00:55:56 +02:00
SetNvramVariable ( L " Clover.SoundIndex " , gEfiAppleBootGuid ,
2019-09-03 11:58:42 +02:00
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS ,
1 , ( UINT8 * ) & TmpIndex ) ;
2020-06-05 14:15:31 +02:00
// DBG(" sound written to nvram variables\n");
2019-09-03 11:58:42 +02:00
}
}
i + + ; //120
if ( InputItems [ i ] . Valid ) {
2020-08-10 13:06:06 +02:00
DefaultAudioVolume = ( UINT8 ) StrDecimalToUintn ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2020-06-05 14:15:31 +02:00
// DBG(" set output volume to %d\n", DefaultAudioVolume);
2019-09-03 11:58:42 +02:00
if ( DefaultAudioVolume > 100 ) {
// correct wrong input
DefaultAudioVolume = 90 ;
2020-08-10 13:06:06 +02:00
InputItems [ i ] . SValue . SWPrintf ( " %04d " , DefaultAudioVolume ) ;
2019-09-03 11:58:42 +02:00
}
2022-04-26 00:55:56 +02:00
SetNvramVariable ( L " Clover.SoundVolume " , gEfiAppleBootGuid ,
2019-09-03 11:58:42 +02:00
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS ,
1 , & DefaultAudioVolume ) ;
}
i + + ; //121
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . KernelAndKextPatches . KPPanicNoKextDump = InputItems [ i ] . BValue ! = 0 ;
2021-09-28 10:28:45 +02:00
GlobalConfig . gBootChanged = true ;
2019-09-03 11:58:42 +02:00
}
2020-07-15 19:29:27 +02:00
i + + ; //122
if ( InputItems [ i ] . Valid ) {
2021-05-08 11:34:17 +02:00
gSettings . Quirks . OcBooterQuirks . ProvideMaxSlide = ( uint8_t ) StrDecimalToUintn ( InputItems [ i ] . SValue . wc_str ( ) ) ;
2021-04-11 07:18:52 +02:00
DBG ( " set MaxSlide = %hhu \n " , gSettings . Quirks . OcBooterQuirks . ProvideMaxSlide ) ;
2020-07-15 19:29:27 +02:00
}
i + + ; //123
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . GUI . ProvideConsoleGop = InputItems [ i ] . BValue ! = 0 ;
2021-03-19 21:32:42 +01:00
DBG ( " applied ConsoleGopEnable=%s \n " , gSettings . GUI . ProvideConsoleGop ? " Y " : " N " ) ;
2020-07-15 19:29:27 +02:00
}
2021-05-19 14:11:21 +02:00
i + + ; //124
if ( InputItems [ i ] . Valid ) {
2021-09-28 15:54:31 +02:00
gSettings . ACPI . FixHeaders = InputItems [ i ] . BValue ! = 0 ;
2021-05-19 14:11:21 +02:00
DBG ( " applied gSettings.ACPI.FixHeaders=%s \n " , gSettings . ACPI . FixHeaders ? " Y " : " N " ) ;
}
2021-09-25 13:33:16 +02:00
i + + ; //125
if ( InputItems [ i ] . Valid ) {
gSettings . Smbios . ExtendedFirmwareFeatures = StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
DBG ( " applied ExtendedFirmwareFeatures=0x%llX \n " , gSettings . Smbios . ExtendedFirmwareFeatures ) ;
}
i + + ; //126
if ( InputItems [ i ] . Valid ) {
gSettings . Smbios . ExtendedFirmwareFeaturesMask = StrHexToUint64 ( InputItems [ i ] . SValue . wc_str ( ) ) ;
DBG ( " applied ExtendedFirmwareFeaturesMask=0x%llX \n " , gSettings . Smbios . ExtendedFirmwareFeaturesMask ) ;
}
2021-10-30 10:21:39 +02:00
i + + ; //127
if ( InputItems [ i ] . Valid ) {
INTN Minus = 0 ;
if ( InputItems [ i ] . SValue [ 0 ] = = ' - ' ) {
Minus = 1 ;
}
gSettings . Quirks . OcBooterQuirks . ResizeAppleGpuBars = StrDecimalToUintn ( InputItems [ i ] . SValue . data ( Minus ) ) ;
if ( Minus ) {
gSettings . Quirks . OcBooterQuirks . ResizeAppleGpuBars = - gSettings . Quirks . OcBooterQuirks . ResizeAppleGpuBars ;
}
DBG ( " set GpuBar = %d \n " , gSettings . Quirks . OcBooterQuirks . ResizeAppleGpuBars ) ;
}
2022-01-29 11:59:16 +01:00
i + + ; //128
if ( InputItems [ i ] . Valid ) {
gSettings . Quirks . OcKernelQuirks . ProvideCurrentCpuInfo = InputItems [ i ] . BValue ! = 0 ;
DBG ( " applied ProvideCurrentCpuInfo=%s \n " , gSettings . Quirks . OcKernelQuirks . ProvideCurrentCpuInfo ? " Y " : " N " ) ;
}
2019-09-03 11:58:42 +02:00
if ( NeedSave ) {
2021-04-28 20:30:34 +02:00
ApplySettings ( ) ;
2019-09-03 11:58:42 +02:00
}
}
2020-10-03 19:02:31 +02:00
void AboutRefit ( void )
2019-09-03 11:58:42 +02:00
{
2020-02-28 21:28:33 +01:00
if ( AboutMenu . Entries . size ( ) = = 0 ) {
2021-05-15 16:52:16 +02:00
AboutMenu . Daylight = ThemeX . Daylight ;
2020-05-04 20:03:25 +02:00
if ( ! ( ThemeX . HideUIFlags & HIDEUI_FLAG_MENU_TITLE_IMAGE ) ) {
2020-05-16 21:30:29 +02:00
AboutMenu . TitleImage = ThemeX . GetIcon ( BUILTIN_ICON_FUNC_ABOUT ) ;
2020-05-04 20:03:25 +02:00
}
2020-05-15 10:17:06 +02:00
// else {
// AboutMenu.TitleImage.setEmpty(); //done in the constructor
// }
2020-03-12 19:23:32 +01:00
// AboutMenu.AddMenuInfo_f(("Clover Version 5.0"));
2020-10-20 21:50:30 +02:00
if ( " unknown " _XS8 ! = LString8 ( gRevisionStr ) ) AboutMenu . AddMenuInfo_f ( " %s " , gRevisionStr ) ;
2020-10-03 19:02:31 +02:00
if ( " unknown " _XS8 ! = LString8 ( gFirmwareBuildDate ) ) AboutMenu . AddMenuInfo_f ( " Build: %s " , gFirmwareBuildDate ) ;
2020-10-07 19:25:31 +02:00
if ( " unknown " _XS8 ! = gBuildId ) AboutMenu . AddMenuInfo_f ( " Build id: %s " , gBuildId . c_str ( ) ) ;
2020-10-28 18:11:50 +01:00
AboutMenu . AddMenuInfo_f ( " %s " , path_independant . c_str ( ) ) ; // trick to let the compiler think path_independant is used and must be kept in binary.
AboutMenu . Entries [ AboutMenu . Entries . size ( ) - 1 ] . Title . SWPrintf ( " %s " , gBuildIdGrepTag . c_str ( ) ) ;
2020-10-20 21:50:30 +02:00
AboutMenu . Entries [ AboutMenu . Entries . size ( ) - 1 ] . Title . SWPrintf ( " " ) ;
2020-04-04 18:22:07 +02:00
AboutMenu . AddMenuInfo_f ( " Based on rEFIt (c) 2006-2010 Christoph Pfisterer " ) ;
AboutMenu . AddMenuInfo_f ( " Portions Copyright (c) Intel Corporation " ) ;
AboutMenu . AddMenuInfo_f ( " Developers: " ) ;
AboutMenu . AddMenuInfo_f ( " Slice, dmazar, apianti, JrCs, pene, usrsse2 " ) ;
AboutMenu . AddMenuInfo_f ( " Kabyl, pcj, jadran, Blackosx, STLVNUB, ycr.ru " ) ;
AboutMenu . AddMenuInfo_f ( " FrodoKenny, skoczi, crazybirdy, Oscar09, xsmile " ) ;
AboutMenu . AddMenuInfo_f ( " cparm, rehabman, nms42, Sherlocks, Zenith432 " ) ;
AboutMenu . AddMenuInfo_f ( " stinga11, TheRacerMaster, solstice, SoThOr, DF " ) ;
AboutMenu . AddMenuInfo_f ( " cecekpawon, Micky1979, Needy, joevt, ErmaC, vit9696 " ) ;
AboutMenu . AddMenuInfo_f ( " ath, savvas, syscl, goodwin_c, clovy, jief_machak " ) ;
AboutMenu . AddMenuInfo_f ( " Credits also: " ) ;
AboutMenu . AddMenuInfo_f ( " projectosx.com, applelife.ru, insanelymac.com " ) ;
2020-04-05 05:44:27 +02:00
AboutMenu . AddMenuInfo_f ( " " ) ;
2020-04-04 18:22:07 +02:00
AboutMenu . AddMenuInfo_f ( " Running on: " ) ;
2020-03-12 19:23:32 +01:00
AboutMenu . AddMenuInfo_f ( " EFI Revision %d.%02d " ,
gST - > Hdr . Revision > > 16 , gST - > Hdr . Revision & ( ( 1 < < 16 ) - 1 ) ) ;
2019-09-03 11:58:42 +02:00
# if defined(MDE_CPU_IA32)
2020-04-04 18:22:07 +02:00
AboutMenu . AddMenuInfo_f ( " Platform: i386 (32 bit) " ) ;
2019-09-03 11:58:42 +02:00
# elif defined(MDE_CPU_X64)
2020-04-04 18:22:07 +02:00
AboutMenu . AddMenuInfo_f ( " Platform: x86_64 (64 bit) " ) ;
2020-03-12 10:09:33 +01:00
# elif defined(_MSC_VER)
2020-04-04 18:22:07 +02:00
AboutMenu . AddMenuInfo_f ( " Platform: x86_64 (64 bit) VS " ) ;
2019-09-03 11:58:42 +02:00
# else
2020-04-04 18:22:07 +02:00
AboutMenu . AddMenuInfo_f ( " Platform: unknown " ) ;
2019-09-03 11:58:42 +02:00
# endif
2020-03-12 19:23:32 +01:00
AboutMenu . AddMenuInfo_f ( " Firmware: %ls rev %d.%04d " , gST - > FirmwareVendor , gST - > FirmwareRevision > > 16 , gST - > FirmwareRevision & ( ( 1 < < 16 ) - 1 ) ) ;
2020-04-14 09:27:23 +02:00
AboutMenu . AddMenuInfo_f ( " Screen Output: %s " , egScreenDescription ( ) . c_str ( ) ) ;
2020-04-15 18:30:39 +02:00
AboutMenu . GetAnime ( ) ;
2020-03-03 21:44:07 +01:00
AboutMenu . AddMenuEntry ( & MenuEntryReturn , false ) ;
2020-02-28 21:28:33 +01:00
} else if ( AboutMenu . Entries . size ( ) > = 2 ) {
2020-04-14 09:27:23 +02:00
AboutMenu . Entries [ AboutMenu . Entries . size ( ) - 2 ] . Title . SWPrintf ( " Screen Output: %s " , egScreenDescription ( ) . c_str ( ) ) ;
2019-09-03 11:58:42 +02:00
}
2020-03-03 21:44:07 +01:00
AboutMenu . RunMenu ( NULL ) ;
2019-09-03 11:58:42 +02:00
}
2020-10-03 19:02:31 +02:00
void HelpRefit ( void )
2019-09-03 11:58:42 +02:00
{
2020-02-28 21:28:33 +01:00
if ( HelpMenu . Entries . size ( ) = = 0 ) {
2021-05-15 16:52:16 +02:00
HelpMenu . Daylight = ThemeX . Daylight ;
2020-05-04 20:03:25 +02:00
if ( ! ( ThemeX . HideUIFlags & HIDEUI_FLAG_MENU_TITLE_IMAGE ) ) {
2020-05-16 21:30:29 +02:00
HelpMenu . TitleImage = ThemeX . GetIcon ( BUILTIN_ICON_FUNC_HELP ) ;
2020-05-04 20:03:25 +02:00
}
2021-04-03 16:42:49 +02:00
switch ( gSettings . GUI . languageCode )
2019-09-03 11:58:42 +02:00
{
case russian :
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " ESC - Выход из подменю, обновление главного меню " ) ;
HelpMenu . AddMenuInfo_f ( " F1 - Помощь по горячим клавишам " ) ;
HelpMenu . AddMenuInfo_f ( " F2 - Сохранить отчет в preboot.log (только если FAT32) " ) ;
HelpMenu . AddMenuInfo_f ( " F3 - Показать скрытые значки в меню " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F4 - Родной DSDT сохранить в %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F5 - Патченный DSDT сохранить в %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F6 - Сохранить ВидеоБиос в %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F7 - Проверить звук на выбранном выходе " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F8 - Сделать дамп звуковых устройств в %ls/misc/ " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F9 - Изменить разрешение экрана на одно из возможных " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F10 - Снимок экрана в папку %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F11 - Reset NVRAM " ) ;
HelpMenu . AddMenuInfo_f ( " F12 - Извлечь указанный DVD " ) ;
HelpMenu . AddMenuInfo_f ( " Пробел - Дополнительное меню запуска выбранного тома " ) ;
HelpMenu . AddMenuInfo_f ( " Цифры 1-9 - Быстрый запуск тома по порядку в меню " ) ;
HelpMenu . AddMenuInfo_f ( " A (About) - О загрузчике " ) ;
HelpMenu . AddMenuInfo_f ( " O (Options) - Дополнительные настройки " ) ;
HelpMenu . AddMenuInfo_f ( " R (Reset) - Теплый перезапуск " ) ;
HelpMenu . AddMenuInfo_f ( " U (go oUt) - Завершить работу в Кловере " ) ;
HelpMenu . AddMenuInfo_f ( " S (Shell) - Переход в режим командной строки " ) ;
2019-09-03 11:58:42 +02:00
break ;
case ukrainian :
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " ESC - Вийти з меню, оновити головне меню " ) ;
HelpMenu . AddMenuInfo_f ( " F1 - Ця довідка " ) ;
HelpMenu . AddMenuInfo_f ( " F2 - Зберегти preboot.log (тiльки FAT32) " ) ;
HelpMenu . AddMenuInfo_f ( " F3 - Відображати приховані розділи " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F4 - Зберегти OEM DSDT в %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F5 - Зберегти патчений DSDT в %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F7 - Check sound on selected output " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F8 - Make audio outputs dump into %ls/misc/ " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F9 - Switch screen resoluton to next possible mode " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F6 - Зберегти VideoBios в %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F10 - Зберегти знімок екрану в %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F11 - Reset NVRAM " ) ;
HelpMenu . AddMenuInfo_f ( " F12 - Відкрити обраний диск (DVD) " ) ;
HelpMenu . AddMenuInfo_f ( " Пробіл - докладніше про обраний пункт меню " ) ;
HelpMenu . AddMenuInfo_f ( " Клавіші 1-9 - клавіші пунктів меню " ) ;
HelpMenu . AddMenuInfo_f ( " A - Про систему " ) ;
HelpMenu . AddMenuInfo_f ( " O - Опції меню " ) ;
HelpMenu . AddMenuInfo_f ( " R - Перезавантаження " ) ;
HelpMenu . AddMenuInfo_f ( " U - Відключити ПК " ) ;
HelpMenu . AddMenuInfo_f ( " S - Shell " ) ;
2019-09-03 11:58:42 +02:00
break ;
case spanish :
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " ESC - Salir de submenu o actualizar el menu principal " ) ;
HelpMenu . AddMenuInfo_f ( " F1 - Esta Ayuda " ) ;
HelpMenu . AddMenuInfo_f ( " F2 - Guardar preboot.log (Solo FAT32) " ) ;
HelpMenu . AddMenuInfo_f ( " F3 - Show hidden entries " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F4 - Guardar DSDT oem en %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F5 - Guardar DSDT parcheado en %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F6 - Guardar VideoBios en %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F7 - Check sound on selected output " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F8 - Make audio outputs dump into %ls/misc/ " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F9 - Switch screen resoluton to next possible mode " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F10 - Guardar Captura de pantalla en %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F11 - Reset NVRAM " ) ;
HelpMenu . AddMenuInfo_f ( " F12 - Expulsar volumen seleccionado (DVD) " ) ;
HelpMenu . AddMenuInfo_f ( " Espacio - Detalles acerca selected menu entry " ) ;
HelpMenu . AddMenuInfo_f ( " Digitos 1-9 - Atajo a la entrada del menu " ) ;
HelpMenu . AddMenuInfo_f ( " A - Menu Acerca de " ) ;
HelpMenu . AddMenuInfo_f ( " O - Menu Optiones " ) ;
HelpMenu . AddMenuInfo_f ( " R - Reiniciar Equipo " ) ;
HelpMenu . AddMenuInfo_f ( " U - Apagar " ) ;
HelpMenu . AddMenuInfo_f ( " S - Shell " ) ;
2019-09-03 11:58:42 +02:00
break ;
case portuguese :
case brasil :
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " ESC - Sai do submenu, atualiza o menu principal " ) ;
HelpMenu . AddMenuInfo_f ( " F1 - Esta ajuda " ) ;
HelpMenu . AddMenuInfo_f ( " F2 - Salva preboot.log (somente FAT32) " ) ;
HelpMenu . AddMenuInfo_f ( " F3 - Show hidden entries " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F4 - Salva oem DSDT em %ls/ACPI/origin/ (somente FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F5 - Salva DSDT corrigido em %ls/ACPI/origin/ (somente FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F6 - Salva VideoBios em %ls/misc/ (somente FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F7 - Check sound on selected output " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F8 - Make audio outputs dump into %ls/misc/ " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F9 - Switch screen resoluton to next possible mode " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F10 - Salva screenshot em %ls/misc/ (somente FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F11 - Reset NVRAM " ) ;
HelpMenu . AddMenuInfo_f ( " F12 - Ejeta o volume selecionado (DVD) " ) ;
HelpMenu . AddMenuInfo_f ( " Espaco - Detalhes sobre a opcao do menu selecionada " ) ;
HelpMenu . AddMenuInfo_f ( " Tecle 1-9 - Atalho para as entradas do menu " ) ;
HelpMenu . AddMenuInfo_f ( " A - Sobre o Menu " ) ;
HelpMenu . AddMenuInfo_f ( " O - Opcoes do Menu " ) ;
HelpMenu . AddMenuInfo_f ( " R - Reiniciar " ) ;
HelpMenu . AddMenuInfo_f ( " U - Desligar " ) ;
HelpMenu . AddMenuInfo_f ( " S - Shell " ) ;
2019-09-03 11:58:42 +02:00
break ;
case italian :
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " ESC - Esci dal submenu, Aggiorna menu principale " ) ;
HelpMenu . AddMenuInfo_f ( " F1 - Aiuto " ) ;
HelpMenu . AddMenuInfo_f ( " F2 - Salva il preboot.log (solo su FAT32) " ) ;
HelpMenu . AddMenuInfo_f ( " F3 - Mostra volumi nascosti " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F4 - Salva il DSDT oem in %ls/ACPI/origin/ (solo suFAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F5 - Salva il patched DSDT in %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F6 - Salva il VideoBios in %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F7 - Controlla il suono sull'uscita selezionata " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F8 - Scarica le uscite audio in %ls/misc/ " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F9 - Cambia la risoluzione dello schermo alla prossima disponibile " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F10 - Salva screenshot in %ls/misc/ (solo su FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F11 - Resetta NVRAM " ) ;
HelpMenu . AddMenuInfo_f ( " F12 - Espelli il volume selezionato (DVD) " ) ;
HelpMenu . AddMenuInfo_f ( " Spazio - Dettagli sul menu selezionato " ) ;
HelpMenu . AddMenuInfo_f ( " Digita 1-9 - Abbreviazioni per il menu " ) ;
HelpMenu . AddMenuInfo_f ( " A - Informazioni " ) ;
HelpMenu . AddMenuInfo_f ( " O - Menu Opzioni " ) ;
HelpMenu . AddMenuInfo_f ( " R - Riavvio " ) ;
HelpMenu . AddMenuInfo_f ( " U - Spegnimento " ) ;
HelpMenu . AddMenuInfo_f ( " S - Shell " ) ;
2019-09-03 11:58:42 +02:00
break ;
case german :
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " ESC - Zurueck aus Untermenue, Hauptmenue erneuern " ) ;
HelpMenu . AddMenuInfo_f ( " F1 - Diese Hilfe " ) ;
HelpMenu . AddMenuInfo_f ( " F2 - Sichere preboot.log (nur mit FAT32) " ) ;
HelpMenu . AddMenuInfo_f ( " F3 - Show hidden entries " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F4 - Sichere OEM DSDT in %ls/ACPI/origin/ (nur mit FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F5 - Sichere gepatchtes DSDT in %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F6 - Sichere VideoBios in %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F7 - Check sound on selected output " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F8 - Make audio outputs dump into %ls/misc/ " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F9 - Switch screen resoluton to next possible mode " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F10 - Sichere Bildschirmfoto in %ls/misc/ (nur mit FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F11 - Reset NVRAM " ) ;
HelpMenu . AddMenuInfo_f ( " F12 - Volume auswerfen (DVD) " ) ;
HelpMenu . AddMenuInfo_f ( " Leertaste - Details über den gewählten Menue Eintrag " ) ;
HelpMenu . AddMenuInfo_f ( " Zahlen 1-9 - Kurzwahl zum Menue Eintrag " ) ;
HelpMenu . AddMenuInfo_f ( " A - Menue Informationen " ) ;
HelpMenu . AddMenuInfo_f ( " O - Menue Optionen " ) ;
HelpMenu . AddMenuInfo_f ( " R - Neustart " ) ;
HelpMenu . AddMenuInfo_f ( " U - Ausschalten " ) ;
HelpMenu . AddMenuInfo_f ( " S - Shell " ) ;
2019-09-03 11:58:42 +02:00
break ;
case dutch :
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " ESC - Verlaat submenu, Vernieuw hoofdmenu " ) ;
HelpMenu . AddMenuInfo_f ( " F1 - Onderdeel hulp " ) ;
HelpMenu . AddMenuInfo_f ( " F2 - preboot.log opslaan (Alleen FAT32) " ) ;
HelpMenu . AddMenuInfo_f ( " F3 - Verborgen opties weergeven " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F4 - Opslaan oem DSDT in %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F5 - Opslaan gepatchte DSDT in %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F6 - Opslaan VideoBios in %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F7 - Controleer geluid op geselecteerde uitgang " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F8 - Opslaan audio uitgangen in %ls/misc/ " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F9 - Wijzig schermresolutie naar eerstvolgende mogelijke modus " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F10 - Opslaan schermafdruk in %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F11 - Reset NVRAM " ) ;
HelpMenu . AddMenuInfo_f ( " F12 - Uitwerpen geselecteerd volume (DVD) " ) ;
HelpMenu . AddMenuInfo_f ( " Spatie - Details over geselecteerd menuoptie " ) ;
HelpMenu . AddMenuInfo_f ( " Cijfers 1-9 - Snelkoppeling naar menuoptie " ) ;
HelpMenu . AddMenuInfo_f ( " A - Menu Over " ) ;
HelpMenu . AddMenuInfo_f ( " O - Menu Opties " ) ;
HelpMenu . AddMenuInfo_f ( " R - Soft Reset " ) ;
HelpMenu . AddMenuInfo_f ( " U - Verlaten " ) ;
HelpMenu . AddMenuInfo_f ( " S - Shell " ) ;
2019-09-03 11:58:42 +02:00
break ;
case french :
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " ESC - Quitter sous-menu, Retour menu principal " ) ;
HelpMenu . AddMenuInfo_f ( " F1 - Aide " ) ;
HelpMenu . AddMenuInfo_f ( " F2 - Enregistrer preboot.log (FAT32 only) " ) ;
HelpMenu . AddMenuInfo_f ( " F3 - Show hidden entries " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F4 - Enregistrer oem DSDT dans %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F5 - Enregistrer DSDT modifié dans %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F6 - Enregistrer VideoBios dans %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F7 - Check sound on selected output " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F8 - Make audio outputs dump into %ls/misc/ " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F9 - Switch screen resoluton to next possible mode " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F10 - Enregistrer la capture d'écran dans %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F11 - Reset NVRAM " ) ;
HelpMenu . AddMenuInfo_f ( " F12 - Ejecter le volume (DVD) " ) ;
HelpMenu . AddMenuInfo_f ( " Space - Détails a propos du menu selectionné " ) ;
HelpMenu . AddMenuInfo_f ( " Digits 1-9 - Raccourci vers entrée menu " ) ;
HelpMenu . AddMenuInfo_f ( " A - A propos " ) ;
HelpMenu . AddMenuInfo_f ( " O - Options Menu " ) ;
HelpMenu . AddMenuInfo_f ( " R - Redémarrer " ) ;
HelpMenu . AddMenuInfo_f ( " U - Eteindre " ) ;
HelpMenu . AddMenuInfo_f ( " S - Shell " ) ;
2019-09-03 11:58:42 +02:00
break ;
case indonesian :
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " ESC - Keluar submenu, Refresh main menu " ) ;
HelpMenu . AddMenuInfo_f ( " F1 - Help " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F2 - Simpan preboot.log ke %ls/ACPI/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F3 - Show hidden entries " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F4 - Simpan oem DSDT ke %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F5 - Simpan patched DSDT ke %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F6 - Simpan VideoBios ke %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F7 - Check sound on selected output " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F8 - Make audio outputs dump into %ls/misc/ " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F9 - Switch screen resoluton to next possible mode " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F10 - Simpan screenshot ke %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F11 - Reset NVRAM " ) ;
HelpMenu . AddMenuInfo_f ( " F12 - Eject volume (DVD) " ) ;
HelpMenu . AddMenuInfo_f ( " Spasi - Detail dari menu yang dipilih " ) ;
HelpMenu . AddMenuInfo_f ( " Tombol 1-9 - Shortcut pilihan menu " ) ;
HelpMenu . AddMenuInfo_f ( " A - About " ) ;
HelpMenu . AddMenuInfo_f ( " O - Opsi " ) ;
HelpMenu . AddMenuInfo_f ( " R - Soft Reset " ) ;
HelpMenu . AddMenuInfo_f ( " U - Shutdown " ) ;
HelpMenu . AddMenuInfo_f ( " S - Shell " ) ;
2019-09-03 11:58:42 +02:00
break ;
case polish :
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " ESC - Wyjscie z podmenu, Odswiezenie glownego menu " ) ;
HelpMenu . AddMenuInfo_f ( " F1 - Pomoc " ) ;
HelpMenu . AddMenuInfo_f ( " F2 - Zapis preboot.log (tylko FAT32) " ) ;
HelpMenu . AddMenuInfo_f ( " F3 - Show hidden entries " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F4 - Zapis DSDT do %ls/ACPI/origin/ (tylko FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F5 - Zapis poprawionego DSDT do %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F6 - Zapis BIOSu k. graficznej do %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F7 - Check sound on selected output " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F8 - Make audio outputs dump into %ls/misc/ " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F9 - Switch screen resoluton to next possible mode " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F10 - Zapis zrzutu ekranu do %ls/misc/ (tylko FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F11 - Reset NVRAM " ) ;
HelpMenu . AddMenuInfo_f ( " F12 - Wysuniecie zaznaczonego dysku (tylko dla DVD) " ) ;
HelpMenu . AddMenuInfo_f ( " Spacja - Informacje nt. dostepnych opcji dla zaznaczonego dysku " ) ;
HelpMenu . AddMenuInfo_f ( " Znaki 1-9 - Skroty opcji dla wybranego dysku " ) ;
HelpMenu . AddMenuInfo_f ( " A - Menu Informacyjne " ) ;
HelpMenu . AddMenuInfo_f ( " O - Menu Opcje " ) ;
HelpMenu . AddMenuInfo_f ( " R - Restart komputera " ) ;
HelpMenu . AddMenuInfo_f ( " U - Wylaczenie komputera " ) ;
HelpMenu . AddMenuInfo_f ( " S - Shell " ) ;
2019-09-03 11:58:42 +02:00
break ;
case croatian :
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " ESC - izlaz iz podizbornika, Osvježi glavni izbornik " ) ;
HelpMenu . AddMenuInfo_f ( " F1 - Ovaj izbornik " ) ;
HelpMenu . AddMenuInfo_f ( " F2 - Spremi preboot.log (samo na FAT32) " ) ;
HelpMenu . AddMenuInfo_f ( " F3 - Show hidden entries " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F4 - Spremi oem DSDT u %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F5 - Spremi patched DSDT into %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F6 - Spremi VideoBios into %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F7 - Check sound on selected output " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F8 - Make audio outputs dump into %ls/misc/ " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F9 - Switch screen resoluton to next possible mode " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F10 - Spremi screenshot into %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F11 - Reset NVRAM " ) ;
HelpMenu . AddMenuInfo_f ( " F12 - Izbaci izabrai (DVD) " ) ;
HelpMenu . AddMenuInfo_f ( " Space - Detalji o odabranom sistemu " ) ;
HelpMenu . AddMenuInfo_f ( " Brojevi 1 do 9 su prečac do izbora " ) ;
HelpMenu . AddMenuInfo_f ( " A - Izbornik o meni " ) ;
HelpMenu . AddMenuInfo_f ( " O - Izbornik opcije " ) ;
HelpMenu . AddMenuInfo_f ( " R - Restart računala " ) ;
HelpMenu . AddMenuInfo_f ( " U - Isključivanje računala " ) ;
HelpMenu . AddMenuInfo_f ( " S - Shell " ) ;
2019-09-03 11:58:42 +02:00
break ;
case czech :
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " ESC - Vrátit se do hlavní nabídky " ) ;
HelpMenu . AddMenuInfo_f ( " F1 - Tato Nápověda " ) ;
HelpMenu . AddMenuInfo_f ( " F2 - Uložit preboot.log (FAT32 only) " ) ;
HelpMenu . AddMenuInfo_f ( " F3 - Show hidden entries " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F4 - Uložit oem DSDT do %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F5 - Uložit patchnuté DSDT do %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F6 - Uložit VideoBios do %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F7 - Check sound on selected output " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F8 - Make audio outputs dump into %ls/misc/ " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F9 - Switch screen resoluton to next possible mode " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F10 - Uložit snímek obrazovky do %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F11 - Reset NVRAM " ) ;
HelpMenu . AddMenuInfo_f ( " F12 - Vysunout vybranou mechaniku (DVD) " ) ;
HelpMenu . AddMenuInfo_f ( " Mezerník - Podrobnosti o vybraném disku " ) ;
HelpMenu . AddMenuInfo_f ( " čísla 1-9 - Klávesové zkratky pro disky " ) ;
HelpMenu . AddMenuInfo_f ( " A - Menu O Programu " ) ;
HelpMenu . AddMenuInfo_f ( " O - Menu Možnosti " ) ;
HelpMenu . AddMenuInfo_f ( " R - Částečný restart " ) ;
HelpMenu . AddMenuInfo_f ( " U - Odejít " ) ;
HelpMenu . AddMenuInfo_f ( " S - Shell " ) ;
2019-09-03 11:58:42 +02:00
break ;
case korean :
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " ESC - 하위메뉴에서 나감, 메인메뉴 새로 고침 " ) ;
HelpMenu . AddMenuInfo_f ( " F1 - 이 도움말 " ) ;
HelpMenu . AddMenuInfo_f ( " F2 - preboot.log를 저장합니다. (FAT32방식에만 해당됨) " ) ;
HelpMenu . AddMenuInfo_f ( " F3 - Show hidden entries " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F4 - oem DSDT를 %ls/ACPI/origin/에 저장합니다. (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F5 - 패치된 DSDT를 %ls/ACPI/origin/에 저장합니다. (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F6 - VideoBios를 %ls/misc/에 저장합니다. (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F7 - 선택한 출력에서 사운드 확인 " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F8 - 오디오 코덱덤프를 %ls/misc/에 저장합니다. " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F9 - Switch screen resoluton to next possible mode " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F10 - 스크린샷을 %ls/misc/에 저장합니다. (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F11 - NVRAM 초기화 " ) ;
HelpMenu . AddMenuInfo_f ( " F12 - 선택한 볼륨을 제거합니다. (DVD) " ) ;
HelpMenu . AddMenuInfo_f ( " Space - 선택한 메뉴의 상세 설명 " ) ;
HelpMenu . AddMenuInfo_f ( " Digits 1-9 - 메뉴 단축 번호 " ) ;
HelpMenu . AddMenuInfo_f ( " A - 단축키 - 이 부트로더에 관하여 " ) ;
HelpMenu . AddMenuInfo_f ( " O - 단축키 - 부트 옵션 " ) ;
HelpMenu . AddMenuInfo_f ( " R - 단축키 - 리셋 " ) ;
HelpMenu . AddMenuInfo_f ( " U - 단축키 - 시스템 종료 " ) ;
HelpMenu . AddMenuInfo_f ( " S - Shell " ) ;
2019-09-03 11:58:42 +02:00
break ;
case romanian :
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " ESC - Iesire din sub-meniu, Refresh meniul principal " ) ;
HelpMenu . AddMenuInfo_f ( " F1 - Ajutor " ) ;
HelpMenu . AddMenuInfo_f ( " F2 - Salvare preboot.log (doar pentru FAT32) " ) ;
HelpMenu . AddMenuInfo_f ( " F4 - Salvare oem DSDT in EFI/ACPI/origin/ (FAT32) " ) ;
HelpMenu . AddMenuInfo_f ( " F5 - Salvare DSDT modificat in EFI/ACPI/origin/ (FAT32) " ) ;
HelpMenu . AddMenuInfo_f ( " F6 - Salvare VideoBios in EFI/misc/ (FAT32) " ) ;
HelpMenu . AddMenuInfo_f ( " F7 - Check sound on selected output " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F8 - Make audio outputs dump into %ls/misc/ " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F9 - Switch screen resoluton to next possible mode " ) ;
HelpMenu . AddMenuInfo_f ( " F10 - Salvare screenshot in EFI/misc/ (FAT32) " ) ;
HelpMenu . AddMenuInfo_f ( " F11 - Reset NVRAM " ) ;
HelpMenu . AddMenuInfo_f ( " F12 - Scoatere volum selectat (DVD) " ) ;
HelpMenu . AddMenuInfo_f ( " Space - Detalii despre item-ul selectat " ) ;
HelpMenu . AddMenuInfo_f ( " Cifre 1-9 - Scurtaturi pentru itemele meniului " ) ;
HelpMenu . AddMenuInfo_f ( " A - Despre " ) ;
HelpMenu . AddMenuInfo_f ( " O - Optiuni " ) ;
HelpMenu . AddMenuInfo_f ( " R - Soft Reset " ) ;
HelpMenu . AddMenuInfo_f ( " U - Inchidere " ) ;
HelpMenu . AddMenuInfo_f ( " S - Shell " ) ;
2019-09-03 11:58:42 +02:00
break ;
case chinese :
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " ESC - 离开子菜单, 刷新主菜单 " ) ;
HelpMenu . AddMenuInfo_f ( " F1 - 帮助 " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F2 - 保存 preboot.log 到 %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F3 - 显示隐藏的启动项 " ) ;
HelpMenu . AddMenuInfo_f ( " F4 - 保存原始的 DSDT 到 EFI/ACPI/origin/ (FAT32) " ) ;
HelpMenu . AddMenuInfo_f ( " F5 - 保存修正后的 DSDT 到 EFI/ACPI/origin/ (FAT32) " ) ;
HelpMenu . AddMenuInfo_f ( " F6 - 保存 VideoBios 到 EFI/misc/ (FAT32) " ) ;
HelpMenu . AddMenuInfo_f ( " F7 - 检查选中输出设备的声音 " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F8 - 生成声卡输出转储到 %ls/misc/ " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F9 - 调整屏幕分辨率为下一个可用的模式 " ) ;
HelpMenu . AddMenuInfo_f ( " F10 - 保存截图到 EFI/misc/ (FAT32) " ) ;
HelpMenu . AddMenuInfo_f ( " F11 - 重置 NVRAM " ) ;
HelpMenu . AddMenuInfo_f ( " F12 - 推出选中的卷 (DVD) " ) ;
HelpMenu . AddMenuInfo_f ( " 空格 - 关于选中项的详情 " ) ;
HelpMenu . AddMenuInfo_f ( " 数字 1-9 - 菜单快捷键 " ) ;
HelpMenu . AddMenuInfo_f ( " A - 关于 " ) ;
HelpMenu . AddMenuInfo_f ( " O - 选项 " ) ;
HelpMenu . AddMenuInfo_f ( " R - 软复位 " ) ;
HelpMenu . AddMenuInfo_f ( " U - 退出 " ) ;
HelpMenu . AddMenuInfo_f ( " S - Shell " ) ;
2019-09-03 11:58:42 +02:00
break ;
case english :
default :
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " ESC - Escape from submenu, Refresh main menu " ) ;
HelpMenu . AddMenuInfo_f ( " F1 - This help " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F2 - Save preboot.log into %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F3 - Show hidden entries " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F4 - Save oem DSDT into %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F5 - Save patched DSDT into %ls/ACPI/origin/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
HelpMenu . AddMenuInfo_f ( " F6 - Save VideoBios into %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F7 - Check sound on selected output " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F8 - Make audio outputs dump into %ls/misc/ " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F9 - Switch screen resoluton to next possible mode " ) ;
2021-09-27 08:39:06 +02:00
HelpMenu . AddMenuInfo_f ( " F10 - Save screenshot into %ls/misc/ (FAT32) " , self . getCloverDirFullPath4Display ( ) . wc_str ( ) ) ;
2020-04-04 18:22:07 +02:00
HelpMenu . AddMenuInfo_f ( " F11 - Reset NVRAM " ) ;
HelpMenu . AddMenuInfo_f ( " F12 - Eject selected volume (DVD) " ) ;
HelpMenu . AddMenuInfo_f ( " Space - Details about selected menu entry " ) ;
HelpMenu . AddMenuInfo_f ( " Digits 1-9 - Shortcut to menu entry " ) ;
HelpMenu . AddMenuInfo_f ( " A - Menu About " ) ;
HelpMenu . AddMenuInfo_f ( " O - Menu Options " ) ;
HelpMenu . AddMenuInfo_f ( " R - Soft Reset " ) ;
HelpMenu . AddMenuInfo_f ( " U - Exit from Clover " ) ;
HelpMenu . AddMenuInfo_f ( " S - Shell " ) ;
2019-09-03 11:58:42 +02:00
break ;
}
2020-04-15 18:30:39 +02:00
HelpMenu . GetAnime ( ) ;
2020-03-03 21:44:07 +01:00
HelpMenu . AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
}
2020-03-03 21:44:07 +01:00
HelpMenu . RunMenu ( NULL ) ;
2019-09-03 11:58:42 +02:00
}
//
// Graphics helper functions
//
/*
SelectionImages :
[ 0 ] SelectionBig
[ 2 ] SelectionSmall
[ 4 ] SelectionIndicator
Buttons :
[ 0 ] radio_button
[ 1 ] radio_button_selected
[ 2 ] checkbox
[ 3 ] checkbox_checked
*/
2020-03-26 21:32:31 +01:00
2020-04-04 14:27:02 +02:00
//
// user-callable dispatcher functions
//
2019-09-03 11:58:42 +02:00
2020-08-12 17:15:47 +02:00
REFIT_ABSTRACT_MENU_ENTRY * NewEntry_ ( REFIT_ABSTRACT_MENU_ENTRY * Entry , REFIT_MENU_SCREEN * * SubScreen , ACTION AtClick , UINTN ID , const XString8 & Title )
2019-09-03 11:58:42 +02:00
{
2020-08-12 17:15:47 +02:00
Entry - > Title = Title ;
2020-05-16 21:30:29 +02:00
Entry - > Image = OptionMenu . TitleImage ;
2020-02-28 21:28:33 +01:00
Entry - > AtClick = AtClick ;
2019-09-03 11:58:42 +02:00
// create the submenu
2021-05-05 19:10:10 +02:00
* SubScreen = new REFIT_MENU_SCREEN ;
2020-03-24 16:17:12 +01:00
( * SubScreen ) - > Title = Entry - > Title ;
2020-05-16 21:30:29 +02:00
( * SubScreen ) - > TitleImage = Entry - > Image ;
2019-09-03 11:58:42 +02:00
( * SubScreen ) - > ID = ID ;
2020-04-15 18:30:39 +02:00
( * SubScreen ) - > GetAnime ( ) ;
2020-02-28 21:28:33 +01:00
Entry - > SubScreen = * SubScreen ;
2020-03-10 10:45:17 +01:00
return Entry ;
2020-02-28 21:28:33 +01:00
}
2020-08-12 17:15:47 +02:00
REFIT_MENU_ITEM_OPTIONS * newREFIT_MENU_ITEM_OPTIONS ( REFIT_MENU_SCREEN * * SubScreen , ACTION AtClick , UINTN ID , const XString8 & Title )
2020-02-28 21:28:33 +01:00
{
2021-05-05 19:10:10 +02:00
REFIT_MENU_ITEM_OPTIONS * Entry = new REFIT_MENU_ITEM_OPTIONS ;
2020-03-10 10:45:17 +01:00
return NewEntry_ ( Entry , SubScreen , AtClick , ID , Title ) - > getREFIT_MENU_ITEM_OPTIONS ( ) ;
2020-02-28 21:28:33 +01:00
}
2019-09-03 11:58:42 +02:00
2020-10-03 19:02:31 +02:00
void ModifyTitles ( REFIT_ABSTRACT_MENU_ENTRY * ChosenEntry )
2019-09-03 11:58:42 +02:00
{
if ( ChosenEntry - > SubScreen - > ID = = SCREEN_DSDT ) {
2021-02-11 12:41:59 +01:00
ChosenEntry - > Title . SWPrintf ( " DSDT fix mask [0x%08x]-> " , gSettings . ACPI . DSDT . FixDsdt ) ;
2020-03-25 19:32:44 +01:00
//MsgLog("@ESC: %ls\n", (*ChosenEntry)->Title);
2019-09-03 11:58:42 +02:00
} else if ( ChosenEntry - > SubScreen - > ID = = SCREEN_CSR ) {
// CSR
2021-03-26 10:43:15 +01:00
ChosenEntry - > Title . SWPrintf ( " System Integrity Protection [0x%04x]-> " , gSettings . RtVariables . CsrActiveConfig ) ;
2019-09-03 11:58:42 +02:00
// check for the right booter flag to allow the application
// of the new System Integrity Protection configuration.
2021-03-26 10:43:15 +01:00
if ( gSettings . RtVariables . CsrActiveConfig ! = 0 & & gSettings . RtVariables . BooterConfig = = 0 ) {
gSettings . RtVariables . BooterConfig = 0x28 ;
2019-09-03 11:58:42 +02:00
}
} else if ( ChosenEntry - > SubScreen - > ID = = SCREEN_BLC ) {
2021-03-26 10:43:15 +01:00
ChosenEntry - > Title . SWPrintf ( " boot_args->flags [0x%04hx]-> " , gSettings . RtVariables . BooterConfig ) ;
2019-09-03 11:58:42 +02:00
}
}
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuGraphics ( )
2019-09-03 11:58:42 +02:00
{
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_GRAPHICS , " Graphics Injector-> " _XS8 ) ;
2021-04-28 20:30:34 +02:00
SubScreen - > AddMenuInfoLine_f ( " Number of VideoCard%s=%zu " , ( ( gConf . GfxPropertiesArray . size ( ) ! = 1 ) ? " s " : " " ) , gConf . GfxPropertiesArray . size ( ) ) ;
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 52 , " InjectEDID " , false ) ;
SubScreen - > AddMenuItemInput ( 53 , " Fake Vendor EDID: " , true ) ;
SubScreen - > AddMenuItemInput ( 54 , " Fake Product EDID: " , true ) ;
SubScreen - > AddMenuItemInput ( 18 , " Backlight Level: " , true ) ;
SubScreen - > AddMenuItemInput ( 112 , " Intel Max Backlight: " , true ) ; //gSettings.Devices.IntelMaxValue
2019-09-03 11:58:42 +02:00
2021-04-28 20:30:34 +02:00
for ( UINTN i = 0 ; i < gConf . GfxPropertiesArray . size ( ) ; i + + ) {
2020-04-04 18:22:07 +02:00
SubScreen - > AddMenuInfo_f ( " ---------------------- " ) ;
2021-04-28 20:30:34 +02:00
SubScreen - > AddMenuInfo_f ( " Card DeviceID=%04hx " , gConf . GfxPropertiesArray [ i ] . DeviceID ) ;
2020-05-16 21:30:29 +02:00
UINTN N = 20 + i * 6 ;
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( N , " Model: " , true ) ;
2019-09-03 11:58:42 +02:00
2021-04-28 20:30:34 +02:00
if ( gConf . GfxPropertiesArray [ i ] . Vendor = = Nvidia ) {
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( N + 1 , " InjectNVidia " , false ) ;
2021-04-28 20:30:34 +02:00
} else if ( gConf . GfxPropertiesArray [ i ] . Vendor = = Ati ) {
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( N + 1 , " InjectATI " , false ) ;
2021-04-28 20:30:34 +02:00
} else if ( gConf . GfxPropertiesArray [ i ] . Vendor = = Intel ) {
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( N + 1 , " InjectIntel " , false ) ;
2019-09-03 11:58:42 +02:00
} else {
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( N + 1 , " InjectX3 " , false ) ;
2019-09-03 11:58:42 +02:00
}
2020-05-16 21:30:29 +02:00
UINTN Ven = 97 ; //it can be used for non Ati, Nvidia, Intel in QEMU for example
2021-04-28 20:30:34 +02:00
if ( gConf . GfxPropertiesArray [ i ] . Vendor = = Nvidia ) {
2019-09-03 11:58:42 +02:00
Ven = 95 ;
2021-04-28 20:30:34 +02:00
} else if ( gConf . GfxPropertiesArray [ i ] . Vendor = = Ati ) {
2019-09-03 11:58:42 +02:00
Ven = 94 ;
2021-04-28 20:30:34 +02:00
} else if ( gConf . GfxPropertiesArray [ i ] . Vendor = = Intel ) {
2019-09-03 11:58:42 +02:00
Ven = 96 ;
}
2021-04-28 20:30:34 +02:00
if ( ( gConf . GfxPropertiesArray [ i ] . Vendor = = Ati ) | | ( gConf . GfxPropertiesArray [ i ] . Vendor = = Intel ) ) {
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 109 , " DualLink: " , true ) ;
2019-09-03 11:58:42 +02:00
}
2021-04-28 20:30:34 +02:00
if ( gConf . GfxPropertiesArray [ i ] . Vendor = = Ati ) {
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 114 , " DeInit: " , true ) ;
2019-09-03 11:58:42 +02:00
}
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( Ven , " FakeID: " , true ) ;
2019-09-03 11:58:42 +02:00
2021-04-28 20:30:34 +02:00
if ( gConf . GfxPropertiesArray [ i ] . Vendor = = Nvidia ) {
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( N + 2 , " DisplayCFG: " , true ) ;
2021-04-28 20:30:34 +02:00
} else if ( gConf . GfxPropertiesArray [ i ] . Vendor = = Ati ) {
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( N + 2 , " FBConfig: " , true ) ;
2019-09-03 11:58:42 +02:00
} else /*if (gGraphics[i].Vendor == Intel)*/ {
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( N + 2 , " *-platform-id: " , true ) ;
2019-09-03 11:58:42 +02:00
}
// ErmaC: NvidiaGeneric entry
2021-04-28 20:30:34 +02:00
if ( gConf . GfxPropertiesArray [ i ] . Vendor = = Nvidia ) {
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 55 , " Generic NVIDIA name " , false ) ;
SubScreen - > AddMenuItemInput ( 110 , " NVIDIA No EFI " , false ) ;
SubScreen - > AddMenuItemInput ( 111 , " NVIDIA Single " , false ) ;
SubScreen - > AddMenuItemInput ( 56 , " Use NVIDIA WEB drivers " , false ) ;
2019-09-03 11:58:42 +02:00
}
2021-04-28 20:30:34 +02:00
if ( gConf . GfxPropertiesArray [ i ] . Vendor = = Intel ) {
2019-09-03 11:58:42 +02:00
continue ;
}
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( N + 3 , " Ports: " , true ) ;
2019-09-03 11:58:42 +02:00
2021-04-28 20:30:34 +02:00
if ( gConf . GfxPropertiesArray [ i ] . Vendor = = Nvidia ) {
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( N + 4 , " NVCAP: " , true ) ;
2019-09-03 11:58:42 +02:00
} else {
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( N + 4 , " Connectors: " , true ) ;
SubScreen - > AddMenuItemInput ( 50 , " RefCLK: " , true ) ;
2019-09-03 11:58:42 +02:00
}
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( N + 5 , " Load Video Bios " , false ) ;
2019-09-03 11:58:42 +02:00
}
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
return Entry ;
}
// ErmaC: Audio submenu
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuAudio ( )
2019-09-03 11:58:42 +02:00
{
UINTN i ;
// init
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
// create the entry in the main menu
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_AUDIO , " Audio tuning-> " _XS8 ) ;
2019-09-03 11:58:42 +02:00
// submenu description
2020-04-04 18:22:07 +02:00
SubScreen - > AddMenuInfoLine_f ( " Choose options to tune the HDA devices " ) ;
2021-04-28 20:30:34 +02:00
SubScreen - > AddMenuInfoLine_f ( " Number of Audio Controller%s=%zu " , ( ( gConf . HdaPropertiesArray . size ( ) ! = 1 ) ? " s " : " " ) , gConf . HdaPropertiesArray . size ( ) ) ;
for ( i = 0 ; i < gConf . HdaPropertiesArray . size ( ) ; i + + ) {
2020-04-17 15:14:24 +02:00
SubScreen - > AddMenuInfoLine_f ( " %llu) %ls [%04hX][%04hX] " ,
2019-09-03 11:58:42 +02:00
( i + 1 ) ,
2021-04-28 20:30:34 +02:00
gConf . HdaPropertiesArray [ i ] . controller_name ,
gConf . HdaPropertiesArray [ i ] . controller_vendor_id ,
gConf . HdaPropertiesArray [ i ] . controller_device_id
2019-09-03 11:58:42 +02:00
) ;
}
2021-09-28 10:28:45 +02:00
//SubScreen->AddMenuItemInput(59, "HDAInjection", false);
2021-03-29 10:50:02 +02:00
if ( gSettings . Devices . Audio . HDAInjection ) {
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 60 , " HDALayoutId: " , true ) ;
2019-09-03 11:58:42 +02:00
}
// avaiable configuration
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 57 , " ResetHDA " , false ) ;
SubScreen - > AddMenuItemInput ( 58 , " AFGLowPowerState " , false ) ;
2019-09-03 11:58:42 +02:00
// return
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
return Entry ;
}
# define nya(x) x / 10,x%10
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuSpeedStep ( )
2019-09-03 11:58:42 +02:00
{
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_CPU , " CPU tuning-> " _XS8 ) ;
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuInfoLine_f ( " %s " , gCPUStructure . BrandString . c_str ( ) ) ;
2020-04-04 18:22:07 +02:00
SubScreen - > AddMenuInfoLine_f ( " Model: %2X/%2X/%2X " ,
gCPUStructure . Family , gCPUStructure . Model , gCPUStructure . Stepping ) ;
SubScreen - > AddMenuInfoLine_f ( " Cores: %d Threads: %d " ,
gCPUStructure . Cores , gCPUStructure . Threads ) ;
SubScreen - > AddMenuInfoLine_f ( " FSB speed MHz: %llu " ,
DivU64x32 ( gCPUStructure . FSBFrequency , Mega ) ) ;
SubScreen - > AddMenuInfoLine_f ( " CPU speed MHz: %llu " ,
DivU64x32 ( gCPUStructure . CPUFrequency , Mega ) ) ;
SubScreen - > AddMenuInfoLine_f ( " Ratio: Min=%d.%d Max=%d.%d Turbo=%d.%d/%d.%d/%d.%d/%d.%d " ,
2019-09-03 11:58:42 +02:00
nya ( gCPUStructure . MinRatio ) , nya ( gCPUStructure . MaxRatio ) ,
2020-04-04 18:22:07 +02:00
nya ( gCPUStructure . Turbo4 ) , nya ( gCPUStructure . Turbo3 ) , nya ( gCPUStructure . Turbo2 ) , nya ( gCPUStructure . Turbo1 ) ) ;
2019-09-03 11:58:42 +02:00
2020-03-03 21:55:37 +01:00
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 76 , " Cores enabled: " , true ) ;
SubScreen - > AddMenuItemInput ( 6 , " Halt Enabler " , false ) ;
SubScreen - > AddMenuItemInput ( 7 , " PLimitDict: " , true ) ;
SubScreen - > AddMenuItemInput ( 8 , " UnderVoltStep: " , true ) ;
SubScreen - > AddMenuItemInput ( 88 , " DoubleFirstState " , false ) ;
SubScreen - > AddMenuItemInput ( 5 , " GeneratePStates " , false ) ;
SubScreen - > AddMenuItemInput ( 9 , " GenerateCStates " , false ) ;
SubScreen - > AddMenuItemInput ( 10 , " EnableC2 " , false ) ;
SubScreen - > AddMenuItemInput ( 11 , " EnableC4 " , false ) ;
SubScreen - > AddMenuItemInput ( 12 , " EnableC6 " , false ) ;
SubScreen - > AddMenuItemInput ( 89 , " EnableC7 " , false ) ;
SubScreen - > AddMenuItemInput ( 13 , " Use SystemIO " , false ) ;
SubScreen - > AddMenuItemInput ( 75 , " C3Latency: " , true ) ;
SubScreen - > AddMenuItemInput ( 19 , " BusSpeed [kHz]: " , true ) ;
SubScreen - > AddMenuItemInput ( 14 , " QPI [MHz]: " , true ) ;
SubScreen - > AddMenuItemInput ( 77 , " Saving Mode: " , true ) ;
SubScreen - > AddMenuItemInput ( 15 , " PatchAPIC " , false ) ; //-> move to ACPI?
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
return Entry ;
}
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuKextPatches ( )
2019-09-03 11:58:42 +02:00
{
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
REFIT_INPUT_DIALOG * InputBootArgs ;
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_KEXTS , " Custom kexts patches-> " _XS8 ) ;
2019-09-03 11:58:42 +02:00
2020-08-12 17:15:47 +02:00
for ( size_t Index = 0 ; Index < gSettings . KernelAndKextPatches . KextPatches . size ( ) ; Index + + ) {
2020-02-28 21:28:33 +01:00
InputBootArgs = new REFIT_INPUT_DIALOG ;
2020-08-12 17:15:47 +02:00
InputBootArgs - > Title . SWPrintf ( " %90s " , gSettings . KernelAndKextPatches . KextPatches [ Index ] . Label . c_str ( ) ) ;
2020-02-28 21:28:33 +01:00
// InputBootArgs->Tag = TAG_INPUT;
InputBootArgs - > Row = 0xFFFF ; //cursor
2020-08-12 17:15:47 +02:00
InputBootArgs - > Item = & ( gSettings . KernelAndKextPatches . KextPatches [ Index ] . MenuItem ) ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > AtClick = ActionEnter ;
InputBootArgs - > AtRightClick = ActionDetails ;
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( InputBootArgs , true ) ;
2019-09-03 11:58:42 +02:00
}
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
return Entry ;
}
2020-08-12 17:15:47 +02:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuKextBlockInjection ( const XString8 & UniSysVer )
2019-09-03 11:58:42 +02:00
{
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry = NULL ;
2019-12-11 13:52:26 +01:00
REFIT_MENU_SCREEN * SubScreen = NULL ;
2019-09-03 11:58:42 +02:00
REFIT_INPUT_DIALOG * InputBootArgs ;
2020-09-16 01:01:53 +02:00
for ( size_t idx = 0 ; idx < InjectKextList . size ( ) ; idx + + ) {
SIDELOAD_KEXT & Kext = InjectKextList [ idx ] ;
if ( Kext . KextDirNameUnderOEMPath = = UniSysVer ) {
2019-12-11 13:52:26 +01:00
if ( SubScreen = = NULL ) {
2021-01-31 10:50:23 +01:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_KEXT_INJECT , S8Printf ( " %s-> " , UniSysVer . c_str ( ) ) ) ;
2020-05-04 20:03:25 +02:00
SubScreen - > AddMenuInfoLine_f ( " Choose/check kext to disable: " ) ;
2019-12-11 13:52:26 +01:00
}
2020-02-28 21:28:33 +01:00
InputBootArgs = new REFIT_INPUT_DIALOG ;
2020-09-16 01:01:53 +02:00
InputBootArgs - > Title . SWPrintf ( " %ls, v.%ls " , Kext . FileName . wc_str ( ) , Kext . Version . wc_str ( ) ) ;
2020-02-28 21:28:33 +01:00
// InputBootArgs->Tag = TAG_INPUT;
InputBootArgs - > Row = 0xFFFF ; //cursor
2020-09-16 01:01:53 +02:00
InputBootArgs - > Item = & ( Kext . MenuItem ) ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > AtClick = ActionEnter ;
InputBootArgs - > AtRightClick = ActionDetails ;
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( InputBootArgs , true ) ;
2019-09-03 11:58:42 +02:00
2020-09-16 01:01:53 +02:00
for ( size_t idxPlugin = 0 ; idxPlugin < Kext . PlugInList . size ( ) ; idxPlugin + + ) {
SIDELOAD_KEXT & plugInKext = Kext . PlugInList [ idxPlugin ] ;
2020-02-28 21:28:33 +01:00
InputBootArgs = new REFIT_INPUT_DIALOG ;
2020-09-16 01:01:53 +02:00
InputBootArgs - > Title . SWPrintf ( " |-- %ls, v.%ls " , plugInKext . FileName . wc_str ( ) , plugInKext . Version . wc_str ( ) ) ;
2020-02-28 21:28:33 +01:00
// InputBootArgs->Tag = TAG_INPUT;
InputBootArgs - > Row = 0xFFFF ; //cursor
2020-09-16 01:01:53 +02:00
InputBootArgs - > Item = & ( plugInKext . MenuItem ) ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > AtClick = ActionEnter ;
InputBootArgs - > AtRightClick = ActionDetails ;
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( InputBootArgs , true ) ;
2019-09-03 11:58:42 +02:00
}
}
}
2020-03-03 21:44:07 +01:00
if ( SubScreen ! = NULL ) SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
return Entry ;
}
2020-05-17 20:56:10 +02:00
LOADER_ENTRY * LOADER_ENTRY : : SubMenuKextInjectMgmt ( )
2019-09-03 11:58:42 +02:00
{
2019-12-11 13:52:26 +01:00
LOADER_ENTRY * SubEntry ;
2020-11-02 14:45:11 +01:00
REFIT_MENU_SCREEN * SubSubScreen ;
2019-12-11 13:52:26 +01:00
2021-05-05 19:10:10 +02:00
SubEntry = new LOADER_ENTRY ;
2020-11-02 14:45:11 +01:00
NewEntry_ ( SubEntry , & SubSubScreen , ActionEnter , SCREEN_SYSTEM , " Block injected kexts-> " _XS8 ) ;
2020-05-17 20:56:10 +02:00
SubEntry - > Flags = Flags ;
2021-01-31 10:50:23 +01:00
if ( macOSVersion . notEmpty ( ) ) {
XString8 OSVersionKextsDirName ; // declare here to avoid multiple allocation
{
XString8 ShortOSVersion = macOSVersion . nbElement ( ) = = 1 ? macOSVersion . asString ( 1 ) : macOSVersion . asString ( macOSVersion . nbElement ( ) - 1 ) ;
SubSubScreen - > AddMenuInfoLine_f ( " Block injected kexts for target version of macOS: %s " , ShortOSVersion . c_str ( ) ) ;
}
2019-12-11 13:52:26 +01:00
2020-09-08 13:00:17 +02:00
// Add kext from 10 or 11
2019-12-11 13:52:26 +01:00
{
2021-01-31 10:50:23 +01:00
OSVersionKextsDirName = macOSVersion . asString ( 1 ) ;
SubSubScreen - > AddMenuEntry ( SubMenuKextBlockInjection ( OSVersionKextsDirName ) , true ) ;
OSVersionKextsDirName . S8Catf ( " _%s " , getSuffixForMacOsVersion ( LoaderType ) . c_str ( ) ) ;
SubSubScreen - > AddMenuEntry ( SubMenuKextBlockInjection ( OSVersionKextsDirName ) , true ) ;
2019-12-11 13:52:26 +01:00
}
2021-01-31 10:50:23 +01:00
// Add kext from 10(or 11).{version}
2019-12-11 13:52:26 +01:00
{
2021-01-31 10:50:23 +01:00
OSVersionKextsDirName = macOSVersion . asString ( 2 ) ;
if ( macOSVersion . elementAt ( 1 ) = = - 1 ) OSVersionKextsDirName . S8Catf ( " .0 " ) ;
SubSubScreen - > AddMenuEntry ( SubMenuKextBlockInjection ( OSVersionKextsDirName ) , true ) ;
OSVersionKextsDirName . S8Catf ( " _%s " , getSuffixForMacOsVersion ( LoaderType ) . c_str ( ) ) ;
SubSubScreen - > AddMenuEntry ( SubMenuKextBlockInjection ( OSVersionKextsDirName ) , true ) ;
}
// Add kext from :
2022-06-24 18:03:14 +02:00
// 10(or 1*).{version}.0 if NO minor version
// 10(or 1*).{version}.{minor version} if minor version is > 0
2021-01-31 10:50:23 +01:00
if ( macOSVersion . nbElement ( ) > = 2 )
{
OSVersionKextsDirName = macOSVersion . asString ( 3 ) ;
if ( macOSVersion . elementAt ( 1 ) = = - 1 ) OSVersionKextsDirName . S8Catf ( " .0 " ) ;
if ( macOSVersion . elementAt ( 2 ) = = - 1 ) OSVersionKextsDirName . S8Catf ( " .0 " ) ;
SubSubScreen - > AddMenuEntry ( SubMenuKextBlockInjection ( OSVersionKextsDirName ) , true ) ;
OSVersionKextsDirName . S8Catf ( " _%s " , getSuffixForMacOsVersion ( LoaderType ) . c_str ( ) ) ;
SubSubScreen - > AddMenuEntry ( SubMenuKextBlockInjection ( OSVersionKextsDirName ) , true ) ;
2019-12-11 13:52:26 +01:00
}
}
else {
2020-11-12 22:25:56 +01:00
SubSubScreen - > AddMenuInfoLine_f ( " Block injected kexts for unknown macOS version " ) ;
SubSubScreen - > AddMenuEntry ( SubMenuKextBlockInjection ( " Unknown " _XS8 ) , true ) ;
2019-12-11 13:52:26 +01:00
}
2020-11-12 22:25:56 +01:00
2021-01-31 10:50:23 +01:00
XStringW kextDir ;
2021-09-28 10:28:45 +02:00
kextDir = GetOtherKextsDir ( true ) ;
2020-08-09 17:55:30 +02:00
if ( kextDir . notEmpty ( ) ) {
2020-11-02 14:45:11 +01:00
SubSubScreen - > AddMenuEntry ( SubMenuKextBlockInjection ( " Other " _XS8 ) , true ) ;
2019-12-11 13:52:26 +01:00
}
2021-09-28 10:28:45 +02:00
kextDir = GetOtherKextsDir ( false ) ;
2020-08-09 17:55:30 +02:00
if ( kextDir . notEmpty ( ) ) {
2020-11-02 14:45:11 +01:00
SubSubScreen - > AddMenuEntry ( SubMenuKextBlockInjection ( " Off " _XS8 ) , true ) ;
2019-12-11 13:52:26 +01:00
}
2020-11-02 14:45:11 +01:00
SubSubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-12-11 13:52:26 +01:00
return SubEntry ;
2019-09-03 11:58:42 +02:00
}
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuKernelPatches ( )
2019-09-03 11:58:42 +02:00
{
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
REFIT_INPUT_DIALOG * InputBootArgs ;
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_KERNELS , " Custom kernel patches-> " _XS8 ) ;
2019-09-03 11:58:42 +02:00
2020-08-12 17:15:47 +02:00
for ( size_t Index = 0 ; Index < gSettings . KernelAndKextPatches . KernelPatches . size ( ) ; Index + + ) {
2020-02-28 21:28:33 +01:00
InputBootArgs = new REFIT_INPUT_DIALOG ;
2020-08-12 17:15:47 +02:00
InputBootArgs - > Title . SWPrintf ( " %90s " , gSettings . KernelAndKextPatches . KernelPatches [ Index ] . Label . c_str ( ) ) ;
2020-02-28 21:28:33 +01:00
// InputBootArgs->Tag = TAG_INPUT;
InputBootArgs - > Row = 0xFFFF ; //cursor
2020-08-12 17:15:47 +02:00
InputBootArgs - > Item = & ( gSettings . KernelAndKextPatches . KernelPatches [ Index ] . MenuItem ) ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > AtClick = ActionEnter ;
InputBootArgs - > AtRightClick = ActionDetails ;
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( InputBootArgs , true ) ;
2019-09-03 11:58:42 +02:00
}
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
return Entry ;
}
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuBootPatches ( )
2019-09-03 11:58:42 +02:00
{
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
REFIT_INPUT_DIALOG * InputBootArgs ;
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_BOOTER , " Custom booter patches-> " _XS8 ) ;
2019-09-03 11:58:42 +02:00
2020-08-12 17:15:47 +02:00
for ( size_t Index = 0 ; Index < gSettings . KernelAndKextPatches . BootPatches . size ( ) ; Index + + ) {
2020-02-28 21:28:33 +01:00
InputBootArgs = new REFIT_INPUT_DIALOG ;
2020-08-12 17:15:47 +02:00
InputBootArgs - > Title . SWPrintf ( " %90s " , gSettings . KernelAndKextPatches . BootPatches [ Index ] . Label . c_str ( ) ) ;
2020-02-28 21:28:33 +01:00
// InputBootArgs->Tag = TAG_INPUT;
InputBootArgs - > Row = 0xFFFF ; //cursor
2020-08-12 17:15:47 +02:00
InputBootArgs - > Item = & ( gSettings . KernelAndKextPatches . BootPatches [ Index ] . MenuItem ) ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > AtClick = ActionEnter ;
InputBootArgs - > AtRightClick = ActionDetails ;
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( InputBootArgs , true ) ;
2019-09-03 11:58:42 +02:00
}
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
return Entry ;
}
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuBinaries ( )
2019-09-03 11:58:42 +02:00
{
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_BINARIES , " Binaries patching-> " _XS8 ) ;
2019-09-03 11:58:42 +02:00
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuInfoLine_f ( " %s " , gCPUStructure . BrandString . c_str ( ) ) ;
2020-05-04 20:03:25 +02:00
SubScreen - > AddMenuInfoLine_f ( " Real CPUID: 0x%06X " , gCPUStructure . Signature ) ;
2020-03-03 21:55:37 +01:00
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 64 , " Debug " , false ) ;
2020-04-04 18:22:07 +02:00
SubScreen - > AddMenuInfo_f ( " ---------------------- " ) ;
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 104 , " Fake CPUID: " , true ) ;
SubScreen - > AddMenuItemInput ( 91 , " Kernel Lapic " , false ) ;
SubScreen - > AddMenuItemInput ( 105 , " Kernel XCPM " , false ) ;
SubScreen - > AddMenuItemInput ( 48 , " Kernel PM " , false ) ;
SubScreen - > AddMenuItemInput ( 121 , " Panic No Kext Dump " , false ) ;
2022-01-29 11:59:16 +01:00
SubScreen - > AddMenuItemInput ( 128 , " Provide CPU Info " , false ) ;
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( SubMenuKernelPatches ( ) , true ) ;
2020-04-04 18:22:07 +02:00
SubScreen - > AddMenuInfo_f ( " ---------------------- " ) ;
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 46 , " AppleIntelCPUPM Patch " , false ) ;
SubScreen - > AddMenuItemInput ( 47 , " AppleRTC Patch " , false ) ;
SubScreen - > AddMenuItemInput ( 45 , " No 8 Apples Patch " , false ) ;
SubScreen - > AddMenuItemInput ( 61 , " Dell SMBIOS Patch " , false ) ;
// SubScreen->AddMenuItemInput(115, "No Caches", false);
// SubScreen->AddMenuItemInput(44, "Kext patching allowed", false);
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( SubMenuKextPatches ( ) , true ) ;
2020-04-04 18:22:07 +02:00
SubScreen - > AddMenuInfo_f ( " ---------------------- " ) ;
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( SubMenuBootPatches ( ) , true ) ;
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
return Entry ;
}
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuDropTables ( )
2019-09-03 11:58:42 +02:00
{
CHAR8 sign [ 5 ] ;
CHAR8 OTID [ 9 ] ;
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
REFIT_INPUT_DIALOG * InputBootArgs ;
sign [ 4 ] = 0 ;
OTID [ 8 ] = 0 ;
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_TABLES , " Tables dropping-> " _XS8 ) ;
2019-09-03 11:58:42 +02:00
2021-02-11 12:41:59 +01:00
if ( GlobalConfig . ACPIDropTables ) {
ACPI_DROP_TABLE * DropTable = GlobalConfig . ACPIDropTables ;
2019-09-03 11:58:42 +02:00
while ( DropTable ) {
CopyMem ( ( CHAR8 * ) & sign , ( CHAR8 * ) & ( DropTable - > Signature ) , 4 ) ;
CopyMem ( ( CHAR8 * ) & OTID , ( CHAR8 * ) & ( DropTable - > TableId ) , 8 ) ;
2020-03-25 19:32:44 +01:00
//MsgLog("adding to menu %s (%X) %s (%lx) L=%d(0x%X)\n",
2019-09-03 11:58:42 +02:00
// sign, DropTable->Signature,
// OTID, DropTable->TableId,
// DropTable->Length, DropTable->Length);
2020-05-27 20:04:31 +02:00
InputBootArgs = new REFIT_INPUT_DIALOG ;
2020-03-31 18:10:30 +02:00
InputBootArgs - > Title . SWPrintf ( " Drop \" %4.4s \" \" %8.8s \" %d " , sign , OTID , DropTable - > Length ) ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > Row = 0xFFFF ; //cursor
2019-09-03 11:58:42 +02:00
InputBootArgs - > Item = & ( DropTable - > MenuItem ) ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > AtClick = ActionEnter ;
InputBootArgs - > AtRightClick = ActionDetails ;
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( InputBootArgs , true ) ;
2019-09-03 11:58:42 +02:00
DropTable = DropTable - > Next ;
}
}
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 4 , " Drop all OEM SSDT " , false ) ;
SubScreen - > AddMenuItemInput ( 113 , " Automatic smart merge " , false ) ;
2019-09-03 11:58:42 +02:00
2021-03-23 20:59:30 +01:00
for ( size_t idx = 0 ; idx < ACPIPatchedAML . size ( ) ; + + idx ) {
ACPI_PATCHED_AML & ACPIPatchedAMLTmp = ACPIPatchedAML [ idx ] ;
InputBootArgs = new REFIT_INPUT_DIALOG ;
InputBootArgs - > Title . SWPrintf ( " Drop \" %s \" " , ACPIPatchedAMLTmp . FileName . c_str ( ) ) ;
InputBootArgs - > Row = 0xFFFF ; //cursor
InputBootArgs - > Item = & ( ACPIPatchedAMLTmp . MenuItem ) ;
InputBootArgs - > AtClick = ActionEnter ;
InputBootArgs - > AtRightClick = ActionDetails ;
SubScreen - > AddMenuEntry ( InputBootArgs , true ) ;
2019-09-03 11:58:42 +02:00
}
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
return Entry ;
}
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuSmbios ( )
2019-09-03 11:58:42 +02:00
{
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_SMBIOS , " SMBIOS-> " _XS8 ) ;
2019-09-03 11:58:42 +02:00
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuInfoLine_f ( " %s " , gCPUStructure . BrandString . c_str ( ) ) ;
2021-04-03 16:42:49 +02:00
SubScreen - > AddMenuInfoLine_f ( " %s " , GlobalConfig . OEMProductFromSmbios . c_str ( ) ) ;
SubScreen - > AddMenuInfoLine_f ( " with board %s " , GlobalConfig . OEMBoardFromSmbios . c_str ( ) ) ;
2020-03-03 21:44:07 +01:00
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 78 , " Product Name: " , true ) ;
SubScreen - > AddMenuItemInput ( 79 , " Product Version: " , true ) ;
SubScreen - > AddMenuItemInput ( 80 , " Product SN: " , true ) ;
SubScreen - > AddMenuItemInput ( 81 , " Board ID: " , true ) ;
SubScreen - > AddMenuItemInput ( 82 , " Board SN: " , true ) ;
SubScreen - > AddMenuItemInput ( 83 , " Board Type: " , true ) ;
SubScreen - > AddMenuItemInput ( 84 , " Board Version: " , true ) ;
SubScreen - > AddMenuItemInput ( 85 , " Chassis Type: " , true ) ;
SubScreen - > AddMenuItemInput ( 86 , " ROM Version: " , true ) ;
SubScreen - > AddMenuItemInput ( 87 , " ROM Release Date: " , true ) ;
SubScreen - > AddMenuItemInput ( 62 , " FirmwareFeatures: " , true ) ;
SubScreen - > AddMenuItemInput ( 63 , " FirmwareFeaturesMask: " , true ) ;
SubScreen - > AddMenuItemInput ( 125 , " ExtendedFirmwareFeatures: " , true ) ;
SubScreen - > AddMenuItemInput ( 126 , " ExtendedFirmwareFeaturesMask: " , true ) ;
SubScreen - > AddMenuItemInput ( 17 , " PlatformFeature: " , true ) ;
SubScreen - > AddMenuItemInput ( 117 , " EFI Version: " , true ) ;
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
return Entry ;
}
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuDsdtFix ( )
2019-09-03 11:58:42 +02:00
{
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ; //, *SubEntry;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_DSDT , NullXString8 ) ;
2019-09-03 11:58:42 +02:00
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuCheck ( " Add DTGP " , FIX_DTGP , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix Darwin as WinXP " , FIX_WARNING , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix Darwin as Win7 " , FIX_DARWIN , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix shutdown " , FIX_SHUTDOWN , 67 ) ;
SubScreen - > AddMenuCheck ( " Add MCHC " , FIX_MCHC , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix HPET " , FIX_HPET , 67 ) ;
SubScreen - > AddMenuCheck ( " Fake LPC " , FIX_LPC , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix IPIC " , FIX_IPIC , 67 ) ;
SubScreen - > AddMenuCheck ( " Add SMBUS " , FIX_SBUS , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix display " , FIX_DISPLAY , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix IDE " , FIX_IDE , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix SATA " , FIX_SATA , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix Firewire " , FIX_FIREWIRE , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix USB " , FIX_USB , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix LAN " , FIX_LAN , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix Airport " , FIX_WIFI , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix sound " , FIX_HDA , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix RTC " , FIX_RTC , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix TMR " , FIX_TMR , 67 ) ;
SubScreen - > AddMenuCheck ( " Add IMEI " , FIX_IMEI , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix IntelGFX " , FIX_INTELGFX , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix _WAK " , FIX_WAK , 67 ) ;
SubScreen - > AddMenuCheck ( " Del unused " , FIX_UNUSED , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix ADP1 " , FIX_ADP1 , 67 ) ;
SubScreen - > AddMenuCheck ( " Add PNLF " , FIX_PNLF , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix S3D " , FIX_S3D , 67 ) ;
SubScreen - > AddMenuCheck ( " Rename ACST " , FIX_ACST , 67 ) ;
SubScreen - > AddMenuCheck ( " Add HDMI " , FIX_HDMI , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix Regions " , FIX_REGIONS , 67 ) ;
SubScreen - > AddMenuCheck ( " Fix Mutex " , FIX_MUTEX , 67 ) ;
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
ModifyTitles ( Entry ) ;
return Entry ;
}
2020-07-15 19:29:27 +02:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuDSDTPatches ( )
2019-09-03 11:58:42 +02:00
{
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
REFIT_INPUT_DIALOG * InputBootArgs ;
2021-02-11 12:41:59 +01:00
size_t PatchDsdtNum = gSettings . ACPI . DSDT . DSDTPatchArray . size ( ) ;
2019-09-03 11:58:42 +02:00
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_DSDT_PATCHES , " Custom DSDT patches-> " _XS8 ) ;
2019-09-03 11:58:42 +02:00
2020-08-27 20:47:56 +02:00
for ( size_t Index = 0 ; Index < PatchDsdtNum ; Index + + ) {
2020-02-28 21:28:33 +01:00
InputBootArgs = new REFIT_INPUT_DIALOG ;
2021-02-11 12:41:59 +01:00
InputBootArgs - > Title . SWPrintf ( " %90s " , gSettings . ACPI . DSDT . DSDTPatchArray [ Index ] . PatchDsdtLabel . c_str ( ) ) ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > Row = 0xFFFF ; //cursor
2021-02-11 12:41:59 +01:00
InputBootArgs - > Item = & gSettings . ACPI . DSDT . DSDTPatchArray [ Index ] . PatchDsdtMenuItem ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > AtClick = ActionEnter ;
InputBootArgs - > AtRightClick = ActionDetails ;
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( InputBootArgs , true ) ;
2019-09-03 11:58:42 +02:00
}
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
return Entry ;
}
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuDsdts ( )
2019-09-03 11:58:42 +02:00
{
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
2020-02-28 21:28:33 +01:00
REFIT_MENU_SWITCH * InputBootArgs ;
2019-09-03 11:58:42 +02:00
UINTN i ;
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_ACPI , " Dsdt name-> " _XS8 ) ;
2019-09-03 11:58:42 +02:00
2020-04-04 18:22:07 +02:00
SubScreen - > AddMenuInfoLine_f ( " Select a DSDT file: " ) ;
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemSwitch ( 116 , " BIOS.aml " , false ) ;
2019-09-03 11:58:42 +02:00
2021-09-27 09:18:52 +02:00
for ( i = 0 ; i < DsdtsList . size ( ) ; i + + ) {
2020-02-28 21:28:33 +01:00
InputBootArgs = new REFIT_MENU_SWITCH ;
2020-03-10 17:50:55 +01:00
InputBootArgs - > Title . takeValueFrom ( DsdtsList [ i ] ) ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > Row = i + 1 ;
2019-09-03 11:58:42 +02:00
InputBootArgs - > Item = & InputItems [ 116 ] ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > AtClick = ActionEnter ;
InputBootArgs - > AtRightClick = ActionDetails ;
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( InputBootArgs , true ) ;
2019-09-03 11:58:42 +02:00
}
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
return Entry ;
}
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuACPI ( )
2019-09-03 11:58:42 +02:00
{
// init
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
// create the entry in the options menu
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_ACPI , " ACPI patching-> " _XS8 ) ;
2019-09-03 11:58:42 +02:00
// submenu description
2020-04-04 18:22:07 +02:00
SubScreen - > AddMenuInfoLine_f ( " Choose options to patch ACPI " ) ;
2019-09-03 11:58:42 +02:00
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 102 , " Debug DSDT " , false ) ;
2019-09-03 11:58:42 +02:00
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( SubMenuDsdts ( ) , true ) ;
SubScreen - > AddMenuEntry ( SubMenuDropTables ( ) , true ) ;
SubScreen - > AddMenuEntry ( SubMenuDsdtFix ( ) , true ) ;
SubScreen - > AddMenuEntry ( SubMenuDSDTPatches ( ) , true ) ;
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 49 , " Fix MCFG " , false ) ;
2021-05-19 14:11:21 +02:00
SubScreen - > AddMenuItemInput ( 124 , " Fix Headers " , gSettings . ACPI . FixHeaders ) ;
2019-09-03 11:58:42 +02:00
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
return Entry ;
}
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuAudioPort ( )
2019-09-03 11:58:42 +02:00
{
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
2020-02-28 21:28:33 +01:00
REFIT_MENU_SWITCH * InputBootArgs ;
2019-09-03 11:58:42 +02:00
UINTN i ;
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_AUDIOPORTS , " Startup sound output-> " _XS8 ) ;
2019-09-03 11:58:42 +02:00
2020-04-04 18:22:07 +02:00
SubScreen - > AddMenuInfoLine_f ( " Select an audio output, press F7 to test " ) ;
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 120 , " Volume: " , true ) ;
2019-09-03 11:58:42 +02:00
2020-08-31 09:07:36 +02:00
for ( i = 0 ; i < AudioList . size ( ) ; i + + ) {
2020-02-28 21:28:33 +01:00
InputBootArgs = new REFIT_MENU_SWITCH ;
2020-08-31 09:07:36 +02:00
InputBootArgs - > Title . SWPrintf ( " %ls_%s " , AudioList [ i ] . Name . wc_str ( ) , AudioOutputNames [ AudioList [ i ] . Device ] ) ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > Row = i ;
2019-09-03 11:58:42 +02:00
InputBootArgs - > Item = & InputItems [ 119 ] ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > AtClick = ActionEnter ;
InputBootArgs - > AtRightClick = ActionDetails ;
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( InputBootArgs , true ) ;
2019-09-03 11:58:42 +02:00
}
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
return Entry ;
}
2021-04-01 10:06:53 +02:00
void CreateMenuProps ( REFIT_MENU_SCREEN * SubScreen , SETTINGS_DATA : : DevicesClass : : SimplePropertyClass * Prop )
2019-09-03 11:58:42 +02:00
{
REFIT_INPUT_DIALOG * InputBootArgs ;
2021-04-01 10:06:53 +02:00
InputBootArgs = new REFIT_INPUT_DIALOG ;
InputBootArgs - > Title . SWPrintf ( " key: %s " , Prop - > Key . c_str ( ) ) ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > Row = 0xFFFF ; //cursor
2019-09-03 11:58:42 +02:00
InputBootArgs - > Item = & Prop - > MenuItem ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > AtClick = ActionEnter ;
InputBootArgs - > AtRightClick = ActionDetails ;
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( InputBootArgs , true ) ;
2019-09-03 11:58:42 +02:00
switch ( Prop - > ValueType ) {
case kTagTypeInteger :
2021-04-01 10:06:53 +02:00
SubScreen - > AddMenuInfo_f ( " value: 0x%08llx " , * ( UINT64 * ) Prop - > Value . data ( ) ) ;
2019-09-03 11:58:42 +02:00
break ;
case kTagTypeString :
2021-04-01 10:06:53 +02:00
SubScreen - > AddMenuInfo_f ( " value: %90s " , Prop - > Value . data ( ) ) ;
2019-09-03 11:58:42 +02:00
break ;
case kTagTypeFalse :
2020-03-12 19:23:32 +01:00
SubScreen - > AddMenuInfo_f ( ( " value: false " ) ) ;
2019-09-03 11:58:42 +02:00
break ;
case kTagTypeTrue :
2020-03-12 19:23:32 +01:00
SubScreen - > AddMenuInfo_f ( ( " value: true " ) ) ;
2019-09-03 11:58:42 +02:00
break ;
2020-04-22 19:52:21 +02:00
case kTagTypeFloat :
2021-04-01 10:06:53 +02:00
SubScreen - > AddMenuInfo_f ( " value: %f " , * ( float * ) Prop - > Value . data ( ) ) ;
2020-04-22 19:52:21 +02:00
break ;
2019-09-03 11:58:42 +02:00
default : //type data, print first 24 bytes
2021-04-01 10:06:53 +02:00
SubScreen - > AddMenuInfo_f ( " value[%zu]: %24s " , Prop - > Value . size ( ) , Bytes2HexStr ( ( UINT8 * ) Prop - > Value . data ( ) , MIN ( 24 , Prop - > Value . size ( ) ) ) . c_str ( ) ) ;
2019-09-03 11:58:42 +02:00
break ;
}
2021-04-01 10:06:53 +02:00
}
2022-07-20 19:33:57 +02:00
/*
2021-04-01 10:06:53 +02:00
void CreateMenuAddProp ( REFIT_MENU_SCREEN * SubScreen , SETTINGS_DATA : : DevicesClass : : AddPropertyClass * Prop )
{
REFIT_INPUT_DIALOG * InputBootArgs ;
InputBootArgs = new REFIT_INPUT_DIALOG ;
InputBootArgs - > Title . SWPrintf ( " key: %s " , Prop - > Key . c_str ( ) ) ;
InputBootArgs - > Row = 0xFFFF ; //cursor
InputBootArgs - > Item = & Prop - > MenuItem ;
InputBootArgs - > AtClick = ActionEnter ;
InputBootArgs - > AtRightClick = ActionDetails ;
SubScreen - > AddMenuEntry ( InputBootArgs , true ) ;
switch ( Prop - > ValueType ) {
case kTagTypeInteger :
SubScreen - > AddMenuInfo_f ( " value: 0x%08llx " , * ( UINT64 * ) Prop - > Value . data ( ) ) ;
break ;
case kTagTypeString :
SubScreen - > AddMenuInfo_f ( " value: %90s " , Prop - > Value . data ( ) ) ;
break ;
case kTagTypeFalse :
SubScreen - > AddMenuInfo_f ( ( " value: false " ) ) ;
break ;
case kTagTypeTrue :
SubScreen - > AddMenuInfo_f ( ( " value: true " ) ) ;
break ;
case kTagTypeFloat :
SubScreen - > AddMenuInfo_f ( " value: %f " , * ( float * ) Prop - > Value . data ( ) ) ;
break ;
default : //type data, print first 24 bytes
SubScreen - > AddMenuInfo_f ( " value[%zu]: %24s " , Prop - > Value . size ( ) , Bytes2HexStr ( ( UINT8 * ) Prop - > Value . data ( ) , MIN ( 24 , Prop - > Value . size ( ) ) ) . c_str ( ) ) ;
break ;
}
2019-09-03 11:58:42 +02:00
}
2022-07-20 19:33:57 +02:00
*/
2021-04-01 10:06:53 +02:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuProperties ( )
2019-09-03 11:58:42 +02:00
{
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
2021-04-01 10:06:53 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_DEVICES , " Properties-> " _XS8 ) ;
2019-09-03 11:58:42 +02:00
2021-04-01 10:06:53 +02:00
for ( size_t idx = 0 ; idx < gSettings . Devices . Properties . PropertyArray . size ( ) ; + + idx )
{
SETTINGS_DATA : : DevicesClass : : PropertiesClass : : PropertyClass & Prop = gSettings . Devices . Properties . PropertyArray [ idx ] ;
2019-09-03 11:58:42 +02:00
2021-04-01 10:06:53 +02:00
if ( idx > 0 ) SubScreen - > AddMenuInfo_f ( " ------------ " ) ;
SubScreen - > AddMenuInfo_f ( " %ls " , Prop . DevicePathAsString . wc_str ( ) ) ;
for ( size_t idxChild = 0 ; idxChild < Prop . propertiesArray . size ( ) ; + + idxChild ) {
SETTINGS_DATA : : DevicesClass : : SimplePropertyClass & Props = Prop . propertiesArray [ idxChild ] ;
CreateMenuProps ( SubScreen , & Props ) ;
2021-03-29 10:50:02 +02:00
}
2021-04-01 10:06:53 +02:00
}
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
Entry - > SubScreen = SubScreen ;
return Entry ;
}
2022-07-20 19:33:57 +02:00
/*
2021-04-01 10:06:53 +02:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuArbProperties ( )
{
REFIT_MENU_ITEM_OPTIONS * Entry ;
REFIT_MENU_SCREEN * SubScreen ;
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_DEVICES , " Arbitrary properties-> " _XS8 ) ;
for ( size_t idx = 0 ; idx < gSettings . Devices . ArbitraryArray . size ( ) ; + + idx ) {
SETTINGS_DATA : : DevicesClass : : ArbitraryPropertyClass & Prop = gSettings . Devices . ArbitraryArray [ idx ] ;
if ( idx > 0 ) SubScreen - > AddMenuInfo_f ( " ------------ " ) ;
for ( size_t idxChild = 0 ; idxChild < Prop . CustomPropertyArray . size ( ) ; + + idxChild ) {
SETTINGS_DATA : : DevicesClass : : SimplePropertyClass & Props = Prop . CustomPropertyArray [ idxChild ] ;
SubScreen - > AddMenuInfo_f ( " %s " , Prop . Label . c_str ( ) ) ;
CreateMenuProps ( SubScreen , & Props ) ;
2019-09-03 11:58:42 +02:00
}
}
2021-04-01 10:06:53 +02:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
Entry - > SubScreen = SubScreen ;
return Entry ;
}
REFIT_ABSTRACT_MENU_ENTRY * SubMenuAddProperties ( )
{
REFIT_MENU_ITEM_OPTIONS * Entry ;
REFIT_MENU_SCREEN * SubScreen ;
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_DEVICES , " Add properties-> " _XS8 ) ;
for ( size_t idx = 0 ; idx < gSettings . Devices . AddPropertyArray . size ( ) ; + + idx ) {
SETTINGS_DATA : : DevicesClass : : AddPropertyClass & Prop = gSettings . Devices . AddPropertyArray [ idx ] ;
CreateMenuAddProp ( SubScreen , & Prop ) ;
}
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
Entry - > SubScreen = SubScreen ;
return Entry ;
}
2022-07-20 19:33:57 +02:00
*/
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuPCI ( )
2019-09-03 11:58:42 +02:00
{
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_USB , " PCI devices-> " _XS8 ) ;
2019-09-03 11:58:42 +02:00
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 74 , " USB Ownership " , false ) ;
SubScreen - > AddMenuItemInput ( 92 , " USB Injection " , false ) ;
SubScreen - > AddMenuItemInput ( 93 , " Inject ClockID " , false ) ;
SubScreen - > AddMenuItemInput ( 106 , " Inject EFI Strings " , false ) ;
SubScreen - > AddMenuItemInput ( 107 , " No Default Properties " , false ) ;
SubScreen - > AddMenuItemInput ( 97 , " FakeID LAN: " , true ) ;
SubScreen - > AddMenuItemInput ( 98 , " FakeID WIFI: " , true ) ;
SubScreen - > AddMenuItemInput ( 99 , " FakeID SATA: " , true ) ;
SubScreen - > AddMenuItemInput ( 100 , " FakeID XHCI: " , true ) ;
SubScreen - > AddMenuItemInput ( 103 , " FakeID IMEI: " , true ) ;
2021-04-01 10:06:53 +02:00
SubScreen - > AddMenuEntry ( SubMenuProperties ( ) , true ) ;
2022-07-20 19:33:57 +02:00
// SubScreen->AddMenuEntry(SubMenuArbProperties(), true);
// SubScreen->AddMenuEntry(SubMenuAddProperties(), true);
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
Entry - > SubScreen = SubScreen ;
return Entry ;
}
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuThemes ( )
2019-09-03 11:58:42 +02:00
{
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
2020-02-28 21:28:33 +01:00
REFIT_MENU_SWITCH * InputBootArgs ;
2019-09-03 11:58:42 +02:00
UINTN i ;
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_THEME , " Themes-> " _XS8 ) ;
2019-09-03 11:58:42 +02:00
2020-04-04 18:22:07 +02:00
SubScreen - > AddMenuInfoLine_f ( " Installed themes: " ) ;
2019-09-03 11:58:42 +02:00
//add embedded
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemSwitch ( 3 , " embedded " , false ) ;
2019-09-03 11:58:42 +02:00
2020-08-31 09:22:11 +02:00
for ( i = 0 ; i < ThemeNameArray . size ( ) ; i + + ) {
2020-02-28 21:28:33 +01:00
InputBootArgs = new REFIT_MENU_SWITCH ;
2020-08-31 09:22:11 +02:00
InputBootArgs - > Title . takeValueFrom ( ThemeNameArray [ i ] ) ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > Row = i + 1 ;
2019-09-03 11:58:42 +02:00
InputBootArgs - > Item = & InputItems [ 3 ] ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > AtClick = ActionEnter ;
InputBootArgs - > AtRightClick = ActionDetails ;
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( InputBootArgs , true ) ;
2019-09-03 11:58:42 +02:00
}
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
return Entry ;
}
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuGUI ( )
2019-09-03 11:58:42 +02:00
{
// init
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
// create the entry in the options menu
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_GUI , " GUI tuning-> " _XS8 ) ;
2019-09-03 11:58:42 +02:00
// submenu description
2020-04-04 18:22:07 +02:00
SubScreen - > AddMenuInfoLine_f ( " Choose options to tune the Interface " ) ;
2019-09-03 11:58:42 +02:00
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 70 , " Pointer Speed: " , true ) ;
SubScreen - > AddMenuItemInput ( 72 , " Mirror Move " , false ) ;
2019-09-03 11:58:42 +02:00
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( SubMenuThemes ( ) , true ) ;
2019-09-03 11:58:42 +02:00
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
return Entry ;
}
/*
* This is a simple and user friendly submenu which makes it possible to modify
* the System Integrity Protection configuration from the Clover ' s GUI .
* Author : Needy .
* The below function is based on the SubMenuDsdtFix function .
*/
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuCSR ( )
2019-09-03 11:58:42 +02:00
{
// init
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
// create the entry in the main menu
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_CSR , NullXString8 ) ;
2019-09-03 11:58:42 +02:00
// submenu description
2020-04-04 18:22:07 +02:00
SubScreen - > AddMenuInfoLine_f ( " Modify the System Integrity Protection configuration. " ) ;
SubScreen - > AddMenuInfoLine_f ( " All configuration changes apply to the entire machine. " ) ;
2019-09-03 11:58:42 +02:00
// available configurations
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuCheck ( " Allow Untrusted Kexts " , CSR_ALLOW_UNTRUSTED_KEXTS , 66 ) ;
SubScreen - > AddMenuCheck ( " Allow Unrestricted FS " , CSR_ALLOW_UNRESTRICTED_FS , 66 ) ;
SubScreen - > AddMenuCheck ( " Allow Task For PID " , CSR_ALLOW_TASK_FOR_PID , 66 ) ;
SubScreen - > AddMenuCheck ( " Allow Kernel Debuger " , CSR_ALLOW_KERNEL_DEBUGGER , 66 ) ;
SubScreen - > AddMenuCheck ( " Allow Apple Internal " , CSR_ALLOW_APPLE_INTERNAL , 66 ) ;
SubScreen - > AddMenuCheck ( " Allow Unrestricted DTrace " , CSR_ALLOW_UNRESTRICTED_DTRACE , 66 ) ;
SubScreen - > AddMenuCheck ( " Allow Unrestricted NVRAM " , CSR_ALLOW_UNRESTRICTED_NVRAM , 66 ) ;
SubScreen - > AddMenuCheck ( " Allow Device Configuration " , CSR_ALLOW_DEVICE_CONFIGURATION , 66 ) ;
SubScreen - > AddMenuCheck ( " Allow Any Recovery OS " , CSR_ALLOW_ANY_RECOVERY_OS , 66 ) ;
SubScreen - > AddMenuCheck ( " Allow Unapproved Kexts " , CSR_ALLOW_UNAPPROVED_KEXTS , 66 ) ;
2021-05-04 18:21:42 +02:00
SubScreen - > AddMenuCheck ( " Allow Executable Policy Override " , CSR_ALLOW_EXECUTABLE_POLICY_OVERRIDE , 66 ) ;
SubScreen - > AddMenuCheck ( " Allow Non-authenticated Root " , CSR_ALLOW_NON_AUTHENTICATED_ROOT , 66 ) ;
2019-09-03 11:58:42 +02:00
// return
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
ModifyTitles ( Entry ) ;
return Entry ;
}
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuBLC ( )
2019-09-03 11:58:42 +02:00
{
// init
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
// create the entry in the main menu
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_BLC , NullXString8 ) ;
2019-09-03 11:58:42 +02:00
// submenu description
2020-04-04 18:22:07 +02:00
SubScreen - > AddMenuInfoLine_f ( " Modify flags for boot.efi " ) ;
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuCheck ( " Reboot On Panic " , kBootArgsFlagRebootOnPanic , 65 ) ;
SubScreen - > AddMenuCheck ( " Hi DPI " , kBootArgsFlagHiDPI , 65 ) ;
SubScreen - > AddMenuCheck ( " Black Screen " , kBootArgsFlagBlack , 65 ) ;
SubScreen - > AddMenuCheck ( " CSR Active Config " , kBootArgsFlagCSRActiveConfig , 65 ) ;
2020-09-07 00:19:48 +02:00
SubScreen - > AddMenuCheck ( " CSR Pending Config " , kBootArgsFlagCSRConfigMode , 65 ) ;
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuCheck ( " CSR Boot " , kBootArgsFlagCSRBoot , 65 ) ;
SubScreen - > AddMenuCheck ( " Black Background " , kBootArgsFlagBlackBg , 65 ) ;
SubScreen - > AddMenuCheck ( " Login UI " , kBootArgsFlagLoginUI , 65 ) ;
SubScreen - > AddMenuCheck ( " Install UI " , kBootArgsFlagInstallUI , 65 ) ;
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
ModifyTitles ( Entry ) ;
return Entry ;
}
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuSystem ( )
2019-09-03 11:58:42 +02:00
{
// init
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
// create the entry in the options menu
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_SYSTEM , " System Parameters-> " _XS8 ) ;
2019-09-03 11:58:42 +02:00
// submenu description
2020-04-04 18:22:07 +02:00
SubScreen - > AddMenuInfoLine_f ( " Choose options for booted OS " ) ;
2019-09-03 11:58:42 +02:00
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 2 , " Block kext: " , true ) ;
SubScreen - > AddMenuItemInput ( 51 , " Set OS version if not detected: " , true ) ;
SubScreen - > AddMenuItemInput ( 118 , " Booter Cfg Command: " , true ) ;
2019-09-03 11:58:42 +02:00
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( SubMenuCSR ( ) , true ) ;
SubScreen - > AddMenuEntry ( SubMenuBLC ( ) , true ) ;
2019-09-03 11:58:42 +02:00
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
return Entry ;
}
2020-03-10 10:45:17 +01:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuConfigs ( )
2019-09-03 11:58:42 +02:00
{
2020-03-10 10:45:17 +01:00
REFIT_MENU_ITEM_OPTIONS * Entry ;
2019-09-03 11:58:42 +02:00
REFIT_MENU_SCREEN * SubScreen ;
2020-02-28 21:28:33 +01:00
REFIT_MENU_SWITCH * InputBootArgs ;
2019-09-03 11:58:42 +02:00
UINTN i ;
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_THEME , " Configs-> " _XS8 ) ;
2019-09-03 11:58:42 +02:00
2020-04-04 18:22:07 +02:00
SubScreen - > AddMenuInfoLine_f ( " Select a config file: " ) ;
2019-09-03 11:58:42 +02:00
2021-09-27 09:05:11 +02:00
for ( i = 0 ; i < ConfigsList . size ( ) ; i + + ) {
2020-02-28 21:28:33 +01:00
InputBootArgs = new REFIT_MENU_SWITCH ;
2021-09-27 09:05:11 +02:00
InputBootArgs - > Title = ConfigsList [ i ] ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > Row = i ;
2019-09-03 11:58:42 +02:00
InputBootArgs - > Item = & InputItems [ 90 ] ;
2020-02-28 21:28:33 +01:00
InputBootArgs - > AtClick = ActionEnter ;
InputBootArgs - > AtRightClick = ActionDetails ;
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( InputBootArgs , true ) ;
2019-09-03 11:58:42 +02:00
}
2020-03-03 21:44:07 +01:00
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
2019-09-03 11:58:42 +02:00
return Entry ;
}
2020-07-15 19:29:27 +02:00
REFIT_ABSTRACT_MENU_ENTRY * SubMenuQuirks ( )
{
// init
REFIT_MENU_ITEM_OPTIONS * Entry ;
REFIT_MENU_SCREEN * SubScreen ;
// create the entry in the main menu
2020-08-12 17:15:47 +02:00
Entry = newREFIT_MENU_ITEM_OPTIONS ( & SubScreen , ActionEnter , SCREEN_QUIRKS , NullXString8 ) ;
2021-03-28 22:13:43 +02:00
Entry - > Title . SWPrintf ( " Quirks mask [0x%04x]-> " , gSettings . Quirks . QuirksMask ) ;
2020-07-15 19:29:27 +02:00
// submenu description
SubScreen - > AddMenuInfoLine_f ( " Choose options to fix memory " ) ;
SubScreen - > AddMenuCheck ( " AvoidRuntimeDefrag " , QUIRK_DEFRAG , 101 ) ;
SubScreen - > AddMenuCheck ( " DevirtualiseMmio " , QUIRK_MMIO , 101 ) ;
SubScreen - > AddMenuCheck ( " DisableSingleUser " , QUIRK_SU , 101 ) ;
SubScreen - > AddMenuCheck ( " DisableVariableWrite " , QUIRK_VAR , 101 ) ;
SubScreen - > AddMenuCheck ( " DiscardHibernateMap " , QUIRK_HIBER , 101 ) ;
SubScreen - > AddMenuCheck ( " EnableSafeModeSlide " , QUIRK_SAFE , 101 ) ;
SubScreen - > AddMenuCheck ( " EnableWriteUnprotector " , QUIRK_UNPROT , 101 ) ;
SubScreen - > AddMenuCheck ( " ForceExitBootServices " , QUIRK_EXIT , 101 ) ;
SubScreen - > AddMenuCheck ( " ProtectMemoryRegions " , QUIRK_REGION , 101 ) ;
SubScreen - > AddMenuCheck ( " ProtectSecureBoot " , QUIRK_SECURE , 101 ) ;
SubScreen - > AddMenuCheck ( " ProtectUefiServices " , QUIRK_UEFI , 101 ) ;
SubScreen - > AddMenuCheck ( " ProvideCustomSlide " , QUIRK_CUSTOM , 101 ) ;
//decimal
2021-09-28 10:28:45 +02:00
SubScreen - > AddMenuItemInput ( 122 , " ProvideMaxSlide: " , true ) ;
2020-07-15 19:29:27 +02:00
SubScreen - > AddMenuCheck ( " RebuildAppleMemoryMap " , QUIRK_MAP , 101 ) ;
2021-10-30 10:21:39 +02:00
SubScreen - > AddMenuItemInput ( 127 , " ResizeAppleGpuBars: " , true ) ;
2020-07-15 19:29:27 +02:00
SubScreen - > AddMenuCheck ( " SetupVirtualMap " , QUIRK_VIRT , 101 ) ;
SubScreen - > AddMenuCheck ( " SyncRuntimePermissions " , QUIRK_PERM , 101 ) ;
SubScreen - > AddMenuEntry ( & MenuEntryReturn , false ) ;
ModifyTitles ( Entry ) ;
return Entry ;
}
2020-10-03 19:02:31 +02:00
void OptionsMenu ( OUT REFIT_ABSTRACT_MENU_ENTRY * * ChosenEntry )
2019-09-03 11:58:42 +02:00
{
2020-02-28 21:28:33 +01:00
REFIT_ABSTRACT_MENU_ENTRY * TmpChosenEntry = NULL ;
REFIT_ABSTRACT_MENU_ENTRY * NextChosenEntry = NULL ;
2019-09-03 11:58:42 +02:00
UINTN MenuExit = 0 ;
UINTN SubMenuExit ;
UINTN NextMenuExit ;
INTN EntryIndex = 0 ;
INTN SubEntryIndex = - 1 ; //value -1 means old position to remember
INTN NextEntryIndex = - 1 ;
2021-09-28 15:54:31 +02:00
XBool OldFontStyle = ThemeX . Proportional ;
2021-09-28 10:28:45 +02:00
ThemeX . Proportional = false ; //temporary disable proportional
2019-09-03 11:58:42 +02:00
// remember, if you extended this menu then change procedures
// FillInputs and ApplyInputs
2021-09-28 10:28:45 +02:00
gThemeOptionsChanged = false ;
2019-09-03 11:58:42 +02:00
2020-02-28 21:28:33 +01:00
if ( OptionMenu . Entries . size ( ) = = 0 ) {
2021-05-15 16:52:16 +02:00
OptionMenu . Daylight = ThemeX . Daylight ;
2020-05-04 20:03:25 +02:00
if ( ! ( ThemeX . HideUIFlags & HIDEUI_FLAG_MENU_TITLE_IMAGE ) ) {
2020-05-16 21:30:29 +02:00
OptionMenu . TitleImage = ThemeX . GetIcon ( BUILTIN_ICON_FUNC_OPTIONS ) ;
2020-05-04 20:03:25 +02:00
}
2021-09-28 10:28:45 +02:00
gThemeOptionsChanged = true ;
2019-09-03 11:58:42 +02:00
OptionMenu . ID = SCREEN_OPTIONS ;
2021-09-28 10:28:45 +02:00
OptionMenu . GetAnime ( ) ; //false;
2019-09-03 11:58:42 +02:00
2021-09-28 10:28:45 +02:00
OptionMenu . AddMenuItemInput ( 0 , " Boot Args: " , true ) ;
2020-03-03 21:44:07 +01:00
OptionMenu . AddMenuEntry ( SubMenuConfigs ( ) , true ) ;
2019-09-03 11:58:42 +02:00
if ( AllowGraphicsMode ) {
2020-03-03 21:44:07 +01:00
OptionMenu . AddMenuEntry ( SubMenuGUI ( ) , true ) ;
2019-09-03 11:58:42 +02:00
}
2020-03-03 21:44:07 +01:00
OptionMenu . AddMenuEntry ( SubMenuACPI ( ) , true ) ;
OptionMenu . AddMenuEntry ( SubMenuSmbios ( ) , true ) ;
2020-07-15 19:29:27 +02:00
OptionMenu . AddMenuEntry ( SubMenuBinaries ( ) , true ) ;
OptionMenu . AddMenuEntry ( SubMenuQuirks ( ) , true ) ;
OptionMenu . AddMenuEntry ( SubMenuGraphics ( ) , true ) ;
2020-03-03 21:44:07 +01:00
OptionMenu . AddMenuEntry ( SubMenuPCI ( ) , true ) ;
OptionMenu . AddMenuEntry ( SubMenuSpeedStep ( ) , true ) ;
OptionMenu . AddMenuEntry ( SubMenuAudio ( ) , true ) ;
OptionMenu . AddMenuEntry ( SubMenuAudioPort ( ) , true ) ;
OptionMenu . AddMenuEntry ( SubMenuSystem ( ) , true ) ;
OptionMenu . AddMenuEntry ( & MenuEntryReturn , false ) ;
2020-02-28 21:28:33 +01:00
//DBG("option menu created entries=%d\n", OptionMenu.Entries.size());
2019-09-03 11:58:42 +02:00
}
while ( ! MenuExit ) {
2021-03-22 13:40:01 +01:00
MenuExit = OptionMenu . RunGenericMenu ( & EntryIndex , ChosenEntry ) ;
2020-05-15 10:17:06 +02:00
if ( MenuExit = = MENU_EXIT_ESCAPE | | ( * ChosenEntry ) - > getREFIT_MENU_ITEM_RETURN ( ) )
2019-09-03 11:58:42 +02:00
break ;
if ( MenuExit = = MENU_EXIT_ENTER | | MenuExit = = MENU_EXIT_DETAILS ) {
//enter input dialog or subscreen
if ( ( * ChosenEntry ) - > SubScreen ! = NULL ) {
SubMenuExit = 0 ;
while ( ! SubMenuExit ) {
2021-03-22 13:40:01 +01:00
SubMenuExit = ( * ChosenEntry ) - > SubScreen - > RunGenericMenu ( & SubEntryIndex , & TmpChosenEntry ) ;
2020-02-28 21:28:33 +01:00
if ( SubMenuExit = = MENU_EXIT_ESCAPE | | TmpChosenEntry - > getREFIT_MENU_ITEM_RETURN ( ) ) {
2019-09-03 11:58:42 +02:00
ApplyInputs ( ) ;
ModifyTitles ( * ChosenEntry ) ;
break ;
}
if ( SubMenuExit = = MENU_EXIT_ENTER | | MenuExit = = MENU_EXIT_DETAILS ) {
if ( TmpChosenEntry - > SubScreen ! = NULL ) {
NextMenuExit = 0 ;
while ( ! NextMenuExit ) {
2021-03-22 13:40:01 +01:00
NextMenuExit = TmpChosenEntry - > SubScreen - > RunGenericMenu ( & NextEntryIndex , & NextChosenEntry ) ;
2020-02-28 21:28:33 +01:00
if ( NextMenuExit = = MENU_EXIT_ESCAPE | | NextChosenEntry - > getREFIT_MENU_ITEM_RETURN ( ) ) {
2019-09-03 11:58:42 +02:00
ApplyInputs ( ) ;
ModifyTitles ( TmpChosenEntry ) ;
break ;
}
if ( NextMenuExit = = MENU_EXIT_ENTER | | MenuExit = = MENU_EXIT_DETAILS ) {
// enter input dialog
NextMenuExit = 0 ;
ApplyInputs ( ) ;
ModifyTitles ( TmpChosenEntry ) ;
}
} //while(!NextMenuExit)
}
// enter input dialog
SubMenuExit = 0 ;
ApplyInputs ( ) ;
ModifyTitles ( TmpChosenEntry ) ;
}
} //while(!SubMenuExit)
}
MenuExit = 0 ;
} // if MENU_EXIT_ENTER
}
//exit:
2020-03-30 10:34:16 +02:00
ThemeX . Proportional = OldFontStyle ;
2019-09-03 11:58:42 +02:00
ApplyInputs ( ) ;
}