diff --git a/src/spice2x/build/controller_presets.xml b/src/spice2x/build/controller_presets.xml
index 9c23bde..9707e5a 100644
--- a/src/spice2x/build/controller_presets.xml
+++ b/src/spice2x/build/controller_presets.xml
@@ -39,8 +39,8 @@
-
-
+
+
@@ -117,8 +117,8 @@
-
-
+
+
@@ -144,34 +144,34 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -277,9 +277,9 @@
-
-
-
+
+
+
@@ -296,8 +296,8 @@
-
-
+
+
diff --git a/src/spice2x/cfg/analog.cpp b/src/spice2x/cfg/analog.cpp
index 2c3815f..f946bfc 100644
--- a/src/spice2x/cfg/analog.cpp
+++ b/src/spice2x/cfg/analog.cpp
@@ -237,8 +237,7 @@ float Analog::applyDeadzone(float raw_value) {
deadzone = -deadzone;
}
- // relative mode assumes that user is using a stick, so center is neutral regardless of analog type
- if (getType() != GameAPI::Analogs::AnalogType::LinearPositive || isRelativeMode()) {
+ if (getType() != GameAPI::Analogs::AnalogType::LinearPositive) {
// calculate values
const auto delta = value - 0.5f;
diff --git a/src/spice2x/cfg/analog.h b/src/spice2x/cfg/analog.h
index 4900b4a..fc3a4e8 100644
--- a/src/spice2x/cfg/analog.h
+++ b/src/spice2x/cfg/analog.h
@@ -63,14 +63,6 @@ private:
float divisor_previous_value = 0.5f;
unsigned short divisor_region = 0;
- // relative input mode
- float absolute_value_for_rel_mode = 0.5f;
- bool relative_mode = false;
-
- // circular buffer (delayed input)
- int delay_buffer_depth = 0;
- std::queue delay_buffer;
-
float calculateAngularDifference(float old_rads, float new_rads);
float normalizeAngle(float rads);
float normalizeAnalogValue(float value);
@@ -106,8 +98,6 @@ public:
smoothing = false;
deadzone_mirror = false;
setMultiplier(1);
- setRelativeMode(false);
- setDelayBufferDepth(0);
setLastState(0.5f);
}
@@ -205,33 +195,6 @@ public:
this->last_state = last_state;
}
- inline bool isRelativeMode() const {
- return this->relative_mode;
- }
-
- inline void setRelativeMode(bool relative_mode) {
- this->relative_mode = relative_mode;
- this->absolute_value_for_rel_mode = 0.5f;
- }
-
- inline float getAbsoluteValue(float relative_delta) {
- this->absolute_value_for_rel_mode =
- normalizeAnalogValue(this->absolute_value_for_rel_mode + relative_delta);
- return this->absolute_value_for_rel_mode;
- }
-
- inline int getDelayBufferDepth() const {
- return this->delay_buffer_depth;
- }
-
- inline void setDelayBufferDepth(int depth) {
- this->delay_buffer_depth = depth;
- }
-
- inline std::queue &getDelayBuffer() {
- return this->delay_buffer;
- }
-
inline GameAPI::Analogs::AnalogType getType() const {
return this->type;
}
diff --git a/src/spice2x/cfg/api.cpp b/src/spice2x/cfg/api.cpp
index 6399f9a..fad0a8b 100644
--- a/src/spice2x/cfg/api.cpp
+++ b/src/spice2x/cfg/api.cpp
@@ -679,34 +679,12 @@ float GameAPI::Analogs::getState(rawinput::RawInputManager *manager, rawinput::D
}
// deadzone
- // do not apply deadzone to circular analogs since it doesn't make sense (except in relative mode)
- if (analog.isDeadzoneSet() &&
- (analog.getType() != AnalogType::Circular || analog.isRelativeMode())) {
+ // do not apply deadzone to circular analogs since it doesn't make sense
+ if (analog.isDeadzoneSet() && analog.getType() != AnalogType::Circular) {
value = analog.applyDeadzone(value);
}
- if (analog.isRelativeMode()) {
- float relative_delta = value - 0.5f;
- // built-in scaling to make values reasonable
- relative_delta /= 80.f;
-
- // integer multiplier/divisor
- const auto mult = analog.getMultiplier();
- if (mult < -1) {
- relative_delta /= -mult;
- } else if (1 < mult) {
- relative_delta *= mult;
- }
-
- // sensitivity (ranges from 0.0 to 4.0)
- if (analog.isSensitivitySet()) {
- relative_delta *= analog.getSensitivity();
- }
-
- // translate relative movement to absolute value
- value = analog.getAbsoluteValue(relative_delta);
-
- } else if (analog.getType() == AnalogType::Circular) {
+ if (analog.getType() == AnalogType::Circular) {
// integer multiplier
value = analog.applyMultiplier(value);
@@ -782,29 +760,6 @@ float GameAPI::Analogs::getState(rawinput::RawInputManager *manager, rawinput::D
value = std::clamp(value, 0.f, 1.f);
}
}
-
- // delay
- if (0 < analog.getDelayBufferDepth()) {
- auto& queue = analog.getDelayBuffer();
-
- // ensure the queue isn't too long; drop old values
- while (analog.getDelayBufferDepth() <= (int)queue.size()) {
- queue.pop();
- }
-
- // always push new value
- queue.push(value);
-
- // get a new value to return
- if ((int)queue.size() < analog.getDelayBufferDepth()) {
- // not enough in the queue, stall for now, shouldn't happen often
- value = analog.getLastState();
- } else {
- value = queue.front();
- queue.pop();
- }
- }
-
break;
}
case rawinput::MIDI: {
diff --git a/src/spice2x/cfg/config.cpp b/src/spice2x/cfg/config.cpp
index a2ac003..ef626d9 100644
--- a/src/spice2x/cfg/config.cpp
+++ b/src/spice2x/cfg/config.cpp
@@ -252,8 +252,6 @@ bool Config::addGame(Game &game) {
bool invert = false;
bool smoothing = false;
int multiplier = 1;
- bool relative_mode = false;
- int delay_buffer_depth = 0;
tinyxml2::XMLError err1 = gameAnalogNode->QueryIntAttribute("index", &index);
gameAnalogNode->QueryFloatAttribute("sensivity", &sensitivity);
gameAnalogNode->QueryFloatAttribute("deadzone", &deadzone);
@@ -261,8 +259,6 @@ bool Config::addGame(Game &game) {
gameAnalogNode->QueryBoolAttribute("invert", &invert);
gameAnalogNode->QueryBoolAttribute("smoothing", &smoothing);
gameAnalogNode->QueryIntAttribute("multiplier", &multiplier);
- gameAnalogNode->QueryBoolAttribute("relative", &relative_mode);
- gameAnalogNode->QueryIntAttribute("delay", &delay_buffer_depth);
const char *devid = gameAnalogNode->Attribute("devid");
if (err1 != tinyxml2::XMLError::XML_SUCCESS || !devid) {
@@ -277,8 +273,6 @@ bool Config::addGame(Game &game) {
gameAnalogNode->SetAttribute("invert", it.getInvert());
gameAnalogNode->SetAttribute("smoothing", it.getSmoothing());
gameAnalogNode->SetAttribute("multiplier", it.getMultiplier());
- gameAnalogNode->SetAttribute("relative", it.isRelativeMode());
- gameAnalogNode->SetAttribute("delay", it.getDelayBufferDepth());
gameAnalogsNode->InsertEndChild(gameAnalogNode);
} else {
it.setIndex(static_cast(index));
@@ -289,8 +283,6 @@ bool Config::addGame(Game &game) {
it.setInvert(invert);
it.setSmoothing(smoothing);
it.setMultiplier(multiplier);
- it.setRelativeMode(relative_mode);
- it.setDelayBufferDepth(delay_buffer_depth);
}
} else {
gameAnalogNode = this->configFile.NewElement("analog");
@@ -302,8 +294,6 @@ bool Config::addGame(Game &game) {
gameAnalogNode->SetAttribute("invert", it.getInvert());
gameAnalogNode->SetAttribute("smoothing", it.getSmoothing());
gameAnalogNode->SetAttribute("multiplier", it.getMultiplier());
- gameAnalogNode->SetAttribute("relative", it.isRelativeMode());
- gameAnalogNode->SetAttribute("delay", it.getDelayBufferDepth());
gameAnalogNode->SetAttribute("devid", it.getDeviceIdentifier().c_str());
gameAnalogsNode->InsertEndChild(gameAnalogNode);
}
@@ -457,8 +447,6 @@ bool Config::addGame(Game &game) {
gameAnalogNode->SetAttribute("invert", it.getInvert());
gameAnalogNode->SetAttribute("smoothing", it.getSmoothing());
gameAnalogNode->SetAttribute("multiplier", it.getMultiplier());
- gameAnalogNode->SetAttribute("relative", it.isRelativeMode());
- gameAnalogNode->SetAttribute("delay", it.getDelayBufferDepth());
gameAnalogsNode->InsertEndChild(gameAnalogNode);
}
@@ -691,8 +679,6 @@ bool Config::updateBinding(const Game &game, const Analog &analog) {
gameAnalogNode->SetAttribute("invert", analog.getInvert());
gameAnalogNode->SetAttribute("smoothing", analog.getSmoothing());
gameAnalogNode->SetAttribute("multiplier", analog.getMultiplier());
- gameAnalogNode->SetAttribute("relative", analog.isRelativeMode());
- gameAnalogNode->SetAttribute("delay", analog.getDelayBufferDepth());
gameAnalogNode->SetAttribute("devid", analog.getDeviceIdentifier().c_str());
} else {
gameAnalogNode = this->configFile.NewElement("analog");
@@ -703,8 +689,6 @@ bool Config::updateBinding(const Game &game, const Analog &analog) {
gameAnalogNode->SetAttribute("invert", analog.getInvert());
gameAnalogNode->SetAttribute("smoothing", analog.getSmoothing());
gameAnalogNode->SetAttribute("multiplier", analog.getMultiplier());
- gameAnalogNode->SetAttribute("relative", analog.isRelativeMode());
- gameAnalogNode->SetAttribute("delay", analog.getDelayBufferDepth());
gameAnalogNode->SetAttribute("devid", analog.getDeviceIdentifier().c_str());
gameAnalogsNode->InsertEndChild(gameAnalogNode);
}
@@ -1141,8 +1125,6 @@ std::vector Config::getAnalogs(const std::string &gameName) {
bool invert = false;
bool smoothing = false;
int multiplier = 1;
- bool relative_mode = false;
- int delay_buffer_depth = 0;
gameAnalogNode->QueryIntAttribute("index", &index);
gameAnalogNode->QueryFloatAttribute("sensivity", &sensitivity);
gameAnalogNode->QueryFloatAttribute("deadzone", &deadzone);
@@ -1150,8 +1132,6 @@ std::vector Config::getAnalogs(const std::string &gameName) {
gameAnalogNode->QueryBoolAttribute("invert", &invert);
gameAnalogNode->QueryBoolAttribute("smoothing", &smoothing);
gameAnalogNode->QueryIntAttribute("multiplier", &multiplier);
- gameAnalogNode->QueryBoolAttribute("relative", &relative_mode);
- gameAnalogNode->QueryIntAttribute("delay", &delay_buffer_depth);
const char *devid = gameAnalogNode->Attribute("devid");
// create analog and add to list
@@ -1163,8 +1143,6 @@ std::vector Config::getAnalogs(const std::string &gameName) {
analog.setInvert(invert);
analog.setSmoothing(smoothing);
analog.setMultiplier(multiplier);
- analog.setRelativeMode(relative_mode);
- analog.setDelayBufferDepth(delay_buffer_depth);
if (devid) {
analog.setDeviceIdentifier(devid);
}
diff --git a/src/spice2x/cfg/controller_presets.cpp b/src/spice2x/cfg/controller_presets.cpp
index 5f32c8e..6d7cb24 100644
--- a/src/spice2x/cfg/controller_presets.cpp
+++ b/src/spice2x/cfg/controller_presets.cpp
@@ -69,8 +69,6 @@ namespace overlay::windows {
el->SetAttribute("invert", analog.invert);
el->SetAttribute("smoothing", analog.smoothing);
el->SetAttribute("multiplier", analog.multiplier);
- el->SetAttribute("relative", analog.relative_mode);
- el->SetAttribute("delay", analog.delay_buffer_depth);
parent->InsertEndChild(el);
}
@@ -92,8 +90,6 @@ namespace overlay::windows {
el->QueryBoolAttribute("invert", &a.invert);
el->QueryBoolAttribute("smoothing", &a.smoothing);
el->QueryIntAttribute("multiplier", &a.multiplier);
- el->QueryBoolAttribute("relative", &a.relative_mode);
- el->QueryIntAttribute("delay", &a.delay_buffer_depth);
return a;
}
diff --git a/src/spice2x/overlay/windows/config.cpp b/src/spice2x/overlay/windows/config.cpp
index cc01642..809c004 100644
--- a/src/spice2x/overlay/windows/config.cpp
+++ b/src/spice2x/overlay/windows/config.cpp
@@ -2522,9 +2522,9 @@ namespace overlay::windows {
}
}
- // hide deadzone for circular analog since it doesn't make any sense (unless in relative mode)
+ // hide deadzone for circular analog since it doesn't make any sense
if ((device->type == rawinput::HID || device->type == rawinput::MIDI) &&
- ((analog.getType() != GameAPI::Analogs::AnalogType::Circular) || analog.isRelativeMode())) {
+ analog.getType() != GameAPI::Analogs::AnalogType::Circular) {
auto deadzone = analog.getDeadzone();
// for back compat (before each analog had a type)
@@ -2568,46 +2568,16 @@ namespace overlay::windows {
if (analog.getType() == GameAPI::Analogs::AnalogType::Circular) {
// smoothing
bool smoothing = analog.getSmoothing();
- ImGui::BeginDisabled(analog.isRelativeMode());
ImGui::Checkbox("Smooth Axis (adds latency)", &smoothing);
ImGui::SameLine();
ImGui::HelpMarker(
"Apply a moving average algorithm; intended for angular input (knobs, turntables). "
"Adds a slight bit of latency to input as the algorithm averages out recent input. "
"Only use in dire situations where the input is too jittery for the game.");
- ImGui::EndDisabled();
if (smoothing != analog.getSmoothing()) {
analog.setSmoothing(smoothing);
}
}
-
- // relative input mode
- bool relative_analog = analog.isRelativeMode();
- ImGui::Checkbox("Relative Axis", &relative_analog);
- ImGui::SameLine();
- ImGui::HelpMarker(
- "Use relative directional input instead of positional values.\n\n"
- "Can be used to translate analog sticks to knob input, for example.\n\n"
- "WARNING: speed depends on how often the game polls for input! "
- "Strongly recommended that you go into the game's test menu instead "
- "of adjusting in spicecfg.");
- if (relative_analog != analog.isRelativeMode()) {
- analog.setRelativeMode(relative_analog);
- }
-
- // delay buffer
- int delay = analog.getDelayBufferDepth();
- if (ImGui::InputInt("Delay (experimental)", &delay, 1, 10)) {
- delay = CLAMP(delay, 0, 256);
- analog.setDelayBufferDepth(delay);
- }
- ImGui::SameLine();
- ImGui::HelpMarker(
- "Adds a delay to input. This is poll-based, not time-based.\n\n"
- "WARNING: delay depends on how often the game polls for input! "
- "Strongly recommended that you go into the game's test menu instead "
- "of adjusting in spicecfg. Close all overlays as that will affect "
- "how input delay is calculated.");
}
}
@@ -5419,8 +5389,6 @@ namespace overlay::windows {
a.setInvert(ta.invert);
a.setSmoothing(ta.smoothing);
a.setMultiplier(ta.multiplier);
- a.setRelativeMode(ta.relative_mode);
- a.setDelayBufferDepth(ta.delay_buffer_depth);
::Config::getInstance().updateBinding(game, a);
break;
}
diff --git a/src/spice2x/overlay/windows/controller_presets.h b/src/spice2x/overlay/windows/controller_presets.h
index b0ab329..fdb82b0 100644
--- a/src/spice2x/overlay/windows/controller_presets.h
+++ b/src/spice2x/overlay/windows/controller_presets.h
@@ -71,8 +71,6 @@ namespace overlay::windows {
bool invert = false;
bool smoothing = false;
int multiplier = 1;
- bool relative_mode = false;
- int delay_buffer_depth = 0;
bool is_device() const { return !device_identifier.empty(); }
bool is_unbound() const { return device_identifier.empty() && index == 0xFF; }
@@ -89,8 +87,6 @@ namespace overlay::windows {
invert = a.getInvert();
smoothing = a.getSmoothing();
multiplier = a.getMultiplier();
- relative_mode = a.isRelativeMode();
- delay_buffer_depth = a.getDelayBufferDepth();
}
};