forked from etc/pineapple-src
early-access version 3428
This commit is contained in:
parent
9495ebb1c2
commit
4475cfff27
59 changed files with 9658 additions and 8374 deletions
|
@ -56,6 +56,8 @@ option(YUZU_USE_BUNDLED_VCPKG "Use vcpkg for yuzu dependencies" "${MSVC}")
|
|||
|
||||
option(YUZU_CHECK_SUBMODULES "Check if submodules are present" ON)
|
||||
|
||||
option(YUZU_ENABLE_LTO "Enable link-time optimization" OFF)
|
||||
|
||||
CMAKE_DEPENDENT_OPTION(YUZU_USE_FASTER_LD "Check if a faster linker is available" ON "NOT WIN32" OFF)
|
||||
|
||||
if (YUZU_USE_BUNDLED_VCPKG)
|
||||
|
@ -65,6 +67,9 @@ if (YUZU_USE_BUNDLED_VCPKG)
|
|||
if (YUZU_CRASH_DUMPS)
|
||||
list(APPEND VCPKG_MANIFEST_FEATURES "dbghelp")
|
||||
endif()
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
list(APPEND VCPKG_MANIFEST_FEATURES "web-service")
|
||||
endif()
|
||||
|
||||
include(${CMAKE_SOURCE_DIR}/externals/vcpkg/scripts/buildsystems/vcpkg.cmake)
|
||||
elseif(NOT "$ENV{VCPKG_TOOLCHAIN_FILE}" STREQUAL "")
|
||||
|
@ -205,10 +210,11 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
|
|||
# =======================================================================
|
||||
|
||||
# Enforce the search mode of non-required packages for better and shorter failure messages
|
||||
find_package(Boost 1.73.0 REQUIRED context)
|
||||
find_package(enet 1.3 MODULE)
|
||||
find_package(fmt 9 REQUIRED)
|
||||
find_package(inih MODULE)
|
||||
find_package(LLVM MODULE)
|
||||
find_package(inih 52 MODULE COMPONENTS INIReader)
|
||||
find_package(LLVM MODULE COMPONENTS Demangle)
|
||||
find_package(lz4 REQUIRED)
|
||||
find_package(nlohmann_json 3.8 REQUIRED)
|
||||
find_package(Opus 1.3 MODULE)
|
||||
|
@ -241,29 +247,13 @@ endif()
|
|||
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
find_package(cpp-jwt 1.4 CONFIG)
|
||||
find_package(httplib 0.12 MODULE)
|
||||
if (NOT cpp-jwt_FOUND OR NOT httplib_FOUND)
|
||||
find_package(OpenSSL 1.1 MODULE COMPONENTS Crypto SSL)
|
||||
endif()
|
||||
find_package(httplib 0.12 MODULE COMPONENTS OpenSSL)
|
||||
endif()
|
||||
|
||||
if (YUZU_TESTS)
|
||||
find_package(Catch2 3.0.1 REQUIRED)
|
||||
endif()
|
||||
|
||||
find_package(Boost 1.73.0 COMPONENTS context)
|
||||
if (Boost_FOUND)
|
||||
set(Boost_LIBRARIES Boost::boost)
|
||||
# Conditionally add Boost::context only if the found Boost package provides it
|
||||
# The old version is missing Boost::context, so we want to avoid adding in that case
|
||||
# The new version requires adding Boost::context to prevent linking issues
|
||||
if (TARGET Boost::context)
|
||||
list(APPEND Boost_LIBRARIES Boost::context)
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Boost 1.73.0 or newer not found")
|
||||
endif()
|
||||
|
||||
# boost:asio has functions that require AcceptEx et al
|
||||
if (MINGW)
|
||||
find_library(MSWSOCK_LIBRARY mswsock REQUIRED)
|
||||
|
@ -460,14 +450,6 @@ if (ENABLE_SDL2)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
# Reexport some targets that are named differently when using the upstream CmakeConfig
|
||||
# In order to ALIAS targets to a new name, they first need to be IMPORTED_GLOBAL
|
||||
# Dynarmic checks for target `boost` and so we want to make sure it can find it through our system instead of using their external
|
||||
if (TARGET Boost::boost)
|
||||
set_target_properties(Boost::boost PROPERTIES IMPORTED_GLOBAL TRUE)
|
||||
add_library(boost ALIAS Boost::boost)
|
||||
endif()
|
||||
|
||||
# List of all FFmpeg components required
|
||||
set(FFmpeg_COMPONENTS
|
||||
avcodec
|
||||
|
@ -583,11 +565,7 @@ function(create_target_directory_groups target_name)
|
|||
endfunction()
|
||||
|
||||
# Prevent boost from linking against libs when building
|
||||
add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY
|
||||
-DBOOST_SYSTEM_NO_LIB
|
||||
-DBOOST_DATE_TIME_NO_LIB
|
||||
-DBOOST_REGEX_NO_LIB
|
||||
)
|
||||
target_link_libraries(Boost::headers INTERFACE Boost::disable_autolinking)
|
||||
# Adjustments for MSVC + Ninja
|
||||
if (MSVC AND CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
add_compile_options(
|
||||
|
|
|
@ -2,15 +2,25 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
find_package(LLVM QUIET CONFIG)
|
||||
find_package(LLVM QUIET COMPONENTS CONFIG)
|
||||
if (LLVM_FOUND)
|
||||
separate_arguments(LLVM_DEFINITIONS)
|
||||
if (LLVMDemangle IN_LIST LLVM_AVAILABLE_LIBS)
|
||||
set(LLVM_Demangle_FOUND TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LLVM CONFIG_MODE)
|
||||
find_package_handle_standard_args(LLVM HANDLE_COMPONENTS CONFIG_MODE)
|
||||
|
||||
if (LLVM_FOUND AND NOT TARGET LLVM::Demangle)
|
||||
if (LLVM_FOUND AND LLVM_Demangle_FOUND AND NOT TARGET LLVM::Demangle)
|
||||
add_library(LLVM::Demangle INTERFACE IMPORTED)
|
||||
llvm_map_components_to_libnames(LLVM_LIBRARIES demangle)
|
||||
target_compile_definitions(LLVM::Demangle INTERFACE ${LLVM_DEFINITIONS})
|
||||
target_include_directories(LLVM::Demangle INTERFACE ${LLVM_INCLUDE_DIRS})
|
||||
# prefer shared LLVM: https://github.com/llvm/llvm-project/issues/34593
|
||||
# but use ugly hack because llvm_config doesn't support interface library
|
||||
add_library(_dummy_lib SHARED EXCLUDE_FROM_ALL src/yuzu/main.cpp)
|
||||
llvm_config(_dummy_lib USE_SHARED demangle)
|
||||
get_target_property(LLVM_LIBRARIES _dummy_lib LINK_LIBRARIES)
|
||||
target_link_libraries(LLVM::Demangle INTERFACE ${LLVM_LIBRARIES})
|
||||
endif()
|
||||
|
|
|
@ -6,13 +6,23 @@ include(FindPackageHandleStandardArgs)
|
|||
|
||||
find_package(httplib QUIET CONFIG)
|
||||
if (httplib_CONSIDERED_CONFIGS)
|
||||
find_package_handle_standard_args(httplib CONFIG_MODE)
|
||||
find_package_handle_standard_args(httplib HANDLE_COMPONENTS CONFIG_MODE)
|
||||
else()
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_search_module(HTTPLIB QUIET IMPORTED_TARGET cpp-httplib)
|
||||
if ("-DCPPHTTPLIB_OPENSSL_SUPPORT" IN_LIST HTTPLIB_CFLAGS_OTHER)
|
||||
set(httplib_OpenSSL_FOUND TRUE)
|
||||
endif()
|
||||
if ("-DCPPHTTPLIB_ZLIB_SUPPORT" IN_LIST HTTPLIB_CFLAGS_OTHER)
|
||||
set(httplib_ZLIB_FOUND TRUE)
|
||||
endif()
|
||||
if ("-DCPPHTTPLIB_BROTLI_SUPPORT" IN_LIST HTTPLIB_CFLAGS_OTHER)
|
||||
set(httplib_Brotli_FOUND TRUE)
|
||||
endif()
|
||||
find_package_handle_standard_args(httplib
|
||||
REQUIRED_VARS HTTPLIB_INCLUDEDIR
|
||||
VERSION_VAR HTTPLIB_VERSION
|
||||
HANDLE_COMPONENTS
|
||||
)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -3,14 +3,25 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_search_module(INIREADER QUIET IMPORTED_TARGET INIReader)
|
||||
pkg_search_module(INIH QUIET IMPORTED_TARGET inih)
|
||||
if (INIReader IN_LIST inih_FIND_COMPONENTS)
|
||||
pkg_search_module(INIREADER QUIET IMPORTED_TARGET INIReader)
|
||||
if (INIREADER_FOUND)
|
||||
set(inih_INIReader_FOUND TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(inih
|
||||
REQUIRED_VARS INIREADER_LINK_LIBRARIES
|
||||
VERSION_VAR INIREADER_VERSION
|
||||
REQUIRED_VARS INIH_LINK_LIBRARIES
|
||||
VERSION_VAR INIH_VERSION
|
||||
HANDLE_COMPONENTS
|
||||
)
|
||||
|
||||
if (inih_FOUND AND NOT TARGET inih::INIReader)
|
||||
if (inih_FOUND AND NOT TARGET inih::inih)
|
||||
add_library(inih::inih ALIAS PkgConfig::INIH)
|
||||
endif()
|
||||
|
||||
if (inih_FOUND AND inih_INIReader_FOUND AND NOT TARGET inih::INIReader)
|
||||
add_library(inih::INIReader ALIAS PkgConfig::INIREADER)
|
||||
endif()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
yuzu emulator early access
|
||||
=============
|
||||
|
||||
This is the source code for early-access 3419.
|
||||
This is the source code for early-access 3428.
|
||||
|
||||
## Legal Notice
|
||||
|
||||
|
|
741
dist/languages/ca.ts
vendored
741
dist/languages/ca.ts
vendored
File diff suppressed because it is too large
Load diff
743
dist/languages/cs.ts
vendored
743
dist/languages/cs.ts
vendored
File diff suppressed because it is too large
Load diff
739
dist/languages/da.ts
vendored
739
dist/languages/da.ts
vendored
File diff suppressed because it is too large
Load diff
741
dist/languages/de.ts
vendored
741
dist/languages/de.ts
vendored
File diff suppressed because it is too large
Load diff
741
dist/languages/el.ts
vendored
741
dist/languages/el.ts
vendored
File diff suppressed because it is too large
Load diff
741
dist/languages/es.ts
vendored
741
dist/languages/es.ts
vendored
File diff suppressed because it is too large
Load diff
849
dist/languages/fr.ts
vendored
849
dist/languages/fr.ts
vendored
File diff suppressed because it is too large
Load diff
739
dist/languages/id.ts
vendored
739
dist/languages/id.ts
vendored
File diff suppressed because it is too large
Load diff
815
dist/languages/it.ts
vendored
815
dist/languages/it.ts
vendored
File diff suppressed because it is too large
Load diff
882
dist/languages/ja_JP.ts
vendored
882
dist/languages/ja_JP.ts
vendored
File diff suppressed because it is too large
Load diff
741
dist/languages/ko_KR.ts
vendored
741
dist/languages/ko_KR.ts
vendored
File diff suppressed because it is too large
Load diff
741
dist/languages/nb.ts
vendored
741
dist/languages/nb.ts
vendored
File diff suppressed because it is too large
Load diff
743
dist/languages/nl.ts
vendored
743
dist/languages/nl.ts
vendored
File diff suppressed because it is too large
Load diff
741
dist/languages/pl.ts
vendored
741
dist/languages/pl.ts
vendored
File diff suppressed because it is too large
Load diff
1171
dist/languages/pt_BR.ts
vendored
1171
dist/languages/pt_BR.ts
vendored
File diff suppressed because it is too large
Load diff
1171
dist/languages/pt_PT.ts
vendored
1171
dist/languages/pt_PT.ts
vendored
File diff suppressed because it is too large
Load diff
841
dist/languages/ru_RU.ts
vendored
841
dist/languages/ru_RU.ts
vendored
File diff suppressed because it is too large
Load diff
745
dist/languages/sv.ts
vendored
745
dist/languages/sv.ts
vendored
File diff suppressed because it is too large
Load diff
741
dist/languages/tr_TR.ts
vendored
741
dist/languages/tr_TR.ts
vendored
File diff suppressed because it is too large
Load diff
805
dist/languages/uk.ts
vendored
805
dist/languages/uk.ts
vendored
File diff suppressed because it is too large
Load diff
749
dist/languages/zh_CN.ts
vendored
749
dist/languages/zh_CN.ts
vendored
File diff suppressed because it is too large
Load diff
741
dist/languages/zh_TW.ts
vendored
741
dist/languages/zh_TW.ts
vendored
File diff suppressed because it is too large
Load diff
35
externals/CMakeLists.txt
vendored
35
externals/CMakeLists.txt
vendored
|
@ -100,41 +100,18 @@ endif()
|
|||
# Sirit
|
||||
add_subdirectory(sirit EXCLUDE_FROM_ALL)
|
||||
|
||||
# LibreSSL
|
||||
if (ENABLE_WEB_SERVICE AND DEFINED OPENSSL_FOUND)
|
||||
if (WIN32 OR NOT OPENSSL_FOUND)
|
||||
set(LIBRESSL_SKIP_INSTALL ON)
|
||||
set(OPENSSLDIR "/etc/ssl/")
|
||||
add_subdirectory(libressl EXCLUDE_FROM_ALL)
|
||||
target_include_directories(ssl INTERFACE ./libressl/include)
|
||||
target_compile_definitions(ssl PRIVATE -DHAVE_INET_NTOP)
|
||||
get_directory_property(OPENSSL_LIBRARIES
|
||||
DIRECTORY libressl
|
||||
DEFINITION OPENSSL_LIBS)
|
||||
else()
|
||||
set(OPENSSL_LIBRARIES OpenSSL::SSL OpenSSL::Crypto)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# httplib
|
||||
if (ENABLE_WEB_SERVICE AND NOT TARGET httplib::httplib)
|
||||
add_library(httplib INTERFACE)
|
||||
target_include_directories(httplib INTERFACE ./cpp-httplib)
|
||||
target_compile_definitions(httplib INTERFACE -DCPPHTTPLIB_OPENSSL_SUPPORT)
|
||||
target_link_libraries(httplib INTERFACE ${OPENSSL_LIBRARIES})
|
||||
if (WIN32)
|
||||
target_link_libraries(httplib INTERFACE crypt32 cryptui ws2_32)
|
||||
endif()
|
||||
add_library(httplib::httplib ALIAS httplib)
|
||||
set(HTTPLIB_REQUIRE_OPENSSL ON)
|
||||
add_subdirectory(cpp-httplib EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
# cpp-jwt
|
||||
if (ENABLE_WEB_SERVICE AND NOT TARGET cpp-jwt::cpp-jwt)
|
||||
add_library(cpp-jwt INTERFACE)
|
||||
target_include_directories(cpp-jwt INTERFACE ./cpp-jwt/include)
|
||||
target_compile_definitions(cpp-jwt INTERFACE CPP_JWT_USE_VENDORED_NLOHMANN_JSON)
|
||||
target_link_libraries(cpp-jwt INTERFACE ${OPENSSL_LIBRARIES})
|
||||
add_library(cpp-jwt::cpp-jwt ALIAS cpp-jwt)
|
||||
set(CPP_JWT_BUILD_EXAMPLES OFF)
|
||||
set(CPP_JWT_BUILD_TESTS OFF)
|
||||
set(CPP_JWT_USE_VENDORED_NLOHMANN_JSON OFF)
|
||||
add_subdirectory(cpp-jwt EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
# Opus
|
||||
|
|
|
@ -176,7 +176,7 @@ endif()
|
|||
|
||||
create_target_directory_groups(common)
|
||||
|
||||
target_link_libraries(common PUBLIC ${Boost_LIBRARIES} fmt::fmt microprofile Threads::Threads)
|
||||
target_link_libraries(common PUBLIC Boost::context Boost::headers fmt::fmt microprofile Threads::Threads)
|
||||
target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd LLVM::Demangle)
|
||||
|
||||
if (YUZU_USE_PRECOMPILED_HEADERS)
|
||||
|
|
|
@ -834,7 +834,7 @@ endif()
|
|||
create_target_directory_groups(core)
|
||||
|
||||
target_link_libraries(core PUBLIC common PRIVATE audio_core network video_core)
|
||||
target_link_libraries(core PUBLIC Boost::boost PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls Opus::opus)
|
||||
target_link_libraries(core PUBLIC Boost::headers PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls Opus::opus)
|
||||
if (MINGW)
|
||||
target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY})
|
||||
endif()
|
||||
|
@ -863,3 +863,7 @@ endif()
|
|||
if (YUZU_USE_PRECOMPILED_HEADERS)
|
||||
target_precompile_headers(core PRIVATE precompiled_headers.h)
|
||||
endif()
|
||||
|
||||
if (YUZU_ENABLE_LTO)
|
||||
set_property(TARGET core PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||
endif()
|
||||
|
|
|
@ -1265,9 +1265,8 @@ void ILibraryAppletCreator::CreateTransferMemoryStorage(Kernel::HLERequestContex
|
|||
return;
|
||||
}
|
||||
|
||||
const u8* const mem_begin = system.Memory().GetPointer(transfer_mem->GetSourceAddress());
|
||||
const u8* const mem_end = mem_begin + transfer_mem->GetSize();
|
||||
std::vector<u8> memory{mem_begin, mem_end};
|
||||
std::vector<u8> memory(transfer_mem->GetSize());
|
||||
system.Memory().ReadBlock(transfer_mem->GetSourceAddress(), memory.data(), memory.size());
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
|
@ -1299,9 +1298,8 @@ void ILibraryAppletCreator::CreateHandleStorage(Kernel::HLERequestContext& ctx)
|
|||
return;
|
||||
}
|
||||
|
||||
const u8* const mem_begin = system.Memory().GetPointer(transfer_mem->GetSourceAddress());
|
||||
const u8* const mem_end = mem_begin + transfer_mem->GetSize();
|
||||
std::vector<u8> memory{mem_begin, mem_end};
|
||||
std::vector<u8> memory(transfer_mem->GetSize());
|
||||
system.Memory().ReadBlock(transfer_mem->GetSourceAddress(), memory.data(), memory.size());
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
|
|
|
@ -73,32 +73,36 @@ private:
|
|||
void AcquireBleScanEvent(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
IPC::ResponseBuilder rb{ctx, 3, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(true);
|
||||
rb.PushCopyObjects(scan_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void AcquireBleConnectionEvent(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
IPC::ResponseBuilder rb{ctx, 3, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(true);
|
||||
rb.PushCopyObjects(connection_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void AcquireBleServiceDiscoveryEvent(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
IPC::ResponseBuilder rb{ctx, 3, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(true);
|
||||
rb.PushCopyObjects(service_discovery_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void AcquireBleMtuConfigEvent(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
IPC::ResponseBuilder rb{ctx, 3, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(true);
|
||||
rb.PushCopyObjects(config_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/hid/emulated_console.h"
|
||||
#include "core/hid/hid_core.h"
|
||||
#include "core/hle/service/hid/controllers/console_sixaxis.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
namespace Service::HID {
|
||||
constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3C200;
|
||||
|
||||
Controller_ConsoleSixAxis::Controller_ConsoleSixAxis(Core::HID::HIDCore& hid_core_,
|
||||
u8* raw_shared_memory_)
|
||||
: ControllerBase{hid_core_} {
|
||||
Controller_ConsoleSixAxis::Controller_ConsoleSixAxis(Core::System& system_, u8* raw_shared_memory_)
|
||||
: ControllerBase{system_.HIDCore()}, system{system_} {
|
||||
console = hid_core.GetEmulatedConsole();
|
||||
static_assert(SHARED_MEMORY_OFFSET + sizeof(ConsoleSharedMemory) < shared_memory_size,
|
||||
"ConsoleSharedMemory is bigger than the shared memory");
|
||||
|
@ -26,7 +27,7 @@ void Controller_ConsoleSixAxis::OnInit() {}
|
|||
void Controller_ConsoleSixAxis::OnRelease() {}
|
||||
|
||||
void Controller_ConsoleSixAxis::OnUpdate(const Core::Timing::CoreTiming& core_timing) {
|
||||
if (!IsControllerActivated() || !is_transfer_memory_set) {
|
||||
if (!IsControllerActivated() || transfer_memory == 0) {
|
||||
seven_sixaxis_lifo.buffer_count = 0;
|
||||
seven_sixaxis_lifo.buffer_tail = 0;
|
||||
return;
|
||||
|
@ -59,11 +60,10 @@ void Controller_ConsoleSixAxis::OnUpdate(const Core::Timing::CoreTiming& core_ti
|
|||
|
||||
// Update seven six axis transfer memory
|
||||
seven_sixaxis_lifo.WriteNextEntry(next_seven_sixaxis_state);
|
||||
std::memcpy(transfer_memory, &seven_sixaxis_lifo, sizeof(seven_sixaxis_lifo));
|
||||
system.Memory().WriteBlock(transfer_memory, &seven_sixaxis_lifo, sizeof(seven_sixaxis_lifo));
|
||||
}
|
||||
|
||||
void Controller_ConsoleSixAxis::SetTransferMemoryPointer(u8* t_mem) {
|
||||
is_transfer_memory_set = true;
|
||||
void Controller_ConsoleSixAxis::SetTransferMemoryAddress(VAddr t_mem) {
|
||||
transfer_memory = t_mem;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,10 @@
|
|||
#include "core/hle/service/hid/controllers/controller_base.h"
|
||||
#include "core/hle/service/hid/ring_lifo.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
} // namespace Core
|
||||
|
||||
namespace Core::HID {
|
||||
class EmulatedConsole;
|
||||
} // namespace Core::HID
|
||||
|
@ -17,7 +21,7 @@ class EmulatedConsole;
|
|||
namespace Service::HID {
|
||||
class Controller_ConsoleSixAxis final : public ControllerBase {
|
||||
public:
|
||||
explicit Controller_ConsoleSixAxis(Core::HID::HIDCore& hid_core_, u8* raw_shared_memory_);
|
||||
explicit Controller_ConsoleSixAxis(Core::System& system_, u8* raw_shared_memory_);
|
||||
~Controller_ConsoleSixAxis() override;
|
||||
|
||||
// Called when the controller is initialized
|
||||
|
@ -30,7 +34,7 @@ public:
|
|||
void OnUpdate(const Core::Timing::CoreTiming& core_timing) override;
|
||||
|
||||
// Called on InitializeSevenSixAxisSensor
|
||||
void SetTransferMemoryPointer(u8* t_mem);
|
||||
void SetTransferMemoryAddress(VAddr t_mem);
|
||||
|
||||
// Called on ResetSevenSixAxisSensorTimestamp
|
||||
void ResetTimestamp();
|
||||
|
@ -62,12 +66,13 @@ private:
|
|||
static_assert(sizeof(seven_sixaxis_lifo) == 0xA70, "SevenSixAxisState is an invalid size");
|
||||
|
||||
SevenSixAxisState next_seven_sixaxis_state{};
|
||||
u8* transfer_memory = nullptr;
|
||||
VAddr transfer_memory{};
|
||||
ConsoleSharedMemory* shared_memory = nullptr;
|
||||
Core::HID::EmulatedConsole* console = nullptr;
|
||||
|
||||
bool is_transfer_memory_set = false;
|
||||
u64 last_saved_timestamp{};
|
||||
u64 last_global_timestamp{};
|
||||
|
||||
Core::System& system;
|
||||
};
|
||||
} // namespace Service::HID
|
||||
|
|
|
@ -152,7 +152,7 @@ Result Controller_Palma::WritePalmaRgbLedPatternEntry(const PalmaConnectionHandl
|
|||
}
|
||||
|
||||
Result Controller_Palma::WritePalmaWaveEntry(const PalmaConnectionHandle& handle, PalmaWaveSet wave,
|
||||
u8* t_mem, u64 size) {
|
||||
VAddr t_mem, u64 size) {
|
||||
if (handle.npad_id != active_handle.npad_id) {
|
||||
return InvalidPalmaHandle;
|
||||
}
|
||||
|
|
|
@ -125,7 +125,7 @@ public:
|
|||
Result ReadPalmaUniqueCode(const PalmaConnectionHandle& handle);
|
||||
Result SetPalmaUniqueCodeInvalid(const PalmaConnectionHandle& handle);
|
||||
Result WritePalmaRgbLedPatternEntry(const PalmaConnectionHandle& handle, u64 unknown);
|
||||
Result WritePalmaWaveEntry(const PalmaConnectionHandle& handle, PalmaWaveSet wave, u8* t_mem,
|
||||
Result WritePalmaWaveEntry(const PalmaConnectionHandle& handle, PalmaWaveSet wave, VAddr t_mem,
|
||||
u64 size);
|
||||
Result SetPalmaDataBaseIdentificationVersion(const PalmaConnectionHandle& handle,
|
||||
s32 database_id_version_);
|
||||
|
|
|
@ -1862,7 +1862,7 @@ void Hid::InitializeSevenSixAxisSensor(Kernel::HLERequestContext& ctx) {
|
|||
.ActivateController();
|
||||
|
||||
applet_resource->GetController<Controller_ConsoleSixAxis>(HidController::ConsoleSixAxisSensor)
|
||||
.SetTransferMemoryPointer(system.Memory().GetPointer(t_mem_1->GetSourceAddress()));
|
||||
.SetTransferMemoryAddress(t_mem_1->GetSourceAddress());
|
||||
|
||||
LOG_WARNING(Service_HID,
|
||||
"called, t_mem_1_handle=0x{:08X}, t_mem_2_handle=0x{:08X}, "
|
||||
|
@ -2149,8 +2149,7 @@ void Hid::WritePalmaWaveEntry(Kernel::HLERequestContext& ctx) {
|
|||
connection_handle.npad_id, wave_set, unknown, t_mem_handle, t_mem_size, size);
|
||||
|
||||
applet_resource->GetController<Controller_Palma>(HidController::Palma)
|
||||
.WritePalmaWaveEntry(connection_handle, wave_set,
|
||||
system.Memory().GetPointer(t_mem->GetSourceAddress()), t_mem_size);
|
||||
.WritePalmaWaveEntry(connection_handle, wave_set, t_mem->GetSourceAddress(), t_mem_size);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
|
|
|
@ -61,9 +61,15 @@ public:
|
|||
private:
|
||||
template <typename T>
|
||||
void MakeController(HidController controller, u8* shared_memory) {
|
||||
controllers[static_cast<std::size_t>(controller)] =
|
||||
std::make_unique<T>(system.HIDCore(), shared_memory);
|
||||
if constexpr (std::is_constructible_v<T, Core::System&, u8*>) {
|
||||
controllers[static_cast<std::size_t>(controller)] =
|
||||
std::make_unique<T>(system, shared_memory);
|
||||
} else {
|
||||
controllers[static_cast<std::size_t>(controller)] =
|
||||
std::make_unique<T>(system.HIDCore(), shared_memory);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void MakeControllerWithServiceContext(HidController controller, u8* shared_memory) {
|
||||
controllers[static_cast<std::size_t>(controller)] =
|
||||
|
|
|
@ -472,7 +472,7 @@ void HidBus::EnableJoyPollingReceiveMode(Kernel::HLERequestContext& ctx) {
|
|||
if (device_index) {
|
||||
auto& device = devices[device_index.value()].device;
|
||||
device->SetPollingMode(polling_mode_);
|
||||
device->SetTransferMemoryPointer(system.Memory().GetPointer(t_mem->GetSourceAddress()));
|
||||
device->SetTransferMemoryAddress(t_mem->GetSourceAddress());
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
|
|
|
@ -115,8 +115,7 @@ private:
|
|||
void MakeDevice(BusHandle handle) {
|
||||
const auto device_index = GetDeviceIndexFromHandle(handle);
|
||||
if (device_index) {
|
||||
devices[device_index.value()].device =
|
||||
std::make_unique<T>(system.HIDCore(), service_context);
|
||||
devices[device_index.value()].device = std::make_unique<T>(system, service_context);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
|
||||
namespace Service::HID {
|
||||
|
||||
HidbusBase::HidbusBase(KernelHelpers::ServiceContext& service_context_)
|
||||
: service_context(service_context_) {
|
||||
HidbusBase::HidbusBase(Core::System& system_, KernelHelpers::ServiceContext& service_context_)
|
||||
: system(system_), service_context(service_context_) {
|
||||
send_command_async_event = service_context.CreateEvent("hidbus:SendCommandAsyncEvent");
|
||||
}
|
||||
HidbusBase::~HidbusBase() = default;
|
||||
|
@ -59,8 +59,7 @@ void HidbusBase::DisablePollingMode() {
|
|||
polling_mode_enabled = false;
|
||||
}
|
||||
|
||||
void HidbusBase::SetTransferMemoryPointer(u8* t_mem) {
|
||||
is_transfer_memory_set = true;
|
||||
void HidbusBase::SetTransferMemoryAddress(VAddr t_mem) {
|
||||
transfer_memory = t_mem;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,10 @@
|
|||
#include "common/common_types.h"
|
||||
#include "core/hle/result.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class KEvent;
|
||||
class KReadableEvent;
|
||||
|
@ -106,7 +110,7 @@ static_assert(sizeof(ButtonOnlyPollingDataAccessor) == 0x2F0,
|
|||
|
||||
class HidbusBase {
|
||||
public:
|
||||
explicit HidbusBase(KernelHelpers::ServiceContext& service_context_);
|
||||
explicit HidbusBase(Core::System& system_, KernelHelpers::ServiceContext& service_context_);
|
||||
virtual ~HidbusBase();
|
||||
|
||||
void ActivateDevice();
|
||||
|
@ -134,7 +138,7 @@ public:
|
|||
void DisablePollingMode();
|
||||
|
||||
// Called on EnableJoyPollingReceiveMode
|
||||
void SetTransferMemoryPointer(u8* t_mem);
|
||||
void SetTransferMemoryAddress(VAddr t_mem);
|
||||
|
||||
Kernel::KReadableEvent& GetSendCommandAsycEvent() const;
|
||||
|
||||
|
@ -170,9 +174,9 @@ protected:
|
|||
JoyEnableSixAxisDataAccessor enable_sixaxis_data{};
|
||||
ButtonOnlyPollingDataAccessor button_only_data{};
|
||||
|
||||
u8* transfer_memory{nullptr};
|
||||
bool is_transfer_memory_set{};
|
||||
VAddr transfer_memory{};
|
||||
|
||||
Core::System& system;
|
||||
Kernel::KEvent* send_command_async_event;
|
||||
KernelHelpers::ServiceContext& service_context;
|
||||
};
|
||||
|
|
|
@ -1,18 +1,20 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hid/emulated_controller.h"
|
||||
#include "core/hid/hid_core.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/kernel/k_readable_event.h"
|
||||
#include "core/hle/service/hid/hidbus/ringcon.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
namespace Service::HID {
|
||||
|
||||
RingController::RingController(Core::HID::HIDCore& hid_core_,
|
||||
RingController::RingController(Core::System& system_,
|
||||
KernelHelpers::ServiceContext& service_context_)
|
||||
: HidbusBase(service_context_) {
|
||||
input = hid_core_.GetEmulatedController(Core::HID::NpadIdType::Player1);
|
||||
: HidbusBase(system_, service_context_) {
|
||||
input = system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Player1);
|
||||
}
|
||||
|
||||
RingController::~RingController() = default;
|
||||
|
@ -38,7 +40,7 @@ void RingController::OnUpdate() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!polling_mode_enabled || !is_transfer_memory_set) {
|
||||
if (!polling_mode_enabled || transfer_memory == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -62,7 +64,8 @@ void RingController::OnUpdate() {
|
|||
curr_entry.polling_data.out_size = sizeof(ringcon_value);
|
||||
std::memcpy(curr_entry.polling_data.data.data(), &ringcon_value, sizeof(ringcon_value));
|
||||
|
||||
std::memcpy(transfer_memory, &enable_sixaxis_data, sizeof(enable_sixaxis_data));
|
||||
system.Memory().WriteBlock(transfer_memory, &enable_sixaxis_data,
|
||||
sizeof(enable_sixaxis_data));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -17,8 +17,7 @@ namespace Service::HID {
|
|||
|
||||
class RingController final : public HidbusBase {
|
||||
public:
|
||||
explicit RingController(Core::HID::HIDCore& hid_core_,
|
||||
KernelHelpers::ServiceContext& service_context_);
|
||||
explicit RingController(Core::System& system_, KernelHelpers::ServiceContext& service_context_);
|
||||
~RingController() override;
|
||||
|
||||
void OnInit() override;
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
namespace Service::HID {
|
||||
constexpr u8 DEVICE_ID = 0x28;
|
||||
|
||||
Starlink::Starlink(Core::HID::HIDCore& hid_core_, KernelHelpers::ServiceContext& service_context_)
|
||||
: HidbusBase(service_context_) {}
|
||||
Starlink::Starlink(Core::System& system_, KernelHelpers::ServiceContext& service_context_)
|
||||
: HidbusBase(system_, service_context_) {}
|
||||
Starlink::~Starlink() = default;
|
||||
|
||||
void Starlink::OnInit() {
|
||||
|
@ -27,7 +27,7 @@ void Starlink::OnUpdate() {
|
|||
if (!device_enabled) {
|
||||
return;
|
||||
}
|
||||
if (!polling_mode_enabled || !is_transfer_memory_set) {
|
||||
if (!polling_mode_enabled || transfer_memory == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,8 +14,7 @@ namespace Service::HID {
|
|||
|
||||
class Starlink final : public HidbusBase {
|
||||
public:
|
||||
explicit Starlink(Core::HID::HIDCore& hid_core_,
|
||||
KernelHelpers::ServiceContext& service_context_);
|
||||
explicit Starlink(Core::System& system_, KernelHelpers::ServiceContext& service_context_);
|
||||
~Starlink() override;
|
||||
|
||||
void OnInit() override;
|
||||
|
|
|
@ -8,9 +8,8 @@
|
|||
namespace Service::HID {
|
||||
constexpr u8 DEVICE_ID = 0xFF;
|
||||
|
||||
HidbusStubbed::HidbusStubbed(Core::HID::HIDCore& hid_core_,
|
||||
KernelHelpers::ServiceContext& service_context_)
|
||||
: HidbusBase(service_context_) {}
|
||||
HidbusStubbed::HidbusStubbed(Core::System& system_, KernelHelpers::ServiceContext& service_context_)
|
||||
: HidbusBase(system_, service_context_) {}
|
||||
HidbusStubbed::~HidbusStubbed() = default;
|
||||
|
||||
void HidbusStubbed::OnInit() {
|
||||
|
@ -28,7 +27,7 @@ void HidbusStubbed::OnUpdate() {
|
|||
if (!device_enabled) {
|
||||
return;
|
||||
}
|
||||
if (!polling_mode_enabled || !is_transfer_memory_set) {
|
||||
if (!polling_mode_enabled || transfer_memory == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,8 +14,7 @@ namespace Service::HID {
|
|||
|
||||
class HidbusStubbed final : public HidbusBase {
|
||||
public:
|
||||
explicit HidbusStubbed(Core::HID::HIDCore& hid_core_,
|
||||
KernelHelpers::ServiceContext& service_context_);
|
||||
explicit HidbusStubbed(Core::System& system_, KernelHelpers::ServiceContext& service_context_);
|
||||
~HidbusStubbed() override;
|
||||
|
||||
void OnInit() override;
|
||||
|
|
|
@ -208,8 +208,6 @@ void IRS::RunImageTransferProcessor(Kernel::HLERequestContext& ctx) {
|
|||
|
||||
ASSERT_MSG(t_mem->GetSize() == parameters.transfer_memory_size, "t_mem has incorrect size");
|
||||
|
||||
u8* transfer_memory = system.Memory().GetPointer(t_mem->GetSourceAddress());
|
||||
|
||||
LOG_INFO(Service_IRS,
|
||||
"called, npad_type={}, npad_id={}, transfer_memory_size={}, transfer_memory_size={}, "
|
||||
"applet_resource_user_id={}",
|
||||
|
@ -224,7 +222,7 @@ void IRS::RunImageTransferProcessor(Kernel::HLERequestContext& ctx) {
|
|||
auto& image_transfer_processor =
|
||||
GetProcessor<ImageTransferProcessor>(parameters.camera_handle);
|
||||
image_transfer_processor.SetConfig(parameters.processor_config);
|
||||
image_transfer_processor.SetTransferMemoryPointer(transfer_memory);
|
||||
image_transfer_processor.SetTransferMemoryAddress(t_mem->GetSourceAddress());
|
||||
npad_device->SetPollingMode(Core::HID::EmulatedDeviceIndex::RightIndex,
|
||||
Common::Input::PollingMode::IR);
|
||||
}
|
||||
|
@ -448,8 +446,6 @@ void IRS::RunImageTransferExProcessor(Kernel::HLERequestContext& ctx) {
|
|||
auto t_mem = system.ApplicationProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>(
|
||||
t_mem_handle);
|
||||
|
||||
u8* transfer_memory = system.Memory().GetPointer(t_mem->GetSourceAddress());
|
||||
|
||||
LOG_INFO(Service_IRS,
|
||||
"called, npad_type={}, npad_id={}, transfer_memory_size={}, "
|
||||
"applet_resource_user_id={}",
|
||||
|
@ -464,7 +460,7 @@ void IRS::RunImageTransferExProcessor(Kernel::HLERequestContext& ctx) {
|
|||
auto& image_transfer_processor =
|
||||
GetProcessor<ImageTransferProcessor>(parameters.camera_handle);
|
||||
image_transfer_processor.SetConfig(parameters.processor_config);
|
||||
image_transfer_processor.SetTransferMemoryPointer(transfer_memory);
|
||||
image_transfer_processor.SetTransferMemoryAddress(t_mem->GetSourceAddress());
|
||||
npad_device->SetPollingMode(Core::HID::EmulatedDeviceIndex::RightIndex,
|
||||
Common::Input::PollingMode::IR);
|
||||
}
|
||||
|
|
|
@ -80,7 +80,13 @@ private:
|
|||
LOG_CRITICAL(Service_IRS, "Invalid index {}", index);
|
||||
return;
|
||||
}
|
||||
processors[index] = std::make_unique<T>(system.HIDCore(), device_state, index);
|
||||
|
||||
if constexpr (std::is_constructible_v<T, Core::System&, Core::IrSensor::DeviceFormat&,
|
||||
std::size_t>) {
|
||||
processors[index] = std::make_unique<T>(system, device_state, index);
|
||||
} else {
|
||||
processors[index] = std::make_unique<T>(system.HIDCore(), device_state, index);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hid/emulated_controller.h"
|
||||
#include "core/hid/hid_core.h"
|
||||
#include "core/hle/service/hid/irsensor/image_transfer_processor.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
namespace Service::IRS {
|
||||
ImageTransferProcessor::ImageTransferProcessor(Core::HID::HIDCore& hid_core_,
|
||||
ImageTransferProcessor::ImageTransferProcessor(Core::System& system_,
|
||||
Core::IrSensor::DeviceFormat& device_format,
|
||||
std::size_t npad_index)
|
||||
: device{device_format} {
|
||||
npad_device = hid_core_.GetEmulatedControllerByIndex(npad_index);
|
||||
: device{device_format}, system{system_} {
|
||||
npad_device = system.HIDCore().GetEmulatedControllerByIndex(npad_index);
|
||||
|
||||
Core::HID::ControllerUpdateCallback engine_callback{
|
||||
.on_change = [this](Core::HID::ControllerTriggerType type) { OnControllerUpdate(type); },
|
||||
|
@ -43,7 +45,7 @@ void ImageTransferProcessor::OnControllerUpdate(Core::HID::ControllerTriggerType
|
|||
if (type != Core::HID::ControllerTriggerType::IrSensor) {
|
||||
return;
|
||||
}
|
||||
if (!is_transfer_memory_set) {
|
||||
if (transfer_memory == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -56,14 +58,16 @@ void ImageTransferProcessor::OnControllerUpdate(Core::HID::ControllerTriggerType
|
|||
if (camera_data.format != current_config.origin_format) {
|
||||
LOG_WARNING(Service_IRS, "Wrong Input format {} expected {}", camera_data.format,
|
||||
current_config.origin_format);
|
||||
memset(transfer_memory, 0, GetDataSize(current_config.trimming_format));
|
||||
system.Memory().ZeroBlock(*system.ApplicationProcess(), transfer_memory,
|
||||
GetDataSize(current_config.trimming_format));
|
||||
return;
|
||||
}
|
||||
|
||||
if (current_config.origin_format > current_config.trimming_format) {
|
||||
LOG_WARNING(Service_IRS, "Origin format {} is smaller than trimming format {}",
|
||||
current_config.origin_format, current_config.trimming_format);
|
||||
memset(transfer_memory, 0, GetDataSize(current_config.trimming_format));
|
||||
system.Memory().ZeroBlock(*system.ApplicationProcess(), transfer_memory,
|
||||
GetDataSize(current_config.trimming_format));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -80,7 +84,8 @@ void ImageTransferProcessor::OnControllerUpdate(Core::HID::ControllerTriggerType
|
|||
"Trimming area ({}, {}, {}, {}) is outside of origin area ({}, {})",
|
||||
current_config.trimming_start_x, current_config.trimming_start_y,
|
||||
trimming_width, trimming_height, origin_width, origin_height);
|
||||
memset(transfer_memory, 0, GetDataSize(current_config.trimming_format));
|
||||
system.Memory().ZeroBlock(*system.ApplicationProcess(), transfer_memory,
|
||||
GetDataSize(current_config.trimming_format));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -94,7 +99,8 @@ void ImageTransferProcessor::OnControllerUpdate(Core::HID::ControllerTriggerType
|
|||
}
|
||||
}
|
||||
|
||||
memcpy(transfer_memory, window_data.data(), GetDataSize(current_config.trimming_format));
|
||||
system.Memory().WriteBlock(transfer_memory, window_data.data(),
|
||||
GetDataSize(current_config.trimming_format));
|
||||
|
||||
if (!IsProcessorActive()) {
|
||||
StartProcessor();
|
||||
|
@ -134,8 +140,7 @@ void ImageTransferProcessor::SetConfig(
|
|||
npad_device->SetCameraFormat(current_config.origin_format);
|
||||
}
|
||||
|
||||
void ImageTransferProcessor::SetTransferMemoryPointer(u8* t_mem) {
|
||||
is_transfer_memory_set = true;
|
||||
void ImageTransferProcessor::SetTransferMemoryAddress(VAddr t_mem) {
|
||||
transfer_memory = t_mem;
|
||||
}
|
||||
|
||||
|
@ -143,7 +148,7 @@ Core::IrSensor::ImageTransferProcessorState ImageTransferProcessor::GetState(
|
|||
std::vector<u8>& data) const {
|
||||
const auto size = GetDataSize(current_config.trimming_format);
|
||||
data.resize(size);
|
||||
memcpy(data.data(), transfer_memory, size);
|
||||
system.Memory().ReadBlock(transfer_memory, data.data(), size);
|
||||
return processor_state;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,10 @@
|
|||
#include "core/hid/irs_types.h"
|
||||
#include "core/hle/service/hid/irsensor/processor_base.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Core::HID {
|
||||
class EmulatedController;
|
||||
} // namespace Core::HID
|
||||
|
@ -14,7 +18,7 @@ class EmulatedController;
|
|||
namespace Service::IRS {
|
||||
class ImageTransferProcessor final : public ProcessorBase {
|
||||
public:
|
||||
explicit ImageTransferProcessor(Core::HID::HIDCore& hid_core_,
|
||||
explicit ImageTransferProcessor(Core::System& system_,
|
||||
Core::IrSensor::DeviceFormat& device_format,
|
||||
std::size_t npad_index);
|
||||
~ImageTransferProcessor() override;
|
||||
|
@ -33,7 +37,7 @@ public:
|
|||
void SetConfig(Core::IrSensor::PackedImageTransferProcessorExConfig config);
|
||||
|
||||
// Transfer memory where the image data will be stored
|
||||
void SetTransferMemoryPointer(u8* t_mem);
|
||||
void SetTransferMemoryAddress(VAddr t_mem);
|
||||
|
||||
Core::IrSensor::ImageTransferProcessorState GetState(std::vector<u8>& data) const;
|
||||
|
||||
|
@ -67,7 +71,7 @@ private:
|
|||
Core::HID::EmulatedController* npad_device;
|
||||
int callback_key{};
|
||||
|
||||
u8* transfer_memory = nullptr;
|
||||
bool is_transfer_memory_set = false;
|
||||
Core::System& system;
|
||||
VAddr transfer_memory{};
|
||||
};
|
||||
} // namespace Service::IRS
|
||||
|
|
|
@ -89,7 +89,7 @@ if (ENABLE_LIBUSB)
|
|||
endif()
|
||||
|
||||
create_target_directory_groups(input_common)
|
||||
target_link_libraries(input_common PUBLIC core PRIVATE common Boost::boost)
|
||||
target_link_libraries(input_common PUBLIC core PRIVATE common Boost::headers)
|
||||
|
||||
if (YUZU_USE_PRECOMPILED_HEADERS)
|
||||
target_precompile_headers(input_common PRIVATE precompiled_headers.h)
|
||||
|
|
|
@ -19,7 +19,7 @@ add_library(network STATIC
|
|||
|
||||
create_target_directory_groups(network)
|
||||
|
||||
target_link_libraries(network PRIVATE common enet::enet Boost::boost)
|
||||
target_link_libraries(network PRIVATE common enet::enet Boost::headers)
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(network PRIVATE -DENABLE_WEB_SERVICE)
|
||||
target_link_libraries(network PRIVATE web_service)
|
||||
|
|
|
@ -35,6 +35,7 @@ struct Bias {
|
|||
u32 index;
|
||||
u32 offset_begin;
|
||||
u32 offset_end;
|
||||
u32 alignment;
|
||||
};
|
||||
|
||||
using boost::container::flat_set;
|
||||
|
@ -349,7 +350,8 @@ std::optional<StorageBufferAddr> Track(const IR::Value& value, const Bias* bias)
|
|||
.index = index.U32(),
|
||||
.offset = offset.U32(),
|
||||
};
|
||||
if (!Common::IsAligned(storage_buffer.offset, 16)) {
|
||||
const u32 alignment{bias ? bias->alignment : 8U};
|
||||
if (!Common::IsAligned(storage_buffer.offset, alignment)) {
|
||||
// The SSBO pointer has to be aligned
|
||||
return std::nullopt;
|
||||
}
|
||||
|
@ -371,6 +373,7 @@ void CollectStorageBuffers(IR::Block& block, IR::Inst& inst, StorageInfo& info)
|
|||
.index = 0,
|
||||
.offset_begin = 0x110,
|
||||
.offset_end = 0x610,
|
||||
.alignment = 16,
|
||||
};
|
||||
// Track the low address of the instruction
|
||||
const std::optional<LowAddrInfo> low_addr_info{TrackLowAddress(&inst)};
|
||||
|
@ -386,8 +389,11 @@ void CollectStorageBuffers(IR::Block& block, IR::Inst& inst, StorageInfo& info)
|
|||
storage_buffer = Track(low_addr, nullptr);
|
||||
if (!storage_buffer) {
|
||||
// If that also fails, use NVN fallbacks
|
||||
LOG_WARNING(Shader, "Storage buffer failed to track, using global memory fallbacks");
|
||||
return;
|
||||
}
|
||||
LOG_WARNING(Shader, "Storage buffer tracked without bias, index {} offset {}",
|
||||
storage_buffer->index, storage_buffer->offset);
|
||||
}
|
||||
// Collect storage buffer and the instruction
|
||||
if (IsGlobalMemoryWrite(inst)) {
|
||||
|
|
|
@ -330,3 +330,7 @@ endif()
|
|||
if (YUZU_USE_PRECOMPILED_HEADERS)
|
||||
target_precompile_headers(video_core PRIVATE precompiled_headers.h)
|
||||
endif()
|
||||
|
||||
if (YUZU_ENABLE_LTO)
|
||||
set_property(TARGET video_core PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||
endif()
|
||||
|
|
|
@ -383,7 +383,8 @@ private:
|
|||
|
||||
void NotifyBufferDeletion();
|
||||
|
||||
[[nodiscard]] Binding StorageBufferBinding(GPUVAddr ssbo_addr, bool is_written = false) const;
|
||||
[[nodiscard]] Binding StorageBufferBinding(GPUVAddr ssbo_addr, u32 cbuf_index,
|
||||
bool is_written = false) const;
|
||||
|
||||
[[nodiscard]] TextureBufferBinding GetTextureBufferBinding(GPUVAddr gpu_addr, u32 size,
|
||||
PixelFormat format);
|
||||
|
@ -802,7 +803,7 @@ void BufferCache<P>::BindGraphicsStorageBuffer(size_t stage, size_t ssbo_index,
|
|||
|
||||
const auto& cbufs = maxwell3d->state.shader_stages[stage];
|
||||
const GPUVAddr ssbo_addr = cbufs.const_buffers[cbuf_index].address + cbuf_offset;
|
||||
storage_buffers[stage][ssbo_index] = StorageBufferBinding(ssbo_addr, is_written);
|
||||
storage_buffers[stage][ssbo_index] = StorageBufferBinding(ssbo_addr, cbuf_index, is_written);
|
||||
}
|
||||
|
||||
template <class P>
|
||||
|
@ -842,7 +843,7 @@ void BufferCache<P>::BindComputeStorageBuffer(size_t ssbo_index, u32 cbuf_index,
|
|||
|
||||
const auto& cbufs = launch_desc.const_buffer_config;
|
||||
const GPUVAddr ssbo_addr = cbufs[cbuf_index].Address() + cbuf_offset;
|
||||
compute_storage_buffers[ssbo_index] = StorageBufferBinding(ssbo_addr, is_written);
|
||||
compute_storage_buffers[ssbo_index] = StorageBufferBinding(ssbo_addr, cbuf_index, is_written);
|
||||
}
|
||||
|
||||
template <class P>
|
||||
|
@ -1988,11 +1989,26 @@ void BufferCache<P>::NotifyBufferDeletion() {
|
|||
|
||||
template <class P>
|
||||
typename BufferCache<P>::Binding BufferCache<P>::StorageBufferBinding(GPUVAddr ssbo_addr,
|
||||
u32 cbuf_index,
|
||||
bool is_written) const {
|
||||
const GPUVAddr gpu_addr = gpu_memory->Read<u64>(ssbo_addr);
|
||||
const u32 size = gpu_memory->Read<u32>(ssbo_addr + 8);
|
||||
const auto size = [&]() {
|
||||
const bool is_nvn_cbuf = cbuf_index == 0;
|
||||
// The NVN driver buffer (index 0) is known to pack the SSBO address followed by its size.
|
||||
if (is_nvn_cbuf) {
|
||||
return gpu_memory->Read<u32>(ssbo_addr + 8);
|
||||
}
|
||||
// Other titles (notably Doom Eternal) may use STG/LDG on buffer addresses in custom defined
|
||||
// cbufs, which do not store the sizes adjacent to the addresses, so use the fully
|
||||
// mapped buffer size for now.
|
||||
const u32 memory_layout_size = static_cast<u32>(gpu_memory->GetMemoryLayoutSize(gpu_addr));
|
||||
LOG_INFO(HW_GPU, "Binding storage buffer for cbuf index {}, MemoryLayoutSize 0x{:X}",
|
||||
cbuf_index, memory_layout_size);
|
||||
return memory_layout_size;
|
||||
}();
|
||||
const std::optional<VAddr> cpu_addr = gpu_memory->GpuToCpuAddress(gpu_addr);
|
||||
if (!cpu_addr || size == 0) {
|
||||
LOG_WARNING(HW_GPU, "Failed to find storage buffer for cbuf index {}", cbuf_index);
|
||||
return NULL_BINDING;
|
||||
}
|
||||
const VAddr cpu_end = Common::AlignUp(*cpu_addr + size, Core::Memory::YUZU_PAGESIZE);
|
||||
|
|
|
@ -314,7 +314,7 @@ endif()
|
|||
create_target_directory_groups(yuzu)
|
||||
|
||||
target_link_libraries(yuzu PRIVATE common core input_common network video_core)
|
||||
target_link_libraries(yuzu PRIVATE Boost::boost glad Qt${QT_MAJOR_VERSION}::Widgets)
|
||||
target_link_libraries(yuzu PRIVATE Boost::headers glad Qt${QT_MAJOR_VERSION}::Widgets)
|
||||
target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
|
||||
|
||||
target_link_libraries(yuzu PRIVATE Vulkan::Headers)
|
||||
|
|
11
vcpkg.json
11
vcpkg.json
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
|
||||
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
|
||||
"name": "yuzu",
|
||||
"builtin-baseline": "9b22b40c6c61bf0da2d46346dd44a11e90972cc9",
|
||||
"version": "1.0",
|
||||
|
@ -35,6 +35,15 @@
|
|||
"dbghelp": {
|
||||
"description": "Compile Windows crash dump (Minidump) support",
|
||||
"dependencies": [ "dbghelp" ]
|
||||
},
|
||||
"web-service": {
|
||||
"description": "Enable web services (telemetry, etc.)",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "openssl",
|
||||
"platform": "windows"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": [
|
||||
|
|
Loading…
Reference in a new issue