From 00c92d74a7ecf113cd66f9d9557fbc8cd3afb1bf Mon Sep 17 00:00:00 2001 From: thombo Date: Sat, 14 Oct 2023 16:41:32 +0200 Subject: [PATCH] Support for MSI board 7E12 added --- .../MSIMysticLight185Controller.cpp | 32 +++++++++++++++++-- .../MSIMysticLight185Controller.h | 1 + .../MSIMysticLightCommon.h | 3 ++ .../MSIMysticLightControllerDetect.cpp | 7 +++- 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/Controllers/MSIMysticLightController/MSIMysticLight185Controller.cpp b/Controllers/MSIMysticLightController/MSIMysticLight185Controller.cpp index ccc40f5b..67230a5d 100644 --- a/Controllers/MSIMysticLightController/MSIMysticLight185Controller.cpp +++ b/Controllers/MSIMysticLightController/MSIMysticLight185Controller.cpp @@ -287,6 +287,7 @@ static const mystic_light_185_config board_configs[] = { 0x7E01, 0, 0, 0, 1, &zones_set11, MSIMysticLight185Controller::DIRECT_MODE_PER_LED }, // MAG B760M MORTAR MAX { 0x7E06, 0, 0, 0, 2, &zones_set11, MSIMysticLight185Controller::DIRECT_MODE_PER_LED }, // PRO Z790-P WIFI DDR4 { 0x7E07, 0, 0, 0, 2, &zones_set10, MSIMysticLight185Controller::DIRECT_MODE_PER_LED }, // PRO Z790-A WIFI DDR4 + { 0x7E12, 0, 0, 0, 2, &zones_set13, MSIMysticLight185Controller::DIRECT_MODE_PER_LED }, // MAG X670E TOMAHAWK WIFI }; @@ -320,6 +321,19 @@ MSIMysticLight185Controller::MSIMysticLight185Controller ReadSettings(); } + if(pid == MSI_USB_PID_COMMON) + { + std::string pidStr(chip_id.substr(0, 4)); + pid = std::stoi(pidStr, nullptr, 16); + } + + mixed_mode_support = false; + + if(pid >= 0x7D03) + { + mixed_mode_support = true; + } + /*---------------------------------------------*\ | Initialize save flag and some static settings | \*---------------------------------------------*/ @@ -784,7 +798,14 @@ ZoneData *MSIMysticLight185Controller::GetZoneData case MSI_ZONE_J_RGB_1: return &data_packet.j_rgb_1; case MSI_ZONE_J_RGB_2: - return &data_packet.j_rgb_2; + if(mixed_mode_support) + { + return &data_packet.on_board_led_6; + } + else + { + return &data_packet.j_rgb_2; + } case MSI_ZONE_J_RAINBOW_1: return &data_packet.j_rainbow_1; case MSI_ZONE_J_RAINBOW_2: @@ -808,7 +829,14 @@ ZoneData *MSIMysticLight185Controller::GetZoneData case MSI_ZONE_ON_BOARD_LED_5: return &data_packet.on_board_led_5; case MSI_ZONE_ON_BOARD_LED_6: - return &data_packet.on_board_led_6; + if(mixed_mode_support) + { + return &data_packet.j_corsair_outerll120; + } + else + { + return &data_packet.on_board_led_6; + } case MSI_ZONE_ON_BOARD_LED_7: return &data_packet.on_board_led_7; case MSI_ZONE_ON_BOARD_LED_8: diff --git a/Controllers/MSIMysticLightController/MSIMysticLight185Controller.h b/Controllers/MSIMysticLightController/MSIMysticLight185Controller.h index ef7591fc..210f4acc 100644 --- a/Controllers/MSIMysticLightController/MSIMysticLight185Controller.h +++ b/Controllers/MSIMysticLightController/MSIMysticLight185Controller.h @@ -142,6 +142,7 @@ private: bool no_jrainbow1; bool no_jrainbow2; bool no_jcorsair; + bool mixed_mode_support; int numof_onboard_leds; int numof_pipe1_leds; int numof_pipe2_leds; diff --git a/Controllers/MSIMysticLightController/MSIMysticLightCommon.h b/Controllers/MSIMysticLightController/MSIMysticLightCommon.h index 43b2a838..0014dbe2 100644 --- a/Controllers/MSIMysticLightController/MSIMysticLightCommon.h +++ b/Controllers/MSIMysticLightController/MSIMysticLightCommon.h @@ -238,3 +238,6 @@ struct FeaturePacket_PerLED_185 unsigned char hdr3 = 0x00; // header byte 3 Color leds[NUMOF_PER_LED_MODE_LEDS]; }; + + +#define MSI_USB_PID_COMMON 0x0076 // Common PID for a certain set of 185-byte boards diff --git a/Controllers/MSIMysticLightController/MSIMysticLightControllerDetect.cpp b/Controllers/MSIMysticLightController/MSIMysticLightControllerDetect.cpp index d6af0ef1..c8ee785f 100644 --- a/Controllers/MSIMysticLightController/MSIMysticLightControllerDetect.cpp +++ b/Controllers/MSIMysticLightController/MSIMysticLightControllerDetect.cpp @@ -11,7 +11,9 @@ #include "LogManager.h" -#define MSI_USB_VID 0x1462 +#define MSI_USB_VID 0x1462 +#define MSI_USB_VID_COMMON 0x0DB0 + /*---------------------------------------------------------------------------------*\ | WARNING! | @@ -174,6 +176,9 @@ REGISTER_HID_DETECTOR_PU("MSI Mystic Light MS_7E01", DetectMSIMysticLightCont REGISTER_HID_DETECTOR_PU("MSI Mystic Light MS_7E06", DetectMSIMysticLightControllers, MSI_USB_VID, 0x7E06, 0x0001, 0x00); REGISTER_HID_DETECTOR_PU("MSI Mystic Light MS_7E07", DetectMSIMysticLightControllers, MSI_USB_VID, 0x7E07, 0x0001, 0x00); REGISTER_HID_DETECTOR_PU("MSI Mystic Light MS_B926", DetectMSIMysticLightControllers, MSI_USB_VID, 0xB926, 0x0001, 0x00); +// Detector for set of common boards +REGISTER_HID_DETECTOR_PU("MSI Mystic Light Common", DetectMSIMysticLightControllers, MSI_USB_VID_COMMON, MSI_USB_PID_COMMON, 0x0001, 0x00); + #ifdef ENABLE_UNTESTED_MYSTIC_LIGHT REGISTER_HID_DETECTOR_PU("MSI Mystic Light MS_3EA4", DetectMSIMysticLightControllers, MSI_USB_VID, 0x3EA4, 0x0001, 0x00);