From e94264f0399b7824847b72c30deb1eb17aae292c Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Tue, 20 Jul 2021 09:07:29 -0600 Subject: [PATCH 1/2] Allow latebloom support --- OpenCore-Patcher.command | 8 ++++---- Resources/Build.py | 2 +- Resources/CliMenu.py | 9 +++++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/OpenCore-Patcher.command b/OpenCore-Patcher.command index 620581b2e..c4e570c9a 100755 --- a/OpenCore-Patcher.command +++ b/OpenCore-Patcher.command @@ -129,10 +129,10 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' f"Allow OpenCore on native Models:\tCurrently {self.constants.allow_oc_everywhere}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).allow_native_models, ], - # [ - # f"Latebloom settings:\t\t\tDelay {self.constants.latebloom_delay}, Range {self.constants.latebloom_range}, Debug {self.constants.latebloom_debug}", - # CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).latebloom_settings, - # ], + [ + f"Latebloom settings:\t\tDelay {self.constants.latebloom_delay}, Range {self.constants.latebloom_range}, Debug {self.constants.latebloom_debug}", + CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).latebloom_settings, + ], ["Advanced Patch Settings, for developers only", self.advanced_patcher_settings], ] diff --git a/Resources/Build.py b/Resources/Build.py index 5828c2376..9cfc54e8b 100644 --- a/Resources/Build.py +++ b/Resources/Build.py @@ -170,7 +170,7 @@ class BuildOpenCore: # Misc ("FeatureUnlock.kext", self.constants.featureunlock_version, self.constants.featureunlock_path, lambda: self.model in ModelArray.SidecarPatch), ("DebugEnhancer.kext", self.constants.debugenhancer_version, self.constants.debugenhancer_path, lambda: self.constants.kext_debug is True), - # ("latebloom.kext", self.constants.latebloom_version, self.constants.latebloom_path, lambda: self.model in ModelArray.PCIRaceCondition), + ("latebloom.kext", self.constants.latebloom_version, self.constants.latebloom_path, lambda: self.model in ModelArray.PCIRaceCondition), ]: self.enable_kext(name, version, path, check) diff --git a/Resources/CliMenu.py b/Resources/CliMenu.py index 230df0fb2..94882eac4 100644 --- a/Resources/CliMenu.py +++ b/Resources/CliMenu.py @@ -542,7 +542,7 @@ Valid options: """ ) - change_menu = input("Set latebloom properties: ") + change_menu = input("Select latebloom property(1/2/3): ") if change_menu == "1": try: self.constants.latebloom_delay = int(input("Set delay: ")) @@ -555,7 +555,12 @@ Valid options: input("Invalid value, press [ENTER] to continue") elif change_menu == "3": try: - self.constants.latebloom_debug = int(input("Set debug: ")) + print("Currently supports either 0(debug disabled) or 1(debug enabled)") + latebloom_debug = int(input("Set debug: ")) + if latebloom_debug not in [0, 1]: + input("Invalid value, press [ENTER] to continue") + else: + self.constants.latebloom_debug = latebloom_debug except ValueError: input("Invalid value, press [ENTER] to continue") else: From ff00e2683ebd06781d5ff3db83b304cd2e31f786 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Tue, 20 Jul 2021 09:30:14 -0600 Subject: [PATCH 2/2] Add better variable presentation --- Resources/Build.py | 2 +- Resources/CliMenu.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Resources/Build.py b/Resources/Build.py index 9cfc54e8b..6cc7f65ae 100644 --- a/Resources/Build.py +++ b/Resources/Build.py @@ -178,7 +178,7 @@ class BuildOpenCore: self.get_item_by_kv(self.config["Kernel"]["Patch"], "Identifier", "com.apple.driver.AppleSMC")["Enabled"] = True if self.get_kext_by_bundle_path("latebloom.kext")["Enabled"] is True: - print(f"- Setting latebloom delay of {self.constants.latebloom_delay}, range {self.constants.latebloom_range}, debug {self.constants.latebloom_debug}") + print(f"- Setting latebloom delay of {self.constants.latebloom_delay}ms, range {self.constants.latebloom_range}ms, debug {bool(self.constants.latebloom_debug)}") self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"][ "boot-args" ] += f" latebloom={self.constants.latebloom_delay}, lb_range={self.constants.latebloom_range}, lb_debug={self.constants.latebloom_debug}" diff --git a/Resources/CliMenu.py b/Resources/CliMenu.py index 94882eac4..b8a56d429 100644 --- a/Resources/CliMenu.py +++ b/Resources/CliMenu.py @@ -536,9 +536,9 @@ pre-Sandy Bridge Macs. Valid options: -1. Set delay (currently: {self.constants.latebloom_delay}) -2. Set range (currently: {self.constants.latebloom_range}) -3. Set debug (currently: {self.constants.latebloom_debug}) +1. Set delay (currently: {self.constants.latebloom_delay}ms) +2. Set range (currently: {self.constants.latebloom_range}ms) +3. Set debug (currently: {bool(self.constants.latebloom_debug)}) """ ) @@ -555,8 +555,8 @@ Valid options: input("Invalid value, press [ENTER] to continue") elif change_menu == "3": try: - print("Currently supports either 0(debug disabled) or 1(debug enabled)") - latebloom_debug = int(input("Set debug: ")) + print("Currently supports either 0(False) or 1(True)") + latebloom_debug = int(input("Set debug(0/1): ")) if latebloom_debug not in [0, 1]: input("Invalid value, press [ENTER] to continue") else: