Skip to content

Commit

Permalink
emulators/yuzu: update to s20210602
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeich committed Jun 3, 2021
1 parent 486fdc2 commit a500d6f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 15 deletions.
4 changes: 2 additions & 2 deletions emulators/yuzu/Makefile
@@ -1,5 +1,5 @@
PORTNAME= yuzu
PORTVERSION= s20210531
PORTVERSION= s20210602
PORTREVISION?= 0
CATEGORIES= emulators

Expand Down Expand Up @@ -43,7 +43,7 @@ LIB_DEPENDS= liblz4.so:archivers/liblz4 \

USE_GITHUB= yes
GH_ACCOUNT= yuzu-emu
GH_TAGNAME= 519ddfae0
GH_TAGNAME= 4ea171fa5
GH_TUPLE= yuzu-emu:mbedtls:v2.16.9-115-g8c88150ca:mbedtls/externals/mbedtls \
KhronosGroup:SPIRV-Headers:2c51218:SPIRV_Headers/externals/sirit/externals/SPIRV-Headers \
KhronosGroup:Vulkan-Headers:v1.2.145:Vulkan_Headers/externals/Vulkan-Headers \
Expand Down
6 changes: 3 additions & 3 deletions emulators/yuzu/distinfo
@@ -1,6 +1,6 @@
TIMESTAMP = 1622485736
SHA256 (yuzu-emu-yuzu-s20210531-519ddfae0_GH0.tar.gz) = f1a6373cba4de696d315c52e4f096468df64d9d723d0a74128915167c49ad609
SIZE (yuzu-emu-yuzu-s20210531-519ddfae0_GH0.tar.gz) = 3845550
TIMESTAMP = 1622672949
SHA256 (yuzu-emu-yuzu-s20210602-4ea171fa5_GH0.tar.gz) = 8f892dfa6d7c2a440ab1cfcc2fb125cab9dad98b8e53333447deddb71bbcc629
SIZE (yuzu-emu-yuzu-s20210602-4ea171fa5_GH0.tar.gz) = 3846587
SHA256 (yuzu-emu-mbedtls-v2.16.9-115-g8c88150ca_GH0.tar.gz) = 8cd6d075b4da0ad5fb995eb37390e2e6088be8d41ab1cdfc7e7e4256bd991450
SIZE (yuzu-emu-mbedtls-v2.16.9-115-g8c88150ca_GH0.tar.gz) = 2679189
SHA256 (KhronosGroup-SPIRV-Headers-2c51218_GH0.tar.gz) = 08f70947b69e17c7e322156adcd471cf02b4b3f63e7baf8ee0f02d32603ac5ff
Expand Down
36 changes: 26 additions & 10 deletions emulators/yuzu/files/patch-sdl2
Expand Up @@ -20,41 +20,41 @@ CMake Error at externals/CMakeLists.txt:54 (add_subdirectory):

