Skip to content

Commit

Permalink
Add new Big Sur CFL framebuffer ids
Browse files Browse the repository at this point in the history
  • Loading branch information
benbaker76 committed Jul 14, 2020
1 parent d57994f commit f4a4b75
Show file tree
Hide file tree
Showing 11 changed files with 132 additions and 116 deletions.
8 changes: 4 additions & 4 deletions Hackintool.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 0341;
CURRENT_PROJECT_VERSION = 0342;
DEVELOPMENT_TEAM = 5LGHPJM9ZR;
ENABLE_HARDENED_RUNTIME = NO;
ENABLE_STRICT_OBJC_MSGSEND = NO;
Expand All @@ -728,7 +728,7 @@
HEADER_SEARCH_PATHS = "$(SDKROOT)/usr/include/libxml2";
INFOPLIST_FILE = "Hackintool/Hackintool-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks";
MARKETING_VERSION = 3.4.1;
MARKETING_VERSION = 3.4.2;
PRODUCT_BUNDLE_IDENTIFIER = com.Headsoft.Hackintool;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -748,7 +748,7 @@
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 0341;
CURRENT_PROJECT_VERSION = 0342;
DEVELOPMENT_TEAM = 5LGHPJM9ZR;
ENABLE_HARDENED_RUNTIME = NO;
ENABLE_STRICT_OBJC_MSGSEND = NO;
Expand All @@ -762,7 +762,7 @@
HEADER_SEARCH_PATHS = "$(SDKROOT)/usr/include/libxml2";
INFOPLIST_FILE = "Hackintool/Hackintool-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks";
MARKETING_VERSION = 3.4.1;
MARKETING_VERSION = 3.4.2;
PRODUCT_BUNDLE_IDENTIFIER = com.Headsoft.Hackintool;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Binary file not shown.
3 changes: 2 additions & 1 deletion Hackintool/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ typedef struct
@property (assign) IBOutlet NSTableView *displaysTableView;
@property (assign) IBOutlet NSTableView *resolutionsTableView;
@property (assign) IBOutlet NSButton *fixMonitorRangesButton;
@property (assign) IBOutlet NSButton *injectAppleInfoButton;
@property (assign) IBOutlet NSButton *injectAppleVIDButton;
@property (assign) IBOutlet NSButton *injectApplePIDButton;
@property (assign) IBOutlet NSButton *forceRGBModeButton;
@property (assign) IBOutlet NSButton *patchColorProfileButton;
@property (assign) IBOutlet NSButton *ignoreDisplayPrefsButton;
Expand Down
6 changes: 4 additions & 2 deletions Hackintool/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -6588,7 +6588,8 @@ - (void)tableViewSelectionDidChange:(NSNotification *)notification;
[_iconComboBox selectItemAtIndex:display.iconIndex];
[_resolutionComboBox selectItemAtIndex:display.resolutionIndex];
[_fixMonitorRangesButton setState:display.fixMonitorRanges];
[_injectAppleInfoButton setState:display.injectAppleInfo];
[_injectAppleVIDButton setState:display.injectAppleVID];
[_injectApplePIDButton setState:display.injectApplePID];
[_forceRGBModeButton setState:display.forceRGBMode];
[_patchColorProfileButton setState:display.patchColorProfile];
[_ignoreDisplayPrefsButton setState:display.ignoreDisplayPrefs];
Expand Down Expand Up @@ -7707,7 +7708,8 @@ - (IBAction)displaySettingsChanged:(id)sender
display.iconIndex = (int)[_iconComboBox indexOfSelectedItem];
display.resolutionIndex = (int)[_resolutionComboBox indexOfSelectedItem];
display.fixMonitorRanges = [_fixMonitorRangesButton state];
display.injectAppleInfo = [_injectAppleInfoButton state];
display.injectAppleVID = [_injectAppleVIDButton state];
display.injectApplePID = [_injectApplePIDButton state];
display.forceRGBMode = [_forceRGBModeButton state];
display.patchColorProfile = [_patchColorProfileButton state];
display.ignoreDisplayPrefs = [_ignoreDisplayPrefsButton state];
Expand Down
183 changes: 102 additions & 81 deletions Hackintool/Base.lproj/MainMenu.xib

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Hackintool/Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
@property uint32_t iconIndex;
@property uint32_t resolutionIndex;
@property bool fixMonitorRanges;
@property bool injectAppleInfo;
@property bool injectAppleVID;
@property bool injectApplePID;
@property bool forceRGBMode;
@property bool patchColorProfile;
@property bool ignoreDisplayPrefs;
Expand Down
3 changes: 2 additions & 1 deletion Hackintool/Display.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ -(id) initWithName:(NSString *)name index:(uint32_t) index port:(uint32_t)port v
self.iconIndex = 0;
self.resolutionIndex = 0;
self.fixMonitorRanges = false;
self.injectAppleInfo = true;
self.injectAppleVID = false;
self.injectApplePID = true;
self.forceRGBMode = true;
self.patchColorProfile = true;
self.ignoreDisplayPrefs = true;
Expand Down
1 change: 0 additions & 1 deletion Hackintool/FixEDID.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ struct EDID
}

