mirror of
https://gitea.tendokyu.moe/Hay1tsme/segatools.git
synced 2026-05-16 08:00:40 -05:00
haseosora-springBoost-Integration (#102)
Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/segatools/pulls/102 Reviewed-by: Dniel97 <dniel97@noreply.gitea.tendokyu.moe> Co-authored-by: HaseoSora <haseosora@noreply.gitea.tendokyu.moe> Co-committed-by: HaseoSora <haseosora@noreply.gitea.tendokyu.moe>
This commit is contained in:
parent
2c2b8b11b4
commit
ddc969ff04
1
dist/idac/segatools.ini
vendored
1
dist/idac/segatools.ini
vendored
|
|
@ -286,3 +286,4 @@ baseDamperFraction = 20
|
|||
; Recommended: 10 (1.0%) to 100 (10.0%).
|
||||
; Default: 20 = 2.0%
|
||||
deadband = 20
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@ static uint8_t idac_di_rumble_duration;
|
|||
static uint8_t idac_di_base_damper;
|
||||
static uint8_t idac_di_deadband;
|
||||
|
||||
/* Fixed spring boost multiplier (1.5x) */
|
||||
static const float idac_di_spring_boost = 1.5f;
|
||||
|
||||
HRESULT idac_di_dev_init(const struct idac_di_config* cfg,
|
||||
IDirectInputDevice8W* dev, HWND wnd) {
|
||||
assert(cfg != NULL);
|
||||
|
|
@ -240,13 +243,18 @@ void idac_di_ffb_damper(uint8_t force) {
|
|||
DIEFFECT fx;
|
||||
DICONDITION cond;
|
||||
|
||||
|
||||
/* SPRING (centering) */
|
||||
memset(&cond, 0, sizeof(cond));
|
||||
cond.lPositiveCoefficient = (LONG)(((uint32_t)force * ffb_strength) / idac_di_ffb_scale);
|
||||
cond.lNegativeCoefficient = cond.lPositiveCoefficient;
|
||||
LONG base_coeff = (LONG)(((uint32_t)force * ffb_strength) / idac_di_ffb_scale);
|
||||
|
||||
LONG boosted_coeff = (LONG)((float)base_coeff * idac_di_spring_boost);
|
||||
|
||||
cond.lPositiveCoefficient = boosted_coeff;
|
||||
cond.lNegativeCoefficient = boosted_coeff;
|
||||
cond.dwPositiveSaturation = DI_FFNOMINALMAX;
|
||||
cond.dwNegativeSaturation = DI_FFNOMINALMAX;
|
||||
|
||||
|
||||
/* If user enters 25, result is 0.025 * DI_FFNOMINALMAX */
|
||||
cond.lDeadBand = (DI_FFNOMINALMAX * (LONG)idac_di_deadband) / 1000;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@ static uint8_t idz_di_rumble_duration;
|
|||
static uint8_t idz_di_base_damper;
|
||||
static uint8_t idz_di_deadband;
|
||||
|
||||
/* Fixed spring boost multiplier (1.5x) */
|
||||
static const float idz_di_spring_boost = 1.5f;
|
||||
|
||||
HRESULT idz_di_dev_init(const struct idz_di_config* cfg,
|
||||
IDirectInputDevice8W* dev, HWND wnd) {
|
||||
assert(cfg != NULL);
|
||||
|
|
@ -63,6 +66,7 @@ HRESULT idz_di_dev_init(const struct idz_di_config* cfg,
|
|||
? 200
|
||||
: cfg->ffb_deadband;
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
@ -251,7 +255,8 @@ void idz_di_ffb_damper(uint8_t force) {
|
|||
|
||||
/* SPRING (centering) */
|
||||
memset(&cond, 0, sizeof(cond));
|
||||
cond.lPositiveCoefficient = (LONG)(((uint32_t)force * ffb_strength) / idz_di_ffb_scale);
|
||||
LONG base_coeff = (LONG)(((uint32_t)force * ffb_strength) / idz_di_ffb_scale);
|
||||
LONG boosted_coeff = (LONG)((float)base_coeff * idz_di_spring_boost);
|
||||
cond.lNegativeCoefficient = cond.lPositiveCoefficient;
|
||||
cond.dwPositiveSaturation = DI_FFNOMINALMAX;
|
||||
cond.dwNegativeSaturation = DI_FFNOMINALMAX;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@ static uint8_t swdc_di_rumble_duration;
|
|||
static uint8_t swdc_di_base_damper;
|
||||
static uint8_t swdc_di_deadband;
|
||||
|
||||
/* Fixed spring boost multiplier (1.5x) */
|
||||
static const float swdc_di_spring_boost = 1.5f;
|
||||
|
||||
HRESULT swdc_di_dev_init(const struct swdc_di_config* cfg,
|
||||
IDirectInputDevice8W* dev, HWND wnd) {
|
||||
assert(cfg != NULL);
|
||||
|
|
@ -64,6 +67,7 @@ HRESULT swdc_di_dev_init(const struct swdc_di_config* cfg,
|
|||
? 200
|
||||
: cfg->ffb_deadband;
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
@ -242,7 +246,8 @@ void swdc_di_ffb_damper(uint8_t force) {
|
|||
|
||||
/* SPRING (centering) */
|
||||
memset(&cond, 0, sizeof(cond));
|
||||
cond.lPositiveCoefficient = (LONG)(((uint32_t)force * ffb_strength) / swdc_di_ffb_scale);
|
||||
LONG base_coeff = (LONG)(((uint32_t)force * ffb_strength) / swdc_di_ffb_scale);
|
||||
LONG boosted_coeff = (LONG)((float)base_coeff * swdc_di_spring_boost);
|
||||
cond.lNegativeCoefficient = cond.lPositiveCoefficient;
|
||||
cond.dwPositiveSaturation = DI_FFNOMINALMAX;
|
||||
cond.dwNegativeSaturation = DI_FFNOMINALMAX;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user