From dab6a0fe35f02227c849897e630d7dba9421c0a0 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Tue, 17 May 2022 10:14:37 +0200 Subject: [PATCH] early-access version 2728 --- README.md | 2 +- externals/sirit/CMakeLists.txt | 11 +++++- externals/sirit/src/CMakeLists.txt | 5 +-- src/core/arm/dynarmic/arm_dynarmic_cp15.cpp | 2 +- src/core/hid/emulated_controller.cpp | 36 ++++--------------- src/core/hid/emulated_controller.h | 6 ---- src/shader_recompiler/frontend/ir/opcodes.h | 2 +- .../frontend/maxwell/opcodes.h | 2 +- 8 files changed, 23 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 21b2370a9..0d4f95fad 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 2725. +This is the source code for early-access 2728. ## Legal Notice diff --git a/externals/sirit/CMakeLists.txt b/externals/sirit/CMakeLists.txt index 3b0574fe5..ca7e3b6cd 100755 --- a/externals/sirit/CMakeLists.txt +++ b/externals/sirit/CMakeLists.txt @@ -10,6 +10,10 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) set(MASTER_PROJECT ON) endif() +# Sirit project options +option(SIRIT_TESTS "Build tests" OFF) +option(SIRIT_USE_SYSTEM_SPIRV_HEADERS "Use system SPIR-V headers" OFF) + # Default to a Release build if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) @@ -81,7 +85,12 @@ endif() enable_testing(true) # SPIR-V headers -add_subdirectory(externals/SPIRV-Headers EXCLUDE_FROM_ALL) +if (SIRIT_USE_SYSTEM_SPIRV_HEADERS) + find_package(SPIRV-Headers REQUIRED) +else() + add_subdirectory(externals/SPIRV-Headers EXCLUDE_FROM_ALL) + add_library(SPIRV-Headers::SPIRV-Headers ALIAS SPIRV-Headers) +endif() # Sirit project files add_subdirectory(src) diff --git a/externals/sirit/src/CMakeLists.txt b/externals/sirit/src/CMakeLists.txt index c9bf0934a..18f3e1b11 100755 --- a/externals/sirit/src/CMakeLists.txt +++ b/externals/sirit/src/CMakeLists.txt @@ -27,5 +27,6 @@ target_compile_options(sirit PRIVATE ${SIRIT_CXX_FLAGS}) target_include_directories(sirit PUBLIC ../include - PRIVATE . ${SPIRV-Headers_SOURCE_DIR}/include - INTERFACE ${SPIRV-Headers_SOURCE_DIR}/include) + PRIVATE .) + +target_link_libraries(sirit PUBLIC SPIRV-Headers::SPIRV-Headers) diff --git a/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp b/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp index a043e6735..6aae79c48 100755 --- a/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_cp15.cpp @@ -20,7 +20,7 @@ struct fmt::formatter { } template auto format(const Dynarmic::A32::CoprocReg& reg, FormatContext& ctx) { - return format_to(ctx.out(), "cp{}", static_cast(reg)); + return fmt::format_to(ctx.out(), "cp{}", static_cast(reg)); } }; diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 0684ab17b..ba1dcd171 100755 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp @@ -631,11 +631,14 @@ void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback lock.unlock(); - // Reconnect controller if input is detected if (!is_connected) { - TryReconnectController(index); + if (npad_id_type == NpadIdType::Player1 && npad_type != NpadStyleIndex::Handheld) { + Connect(); + } + if (npad_id_type == NpadIdType::Handheld && npad_type == NpadStyleIndex::Handheld) { + Connect(); + } } - TriggerOnChange(ControllerTriggerType::Button, true); } @@ -987,33 +990,6 @@ bool EmulatedController::IsControllerSupported(bool use_temporary_value) const { return false; } } -void EmulatedController::TryReconnectController(std::size_t button_index) { - if (button_index >= button_params.size()) { - return; - } - - const auto engine = button_params[button_index].Get("engine", ""); - bool reconnect_controller = false; - - // TAS is not allowed to turn on controllers - if (engine == "tas") { - return; - } - // Only connect the controller if button config is custom - if (engine != "keyboard") { - reconnect_controller = true; - } - if (npad_id_type == NpadIdType::Player1 && npad_type != NpadStyleIndex::Handheld) { - reconnect_controller = true; - } - if (npad_id_type == NpadIdType::Handheld && npad_type == NpadStyleIndex::Handheld) { - reconnect_controller = true; - } - - if (reconnect_controller) { - Connect(); - } -} void EmulatedController::Connect(bool use_temporary_value) { if (!IsControllerSupported(use_temporary_value)) { diff --git a/src/core/hid/emulated_controller.h b/src/core/hid/emulated_controller.h index dd7d0386c..3f02ed3c0 100755 --- a/src/core/hid/emulated_controller.h +++ b/src/core/hid/emulated_controller.h @@ -166,12 +166,6 @@ public: */ void SetSupportedNpadStyleTag(NpadStyleTag supported_styles); - /** - * Tries to turn on the controller if a button is pressed - * @param button_index index to verify if controller should be connected - */ - void TryReconnectController(std::size_t button_index); - /** * Sets the connected status to true * @param use_temporary_value If true tmp_npad_type will be used diff --git a/src/shader_recompiler/frontend/ir/opcodes.h b/src/shader_recompiler/frontend/ir/opcodes.h index d17dc0376..752879a18 100755 --- a/src/shader_recompiler/frontend/ir/opcodes.h +++ b/src/shader_recompiler/frontend/ir/opcodes.h @@ -103,6 +103,6 @@ struct fmt::formatter { } template auto format(const Shader::IR::Opcode& op, FormatContext& ctx) { - return format_to(ctx.out(), "{}", Shader::IR::NameOf(op)); + return fmt::format_to(ctx.out(), "{}", Shader::IR::NameOf(op)); } }; diff --git a/src/shader_recompiler/frontend/maxwell/opcodes.h b/src/shader_recompiler/frontend/maxwell/opcodes.h index 83093fca0..72dd143c2 100755 --- a/src/shader_recompiler/frontend/maxwell/opcodes.h +++ b/src/shader_recompiler/frontend/maxwell/opcodes.h @@ -24,6 +24,6 @@ struct fmt::formatter { } template auto format(const Shader::Maxwell::Opcode& opcode, FormatContext& ctx) { - return format_to(ctx.out(), "{}", NameOf(opcode)); + return fmt::format_to(ctx.out(), "{}", NameOf(opcode)); } };