+ (NSString *)getAspectRatio:(EDID &)edid;
+ (void)getEDIDOrigData:(Display *)display edidOrigData:(NSData **)edidOrigData;
+ (void)getEDIDData:(Display *)display edidData:(NSData **)edidData;
+ (void)makeEDIDFiles:(Display *)display;
+ (void)createDisplayIcons:(NSArray *)displaysArray;
Expand Down
39 changes: 15 additions & 24 deletions Hackintool/FixEDID.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
// Monitor Ranges Override - fixes some issues
const uint8_t Monitor_Ranges[18] = { 0x00, 0x00, 0x00, 0xfd, 0x00, 0x38, 0x4c, 0x1e, 0x53, 0x11, 0x00, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 };

// VendorID 0x0610 / ProductID 0xA012
const uint8_t AppleDisplay_VIDPID[4] = { 0x06, 0x10, 0x7c, 0x9c };
// VendorID 0x0610
const uint8_t AppleDisplay_VID[2] = { 0x06, 0x10 };
// ProductID 0xA012
const uint8_t AppleDisplay_PID[2] = { 0x7c, 0x9c };

// Apple iMac Display fixes
const char *iMac_CapabilityString = "model(iMac Cello) vcp(10 8D B6 C8 C9 DF) ver(2.2)";
Expand Down Expand Up @@ -578,21 +580,6 @@ + (void)makeIOProviderMergeProperties:(NSMutableDictionary **)ioProviderMergePro
*ioProviderMergeProperties = [NSMutableDictionary dictionaryWithObjectsAndKeys:productName, @"DisplayProductName", @(productID), @"DisplayProductID", @(vendorID), @"DisplayVendorID", @(displaySerial), @"DisplaySerialNumber", edidData, @"IODisplayEDID", [NSData dataWithBytes:capabilityString length:strlen(capabilityString)], @"IODisplayCapabilityString", [NSData dataWithBytes:connectFlags length:4], @"IODisplayConnectFlags", [NSData dataWithBytes:controllerID length:4], @"IODisplayControllerID", [NSData dataWithBytes:firmwareLevel length:4], @"IODisplayFirmwareLevel", [NSData dataWithBytes:mccsVersion length:4], @"IODisplayMCCSVersion", [NSData dataWithBytes:technologyType length:4], @"IODisplayTechnologyType", [[display.prefsKey stringByDeletingLastPathComponent] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@-%x-%x", displayClass, vendorID, productID]], @"IODisplayPrefsKey", displayClass, @"IOClass", nil];
}

+ (void)getEDIDOrigData:(Display *)display edidOrigData:(NSData **)edidOrigData
{
EDID edid {};

if (display.eDID.bytes == nil)
return;

if (display.eDID.length < sizeof(EDID))
return;

memcpy(&edid, display.eDID.bytes, sizeof(EDID));

*edidOrigData = [NSData dataWithBytes:&edid length:sizeof(EDID)];
}

+ (void)getEDIDData:(Display *)display edidData:(NSData **)edidData
{
EDID edid {};
Expand Down Expand Up @@ -620,8 +607,11 @@ + (void)getEDIDData:(Display *)display edidData:(NSData **)edidData
edid.SerialInfo.ProductID[1] = display.productIDOverride >> 16;
}

if (display.injectAppleInfo)
memcpy(&edid.SerialInfo, AppleDisplay_VIDPID, sizeof(AppleDisplay_VIDPID));
if (display.injectAppleVID)
memcpy(&edid.SerialInfo.VendorID, AppleDisplay_VID, sizeof(AppleDisplay_VID));

if (display.injectApplePID)
memcpy(&edid.SerialInfo.ProductID, AppleDisplay_PID, sizeof(AppleDisplay_PID));

if (display.forceRGBMode)
edid.BasicParams.Gamma &= ~(0B11000); // Setting Color Support to RGB 4:4:4 Only
Expand Down Expand Up @@ -692,7 +682,9 @@ + (void)getEDIDData:(Display *)display edidData:(NSData **)edidData
break;
}

