Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negcon rumble #3177

Merged
merged 7 commits into from
Apr 16, 2024
Merged

Negcon rumble #3177

merged 7 commits into from
Apr 16, 2024

Conversation

sonik-br
Copy link
Contributor

This PR adds a new device: Negcon with rumble.
There's no QT interface for it, but the "Automatic Mapping" should work.
Rumble motors should also be automatic mapped to the current standard left and right motors.

It's also possible to toogle between a digital pad and the new Negcon mode by pressing the "analog button".
I've added this as at least one game refused to pass the initial screen when in NegconRumble mode. After the screen, the mode change worked as expected.

@CookiePLMonster helped with testing a lot of games.
Here's the list of some of the games that supports this device.

  • Advan Racing
  • CMR1
  • CMR2.0
  • Gran Turismo 1
  • NASCAR '99 Legacy
  • NASCAR 2000
  • NASCAR 2001
  • Rally de Africa
  • Rally de Europe
  • Side by Side Special 2000
  • TOCA1
  • TOCA2
  • TOCA WTC
  • NFS4

Comment on lines 154 to 172
//if (index == (static_cast<u32>(Button::Count) + static_cast<u32>(HalfAxis::SteeringLeft)) ||
// index == (static_cast<u32>(Button::Count) + static_cast<u32>(HalfAxis::SteeringRight)))
//{
// return static_cast<float>(m_half_axis_state[index - static_cast<u32>(Button::Count)]) * (1.0f / 255.0f);
//}
//else if (index >= static_cast<u32>(Button::Count))
//{
// // less one because of the two steering axes
// const u32 sub_index = index - (static_cast<u32>(Button::Analog) + 1);
// if (sub_index >= m_axis_state.size())
// return 0.0f;

// return static_cast<float>(m_axis_state[sub_index]) * (1.0f / 255.0f);
//}
//else
//{
// const u32 bit = s_button_indices[index];
// return static_cast<float>(((m_button_state >> bit) & 1u) ^ 1u);
//}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't leave code like this commented out. If it's not needed, remove it. There were a few others below and in the header too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@stenzek stenzek merged commit 17f55fd into stenzek:master Apr 16, 2024
3 of 6 checks passed
stenzek pushed a commit that referenced this pull request Apr 16, 2024
* Implemented NeGcon with rumble. Code is a mix of the existing NeGcon AnalogController modes.

* Fix negcon id reply and analog/digital toggle.

* Implemented NeGcon with rumble. Code is a mix of the existing NeGcon AnalogController modes.

* Fix negcon id reply and analog/digital toggle.

* Update macros

* Code cleanup
stenzek pushed a commit that referenced this pull request Apr 16, 2024
* Implemented NeGcon with rumble. Code is a mix of the existing NeGcon AnalogController modes.

* Fix negcon id reply and analog/digital toggle.

* Implemented NeGcon with rumble. Code is a mix of the existing NeGcon AnalogController modes.

* Fix negcon id reply and analog/digital toggle.

* Update macros

* Code cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants