mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-14 02:42:44 +01:00
Merge pull request #4950 from german77/RumbleStrenght
Modify rumble amplification
This commit is contained in:
commit
bba7e8ea4b
2 changed files with 3 additions and 4 deletions
|
@ -302,8 +302,8 @@ public:
|
||||||
|
|
||||||
bool SetRumblePlay(f32 amp_low, f32 freq_low, f32 amp_high, f32 freq_high) const override {
|
bool SetRumblePlay(f32 amp_low, f32 freq_low, f32 amp_high, f32 freq_high) const override {
|
||||||
const auto mean_amplitude = (amp_low + amp_high) * 0.5f;
|
const auto mean_amplitude = (amp_low + amp_high) * 0.5f;
|
||||||
const auto processed_amplitude = static_cast<u8>(
|
const auto processed_amplitude =
|
||||||
pow(mean_amplitude, 0.5f) * (3.0f - 2.0f * pow(mean_amplitude, 0.15f)) * 0x8);
|
static_cast<u8>((mean_amplitude + std::pow(mean_amplitude, 0.3f)) * 0.5f * 0x8);
|
||||||
|
|
||||||
return gcadapter->RumblePlay(port, processed_amplitude);
|
return gcadapter->RumblePlay(port, processed_amplitude);
|
||||||
}
|
}
|
||||||
|
|
|
@ -402,8 +402,7 @@ public:
|
||||||
|
|
||||||
bool SetRumblePlay(f32 amp_low, f32 freq_low, f32 amp_high, f32 freq_high) const override {
|
bool SetRumblePlay(f32 amp_low, f32 freq_low, f32 amp_high, f32 freq_high) const override {
|
||||||
const auto process_amplitude = [](f32 amplitude) {
|
const auto process_amplitude = [](f32 amplitude) {
|
||||||
return static_cast<u16>(std::pow(amplitude, 0.5f) *
|
return static_cast<u16>((amplitude + std::pow(amplitude, 0.3f)) * 0.5f * 0xFFFF);
|
||||||
(3.0f - 2.0f * std::pow(amplitude, 0.15f)) * 0xFFFF);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto processed_amp_low = process_amplitude(amp_low);
|
const auto processed_amp_low = process_amplitude(amp_low);
|
||||||
|
|
Loading…
Reference in a new issue