Skip to content

Commit

Permalink
Release 3.5.3
Browse files Browse the repository at this point in the history
* Update SDL2 to latest 2.28.5

* Fixed Instant Press not applying properly
* Fixed a deadlock with releasing a virtual controller
  • Loading branch information
Electronicks committed Jan 9, 2024
1 parent 66f0968 commit 6ca910c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,15 @@ This is a summary of new features and bugfixes. Read the README to learn how to
## Known issues
* SDL always merges joycons behind the scene into a single controller. JSM is not able to split them. Use legacy-JSL version to use this feature.

## 3.5.3

### Features
* Update SDL2 to latest 2.28.5

### Bugfixes
* Fixed Instant Press not applying properly
* Fixed a deadlock with releasing a virtual controller

## 3.5.2

### Bugfixes
Expand Down
2 changes: 1 addition & 1 deletion JoyShockMapper/CMakeLists.txt
Expand Up @@ -166,7 +166,7 @@ if(SDL OR NOT DEFINED SDL)
CPMAddPackage (
NAME SDL2
GITHUB_REPOSITORY libsdl-org/SDL
GIT_TAG release-2.28.3
GIT_TAG release-2.28.5
)

set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
Expand Down
1 change: 1 addition & 0 deletions JoyShockMapper/src/main.cpp
Expand Up @@ -3474,6 +3474,7 @@ ControllerScheme UpdateVirtualController(ControllerScheme prevScheme, Controller
bool success = true;
for (auto &js : handle_to_joyshock)
{
lock_guard guard(js.second->_context->callback_lock);
if (!js.second->_context->_vigemController ||
js.second->_context->_vigemController->getType() != nextScheme)
{
Expand Down
7 changes: 5 additions & 2 deletions JoyShockMapper/src/win32/Gamepad.cpp
Expand Up @@ -221,7 +221,7 @@ class VigemGamepad : public Gamepad
{
*errorMsg = _errorMsg;
}
return _errorMsg.empty() && vigem_target_is_attached(_gamepad) == TRUE;
return _errorMsg.empty() && _gamepad && vigem_target_is_attached(_gamepad) == TRUE;
}

void setStick(float x, float y, bool isLeft) override
Expand Down Expand Up @@ -427,14 +427,17 @@ class Ds4Gamepad : public VigemGamepad
vigem_target_remove(client, _gamepad);
}
vigem_target_free(_gamepad);
_gamepad = nullptr;
}
_pollDs4Thread.join();
}

VIGEM_ERROR awaitOutputReportTimeout(UDs4OutputBuffer &out)
{
lock_guard guard(_gamepadLock);
return vigem_target_ds4_await_output_report_timeout(VigemClient::get(), _gamepad, 1000, &out.buffer);
if (_gamepad)
return vigem_target_ds4_await_output_report_timeout(VigemClient::get(), _gamepad, 1000, &out.buffer);
return VIGEM_ERROR_IS_DISPOSING;
}

void pollDs4()
Expand Down

0 comments on commit 6ca910c

Please sign in to comment.