From fb3690127ceb24368b97b2d64df219f3823a906e Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Thu, 23 Jan 2020 23:27:35 -0600 Subject: [PATCH] Finish AMD Wraith Prism mode updates including working speed table, working random color flag, and appropriate fan/logo modes for ring-specific effects --- .../AMDWraithPrismController.cpp | 6 +-- .../AMDWraithPrismController.h | 1 + .../RGBController_AMDWraithPrism.cpp | 43 ++++++++++++++++++- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/Controllers/AMDWraithPrismController/AMDWraithPrismController.cpp b/Controllers/AMDWraithPrismController/AMDWraithPrismController.cpp index 85c96a037..b67e01f50 100644 --- a/Controllers/AMDWraithPrismController/AMDWraithPrismController.cpp +++ b/Controllers/AMDWraithPrismController/AMDWraithPrismController.cpp @@ -129,7 +129,7 @@ std::string AMDWraithPrismController::GetFirmwareVersionString() void AMDWraithPrismController::SetFanMode(unsigned char mode, unsigned char speed, bool random_color) { current_fan_mode = mode; - current_fan_speed = speed_values_fan_logo[speed][mode]; + current_fan_speed = speed_values_fan_logo[mode][speed]; current_fan_random_color = random_color; } @@ -152,7 +152,7 @@ void AMDWraithPrismController::SetFanColor(unsigned char red, unsigned char gree void AMDWraithPrismController::SetLogoMode(unsigned char mode, unsigned char speed, bool random_color) { current_logo_mode = mode; - current_logo_speed = speed_values_fan_logo[speed][mode]; + current_logo_speed = speed_values_fan_logo[mode][speed]; current_logo_random_color = random_color; } @@ -175,7 +175,7 @@ void AMDWraithPrismController::SetLogoColor(unsigned char red, unsigned char gre void AMDWraithPrismController::SetRingMode(unsigned char mode, unsigned char speed, bool direction, bool random_color) { current_ring_mode = mode; - current_ring_speed = speed_values_ring[speed][mode]; + current_ring_speed = speed_values_ring[mode][speed]; current_ring_direction = direction; current_ring_random_color = random_color; } diff --git a/Controllers/AMDWraithPrismController/AMDWraithPrismController.h b/Controllers/AMDWraithPrismController/AMDWraithPrismController.h index a0039600f..393c889ef 100644 --- a/Controllers/AMDWraithPrismController/AMDWraithPrismController.h +++ b/Controllers/AMDWraithPrismController/AMDWraithPrismController.h @@ -22,6 +22,7 @@ static const unsigned char max_brightness_fan_logo[] = static const unsigned char speed_values_fan_logo[][5] = { + { 0x00, 0x00, 0x00, 0x00, 0x00 }, /* */ { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, /* Static */ { 0x96, 0x8C, 0x80, 0x6E, 0x68 }, /* Color Cycle */ { 0x3C, 0x37, 0x31, 0x2C, 0x26 }, /* Breathing */ diff --git a/RGBController/RGBController_AMDWraithPrism.cpp b/RGBController/RGBController_AMDWraithPrism.cpp index d26bcf54d..cacf42b9b 100644 --- a/RGBController/RGBController_AMDWraithPrism.cpp +++ b/RGBController/RGBController_AMDWraithPrism.cpp @@ -51,6 +51,36 @@ RGBController_AMDWraithPrism::RGBController_AMDWraithPrism(AMDWraithPrismControl Rainbow.speed = AMD_WRAITH_PRISM_SPEED_NORMAL; modes.push_back(Rainbow); + mode Bounce; + Bounce.name = "Bounce"; + Bounce.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_BOUNCE; + Bounce.flags = MODE_FLAG_HAS_SPEED; + Bounce.speed_min = AMD_WRAITH_PRISM_SPEED_SLOWEST; + Bounce.speed_max = AMD_WRAITH_PRISM_SPEED_FASTEST; + Bounce.random = true; + Bounce.speed = AMD_WRAITH_PRISM_SPEED_NORMAL; + modes.push_back(Bounce); + + mode Chase; + Chase.name = "Chase"; + Chase.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_CHASE; + Chase.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR | MODE_FLAG_RANDOM_COLOR; + Chase.speed_min = AMD_WRAITH_PRISM_SPEED_SLOWEST; + Chase.speed_max = AMD_WRAITH_PRISM_SPEED_FASTEST; + Chase.random = false; + Chase.speed = AMD_WRAITH_PRISM_SPEED_NORMAL; + modes.push_back(Chase); + + mode Swirl; + Swirl.name = "Swirl"; + Swirl.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_SWIRL; + Swirl.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_COLOR | MODE_FLAG_PER_LED_COLOR | MODE_FLAG_RANDOM_COLOR; + Swirl.speed_min = AMD_WRAITH_PRISM_SPEED_SLOWEST; + Swirl.speed_max = AMD_WRAITH_PRISM_SPEED_FASTEST; + Swirl.random = false; + Swirl.speed = AMD_WRAITH_PRISM_SPEED_NORMAL; + modes.push_back(Swirl); + led logo_led; logo_led.name = "Logo"; leds.push_back(logo_led); @@ -109,6 +139,7 @@ void RGBController_AMDWraithPrism::SetMode(int mode) { case AMD_WRAITH_PRISM_EFFECT_CHANNEL_COLOR_CYCLE: case AMD_WRAITH_PRISM_EFFECT_CHANNEL_RAINBOW: + case AMD_WRAITH_PRISM_EFFECT_CHANNEL_BOUNCE: wraith->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[mode].speed, modes[mode].random); wraith->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[mode].speed, modes[mode].random); break; @@ -119,8 +150,16 @@ void RGBController_AMDWraithPrism::SetMode(int mode) break; default: - wraith->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_STATIC, modes[mode].speed, modes[mode].random); - wraith->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_STATIC, modes[mode].speed, modes[mode].random); + if(modes[mode].random) + { + wraith->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[mode].speed, modes[mode].random); + wraith->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[mode].speed, modes[mode].random); + } + else + { + wraith->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_STATIC, modes[mode].speed, modes[mode].random); + wraith->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_STATIC, modes[mode].speed, modes[mode].random); + } break; }