提交 a4a46e9a 编写于 作者: V vit9696

OcBootManagementLib: Added tool and custom entry separation in audio assistant

上级 c9e2f8ce
......@@ -7,6 +7,7 @@ OpenCore Changelog
- Fixed FS discovery on NVMe with legacy drivers
- Added `DirectGopCacheMode` option for FB cache policy
- Added `KeyFiltering` option to workaround buggy KB drivers
- Added tool and custom entry separation in audio assistant
#### v0.5.6
- Various improvements to builtin text renderer
......
......@@ -78,8 +78,9 @@ typedef UINT32 OC_BOOT_ENTRY_TYPE;
#define OC_BOOT_APPLE_TIME_MACHINE BIT3
#define OC_BOOT_APPLE_ANY (OC_BOOT_APPLE_OS | OC_BOOT_APPLE_RECOVERY | OC_BOOT_APPLE_TIME_MACHINE)
#define OC_BOOT_WINDOWS BIT4
#define OC_BOOT_CUSTOM BIT5
#define OC_BOOT_SYSTEM BIT6
#define OC_BOOT_EXTERNAL_OS BIT5
#define OC_BOOT_EXTERNAL_TOOL BIT6
#define OC_BOOT_SYSTEM BIT7
/**
Picker mode.
......@@ -374,6 +375,10 @@ typedef struct {
// Whether this entry is auxiliary.
//
BOOLEAN Auxiliary;
//
// Whether this entry is a tool.
//
BOOLEAN Tool;
} OC_PICKER_ENTRY;
/**
......
......@@ -83,25 +83,26 @@ typedef enum {
OcVoiceOverAudioFileExecutionFailure = 0x1035,
OcVoiceOverAudioFileExecutionSuccessful = 0x1036,
OcVoiceOverAudioFileExternal = 0x1037,
OcVoiceOverAudioFileExternalOption = 0x1038,
OcVoiceOverAudioFileLoading = 0x1039,
OcVoiceOverAudioFilemacOS = 0x103A,
OcVoiceOverAudioFilemacOS_Recovery = 0x103B,
OcVoiceOverAudioFilemacOS_TimeMachine = 0x103C,
OcVoiceOverAudioFileOtherOS = 0x103D,
OcVoiceOverAudioFilePasswordAccepted = 0x103E,
OcVoiceOverAudioFilePasswordIncorrect = 0x103F,
OcVoiceOverAudioFilePasswordRetryLimit = 0x1040,
OcVoiceOverAudioFileReloading = 0x1041,
OcVoiceOverAudioFileResetNVRAM = 0x1042,
OcVoiceOverAudioFileSelected = 0x1043,
OcVoiceOverAudioFileShowAuxiliary = 0x1044,
OcVoiceOverAudioFileTimeout = 0x1045,
OcVoiceOverAudioFileUEFI_Shell = 0x1046,
OcVoiceOverAudioFileWelcome = 0x1047,
OcVoiceOverAudioFileWindows = 0x1048,
OcVoiceOverAudioFileMax = 0x1049,
OcVoiceOverAudioFileExternalOS = 0x1038,
OcVoiceOverAudioFileExternalTool = 0x1039,
OcVoiceOverAudioFileLoading = 0x103A,
OcVoiceOverAudioFilemacOS = 0x103B,
OcVoiceOverAudioFilemacOS_Recovery = 0x103C,
OcVoiceOverAudioFilemacOS_TimeMachine = 0x103D,
OcVoiceOverAudioFileOtherOS = 0x103E,
OcVoiceOverAudioFilePasswordAccepted = 0x103F,
OcVoiceOverAudioFilePasswordIncorrect = 0x1040,
OcVoiceOverAudioFilePasswordRetryLimit = 0x1041,
OcVoiceOverAudioFileReloading = 0x1042,
OcVoiceOverAudioFileResetNVRAM = 0x1043,
OcVoiceOverAudioFileSelected = 0x1044,
OcVoiceOverAudioFileShowAuxiliary = 0x1045,
OcVoiceOverAudioFileTimeout = 0x1046,
OcVoiceOverAudioFileUEFI_Shell = 0x1047,
OcVoiceOverAudioFileWelcome = 0x1048,
OcVoiceOverAudioFileWindows = 0x1049,
OcVoiceOverAudioFileMax = 0x104A,
} OC_VOICE_OVER_AUDIO_FILE;
STATIC_ASSERT (OcVoiceOverAudioFileIndexMax - OcVoiceOverAudioFileIndexBase == 9 + 26, "Invalid index count");
......
......@@ -190,8 +190,10 @@ OcPlayAudioEntry (
OcPlayAudioFile (Context, OcVoiceOverAudioFileUEFI_Shell, FALSE);
} else if (StrStr (Entry->Name, OC_MENU_RESET_NVRAM_ENTRY) != NULL) {
OcPlayAudioFile (Context, OcVoiceOverAudioFileResetNVRAM, FALSE);
} else if (Entry->Type == OC_BOOT_CUSTOM) {
OcPlayAudioFile (Context, OcVoiceOverAudioFileExternalOption, FALSE);
} else if (Entry->Type == OC_BOOT_EXTERNAL_OS) {
OcPlayAudioFile (Context, OcVoiceOverAudioFileExternalOS, FALSE);
} else if (Entry->Type == OC_BOOT_EXTERNAL_TOOL) {
OcPlayAudioFile (Context, OcVoiceOverAudioFileExternalTool, FALSE);
} else {
OcPlayAudioFile (Context, OcVoiceOverAudioFileOtherOS, FALSE);
}
......
......@@ -42,7 +42,7 @@ OcDescribeBootEntry (
//
// Custom entries need no special description.
//
if (BootEntry->Type == OC_BOOT_CUSTOM) {
if (BootEntry->Type == OC_BOOT_EXTERNAL_OS || BootEntry->Type == OC_BOOT_EXTERNAL_TOOL) {
return EFI_SUCCESS;
}
......@@ -370,7 +370,11 @@ OcScanForBootEntries (
return EFI_OUT_OF_RESOURCES;
}
Entries[EntryIndex].Type = OC_BOOT_CUSTOM;
if (Context->CustomEntries[Index].Tool) {
Entries[EntryIndex].Type = OC_BOOT_EXTERNAL_TOOL;
} else {
Entries[EntryIndex].Type = OC_BOOT_EXTERNAL_OS;
}
if (Index < Context->AbsoluteEntryCount) {
DEBUG ((
......
......@@ -1142,7 +1142,7 @@ InternalLoadBootEntry (
if (DevicePath == NULL) {
return EFI_UNSUPPORTED;
}
} else if (BootEntry->Type == OC_BOOT_CUSTOM && BootEntry->DevicePath == NULL) {
} else if (BootEntry->Type == OC_BOOT_EXTERNAL_TOOL) {
ASSERT (Context->CustomRead != NULL);
Status = Context->CustomRead (
......@@ -1232,10 +1232,11 @@ InternalLoadBootEntry (
}
}
if (BootEntry->Type == OC_BOOT_CUSTOM) {
if (BootEntry->Type == OC_BOOT_EXTERNAL_OS || BootEntry->Type == OC_BOOT_EXTERNAL_TOOL) {
DEBUG ((
DEBUG_INFO,
"OCB: Custom DeviceHandle %p FilePath %p\n",
"OCB: Custom (%u) DeviceHandle %p FilePath %p\n",
BootEntry->Type,
LoadedImage->DeviceHandle,
LoadedImage->FilePath
));
......
......@@ -515,6 +515,7 @@ OcMiscBoot (
Context->CustomEntries[EntryIndex].Path = OC_BLOB_GET (&Config->Misc.Entries.Values[Index]->Path);
Context->CustomEntries[EntryIndex].Arguments = OC_BLOB_GET (&Config->Misc.Entries.Values[Index]->Arguments);
Context->CustomEntries[EntryIndex].Auxiliary = Config->Misc.Entries.Values[Index]->Auxiliary;
Context->CustomEntries[EntryIndex].Tool = FALSE;
++EntryIndex;
}
}
......@@ -530,6 +531,7 @@ OcMiscBoot (
Context->CustomEntries[EntryIndex].Path = OC_BLOB_GET (&Config->Misc.Tools.Values[Index]->Path);
Context->CustomEntries[EntryIndex].Arguments = OC_BLOB_GET (&Config->Misc.Tools.Values[Index]->Arguments);
Context->CustomEntries[EntryIndex].Auxiliary = Config->Misc.Tools.Values[Index]->Auxiliary;
Context->CustomEntries[EntryIndex].Tool = TRUE;
++EntryIndex;
}
}
......
......@@ -128,8 +128,11 @@ OcAudioAcquireFile (
case OcVoiceOverAudioFileExternal:
BasePath = "External";
break;
case OcVoiceOverAudioFileExternalOption:
BasePath = "ExternalOption";
case OcVoiceOverAudioFileExternalOS:
BasePath = "ExternalOS";
break;
case OcVoiceOverAudioFileExternalTool:
BasePath = "ExternalTool";
break;
case OcVoiceOverAudioFileLoading:
BasePath = "Loading";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册