Skip to content

Commit

Permalink
Negcon rumble (#3177)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
sonik-br authored and stenzek committed Apr 16, 2024
1 parent 4d8ed49 commit 07c012a
Show file tree
Hide file tree
Showing 8 changed files with 944 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ add_library(core
multitap.h
negcon.cpp
negcon.h
negcon_rumble.cpp
negcon_rumble.h
pad.cpp
pad.h
pcdrv.cpp
Expand Down
8 changes: 6 additions & 2 deletions src/core/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "guncon.h"
#include "host.h"
#include "negcon.h"
#include "negcon_rumble.h"
#include "playstation_mouse.h"
#include "util/state_wrapper.h"

Expand All @@ -21,8 +22,8 @@ static const Controller::ControllerInfo s_none_info = {ControllerType::None,
Controller::VibrationCapabilities::NoVibration};

static const Controller::ControllerInfo* s_controller_info[] = {
&s_none_info, &DigitalController::INFO, &AnalogController::INFO, &AnalogJoystick::INFO, &NeGcon::INFO,
&GunCon::INFO, &PlayStationMouse::INFO,
&s_none_info, &DigitalController::INFO, &AnalogController::INFO, &AnalogJoystick::INFO,
&NeGcon::INFO, &NeGconRumble::INFO,&GunCon::INFO, &PlayStationMouse::INFO,
};

Controller::Controller(u32 index) : m_index(index)
Expand Down Expand Up @@ -99,6 +100,9 @@ std::unique_ptr<Controller> Controller::Create(ControllerType type, u32 index)

case ControllerType::NeGcon:
return NeGcon::Create(index);

case ControllerType::NeGconRumble:
return NeGconRumble::Create(index);

case ControllerType::None:
default:
Expand Down
2 changes: 2 additions & 0 deletions src/core/core.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<ClCompile Include="multitap.cpp" />
<ClCompile Include="guncon.cpp" />
<ClCompile Include="negcon.cpp" />
<ClCompile Include="negcon_rumble.cpp" />
<ClCompile Include="pad.cpp" />
<ClCompile Include="controller.cpp" />
<ClCompile Include="pcdrv.cpp" />
Expand Down Expand Up @@ -143,6 +144,7 @@
<ClInclude Include="multitap.h" />
<ClInclude Include="guncon.h" />
<ClInclude Include="negcon.h" />
<ClInclude Include="negcon_rumble.h" />
<ClInclude Include="pad.h" />
<ClInclude Include="controller.h" />
<ClInclude Include="pcdrv.h" />
Expand Down
2 changes: 2 additions & 0 deletions src/core/core.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<ClCompile Include="multitap.cpp" />
<ClCompile Include="host.cpp" />
<ClCompile Include="game_database.cpp" />
<ClCompile Include="negcon_rumble.cpp" />
<ClCompile Include="pcdrv.cpp" />
<ClCompile Include="game_list.cpp" />
<ClCompile Include="imgui_overlays.cpp" />
Expand Down Expand Up @@ -122,6 +123,7 @@
<ClInclude Include="achievements.h" />
<ClInclude Include="game_database.h" />
<ClInclude Include="input_types.h" />
<ClInclude Include="negcon_rumble.h" />
<ClInclude Include="pcdrv.h" />
<ClInclude Include="game_list.h" />
<ClInclude Include="imgui_overlays.h" />
Expand Down
Loading

0 comments on commit 07c012a

Please sign in to comment.