mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-23 19:40:15 +10:00
Move from i++ to enumerate()
This commit is contained in:
@@ -677,8 +677,7 @@ set million colour before rebooting"""
|
|||||||
non_metal_os = os_data.os_data.high_sierra
|
non_metal_os = os_data.os_data.high_sierra
|
||||||
else:
|
else:
|
||||||
non_metal_os = os_data.os_data.catalina
|
non_metal_os = os_data.os_data.catalina
|
||||||
i = 0
|
for i, gpu in enumerate(gpus):
|
||||||
for gpu in gpus:
|
|
||||||
if gpu.class_code and gpu.class_code != 0xFFFFFFFF:
|
if gpu.class_code and gpu.class_code != 0xFFFFFFFF:
|
||||||
print(f"- Found GPU ({i}): {utilities.friendly_hex(gpu.vendor_id)}:{utilities.friendly_hex(gpu.device_id)}")
|
print(f"- Found GPU ({i}): {utilities.friendly_hex(gpu.vendor_id)}:{utilities.friendly_hex(gpu.device_id)}")
|
||||||
if gpu.arch in [device_probe.NVIDIA.Archs.Tesla, device_probe.NVIDIA.Archs.Fermi]:
|
if gpu.arch in [device_probe.NVIDIA.Archs.Tesla, device_probe.NVIDIA.Archs.Fermi]:
|
||||||
@@ -716,7 +715,6 @@ set million colour before rebooting"""
|
|||||||
if self.constants.detected_os > os_data.os_data.big_sur:
|
if self.constants.detected_os > os_data.os_data.big_sur:
|
||||||
self.ivy_gpu = True
|
self.ivy_gpu = True
|
||||||
self.supports_metal = True
|
self.supports_metal = True
|
||||||
i += 1
|
|
||||||
if self.supports_metal is True:
|
if self.supports_metal is True:
|
||||||
# Avoid patching Metal and non-Metal GPUs if both present, prioritize Metal GPU
|
# Avoid patching Metal and non-Metal GPUs if both present, prioritize Metal GPU
|
||||||
# Main concerns are for iMac12,x with Sandy iGPU and Kepler dGPU
|
# Main concerns are for iMac12,x with Sandy iGPU and Kepler dGPU
|
||||||
|
|||||||
@@ -105,11 +105,9 @@ def csr_decode(os_sip):
|
|||||||
raw = c_uint(0)
|
raw = c_uint(0)
|
||||||
errmsg = libsys.csr_get_active_config(byref(raw))
|
errmsg = libsys.csr_get_active_config(byref(raw))
|
||||||
sip_int = raw.value
|
sip_int = raw.value
|
||||||
i = 0
|
for i, current_sip_bit in enumerate(sip_data.system_integrity_protection.csr_values):
|
||||||
for current_sip_bit in sip_data.system_integrity_protection.csr_values:
|
|
||||||
if sip_int & (1 << i):
|
if sip_int & (1 << i):
|
||||||
sip_data.system_integrity_protection.csr_values[current_sip_bit] = True
|
sip_data.system_integrity_protection.csr_values[current_sip_bit] = True
|
||||||
i = i + 1
|
|
||||||
|
|
||||||
# Can be adjusted to whatever OS needs patching
|
# Can be adjusted to whatever OS needs patching
|
||||||
sip_needs_change = all(sip_data.system_integrity_protection.csr_values[i] for i in os_sip)
|
sip_needs_change = all(sip_data.system_integrity_protection.csr_values[i] for i in os_sip)
|
||||||
|
|||||||
Reference in New Issue
Block a user