*edidData = [NSData dataWithBytes:&edid length:sizeof(EDID)];
*edidData = [NSData dataWithBytes:display.eDID.bytes length:display.eDID.length];

memcpy((void *)(*edidData).bytes, &edid, sizeof(EDID));
}

+ (void)makeEDIDFiles:(Display *)display
Expand All @@ -703,12 +695,11 @@ + (void)makeEDIDFiles:(Display *)display
NSString *productName = display.name;
NSNumber *productIDNumber = @0;
NSNumber *vendorIDNumber = @0;
NSData *edidOrigData = nil, *edidData = nil;
NSData *edidData = nil;

[FixEDID getEDIDOrigData:display edidOrigData:&edidOrigData];
[FixEDID getEDIDData:display edidData:&edidData];

if (edidOrigData == nil || edidData == nil)
if (edidData == nil)
return;

switch(display.eDIDIndex)
Expand Down Expand Up @@ -892,7 +883,7 @@ + (void)makeEDIDFiles:(Display *)display
newDisplayOverridePath = [newDisplayOverridePath stringByAppendingPathComponent:[NSString stringWithFormat:@"DisplayProductID-%x", display.productID]];

[edidOverride writeToFile:newDisplayOverridePath atomically:YES];
[edidOrigData writeToFile:edidOrigBinPath atomically:YES];
[display.eDID writeToFile:edidOrigBinPath atomically:YES];
[edidData writeToFile:edidBinPath atomically:YES];

#ifdef USE_USBMERGENUB
Expand Down
Binary file modified Resources/Framebuffer/macOS 10.14/Coffee Lake.bin
100755 → 100644
Binary file not shown.
2 changes: 1 addition & 1 deletion Resources/Intel/DeviceIDs.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>Kaby Lake</key>
<string>0x59128086 0x59168086 0x591B8086 0x591C8086 0x591E8086 0x59268086 0x59278086 0x59238086 0x87C08086</string>
<key>Coffee Lake</key>
<string>0x3E9B8086 0x3EA58086 0x3EA68086 0x3E928086 0x3E918086 0x3E988086</string>
<string>0x3E9B8086 0x3EA58086 0x3EA68086 0x3E928086 0x3E918086 0x3E988086 0x9BC88086 0x9BC58086 0x9BC48086</string>
<key>Cannon Lake</key>
<string>0x5A408086 0x5A418086 0x5A498086 0x5A508086 0x5A518086 0x5A528086 0x5A548086 0x5A568086 0x5A598086 0x0A018086</string>
<key>Ice Lake (LP)</key>
Expand Down

0 comments on commit f4a4b75

Please sign in to comment.