if (TRUE)
if (SDL2_FOUND)
--- src/input_common/sdl/sdl_impl.cpp.orig 2021-05-19 22:47:48 UTC
--- src/input_common/sdl/sdl_impl.cpp.orig 2021-06-02 22:29:09 UTC
+++ src/input_common/sdl/sdl_impl.cpp
@@ -74,6 +74,7 @@ class SDLJoystick { (public)
@@ -64,6 +64,7 @@ class SDLJoystick { (public)
}

void EnableMotion() {
+#if SDL_VERSION_ATLEAST(2,0,14)
if (sdl_controller) {
SDL_GameController* controller = sdl_controller.get();
if (SDL_GameControllerHasSensor(controller, SDL_SENSOR_ACCEL) && !has_accel) {
@@ -85,6 +86,7 @@ class SDLJoystick { (public)
@@ -75,6 +76,7 @@ class SDLJoystick { (public)
has_gyro = true;
}
}
+#endif
}

void SetButton(int button, bool value) {
@@ -92,6 +94,7 @@ class SDLJoystick { (public)
@@ -82,6 +84,7 @@ class SDLJoystick { (public)
state.buttons.insert_or_assign(button, value);
}

+#if SDL_VERSION_ATLEAST(2,0,14)
void SetMotion(SDL_ControllerSensorEvent event) {
constexpr float gravity_constant = 9.80665f;
std::lock_guard lock{mutex};
@@ -119,6 +122,7 @@ class SDLJoystick { (public)
@@ -109,6 +112,7 @@ class SDLJoystick { (public)
motion.UpdateRotation(time_difference * 1000);
motion.UpdateOrientation(time_difference * 1000);
}
+#endif

bool GetButton(int button) const {
std::lock_guard lock{mutex};
@@ -352,12 +356,14 @@ void SDLState::HandleGameControllerEvent(const SDL_Eve
@@ -378,12 +382,14 @@ void SDLState::HandleGameControllerEvent(const SDL_Eve
}
break;
}
Expand All @@ -69,7 +69,7 @@ CMake Error at externals/CMakeLists.txt:54 (add_subdirectory):
case SDL_JOYDEVICEREMOVED:
LOG_DEBUG(Input, "Controller removed with Instance_ID {}", event.jdevice.which);
CloseJoystick(SDL_JoystickFromInstanceID(event.jdevice.which));
@@ -797,7 +803,9 @@ SDLState::SDLState() {
@@ -823,7 +829,9 @@ SDLState::SDLState() {

// Enable HIDAPI rumble. This prevents SDL from disabling motion on PS4 and PS5 controllers
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1");
Expand All @@ -79,23 +79,39 @@ CMake Error at externals/CMakeLists.txt:54 (add_subdirectory):

// Tell SDL2 to use the hidapi driver. This will allow joycons to be detected as a
// GameController and not a generic one
@@ -1003,6 +1011,7 @@ Common::ParamPackage SDLEventToMotionParamPackage(SDLS
@@ -1037,6 +1045,7 @@ Common::ParamPackage SDLEventToMotionParamPackage(SDLS
}
break;
}
+#if SDL_VERSION_ATLEAST(2,0,14)
case SDL_CONTROLLERSENSORUPDATE: {
bool is_motion_shaking = false;
constexpr float gyro_threshold = 5.0f;
@@ -1032,6 +1041,7 @@ Common::ParamPackage SDLEventToMotionParamPackage(SDLS
@@ -1066,6 +1075,7 @@ Common::ParamPackage SDLEventToMotionParamPackage(SDLS
}
break;
}
+#endif
}
return {};
}
@@ -1295,7 +1305,9 @@ class SDLMotionPoller final : public SDLPoller { (publ
@@ -1169,6 +1179,7 @@ ButtonBindings SDLState::GetNintendoButtonBinding(
auto sl_button = SDL_CONTROLLER_BUTTON_LEFTSHOULDER;
auto sr_button = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER;

+#if SDL_VERSION_ATLEAST(2,0,14)
if (joystick->IsJoyconLeft()) {
sl_button = SDL_CONTROLLER_BUTTON_PADDLE2;
sr_button = SDL_CONTROLLER_BUTTON_PADDLE4;
@@ -1177,6 +1188,7 @@ ButtonBindings SDLState::GetNintendoButtonBinding(
sl_button = SDL_CONTROLLER_BUTTON_PADDLE3;
sr_button = SDL_CONTROLLER_BUTTON_PADDLE1;
}
+#endif

return {
std::pair{Settings::NativeButton::A, SDL_CONTROLLER_BUTTON_A},
@@ -1462,7 +1474,9 @@ class SDLMotionPoller final : public SDLPoller { (publ
[[fallthrough]];
case SDL_JOYBUTTONUP:
case SDL_JOYHATMOTION:
Expand Down

0 comments on commit a500d6f

Please sign in to comment.