Compare commits
3 Commits
android-18
...
android-18
Author | SHA1 | Date | |
---|---|---|---|
4634c092d1 | |||
8b27dd4442 | |||
797970093f |
@ -3,33 +3,38 @@
|
|||||||
# SPDX-FileCopyrightText: 2019 yuzu Emulator Project
|
# SPDX-FileCopyrightText: 2019 yuzu Emulator Project
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
shopt -s nullglob globstar
|
if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .ci* dist/*.desktop \
|
||||||
|
|
||||||
if grep -nrI '\s$' src **/*.yml **/*.txt **/*.md Doxyfile .gitignore .gitmodules .ci* dist/*.desktop \
|
|
||||||
dist/*.svg dist/*.xml; then
|
dist/*.svg dist/*.xml; then
|
||||||
echo Trailing whitespace found, aborting
|
echo Trailing whitespace found, aborting
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Default clang-format points to default 3.5 version one
|
# Default clang-format points to default 3.5 version one
|
||||||
CLANG_FORMAT="${CLANG_FORMAT:-clang-format-15}"
|
CLANG_FORMAT=${CLANG_FORMAT:-clang-format-15}
|
||||||
"$CLANG_FORMAT" --version
|
$CLANG_FORMAT --version
|
||||||
|
|
||||||
|
if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then
|
||||||
|
# Get list of every file modified in this pull request
|
||||||
|
files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' || true)"
|
||||||
|
else
|
||||||
|
# Check everything for branch pushes
|
||||||
|
files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')"
|
||||||
|
fi
|
||||||
|
|
||||||
# Turn off tracing for this because it's too verbose
|
# Turn off tracing for this because it's too verbose
|
||||||
set +x
|
set +x
|
||||||
|
|
||||||
# Check everything for branch pushes
|
for f in $files_to_lint; do
|
||||||
FILES_TO_LINT="$(find src/ -name '*.cpp' -or -name '*.h')"
|
d=$(diff -u "$f" <($CLANG_FORMAT "$f") || true)
|
||||||
|
if ! [ -z "$d" ]; then
|
||||||
for f in $FILES_TO_LINT; do
|
echo "!!! $f not compliant to coding style, here is the fix:"
|
||||||
echo "$f"
|
echo "$d"
|
||||||
"$CLANG_FORMAT" -i "$f"
|
fail=1
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
DIFF=$(git diff)
|
set -x
|
||||||
|
|
||||||
if [ ! -z "$DIFF" ]; then
|
if [ "$fail" = 1 ]; then
|
||||||
echo "!!! Not compliant to coding style, here is the fix:"
|
|
||||||
echo "$DIFF"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
| Pull Request | Commit | Title | Author | Merged? |
|
| Pull Request | Commit | Title | Author | Merged? |
|
||||||
|----|----|----|----|----|
|
|----|----|----|----|----|
|
||||||
| [12579](https://github.com/yuzu-emu/yuzu-android//pull/12579) | [`66ae60a9e`](https://github.com/yuzu-emu/yuzu-android//pull/12579/files) | Core: Implement Device Mapping & GPU SMMU | [FernandoS27](https://github.com/FernandoS27/) | Yes |
|
| [12560](https://github.com/yuzu-emu/yuzu-android//pull/12560) | [`e5de3d5a7`](https://github.com/yuzu-emu/yuzu-android//pull/12560/files) | android: add basic support for google game dashboard | [GayPotatoEmma](https://github.com/GayPotatoEmma/) | Yes |
|
||||||
|
| [12576](https://github.com/yuzu-emu/yuzu-android//pull/12576) | [`53d4dbacf`](https://github.com/yuzu-emu/yuzu-android//pull/12576/files) | android: Re-add global save manager | [t895](https://github.com/t895/) | Yes |
|
||||||
|
|
||||||
|
|
||||||
End of merge log. You can find the original README.md below the break.
|
End of merge log. You can find the original README.md below the break.
|
||||||
|
2
externals/nx_tzdb/tzdb_to_nx
vendored
2
externals/nx_tzdb/tzdb_to_nx
vendored
Submodule externals/nx_tzdb/tzdb_to_nx updated: 404d390045...f6680093bc
@ -185,7 +185,6 @@ add_subdirectory(common)
|
|||||||
add_subdirectory(core)
|
add_subdirectory(core)
|
||||||
add_subdirectory(audio_core)
|
add_subdirectory(audio_core)
|
||||||
add_subdirectory(video_core)
|
add_subdirectory(video_core)
|
||||||
add_subdirectory(hid_core)
|
|
||||||
add_subdirectory(network)
|
add_subdirectory(network)
|
||||||
add_subdirectory(input_common)
|
add_subdirectory(input_common)
|
||||||
add_subdirectory(frontend_common)
|
add_subdirectory(frontend_common)
|
||||||
|
@ -45,15 +45,15 @@
|
|||||||
#include "core/frontend/applets/profile_select.h"
|
#include "core/frontend/applets/profile_select.h"
|
||||||
#include "core/frontend/applets/software_keyboard.h"
|
#include "core/frontend/applets/software_keyboard.h"
|
||||||
#include "core/frontend/applets/web_browser.h"
|
#include "core/frontend/applets/web_browser.h"
|
||||||
|
#include "core/hid/emulated_controller.h"
|
||||||
|
#include "core/hid/hid_core.h"
|
||||||
|
#include "core/hid/hid_types.h"
|
||||||
#include "core/hle/service/am/applet_ae.h"
|
#include "core/hle/service/am/applet_ae.h"
|
||||||
#include "core/hle/service/am/applet_oe.h"
|
#include "core/hle/service/am/applet_oe.h"
|
||||||
#include "core/hle/service/am/applets/applets.h"
|
#include "core/hle/service/am/applets/applets.h"
|
||||||
#include "core/hle/service/filesystem/filesystem.h"
|
#include "core/hle/service/filesystem/filesystem.h"
|
||||||
#include "core/loader/loader.h"
|
#include "core/loader/loader.h"
|
||||||
#include "frontend_common/config.h"
|
#include "frontend_common/config.h"
|
||||||
#include "hid_core/frontend/emulated_controller.h"
|
|
||||||
#include "hid_core/hid_core.h"
|
|
||||||
#include "hid_core/hid_types.h"
|
|
||||||
#include "jni/android_common/android_common.h"
|
#include "jni/android_common/android_common.h"
|
||||||
#include "jni/id_cache.h"
|
#include "jni/id_cache.h"
|
||||||
#include "jni/native.h"
|
#include "jni/native.h"
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
#include "audio_core/sink/sink_stream.h"
|
#include "audio_core/sink/sink_stream.h"
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
#include "core/guest_memory.h"
|
|
||||||
#include "core/memory.h"
|
#include "core/memory.h"
|
||||||
|
|
||||||
namespace AudioCore {
|
namespace AudioCore {
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
#include "common/fixed_point.h"
|
#include "common/fixed_point.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "common/scratch_buffer.h"
|
#include "common/scratch_buffer.h"
|
||||||
#include "core/guest_memory.h"
|
|
||||||
#include "core/memory.h"
|
#include "core/memory.h"
|
||||||
|
|
||||||
namespace AudioCore::Renderer {
|
namespace AudioCore::Renderer {
|
||||||
|
@ -45,7 +45,6 @@ using f32 = float; ///< 32-bit floating point
|
|||||||
using f64 = double; ///< 64-bit floating point
|
using f64 = double; ///< 64-bit floating point
|
||||||
|
|
||||||
using VAddr = u64; ///< Represents a pointer in the userspace virtual address space.
|
using VAddr = u64; ///< Represents a pointer in the userspace virtual address space.
|
||||||
using DAddr = u64; ///< Represents a pointer in the device specific virtual address space.
|
|
||||||
using PAddr = u64; ///< Represents a pointer in the ARM11 physical address space.
|
using PAddr = u64; ///< Represents a pointer in the ARM11 physical address space.
|
||||||
using GPUVAddr = u64; ///< Represents a pointer in the GPU virtual address space.
|
using GPUVAddr = u64; ///< Represents a pointer in the GPU virtual address space.
|
||||||
|
|
||||||
|
@ -37,8 +37,6 @@ add_library(core STATIC
|
|||||||
debugger/gdbstub_arch.h
|
debugger/gdbstub_arch.h
|
||||||
debugger/gdbstub.cpp
|
debugger/gdbstub.cpp
|
||||||
debugger/gdbstub.h
|
debugger/gdbstub.h
|
||||||
device_memory_manager.h
|
|
||||||
device_memory_manager.inc
|
|
||||||
device_memory.cpp
|
device_memory.cpp
|
||||||
device_memory.h
|
device_memory.h
|
||||||
file_sys/fssystem/fs_i_storage.h
|
file_sys/fssystem/fs_i_storage.h
|
||||||
@ -185,6 +183,22 @@ add_library(core STATIC
|
|||||||
frontend/framebuffer_layout.cpp
|
frontend/framebuffer_layout.cpp
|
||||||
frontend/framebuffer_layout.h
|
frontend/framebuffer_layout.h
|
||||||
frontend/graphics_context.h
|
frontend/graphics_context.h
|
||||||
|
hid/emulated_console.cpp
|
||||||
|
hid/emulated_console.h
|
||||||
|
hid/emulated_controller.cpp
|
||||||
|
hid/emulated_controller.h
|
||||||
|
hid/emulated_devices.cpp
|
||||||
|
hid/emulated_devices.h
|
||||||
|
hid/hid_core.cpp
|
||||||
|
hid/hid_core.h
|
||||||
|
hid/hid_types.h
|
||||||
|
hid/input_converter.cpp
|
||||||
|
hid/input_converter.h
|
||||||
|
hid/input_interpreter.cpp
|
||||||
|
hid/input_interpreter.h
|
||||||
|
hid/irs_types.h
|
||||||
|
hid/motion_input.cpp
|
||||||
|
hid/motion_input.h
|
||||||
hle/api_version.h
|
hle/api_version.h
|
||||||
hle/ipc.h
|
hle/ipc.h
|
||||||
hle/kernel/board/nintendo/nx/k_memory_layout.cpp
|
hle/kernel/board/nintendo/nx/k_memory_layout.cpp
|
||||||
@ -517,16 +531,94 @@ add_library(core STATIC
|
|||||||
hle/service/hid/hid.h
|
hle/service/hid/hid.h
|
||||||
hle/service/hid/hid_debug_server.cpp
|
hle/service/hid/hid_debug_server.cpp
|
||||||
hle/service/hid/hid_debug_server.h
|
hle/service/hid/hid_debug_server.h
|
||||||
|
hle/service/hid/hid_firmware_settings.cpp
|
||||||
|
hle/service/hid/hid_firmware_settings.h
|
||||||
hle/service/hid/hid_server.cpp
|
hle/service/hid/hid_server.cpp
|
||||||
hle/service/hid/hid_server.h
|
hle/service/hid/hid_server.h
|
||||||
hle/service/hid/hid_system_server.cpp
|
hle/service/hid/hid_system_server.cpp
|
||||||
hle/service/hid/hid_system_server.h
|
hle/service/hid/hid_system_server.h
|
||||||
|
hle/service/hid/hid_util.h
|
||||||
hle/service/hid/hidbus.cpp
|
hle/service/hid/hidbus.cpp
|
||||||
hle/service/hid/hidbus.h
|
hle/service/hid/hidbus.h
|
||||||
hle/service/hid/irs.cpp
|
hle/service/hid/irs.cpp
|
||||||
hle/service/hid/irs.h
|
hle/service/hid/irs.h
|
||||||
|
hle/service/hid/irs_ring_lifo.h
|
||||||
|
hle/service/hid/resource_manager.cpp
|
||||||
|
hle/service/hid/resource_manager.h
|
||||||
|
hle/service/hid/ring_lifo.h
|
||||||
hle/service/hid/xcd.cpp
|
hle/service/hid/xcd.cpp
|
||||||
hle/service/hid/xcd.h
|
hle/service/hid/xcd.h
|
||||||
|
hle/service/hid/errors.h
|
||||||
|
hle/service/hid/controllers/npad/npad_data.cpp
|
||||||
|
hle/service/hid/controllers/npad/npad_data.h
|
||||||
|
hle/service/hid/controllers/npad/npad_resource.cpp
|
||||||
|
hle/service/hid/controllers/npad/npad_resource.h
|
||||||
|
hle/service/hid/controllers/types/debug_pad_types.h
|
||||||
|
hle/service/hid/controllers/types/keyboard_types.h
|
||||||
|
hle/service/hid/controllers/types/mouse_types.h
|
||||||
|
hle/service/hid/controllers/types/npad_types.h
|
||||||
|
hle/service/hid/controllers/types/shared_memory_format.h
|
||||||
|
hle/service/hid/controllers/types/touch_types.h
|
||||||
|
hle/service/hid/controllers/applet_resource.cpp
|
||||||
|
hle/service/hid/controllers/applet_resource.h
|
||||||
|
hle/service/hid/controllers/capture_button.cpp
|
||||||
|
hle/service/hid/controllers/capture_button.h
|
||||||
|
hle/service/hid/controllers/console_six_axis.cpp
|
||||||
|
hle/service/hid/controllers/console_six_axis.h
|
||||||
|
hle/service/hid/controllers/controller_base.cpp
|
||||||
|
hle/service/hid/controllers/controller_base.h
|
||||||
|
hle/service/hid/controllers/debug_mouse.cpp
|
||||||
|
hle/service/hid/controllers/debug_mouse.h
|
||||||
|
hle/service/hid/controllers/debug_pad.cpp
|
||||||
|
hle/service/hid/controllers/debug_pad.h
|
||||||
|
hle/service/hid/controllers/digitizer.cpp
|
||||||
|
hle/service/hid/controllers/digitizer.h
|
||||||
|
hle/service/hid/controllers/gesture.cpp
|
||||||
|
hle/service/hid/controllers/gesture.h
|
||||||
|
hle/service/hid/controllers/home_button.cpp
|
||||||
|
hle/service/hid/controllers/home_button.h
|
||||||
|
hle/service/hid/controllers/keyboard.cpp
|
||||||
|
hle/service/hid/controllers/keyboard.h
|
||||||
|
hle/service/hid/controllers/mouse.cpp
|
||||||
|
hle/service/hid/controllers/mouse.h
|
||||||
|
hle/service/hid/controllers/npad.cpp
|
||||||
|
hle/service/hid/controllers/npad.h
|
||||||
|
hle/service/hid/controllers/palma.cpp
|
||||||
|
hle/service/hid/controllers/palma.h
|
||||||
|
hle/service/hid/controllers/seven_six_axis.cpp
|
||||||
|
hle/service/hid/controllers/seven_six_axis.h
|
||||||
|
hle/service/hid/controllers/shared_memory_holder.cpp
|
||||||
|
hle/service/hid/controllers/shared_memory_holder.h
|
||||||
|
hle/service/hid/controllers/six_axis.cpp
|
||||||
|
hle/service/hid/controllers/six_axis.h
|
||||||
|
hle/service/hid/controllers/sleep_button.cpp
|
||||||
|
hle/service/hid/controllers/sleep_button.h
|
||||||
|
hle/service/hid/controllers/touchscreen.cpp
|
||||||
|
hle/service/hid/controllers/touchscreen.h
|
||||||
|
hle/service/hid/controllers/unique_pad.cpp
|
||||||
|
hle/service/hid/controllers/unique_pad.h
|
||||||
|
hle/service/hid/hidbus/hidbus_base.cpp
|
||||||
|
hle/service/hid/hidbus/hidbus_base.h
|
||||||
|
hle/service/hid/hidbus/ringcon.cpp
|
||||||
|
hle/service/hid/hidbus/ringcon.h
|
||||||
|
hle/service/hid/hidbus/starlink.cpp
|
||||||
|
hle/service/hid/hidbus/starlink.h
|
||||||
|
hle/service/hid/hidbus/stubbed.cpp
|
||||||
|
hle/service/hid/hidbus/stubbed.h
|
||||||
|
hle/service/hid/irsensor/clustering_processor.cpp
|
||||||
|
hle/service/hid/irsensor/clustering_processor.h
|
||||||
|
hle/service/hid/irsensor/image_transfer_processor.cpp
|
||||||
|
hle/service/hid/irsensor/image_transfer_processor.h
|
||||||
|
hle/service/hid/irsensor/ir_led_processor.cpp
|
||||||
|
hle/service/hid/irsensor/ir_led_processor.h
|
||||||
|
hle/service/hid/irsensor/moment_processor.cpp
|
||||||
|
hle/service/hid/irsensor/moment_processor.h
|
||||||
|
hle/service/hid/irsensor/pointing_processor.cpp
|
||||||
|
hle/service/hid/irsensor/pointing_processor.h
|
||||||
|
hle/service/hid/irsensor/processor_base.cpp
|
||||||
|
hle/service/hid/irsensor/processor_base.h
|
||||||
|
hle/service/hid/irsensor/tera_plugin_processor.cpp
|
||||||
|
hle/service/hid/irsensor/tera_plugin_processor.h
|
||||||
hle/service/lbl/lbl.cpp
|
hle/service/lbl/lbl.cpp
|
||||||
hle/service/lbl/lbl.h
|
hle/service/lbl/lbl.h
|
||||||
hle/service/ldn/lan_discovery.cpp
|
hle/service/ldn/lan_discovery.cpp
|
||||||
@ -607,8 +699,6 @@ add_library(core STATIC
|
|||||||
hle/service/ns/pdm_qry.h
|
hle/service/ns/pdm_qry.h
|
||||||
hle/service/nvdrv/core/container.cpp
|
hle/service/nvdrv/core/container.cpp
|
||||||
hle/service/nvdrv/core/container.h
|
hle/service/nvdrv/core/container.h
|
||||||
hle/service/nvdrv/core/heap_mapper.cpp
|
|
||||||
hle/service/nvdrv/core/heap_mapper.h
|
|
||||||
hle/service/nvdrv/core/nvmap.cpp
|
hle/service/nvdrv/core/nvmap.cpp
|
||||||
hle/service/nvdrv/core/nvmap.h
|
hle/service/nvdrv/core/nvmap.h
|
||||||
hle/service/nvdrv/core/syncpoint_manager.cpp
|
hle/service/nvdrv/core/syncpoint_manager.cpp
|
||||||
@ -712,24 +802,24 @@ add_library(core STATIC
|
|||||||
hle/service/server_manager.h
|
hle/service/server_manager.h
|
||||||
hle/service/service.cpp
|
hle/service/service.cpp
|
||||||
hle/service/service.h
|
hle/service/service.h
|
||||||
|
hle/service/set/set.cpp
|
||||||
|
hle/service/set/set.h
|
||||||
hle/service/set/appln_settings.cpp
|
hle/service/set/appln_settings.cpp
|
||||||
hle/service/set/appln_settings.h
|
hle/service/set/appln_settings.h
|
||||||
hle/service/set/device_settings.cpp
|
hle/service/set/device_settings.cpp
|
||||||
hle/service/set/device_settings.h
|
hle/service/set/device_settings.h
|
||||||
hle/service/set/factory_settings_server.cpp
|
|
||||||
hle/service/set/factory_settings_server.h
|
|
||||||
hle/service/set/firmware_debug_settings_server.cpp
|
|
||||||
hle/service/set/firmware_debug_settings_server.h
|
|
||||||
hle/service/set/private_settings.cpp
|
hle/service/set/private_settings.cpp
|
||||||
hle/service/set/private_settings.h
|
hle/service/set/private_settings.h
|
||||||
|
hle/service/set/set_cal.cpp
|
||||||
|
hle/service/set/set_cal.h
|
||||||
|
hle/service/set/set_fd.cpp
|
||||||
|
hle/service/set/set_fd.h
|
||||||
|
hle/service/set/set_sys.cpp
|
||||||
|
hle/service/set/set_sys.h
|
||||||
hle/service/set/settings.cpp
|
hle/service/set/settings.cpp
|
||||||
hle/service/set/settings.h
|
hle/service/set/settings.h
|
||||||
hle/service/set/settings_server.cpp
|
|
||||||
hle/service/set/settings_server.h
|
|
||||||
hle/service/set/system_settings.cpp
|
hle/service/set/system_settings.cpp
|
||||||
hle/service/set/system_settings.h
|
hle/service/set/system_settings.h
|
||||||
hle/service/set/system_settings_server.cpp
|
|
||||||
hle/service/set/system_settings_server.h
|
|
||||||
hle/service/sm/sm.cpp
|
hle/service/sm/sm.cpp
|
||||||
hle/service/sm/sm.h
|
hle/service/sm/sm.h
|
||||||
hle/service/sm/sm_controller.cpp
|
hle/service/sm/sm_controller.cpp
|
||||||
@ -869,7 +959,7 @@ endif()
|
|||||||
|
|
||||||
create_target_directory_groups(core)
|
create_target_directory_groups(core)
|
||||||
|
|
||||||
target_link_libraries(core PUBLIC common PRIVATE audio_core hid_core network video_core nx_tzdb)
|
target_link_libraries(core PUBLIC common PRIVATE audio_core network video_core nx_tzdb)
|
||||||
target_link_libraries(core PUBLIC Boost::headers PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls RenderDoc::API)
|
target_link_libraries(core PUBLIC Boost::headers PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls RenderDoc::API)
|
||||||
if (MINGW)
|
if (MINGW)
|
||||||
target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY})
|
target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY})
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include "core/file_sys/savedata_factory.h"
|
#include "core/file_sys/savedata_factory.h"
|
||||||
#include "core/file_sys/vfs_concat.h"
|
#include "core/file_sys/vfs_concat.h"
|
||||||
#include "core/file_sys/vfs_real.h"
|
#include "core/file_sys/vfs_real.h"
|
||||||
#include "core/gpu_dirty_memory_manager.h"
|
#include "core/hid/hid_core.h"
|
||||||
#include "core/hle/kernel/k_memory_manager.h"
|
#include "core/hle/kernel/k_memory_manager.h"
|
||||||
#include "core/hle/kernel/k_process.h"
|
#include "core/hle/kernel/k_process.h"
|
||||||
#include "core/hle/kernel/k_resource_limit.h"
|
#include "core/hle/kernel/k_resource_limit.h"
|
||||||
@ -52,7 +52,6 @@
|
|||||||
#include "core/telemetry_session.h"
|
#include "core/telemetry_session.h"
|
||||||
#include "core/tools/freezer.h"
|
#include "core/tools/freezer.h"
|
||||||
#include "core/tools/renderdoc.h"
|
#include "core/tools/renderdoc.h"
|
||||||
#include "hid_core/hid_core.h"
|
|
||||||
#include "network/network.h"
|
#include "network/network.h"
|
||||||
#include "video_core/host1x/host1x.h"
|
#include "video_core/host1x/host1x.h"
|
||||||
#include "video_core/renderer_base.h"
|
#include "video_core/renderer_base.h"
|
||||||
@ -565,9 +564,6 @@ struct System::Impl {
|
|||||||
std::array<u64, Core::Hardware::NUM_CPU_CORES> dynarmic_ticks{};
|
std::array<u64, Core::Hardware::NUM_CPU_CORES> dynarmic_ticks{};
|
||||||
std::array<MicroProfileToken, Core::Hardware::NUM_CPU_CORES> microprofile_cpu{};
|
std::array<MicroProfileToken, Core::Hardware::NUM_CPU_CORES> microprofile_cpu{};
|
||||||
|
|
||||||
std::array<Core::GPUDirtyMemoryManager, Core::Hardware::NUM_CPU_CORES>
|
|
||||||
gpu_dirty_memory_managers;
|
|
||||||
|
|
||||||
std::deque<std::vector<u8>> user_channel;
|
std::deque<std::vector<u8>> user_channel;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -654,14 +650,8 @@ size_t System::GetCurrentHostThreadID() const {
|
|||||||
return impl->kernel.GetCurrentHostThreadID();
|
return impl->kernel.GetCurrentHostThreadID();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::span<GPUDirtyMemoryManager> System::GetGPUDirtyMemoryManager() {
|
void System::GatherGPUDirtyMemory(std::function<void(VAddr, size_t)>& callback) {
|
||||||
return impl->gpu_dirty_memory_managers;
|
return this->ApplicationProcess()->GatherGPUDirtyMemory(callback);
|
||||||
}
|
|
||||||
|
|
||||||
void System::GatherGPUDirtyMemory(std::function<void(PAddr, size_t)>& callback) {
|
|
||||||
for (auto& manager : impl->gpu_dirty_memory_managers) {
|
|
||||||
manager.Gather(callback);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PerfStatsResults System::GetAndResetPerfStats() {
|
PerfStatsResults System::GetAndResetPerfStats() {
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <span>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -117,7 +116,6 @@ class CpuManager;
|
|||||||
class Debugger;
|
class Debugger;
|
||||||
class DeviceMemory;
|
class DeviceMemory;
|
||||||
class ExclusiveMonitor;
|
class ExclusiveMonitor;
|
||||||
class GPUDirtyMemoryManager;
|
|
||||||
class PerfStats;
|
class PerfStats;
|
||||||
class Reporter;
|
class Reporter;
|
||||||
class SpeedLimiter;
|
class SpeedLimiter;
|
||||||
@ -226,9 +224,7 @@ public:
|
|||||||
/// Prepare the core emulation for a reschedule
|
/// Prepare the core emulation for a reschedule
|
||||||
void PrepareReschedule(u32 core_index);
|
void PrepareReschedule(u32 core_index);
|
||||||
|
|
||||||
std::span<GPUDirtyMemoryManager> GetGPUDirtyMemoryManager();
|
void GatherGPUDirtyMemory(std::function<void(VAddr, size_t)>& callback);
|
||||||
|
|
||||||
void GatherGPUDirtyMemory(std::function<void(PAddr, size_t)>& callback);
|
|
||||||
|
|
||||||
[[nodiscard]] size_t GetCurrentHostThreadID() const;
|
[[nodiscard]] size_t GetCurrentHostThreadID() const;
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ public:
|
|||||||
return [this] { ShutdownThreadFunction(); };
|
return [this] { ShutdownThreadFunction(); };
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreemptSingleCore(bool from_running_environment = true);
|
void PreemptSingleCore(bool from_running_enviroment = true);
|
||||||
|
|
||||||
std::size_t CurrentCore() const {
|
std::size_t CurrentCore() const {
|
||||||
return current_core.load();
|
return current_core.load();
|
||||||
|
@ -559,7 +559,7 @@ void GDBStub::HandleVCont(std::string_view command, std::vector<DebuggerAction>&
|
|||||||
}
|
}
|
||||||
|
|
||||||
constexpr std::array<std::pair<const char*, Kernel::Svc::MemoryState>, 22> MemoryStateNames{{
|
constexpr std::array<std::pair<const char*, Kernel::Svc::MemoryState>, 22> MemoryStateNames{{
|
||||||
{"----- Free ------", Kernel::Svc::MemoryState::Free},
|
{"----- Free -----", Kernel::Svc::MemoryState::Free},
|
||||||
{"Io ", Kernel::Svc::MemoryState::Io},
|
{"Io ", Kernel::Svc::MemoryState::Io},
|
||||||
{"Static ", Kernel::Svc::MemoryState::Static},
|
{"Static ", Kernel::Svc::MemoryState::Static},
|
||||||
{"Code ", Kernel::Svc::MemoryState::Code},
|
{"Code ", Kernel::Svc::MemoryState::Code},
|
||||||
@ -571,8 +571,8 @@ constexpr std::array<std::pair<const char*, Kernel::Svc::MemoryState>, 22> Memor
|
|||||||
{"Ipc ", Kernel::Svc::MemoryState::Ipc},
|
{"Ipc ", Kernel::Svc::MemoryState::Ipc},
|
||||||
{"Stack ", Kernel::Svc::MemoryState::Stack},
|
{"Stack ", Kernel::Svc::MemoryState::Stack},
|
||||||
{"ThreadLocal ", Kernel::Svc::MemoryState::ThreadLocal},
|
{"ThreadLocal ", Kernel::Svc::MemoryState::ThreadLocal},
|
||||||
{"Transferred ", Kernel::Svc::MemoryState::Transferred},
|
{"Transfered ", Kernel::Svc::MemoryState::Transfered},
|
||||||
{"SharedTransferred", Kernel::Svc::MemoryState::SharedTransferred},
|
{"SharedTransfered", Kernel::Svc::MemoryState::SharedTransfered},
|
||||||
{"SharedCode ", Kernel::Svc::MemoryState::SharedCode},
|
{"SharedCode ", Kernel::Svc::MemoryState::SharedCode},
|
||||||
{"Inaccessible ", Kernel::Svc::MemoryState::Inaccessible},
|
{"Inaccessible ", Kernel::Svc::MemoryState::Inaccessible},
|
||||||
{"NonSecureIpc ", Kernel::Svc::MemoryState::NonSecureIpc},
|
{"NonSecureIpc ", Kernel::Svc::MemoryState::NonSecureIpc},
|
||||||
|
@ -31,12 +31,6 @@ public:
|
|||||||
DramMemoryMap::Base;
|
DramMemoryMap::Base;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
PAddr GetRawPhysicalAddr(const T* ptr) const {
|
|
||||||
return static_cast<PAddr>(reinterpret_cast<uintptr_t>(ptr) -
|
|
||||||
reinterpret_cast<uintptr_t>(buffer.BackingBasePointer()));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T* GetPointer(Common::PhysicalAddress addr) {
|
T* GetPointer(Common::PhysicalAddress addr) {
|
||||||
return reinterpret_cast<T*>(buffer.BackingBasePointer() +
|
return reinterpret_cast<T*>(buffer.BackingBasePointer() +
|
||||||
@ -49,16 +43,6 @@ public:
|
|||||||
(GetInteger(addr) - DramMemoryMap::Base));
|
(GetInteger(addr) - DramMemoryMap::Base));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
T* GetPointerFromRaw(PAddr addr) {
|
|
||||||
return reinterpret_cast<T*>(buffer.BackingBasePointer() + addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
const T* GetPointerFromRaw(PAddr addr) const {
|
|
||||||
return reinterpret_cast<T*>(buffer.BackingBasePointer() + addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
Common::HostMemory buffer;
|
Common::HostMemory buffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,208 +0,0 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#include <atomic>
|
|
||||||
#include <deque>
|
|
||||||
#include <memory>
|
|
||||||
#include <mutex>
|
|
||||||
|
|
||||||
#include "common/common_types.h"
|
|
||||||
#include "common/scratch_buffer.h"
|
|
||||||
#include "common/virtual_buffer.h"
|
|
||||||
|
|
||||||
namespace Core {
|
|
||||||
|
|
||||||
constexpr size_t DEVICE_PAGEBITS = 12ULL;
|
|
||||||
constexpr size_t DEVICE_PAGESIZE = 1ULL << DEVICE_PAGEBITS;
|
|
||||||
constexpr size_t DEVICE_PAGEMASK = DEVICE_PAGESIZE - 1ULL;
|
|
||||||
|
|
||||||
class DeviceMemory;
|
|
||||||
|
|
||||||
namespace Memory {
|
|
||||||
class Memory;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename DTraits>
|
|
||||||
struct DeviceMemoryManagerAllocator;
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
class DeviceMemoryManager {
|
|
||||||
using DeviceInterface = typename Traits::DeviceInterface;
|
|
||||||
using DeviceMethods = typename Traits::DeviceMethods;
|
|
||||||
|
|
||||||
public:
|
|
||||||
DeviceMemoryManager(const DeviceMemory& device_memory);
|
|
||||||
~DeviceMemoryManager();
|
|
||||||
|
|
||||||
void BindInterface(DeviceInterface* device_inter);
|
|
||||||
|
|
||||||
DAddr Allocate(size_t size);
|
|
||||||
void AllocateFixed(DAddr start, size_t size);
|
|
||||||
void Free(DAddr start, size_t size);
|
|
||||||
|
|
||||||
void Map(DAddr address, VAddr virtual_address, size_t size, size_t process_id,
|
|
||||||
bool track = false);
|
|
||||||
|
|
||||||
void Unmap(DAddr address, size_t size);
|
|
||||||
|
|
||||||
void TrackContinuityImpl(DAddr address, VAddr virtual_address, size_t size, size_t process_id);
|
|
||||||
void TrackContinuity(DAddr address, VAddr virtual_address, size_t size, size_t process_id) {
|
|
||||||
std::scoped_lock lk(mapping_guard);
|
|
||||||
TrackContinuityImpl(address, virtual_address, size, process_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write / Read
|
|
||||||
template <typename T>
|
|
||||||
T* GetPointer(DAddr address);
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
const T* GetPointer(DAddr address) const;
|
|
||||||
|
|
||||||
template <typename Func>
|
|
||||||
void ApplyOpOnPAddr(PAddr address, Common::ScratchBuffer<u32>& buffer, Func&& operation) {
|
|
||||||
DAddr subbits = static_cast<DAddr>(address & page_mask);
|
|
||||||
const u32 base = compressed_device_addr[(address >> page_bits)];
|
|
||||||
if ((base >> MULTI_FLAG_BITS) == 0) [[likely]] {
|
|
||||||
const DAddr d_address = (static_cast<DAddr>(base) << page_bits) + subbits;
|
|
||||||
operation(d_address);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
InnerGatherDeviceAddresses(buffer, address);
|
|
||||||
for (u32 value : buffer) {
|
|
||||||
operation((static_cast<DAddr>(value) << page_bits) + subbits);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Func>
|
|
||||||
void ApplyOpOnPointer(const u8* p, Common::ScratchBuffer<u32>& buffer, Func&& operation) {
|
|
||||||
PAddr address = GetRawPhysicalAddr<u8>(p);
|
|
||||||
ApplyOpOnPAddr(address, buffer, operation);
|
|
||||||
}
|
|
||||||
|
|
||||||
PAddr GetPhysicalRawAddressFromDAddr(DAddr address) const {
|
|
||||||
PAddr subbits = static_cast<PAddr>(address & page_mask);
|
|
||||||
auto paddr = compressed_physical_ptr[(address >> page_bits)];
|
|
||||||
if (paddr == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return (static_cast<PAddr>(paddr - 1) << page_bits) + subbits;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
void Write(DAddr address, T value);
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
T Read(DAddr address) const;
|
|
||||||
|
|
||||||
u8* GetSpan(const DAddr src_addr, const std::size_t size);
|
|
||||||
const u8* GetSpan(const DAddr src_addr, const std::size_t size) const;
|
|
||||||
|
|
||||||
void ReadBlock(DAddr address, void* dest_pointer, size_t size);
|
|
||||||
void ReadBlockUnsafe(DAddr address, void* dest_pointer, size_t size);
|
|
||||||
void WriteBlock(DAddr address, const void* src_pointer, size_t size);
|
|
||||||
void WriteBlockUnsafe(DAddr address, const void* src_pointer, size_t size);
|
|
||||||
|
|
||||||
size_t RegisterProcess(Memory::Memory* memory);
|
|
||||||
void UnregisterProcess(size_t id);
|
|
||||||
|
|
||||||
void UpdatePagesCachedCount(DAddr addr, size_t size, s32 delta);
|
|
||||||
|
|
||||||
static constexpr size_t AS_BITS = Traits::device_virtual_bits;
|
|
||||||
|
|
||||||
private:
|
|
||||||
static constexpr size_t device_virtual_bits = Traits::device_virtual_bits;
|
|
||||||
static constexpr size_t device_as_size = 1ULL << device_virtual_bits;
|
|
||||||
static constexpr size_t physical_min_bits = 32;
|
|
||||||
static constexpr size_t physical_max_bits = 33;
|
|
||||||
static constexpr size_t page_bits = 12;
|
|
||||||
static constexpr size_t page_size = 1ULL << page_bits;
|
|
||||||
static constexpr size_t page_mask = page_size - 1ULL;
|
|
||||||
static constexpr u32 physical_address_base = 1U << page_bits;
|
|
||||||
static constexpr u32 MULTI_FLAG_BITS = 31;
|
|
||||||
static constexpr u32 MULTI_FLAG = 1U << MULTI_FLAG_BITS;
|
|
||||||
static constexpr u32 MULTI_MASK = ~MULTI_FLAG;
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
T* GetPointerFromRaw(PAddr addr) {
|
|
||||||
return reinterpret_cast<T*>(physical_base + addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
const T* GetPointerFromRaw(PAddr addr) const {
|
|
||||||
return reinterpret_cast<T*>(physical_base + addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
PAddr GetRawPhysicalAddr(const T* ptr) const {
|
|
||||||
return static_cast<PAddr>(reinterpret_cast<uintptr_t>(ptr) - physical_base);
|
|
||||||
}
|
|
||||||
|
|
||||||
void WalkBlock(const DAddr addr, const std::size_t size, auto on_unmapped, auto on_memory,
|
|
||||||
auto increment);
|
|
||||||
|
|
||||||
void InnerGatherDeviceAddresses(Common::ScratchBuffer<u32>& buffer, PAddr address);
|
|
||||||
|
|
||||||
std::unique_ptr<DeviceMemoryManagerAllocator<Traits>> impl;
|
|
||||||
|
|
||||||
const uintptr_t physical_base;
|
|
||||||
DeviceInterface* device_inter;
|
|
||||||
Common::VirtualBuffer<u32> compressed_physical_ptr;
|
|
||||||
Common::VirtualBuffer<u32> compressed_device_addr;
|
|
||||||
Common::VirtualBuffer<u32> continuity_tracker;
|
|
||||||
|
|
||||||
// Process memory interfaces
|
|
||||||
|
|
||||||
std::deque<size_t> id_pool;
|
|
||||||
std::deque<Memory::Memory*> registered_processes;
|
|
||||||
|
|
||||||
// Memory protection management
|
|
||||||
|
|
||||||
static constexpr size_t guest_max_as_bits = 39;
|
|
||||||
static constexpr size_t guest_as_size = 1ULL << guest_max_as_bits;
|
|
||||||
static constexpr size_t guest_mask = guest_as_size - 1ULL;
|
|
||||||
static constexpr size_t process_id_start_bit = guest_max_as_bits;
|
|
||||||
|
|
||||||
std::pair<size_t, VAddr> ExtractCPUBacking(size_t page_index) {
|
|
||||||
auto content = cpu_backing_address[page_index];
|
|
||||||
const VAddr address = content & guest_mask;
|
|
||||||
const size_t process_id = static_cast<size_t>(content >> process_id_start_bit);
|
|
||||||
return std::make_pair(process_id, address);
|
|
||||||
}
|
|
||||||
|
|
||||||
void InsertCPUBacking(size_t page_index, VAddr address, size_t process_id) {
|
|
||||||
cpu_backing_address[page_index] = address | (process_id << process_id_start_bit);
|
|
||||||
}
|
|
||||||
|
|
||||||
Common::VirtualBuffer<VAddr> cpu_backing_address;
|
|
||||||
static constexpr size_t subentries = 8 / sizeof(u8);
|
|
||||||
static constexpr size_t subentries_mask = subentries - 1;
|
|
||||||
class CounterEntry final {
|
|
||||||
public:
|
|
||||||
CounterEntry() = default;
|
|
||||||
|
|
||||||
std::atomic_uint8_t& Count(std::size_t page) {
|
|
||||||
return values[page & subentries_mask];
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::atomic_uint8_t& Count(std::size_t page) const {
|
|
||||||
return values[page & subentries_mask];
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::array<std::atomic_uint8_t, subentries> values{};
|
|
||||||
};
|
|
||||||
static_assert(sizeof(CounterEntry) == subentries * sizeof(u8),
|
|
||||||
"CounterEntry should be 8 bytes!");
|
|
||||||
|
|
||||||
static constexpr size_t num_counter_entries =
|
|
||||||
(1ULL << (device_virtual_bits - page_bits)) / subentries;
|
|
||||||
using CachedPages = std::array<CounterEntry, num_counter_entries>;
|
|
||||||
std::unique_ptr<CachedPages> cached_pages;
|
|
||||||
std::mutex counter_guard;
|
|
||||||
std::mutex mapping_guard;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Core
|
|
@ -1,588 +0,0 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
||||||
|
|
||||||
#include <atomic>
|
|
||||||
#include <limits>
|
|
||||||
#include <memory>
|
|
||||||
#include <type_traits>
|
|
||||||
|
|
||||||
#include "common/address_space.h"
|
|
||||||
#include "common/address_space.inc"
|
|
||||||
#include "common/alignment.h"
|
|
||||||
#include "common/assert.h"
|
|
||||||
#include "common/div_ceil.h"
|
|
||||||
#include "common/scope_exit.h"
|
|
||||||
#include "common/settings.h"
|
|
||||||
#include "core/device_memory.h"
|
|
||||||
#include "core/device_memory_manager.h"
|
|
||||||
#include "core/memory.h"
|
|
||||||
|
|
||||||
namespace Core {
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
class MultiAddressContainer {
|
|
||||||
public:
|
|
||||||
MultiAddressContainer() = default;
|
|
||||||
~MultiAddressContainer() = default;
|
|
||||||
|
|
||||||
void GatherValues(u32 start_entry, Common::ScratchBuffer<u32>& buffer) {
|
|
||||||
buffer.resize(8);
|
|
||||||
buffer.resize(0);
|
|
||||||
size_t index = 0;
|
|
||||||
const auto add_value = [&](u32 value) {
|
|
||||||
buffer[index] = value;
|
|
||||||
index++;
|
|
||||||
buffer.resize(index);
|
|
||||||
};
|
|
||||||
|
|
||||||
u32 iter_entry = start_entry;
|
|
||||||
Entry* current = &storage[iter_entry - 1];
|
|
||||||
add_value(current->value);
|
|
||||||
while (current->next_entry != 0) {
|
|
||||||
iter_entry = current->next_entry;
|
|
||||||
current = &storage[iter_entry - 1];
|
|
||||||
add_value(current->value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
u32 Register(u32 value) {
|
|
||||||
return RegisterImplementation(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register(u32 value, u32 start_entry) {
|
|
||||||
auto entry_id = RegisterImplementation(value);
|
|
||||||
u32 iter_entry = start_entry;
|
|
||||||
Entry* current = &storage[iter_entry - 1];
|
|
||||||
while (current->next_entry != 0) {
|
|
||||||
iter_entry = current->next_entry;
|
|
||||||
current = &storage[iter_entry - 1];
|
|
||||||
}
|
|
||||||
current->next_entry = entry_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::pair<bool, u32> Unregister(u32 value, u32 start_entry) {
|
|
||||||
u32 iter_entry = start_entry;
|
|
||||||
Entry* previous{};
|
|
||||||
Entry* current = &storage[iter_entry - 1];
|
|
||||||
Entry* next{};
|
|
||||||
bool more_than_one_remaining = false;
|
|
||||||
u32 result_start{start_entry};
|
|
||||||
size_t count = 0;
|
|
||||||
while (current->value != value) {
|
|
||||||
count++;
|
|
||||||
previous = current;
|
|
||||||
iter_entry = current->next_entry;
|
|
||||||
current = &storage[iter_entry - 1];
|
|
||||||
}
|
|
||||||
// Find next
|
|
||||||
u32 next_entry = current->next_entry;
|
|
||||||
if (next_entry != 0) {
|
|
||||||
next = &storage[next_entry - 1];
|
|
||||||
more_than_one_remaining = next->next_entry != 0 || previous != nullptr;
|
|
||||||
}
|
|
||||||
if (previous) {
|
|
||||||
previous->next_entry = next_entry;
|
|
||||||
} else {
|
|
||||||
result_start = next_entry;
|
|
||||||
}
|
|
||||||
free_entries.emplace_back(iter_entry);
|
|
||||||
return std::make_pair(more_than_one_remaining || count > 1, result_start);
|
|
||||||
}
|
|
||||||
|
|
||||||
u32 ReleaseEntry(u32 start_entry) {
|
|
||||||
Entry* current = &storage[start_entry - 1];
|
|
||||||
free_entries.emplace_back(start_entry);
|
|
||||||
return current->value;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
u32 RegisterImplementation(u32 value) {
|
|
||||||
auto entry_id = GetNewEntry();
|
|
||||||
auto& entry = storage[entry_id - 1];
|
|
||||||
entry.next_entry = 0;
|
|
||||||
entry.value = value;
|
|
||||||
return entry_id;
|
|
||||||
}
|
|
||||||
u32 GetNewEntry() {
|
|
||||||
if (!free_entries.empty()) {
|
|
||||||
u32 result = free_entries.front();
|
|
||||||
free_entries.pop_front();
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
storage.emplace_back();
|
|
||||||
u32 new_entry = static_cast<u32>(storage.size());
|
|
||||||
return new_entry;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct Entry {
|
|
||||||
u32 next_entry{};
|
|
||||||
u32 value{};
|
|
||||||
};
|
|
||||||
|
|
||||||
std::deque<Entry> storage;
|
|
||||||
std::deque<u32> free_entries;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct EmptyAllocator {
|
|
||||||
EmptyAllocator([[maybe_unused]] DAddr address) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
template <typename DTraits>
|
|
||||||
struct DeviceMemoryManagerAllocator {
|
|
||||||
static constexpr size_t device_virtual_bits = DTraits::device_virtual_bits;
|
|
||||||
static constexpr DAddr first_address = 1ULL << Memory::YUZU_PAGEBITS;
|
|
||||||
static constexpr DAddr max_device_area = 1ULL << device_virtual_bits;
|
|
||||||
|
|
||||||
DeviceMemoryManagerAllocator() : main_allocator(first_address) {}
|
|
||||||
|
|
||||||
Common::FlatAllocator<DAddr, 0, device_virtual_bits> main_allocator;
|
|
||||||
MultiAddressContainer multi_dev_address;
|
|
||||||
|
|
||||||
/// Returns true when vaddr -> vaddr+size is fully contained in the buffer
|
|
||||||
template <bool pin_area>
|
|
||||||
[[nodiscard]] bool IsInBounds(VAddr addr, u64 size) const noexcept {
|
|
||||||
return addr >= 0 && addr + size <= max_device_area;
|
|
||||||
}
|
|
||||||
|
|
||||||
DAddr Allocate(size_t size) {
|
|
||||||
return main_allocator.Allocate(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AllocateFixed(DAddr b_address, size_t b_size) {
|
|
||||||
main_allocator.AllocateFixed(b_address, b_size);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Free(DAddr b_address, size_t b_size) {
|
|
||||||
main_allocator.Free(b_address, b_size);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
DeviceMemoryManager<Traits>::DeviceMemoryManager(const DeviceMemory& device_memory_)
|
|
||||||
: physical_base{reinterpret_cast<const uintptr_t>(device_memory_.buffer.BackingBasePointer())},
|
|
||||||
device_inter{nullptr}, compressed_physical_ptr(device_as_size >> Memory::YUZU_PAGEBITS),
|
|
||||||
compressed_device_addr(1ULL << ((Settings::values.memory_layout_mode.GetValue() ==
|
|
||||||
Settings::MemoryLayout::Memory_4Gb
|
|
||||||
? physical_min_bits
|
|
||||||
: physical_max_bits) -
|
|
||||||
Memory::YUZU_PAGEBITS)),
|
|
||||||
continuity_tracker(device_as_size >> Memory::YUZU_PAGEBITS),
|
|
||||||
cpu_backing_address(device_as_size >> Memory::YUZU_PAGEBITS) {
|
|
||||||
impl = std::make_unique<DeviceMemoryManagerAllocator<Traits>>();
|
|
||||||
cached_pages = std::make_unique<CachedPages>();
|
|
||||||
|
|
||||||
const size_t total_virtual = device_as_size >> Memory::YUZU_PAGEBITS;
|
|
||||||
for (size_t i = 0; i < total_virtual; i++) {
|
|
||||||
compressed_physical_ptr[i] = 0;
|
|
||||||
continuity_tracker[i] = 1;
|
|
||||||
cpu_backing_address[i] = 0;
|
|
||||||
}
|
|
||||||
const size_t total_phys = 1ULL << ((Settings::values.memory_layout_mode.GetValue() ==
|
|
||||||
Settings::MemoryLayout::Memory_4Gb
|
|
||||||
? physical_min_bits
|
|
||||||
: physical_max_bits) -
|
|
||||||
Memory::YUZU_PAGEBITS);
|
|
||||||
for (size_t i = 0; i < total_phys; i++) {
|
|
||||||
compressed_device_addr[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
DeviceMemoryManager<Traits>::~DeviceMemoryManager() = default;
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
void DeviceMemoryManager<Traits>::BindInterface(DeviceInterface* device_inter_) {
|
|
||||||
device_inter = device_inter_;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
DAddr DeviceMemoryManager<Traits>::Allocate(size_t size) {
|
|
||||||
return impl->Allocate(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
void DeviceMemoryManager<Traits>::AllocateFixed(DAddr start, size_t size) {
|
|
||||||
return impl->AllocateFixed(start, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
void DeviceMemoryManager<Traits>::Free(DAddr start, size_t size) {
|
|
||||||
impl->Free(start, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
void DeviceMemoryManager<Traits>::Map(DAddr address, VAddr virtual_address, size_t size,
|
|
||||||
size_t process_id, bool track) {
|
|
||||||
Core::Memory::Memory* process_memory = registered_processes[process_id];
|
|
||||||
size_t start_page_d = address >> Memory::YUZU_PAGEBITS;
|
|
||||||
size_t num_pages = Common::AlignUp(size, Memory::YUZU_PAGESIZE) >> Memory::YUZU_PAGEBITS;
|
|
||||||
std::scoped_lock lk(mapping_guard);
|
|
||||||
for (size_t i = 0; i < num_pages; i++) {
|
|
||||||
const VAddr new_vaddress = virtual_address + i * Memory::YUZU_PAGESIZE;
|
|
||||||
auto* ptr = process_memory->GetPointerSilent(Common::ProcessAddress(new_vaddress));
|
|
||||||
if (ptr == nullptr) [[unlikely]] {
|
|
||||||
compressed_physical_ptr[start_page_d + i] = 0;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
auto phys_addr = static_cast<u32>(GetRawPhysicalAddr(ptr) >> Memory::YUZU_PAGEBITS) + 1U;
|
|
||||||
compressed_physical_ptr[start_page_d + i] = phys_addr;
|
|
||||||
InsertCPUBacking(start_page_d + i, new_vaddress, process_id);
|
|
||||||
const u32 base_dev = compressed_device_addr[phys_addr - 1U];
|
|
||||||
const u32 new_dev = static_cast<u32>(start_page_d + i);
|
|
||||||
if (base_dev == 0) [[likely]] {
|
|
||||||
compressed_device_addr[phys_addr - 1U] = new_dev;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
u32 start_id = base_dev & MULTI_MASK;
|
|
||||||
if ((base_dev >> MULTI_FLAG_BITS) == 0) {
|
|
||||||
start_id = impl->multi_dev_address.Register(base_dev);
|
|
||||||
compressed_device_addr[phys_addr - 1U] = MULTI_FLAG | start_id;
|
|
||||||
}
|
|
||||||
impl->multi_dev_address.Register(new_dev, start_id);
|
|
||||||
}
|
|
||||||
if (track) {
|
|
||||||
TrackContinuityImpl(address, virtual_address, size, process_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
void DeviceMemoryManager<Traits>::Unmap(DAddr address, size_t size) {
|
|
||||||
size_t start_page_d = address >> Memory::YUZU_PAGEBITS;
|
|
||||||
size_t num_pages = Common::AlignUp(size, Memory::YUZU_PAGESIZE) >> Memory::YUZU_PAGEBITS;
|
|
||||||
device_inter->InvalidateRegion(address, size);
|
|
||||||
std::scoped_lock lk(mapping_guard);
|
|
||||||
for (size_t i = 0; i < num_pages; i++) {
|
|
||||||
auto phys_addr = compressed_physical_ptr[start_page_d + i];
|
|
||||||
compressed_physical_ptr[start_page_d + i] = 0;
|
|
||||||
cpu_backing_address[start_page_d + i] = 0;
|
|
||||||
if (phys_addr != 0) [[likely]] {
|
|
||||||
const u32 base_dev = compressed_device_addr[phys_addr - 1U];
|
|
||||||
if ((base_dev >> MULTI_FLAG_BITS) == 0) [[likely]] {
|
|
||||||
compressed_device_addr[phys_addr - 1] = 0;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
const auto [more_entries, new_start] = impl->multi_dev_address.Unregister(
|
|
||||||
static_cast<u32>(start_page_d + i), base_dev & MULTI_MASK);
|
|
||||||
if (!more_entries) {
|
|
||||||
compressed_device_addr[phys_addr - 1] =
|
|
||||||
impl->multi_dev_address.ReleaseEntry(new_start);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
compressed_device_addr[phys_addr - 1] = new_start | MULTI_FLAG;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
template <typename Traits>
|
|
||||||
void DeviceMemoryManager<Traits>::TrackContinuityImpl(DAddr address, VAddr virtual_address,
|
|
||||||
size_t size, size_t process_id) {
|
|
||||||
Core::Memory::Memory* process_memory = registered_processes[process_id];
|
|
||||||
size_t start_page_d = address >> Memory::YUZU_PAGEBITS;
|
|
||||||
size_t num_pages = Common::AlignUp(size, Memory::YUZU_PAGESIZE) >> Memory::YUZU_PAGEBITS;
|
|
||||||
uintptr_t last_ptr = 0;
|
|
||||||
size_t page_count = 1;
|
|
||||||
for (size_t i = num_pages; i > 0; i--) {
|
|
||||||
size_t index = i - 1;
|
|
||||||
const VAddr new_vaddress = virtual_address + index * Memory::YUZU_PAGESIZE;
|
|
||||||
const uintptr_t new_ptr = reinterpret_cast<uintptr_t>(
|
|
||||||
process_memory->GetPointerSilent(Common::ProcessAddress(new_vaddress)));
|
|
||||||
if (new_ptr + page_size == last_ptr) {
|
|
||||||
page_count++;
|
|
||||||
} else {
|
|
||||||
page_count = 1;
|
|
||||||
}
|
|
||||||
last_ptr = new_ptr;
|
|
||||||
continuity_tracker[start_page_d + index] = static_cast<u32>(page_count);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
template <typename Traits>
|
|
||||||
u8* DeviceMemoryManager<Traits>::GetSpan(const DAddr src_addr, const std::size_t size) {
|
|
||||||
size_t page_index = src_addr >> page_bits;
|
|
||||||
size_t subbits = src_addr & page_mask;
|
|
||||||
if ((static_cast<size_t>(continuity_tracker[page_index]) << page_bits) >= size + subbits) {
|
|
||||||
return GetPointer<u8>(src_addr);
|
|
||||||
}
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
const u8* DeviceMemoryManager<Traits>::GetSpan(const DAddr src_addr, const std::size_t size) const {
|
|
||||||
size_t page_index = src_addr >> page_bits;
|
|
||||||
size_t subbits = src_addr & page_mask;
|
|
||||||
if ((static_cast<size_t>(continuity_tracker[page_index]) << page_bits) >= size + subbits) {
|
|
||||||
return GetPointer<u8>(src_addr);
|
|
||||||
}
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
void DeviceMemoryManager<Traits>::InnerGatherDeviceAddresses(Common::ScratchBuffer<u32>& buffer,
|
|
||||||
PAddr address) {
|
|
||||||
size_t phys_addr = address >> page_bits;
|
|
||||||
std::scoped_lock lk(mapping_guard);
|
|
||||||
u32 backing = compressed_device_addr[phys_addr];
|
|
||||||
if ((backing >> MULTI_FLAG_BITS) != 0) {
|
|
||||||
impl->multi_dev_address.GatherValues(backing & MULTI_MASK, buffer);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
buffer.resize(1);
|
|
||||||
buffer[0] = backing;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
template <typename T>
|
|
||||||
T* DeviceMemoryManager<Traits>::GetPointer(DAddr address) {
|
|
||||||
const size_t index = address >> Memory::YUZU_PAGEBITS;
|
|
||||||
const size_t offset = address & Memory::YUZU_PAGEMASK;
|
|
||||||
auto phys_addr = compressed_physical_ptr[index];
|
|
||||||
if (phys_addr == 0) [[unlikely]] {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
return GetPointerFromRaw<T>((static_cast<PAddr>(phys_addr - 1) << Memory::YUZU_PAGEBITS) +
|
|
||||||
offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
template <typename T>
|
|
||||||
const T* DeviceMemoryManager<Traits>::GetPointer(DAddr address) const {
|
|
||||||
const size_t index = address >> Memory::YUZU_PAGEBITS;
|
|
||||||
const size_t offset = address & Memory::YUZU_PAGEMASK;
|
|
||||||
auto phys_addr = compressed_physical_ptr[index];
|
|
||||||
if (phys_addr == 0) [[unlikely]] {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
return GetPointerFromRaw<T>((static_cast<PAddr>(phys_addr - 1) << Memory::YUZU_PAGEBITS) +
|
|
||||||
offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
template <typename T>
|
|
||||||
void DeviceMemoryManager<Traits>::Write(DAddr address, T value) {
|
|
||||||
T* ptr = GetPointer<T>(address);
|
|
||||||
if (!ptr) [[unlikely]] {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
std::memcpy(ptr, &value, sizeof(T));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
template <typename T>
|
|
||||||
T DeviceMemoryManager<Traits>::Read(DAddr address) const {
|
|
||||||
const T* ptr = GetPointer<T>(address);
|
|
||||||
T result{};
|
|
||||||
if (!ptr) [[unlikely]] {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
std::memcpy(&result, ptr, sizeof(T));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
void DeviceMemoryManager<Traits>::WalkBlock(DAddr addr, std::size_t size, auto on_unmapped,
|
|
||||||
auto on_memory, auto increment) {
|
|
||||||
std::size_t remaining_size = size;
|
|
||||||
std::size_t page_index = addr >> Memory::YUZU_PAGEBITS;
|
|
||||||
std::size_t page_offset = addr & Memory::YUZU_PAGEMASK;
|
|
||||||
|
|
||||||
while (remaining_size) {
|
|
||||||
const size_t next_pages = static_cast<std::size_t>(continuity_tracker[page_index]);
|
|
||||||
const std::size_t copy_amount =
|
|
||||||
std::min((next_pages << Memory::YUZU_PAGEBITS) - page_offset, remaining_size);
|
|
||||||
const auto current_vaddr =
|
|
||||||
static_cast<u64>((page_index << Memory::YUZU_PAGEBITS) + page_offset);
|
|
||||||
SCOPE_EXIT({
|
|
||||||
page_index += next_pages;
|
|
||||||
page_offset = 0;
|
|
||||||
increment(copy_amount);
|
|
||||||
remaining_size -= copy_amount;
|
|
||||||
});
|
|
||||||
|
|
||||||
auto phys_addr = compressed_physical_ptr[page_index];
|
|
||||||
if (phys_addr == 0) {
|
|
||||||
on_unmapped(copy_amount, current_vaddr);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
auto* mem_ptr = GetPointerFromRaw<u8>(
|
|
||||||
(static_cast<PAddr>(phys_addr - 1) << Memory::YUZU_PAGEBITS) + page_offset);
|
|
||||||
on_memory(copy_amount, mem_ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
void DeviceMemoryManager<Traits>::ReadBlock(DAddr address, void* dest_pointer, size_t size) {
|
|
||||||
device_inter->FlushRegion(address, size);
|
|
||||||
WalkBlock(
|
|
||||||
address, size,
|
|
||||||
[&](size_t copy_amount, DAddr current_vaddr) {
|
|
||||||
LOG_ERROR(
|
|
||||||
HW_Memory,
|
|
||||||
"Unmapped Device ReadBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})",
|
|
||||||
current_vaddr, address, size);
|
|
||||||
std::memset(dest_pointer, 0, copy_amount);
|
|
||||||
},
|
|
||||||
[&](size_t copy_amount, const u8* const src_ptr) {
|
|
||||||
std::memcpy(dest_pointer, src_ptr, copy_amount);
|
|
||||||
},
|
|
||||||
[&](const std::size_t copy_amount) {
|
|
||||||
dest_pointer = static_cast<u8*>(dest_pointer) + copy_amount;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
void DeviceMemoryManager<Traits>::WriteBlock(DAddr address, const void* src_pointer, size_t size) {
|
|
||||||
WalkBlock(
|
|
||||||
address, size,
|
|
||||||
[&](size_t copy_amount, DAddr current_vaddr) {
|
|
||||||
LOG_ERROR(
|
|
||||||
HW_Memory,
|
|
||||||
"Unmapped Device WriteBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})",
|
|
||||||
current_vaddr, address, size);
|
|
||||||
},
|
|
||||||
[&](size_t copy_amount, u8* const dst_ptr) {
|
|
||||||
std::memcpy(dst_ptr, src_pointer, copy_amount);
|
|
||||||
},
|
|
||||||
[&](const std::size_t copy_amount) {
|
|
||||||
src_pointer = static_cast<const u8*>(src_pointer) + copy_amount;
|
|
||||||
});
|
|
||||||
device_inter->InvalidateRegion(address, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
void DeviceMemoryManager<Traits>::ReadBlockUnsafe(DAddr address, void* dest_pointer, size_t size) {
|
|
||||||
WalkBlock(
|
|
||||||
address, size,
|
|
||||||
[&](size_t copy_amount, DAddr current_vaddr) {
|
|
||||||
LOG_ERROR(
|
|
||||||
HW_Memory,
|
|
||||||
"Unmapped Device ReadBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})",
|
|
||||||
current_vaddr, address, size);
|
|
||||||
std::memset(dest_pointer, 0, copy_amount);
|
|
||||||
},
|
|
||||||
[&](size_t copy_amount, const u8* const src_ptr) {
|
|
||||||
std::memcpy(dest_pointer, src_ptr, copy_amount);
|
|
||||||
},
|
|
||||||
[&](const std::size_t copy_amount) {
|
|
||||||
dest_pointer = static_cast<u8*>(dest_pointer) + copy_amount;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
void DeviceMemoryManager<Traits>::WriteBlockUnsafe(DAddr address, const void* src_pointer,
|
|
||||||
size_t size) {
|
|
||||||
WalkBlock(
|
|
||||||
address, size,
|
|
||||||
[&](size_t copy_amount, DAddr current_vaddr) {
|
|
||||||
LOG_ERROR(
|
|
||||||
HW_Memory,
|
|
||||||
"Unmapped Device WriteBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})",
|
|
||||||
current_vaddr, address, size);
|
|
||||||
},
|
|
||||||
[&](size_t copy_amount, u8* const dst_ptr) {
|
|
||||||
std::memcpy(dst_ptr, src_pointer, copy_amount);
|
|
||||||
},
|
|
||||||
[&](const std::size_t copy_amount) {
|
|
||||||
src_pointer = static_cast<const u8*>(src_pointer) + copy_amount;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
size_t DeviceMemoryManager<Traits>::RegisterProcess(Memory::Memory* memory_device_inter) {
|
|
||||||
size_t new_id;
|
|
||||||
if (!id_pool.empty()) {
|
|
||||||
new_id = id_pool.front();
|
|
||||||
id_pool.pop_front();
|
|
||||||
registered_processes[new_id] = memory_device_inter;
|
|
||||||
} else {
|
|
||||||
registered_processes.emplace_back(memory_device_inter);
|
|
||||||
new_id = registered_processes.size() - 1U;
|
|
||||||
}
|
|
||||||
return new_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
void DeviceMemoryManager<Traits>::UnregisterProcess(size_t id) {
|
|
||||||
registered_processes[id] = nullptr;
|
|
||||||
id_pool.push_front(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Traits>
|
|
||||||
void DeviceMemoryManager<Traits>::UpdatePagesCachedCount(DAddr addr, size_t size, s32 delta) {
|
|
||||||
bool locked = false;
|
|
||||||
auto lock = [&] {
|
|
||||||
if (!locked) {
|
|
||||||
counter_guard.lock();
|
|
||||||
locked = true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
SCOPE_EXIT({
|
|
||||||
if (locked) {
|
|
||||||
counter_guard.unlock();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
u64 uncache_begin = 0;
|
|
||||||
u64 cache_begin = 0;
|
|
||||||
u64 uncache_bytes = 0;
|
|
||||||
u64 cache_bytes = 0;
|
|
||||||
const auto MarkRegionCaching = &DeviceMemoryManager<Traits>::DeviceMethods::MarkRegionCaching;
|
|
||||||
|
|
||||||
std::atomic_thread_fence(std::memory_order_acquire);
|
|
||||||
const size_t page_end = Common::DivCeil(addr + size, Memory::YUZU_PAGESIZE);
|
|
||||||
size_t page = addr >> Memory::YUZU_PAGEBITS;
|
|
||||||
auto [process_id, base_vaddress] = ExtractCPUBacking(page);
|
|
||||||
size_t vpage = base_vaddress >> Memory::YUZU_PAGEBITS;
|
|
||||||
auto* memory_device_inter = registered_processes[process_id];
|
|
||||||
for (; page != page_end; ++page) {
|
|
||||||
std::atomic_uint8_t& count = cached_pages->at(page >> 3).Count(page);
|
|
||||||
|
|
||||||
if (delta > 0) {
|
|
||||||
ASSERT_MSG(count.load(std::memory_order::relaxed) < std::numeric_limits<u8>::max(),
|
|
||||||
"Count may overflow!");
|
|
||||||
} else if (delta < 0) {
|
|
||||||
ASSERT_MSG(count.load(std::memory_order::relaxed) > 0, "Count may underflow!");
|
|
||||||
} else {
|
|
||||||
ASSERT_MSG(false, "Delta must be non-zero!");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Adds or subtracts 1, as count is a unsigned 8-bit value
|
|
||||||
count.fetch_add(static_cast<u8>(delta), std::memory_order_release);
|
|
||||||
|
|
||||||
// Assume delta is either -1 or 1
|
|
||||||
if (count.load(std::memory_order::relaxed) == 0) {
|
|
||||||
if (uncache_bytes == 0) {
|
|
||||||
uncache_begin = vpage;
|
|
||||||
}
|
|
||||||
uncache_bytes += Memory::YUZU_PAGESIZE;
|
|
||||||
} else if (uncache_bytes > 0) {
|
|
||||||
lock();
|
|
||||||
MarkRegionCaching(memory_device_inter, uncache_begin << Memory::YUZU_PAGEBITS,
|
|
||||||
uncache_bytes, false);
|
|
||||||
uncache_bytes = 0;
|
|
||||||
}
|
|
||||||
if (count.load(std::memory_order::relaxed) == 1 && delta > 0) {
|
|
||||||
if (cache_bytes == 0) {
|
|
||||||
cache_begin = vpage;
|
|
||||||
}
|
|
||||||
cache_bytes += Memory::YUZU_PAGESIZE;
|
|
||||||
} else if (cache_bytes > 0) {
|
|
||||||
lock();
|
|
||||||
MarkRegionCaching(memory_device_inter, cache_begin << Memory::YUZU_PAGEBITS, cache_bytes,
|
|
||||||
true);
|
|
||||||
cache_bytes = 0;
|
|
||||||
}
|
|
||||||
vpage++;
|
|
||||||
}
|
|
||||||
if (uncache_bytes > 0) {
|
|
||||||
lock();
|
|
||||||
MarkRegionCaching(memory_device_inter, uncache_begin << Memory::YUZU_PAGEBITS, uncache_bytes,
|
|
||||||
false);
|
|
||||||
}
|
|
||||||
if (cache_bytes > 0) {
|
|
||||||
lock();
|
|
||||||
MarkRegionCaching(memory_device_inter, cache_begin << Memory::YUZU_PAGEBITS, cache_bytes,
|
|
||||||
true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Core
|
|
@ -26,7 +26,7 @@
|
|||||||
#include "core/file_sys/vfs_vector.h"
|
#include "core/file_sys/vfs_vector.h"
|
||||||
#include "core/hle/service/filesystem/filesystem.h"
|
#include "core/hle/service/filesystem/filesystem.h"
|
||||||
#include "core/hle/service/ns/language.h"
|
#include "core/hle/service/ns/language.h"
|
||||||
#include "core/hle/service/set/settings_server.h"
|
#include "core/hle/service/set/set.h"
|
||||||
#include "core/loader/loader.h"
|
#include "core/loader/loader.h"
|
||||||
#include "core/loader/nso.h"
|
#include "core/loader/nso.h"
|
||||||
#include "core/memory/cheat_engine.h"
|
#include "core/memory/cheat_engine.h"
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
#include "common/settings.h"
|
#include "common/settings.h"
|
||||||
#include "common/settings_enums.h"
|
#include "common/settings_enums.h"
|
||||||
#include "core/frontend/applets/controller.h"
|
#include "core/frontend/applets/controller.h"
|
||||||
#include "hid_core/frontend/emulated_controller.h"
|
#include "core/hid/emulated_controller.h"
|
||||||
#include "hid_core/hid_core.h"
|
#include "core/hid/hid_core.h"
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hid/hid_types.h"
|
||||||
|
|
||||||
namespace Core::Frontend {
|
namespace Core::Frontend {
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "core/device_memory_manager.h"
|
#include "core/memory.h"
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ public:
|
|||||||
|
|
||||||
~GPUDirtyMemoryManager() = default;
|
~GPUDirtyMemoryManager() = default;
|
||||||
|
|
||||||
void Collect(PAddr address, size_t size) {
|
void Collect(VAddr address, size_t size) {
|
||||||
TransformAddress t = BuildTransform(address, size);
|
TransformAddress t = BuildTransform(address, size);
|
||||||
TransformAddress tmp, original;
|
TransformAddress tmp, original;
|
||||||
do {
|
do {
|
||||||
@ -47,7 +47,7 @@ public:
|
|||||||
std::memory_order_relaxed));
|
std::memory_order_relaxed));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gather(std::function<void(PAddr, size_t)>& callback) {
|
void Gather(std::function<void(VAddr, size_t)>& callback) {
|
||||||
{
|
{
|
||||||
std::scoped_lock lk(guard);
|
std::scoped_lock lk(guard);
|
||||||
TransformAddress t = current.exchange(default_transform, std::memory_order_relaxed);
|
TransformAddress t = current.exchange(default_transform, std::memory_order_relaxed);
|
||||||
@ -65,7 +65,7 @@ public:
|
|||||||
mask = mask >> empty_bits;
|
mask = mask >> empty_bits;
|
||||||
|
|
||||||
const size_t continuous_bits = std::countr_one(mask);
|
const size_t continuous_bits = std::countr_one(mask);
|
||||||
callback((static_cast<PAddr>(transform.address) << page_bits) + offset,
|
callback((static_cast<VAddr>(transform.address) << page_bits) + offset,
|
||||||
continuous_bits << align_bits);
|
continuous_bits << align_bits);
|
||||||
mask = continuous_bits < align_size ? (mask >> continuous_bits) : 0;
|
mask = continuous_bits < align_size ? (mask >> continuous_bits) : 0;
|
||||||
offset += continuous_bits << align_bits;
|
offset += continuous_bits << align_bits;
|
||||||
@ -80,7 +80,7 @@ private:
|
|||||||
u32 mask;
|
u32 mask;
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr static size_t page_bits = DEVICE_PAGEBITS - 1;
|
constexpr static size_t page_bits = Memory::YUZU_PAGEBITS - 1;
|
||||||
constexpr static size_t page_size = 1ULL << page_bits;
|
constexpr static size_t page_size = 1ULL << page_bits;
|
||||||
constexpr static size_t page_mask = page_size - 1;
|
constexpr static size_t page_mask = page_size - 1;
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ private:
|
|||||||
constexpr static size_t align_mask = align_size - 1;
|
constexpr static size_t align_mask = align_size - 1;
|
||||||
constexpr static TransformAddress default_transform = {.address = ~0U, .mask = 0U};
|
constexpr static TransformAddress default_transform = {.address = ~0U, .mask = 0U};
|
||||||
|
|
||||||
bool IsValid(PAddr address) {
|
bool IsValid(VAddr address) {
|
||||||
return address < (1ULL << 39);
|
return address < (1ULL << 39);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ private:
|
|||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
TransformAddress BuildTransform(PAddr address, size_t size) {
|
TransformAddress BuildTransform(VAddr address, size_t size) {
|
||||||
const size_t minor_address = address & page_mask;
|
const size_t minor_address = address & page_mask;
|
||||||
const size_t minor_bit = minor_address >> align_bits;
|
const size_t minor_bit = minor_address >> align_bits;
|
||||||
const size_t top_bit = (minor_address + size + align_mask) >> align_bits;
|
const size_t top_bit = (minor_address + size + align_mask) >> align_bits;
|
||||||
|
@ -1,214 +0,0 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <iterator>
|
|
||||||
#include <memory>
|
|
||||||
#include <optional>
|
|
||||||
#include <span>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include "common/assert.h"
|
|
||||||
#include "common/scratch_buffer.h"
|
|
||||||
|
|
||||||
namespace Core::Memory {
|
|
||||||
|
|
||||||
enum GuestMemoryFlags : u32 {
|
|
||||||
Read = 1 << 0,
|
|
||||||
Write = 1 << 1,
|
|
||||||
Safe = 1 << 2,
|
|
||||||
Cached = 1 << 3,
|
|
||||||
|
|
||||||
SafeRead = Read | Safe,
|
|
||||||
SafeWrite = Write | Safe,
|
|
||||||
SafeReadWrite = SafeRead | SafeWrite,
|
|
||||||
SafeReadCachedWrite = SafeReadWrite | Cached,
|
|
||||||
|
|
||||||
UnsafeRead = Read,
|
|
||||||
UnsafeWrite = Write,
|
|
||||||
UnsafeReadWrite = UnsafeRead | UnsafeWrite,
|
|
||||||
UnsafeReadCachedWrite = UnsafeReadWrite | Cached,
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
template <typename M, typename T, GuestMemoryFlags FLAGS>
|
|
||||||
class GuestMemory {
|
|
||||||
using iterator = T*;
|
|
||||||
using const_iterator = const T*;
|
|
||||||
using value_type = T;
|
|
||||||
using element_type = T;
|
|
||||||
using iterator_category = std::contiguous_iterator_tag;
|
|
||||||
|
|
||||||
public:
|
|
||||||
GuestMemory() = delete;
|
|
||||||
explicit GuestMemory(M& memory, u64 addr, std::size_t size,
|
|
||||||
Common::ScratchBuffer<T>* backup = nullptr)
|
|
||||||
: m_memory{memory}, m_addr{addr}, m_size{size} {
|
|
||||||
static_assert(FLAGS & GuestMemoryFlags::Read || FLAGS & GuestMemoryFlags::Write);
|
|
||||||
if constexpr (FLAGS & GuestMemoryFlags::Read) {
|
|
||||||
Read(addr, size, backup);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
~GuestMemory() = default;
|
|
||||||
|
|
||||||
T* data() noexcept {
|
|
||||||
return m_data_span.data();
|
|
||||||
}
|
|
||||||
|
|
||||||
const T* data() const noexcept {
|
|
||||||
return m_data_span.data();
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t size() const noexcept {
|
|
||||||
return m_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t size_bytes() const noexcept {
|
|
||||||
return this->size() * sizeof(T);
|
|
||||||
}
|
|
||||||
|
|
||||||
[[nodiscard]] T* begin() noexcept {
|
|
||||||
return this->data();
|
|
||||||
}
|
|
||||||
|
|
||||||
[[nodiscard]] const T* begin() const noexcept {
|
|
||||||
return this->data();
|
|
||||||
}
|
|
||||||
|
|
||||||
[[nodiscard]] T* end() noexcept {
|
|
||||||
return this->data() + this->size();
|
|
||||||
}
|
|
||||||
|
|
||||||
[[nodiscard]] const T* end() const noexcept {
|
|
||||||
return this->data() + this->size();
|
|
||||||
}
|
|
||||||
|
|
||||||
T& operator[](size_t index) noexcept {
|
|
||||||
return m_data_span[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
const T& operator[](size_t index) const noexcept {
|
|
||||||
return m_data_span[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetAddressAndSize(u64 addr, std::size_t size) noexcept {
|
|
||||||
m_addr = addr;
|
|
||||||
m_size = size;
|
|
||||||
m_addr_changed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::span<T> Read(u64 addr, std::size_t size,
|
|
||||||
Common::ScratchBuffer<T>* backup = nullptr) noexcept {
|
|
||||||
m_addr = addr;
|
|
||||||
m_size = size;
|
|
||||||
if (m_size == 0) {
|
|
||||||
m_is_data_copy = true;
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this->TrySetSpan()) {
|
|
||||||
if constexpr (FLAGS & GuestMemoryFlags::Safe) {
|
|
||||||
m_memory.FlushRegion(m_addr, this->size_bytes());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (backup) {
|
|
||||||
backup->resize_destructive(this->size());
|
|
||||||
m_data_span = *backup;
|
|
||||||
} else {
|
|
||||||
m_data_copy.resize(this->size());
|
|
||||||
m_data_span = std::span(m_data_copy);
|
|
||||||
}
|
|
||||||
m_is_data_copy = true;
|
|
||||||
m_span_valid = true;
|
|
||||||
if constexpr (FLAGS & GuestMemoryFlags::Safe) {
|
|
||||||
m_memory.ReadBlock(m_addr, this->data(), this->size_bytes());
|
|
||||||
} else {
|
|
||||||
m_memory.ReadBlockUnsafe(m_addr, this->data(), this->size_bytes());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return m_data_span;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Write(std::span<T> write_data) noexcept {
|
|
||||||
if constexpr (FLAGS & GuestMemoryFlags::Cached) {
|
|
||||||
m_memory.WriteBlockCached(m_addr, write_data.data(), this->size_bytes());
|
|
||||||
} else if constexpr (FLAGS & GuestMemoryFlags::Safe) {
|
|
||||||
m_memory.WriteBlock(m_addr, write_data.data(), this->size_bytes());
|
|
||||||
} else {
|
|
||||||
m_memory.WriteBlockUnsafe(m_addr, write_data.data(), this->size_bytes());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TrySetSpan() noexcept {
|
|
||||||
if (u8* ptr = m_memory.GetSpan(m_addr, this->size_bytes()); ptr) {
|
|
||||||
m_data_span = {reinterpret_cast<T*>(ptr), this->size()};
|
|
||||||
m_span_valid = true;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool IsDataCopy() const noexcept {
|
|
||||||
return m_is_data_copy;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AddressChanged() const noexcept {
|
|
||||||
return m_addr_changed;
|
|
||||||
}
|
|
||||||
|
|
||||||
M& m_memory;
|
|
||||||
u64 m_addr{};
|
|
||||||
size_t m_size{};
|
|
||||||
std::span<T> m_data_span{};
|
|
||||||
std::vector<T> m_data_copy{};
|
|
||||||
bool m_span_valid{false};
|
|
||||||
bool m_is_data_copy{false};
|
|
||||||
bool m_addr_changed{false};
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename M, typename T, GuestMemoryFlags FLAGS>
|
|
||||||
class GuestMemoryScoped : public GuestMemory<M, T, FLAGS> {
|
|
||||||
public:
|
|
||||||
GuestMemoryScoped() = delete;
|
|
||||||
explicit GuestMemoryScoped(M& memory, u64 addr, std::size_t size,
|
|
||||||
Common::ScratchBuffer<T>* backup = nullptr)
|
|
||||||
: GuestMemory<M, T, FLAGS>(memory, addr, size, backup) {
|
|
||||||
if constexpr (!(FLAGS & GuestMemoryFlags::Read)) {
|
|
||||||
if (!this->TrySetSpan()) {
|
|
||||||
if (backup) {
|
|
||||||
this->m_data_span = *backup;
|
|
||||||
this->m_span_valid = true;
|
|
||||||
this->m_is_data_copy = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
~GuestMemoryScoped() {
|
|
||||||
if constexpr (FLAGS & GuestMemoryFlags::Write) {
|
|
||||||
if (this->size() == 0) [[unlikely]] {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this->AddressChanged() || this->IsDataCopy()) {
|
|
||||||
ASSERT(this->m_span_valid);
|
|
||||||
if constexpr (FLAGS & GuestMemoryFlags::Cached) {
|
|
||||||
this->m_memory.WriteBlockCached(this->m_addr, this->data(), this->size_bytes());
|
|
||||||
} else if constexpr (FLAGS & GuestMemoryFlags::Safe) {
|
|
||||||
this->m_memory.WriteBlock(this->m_addr, this->data(), this->size_bytes());
|
|
||||||
} else {
|
|
||||||
this->m_memory.WriteBlockUnsafe(this->m_addr, this->data(), this->size_bytes());
|
|
||||||
}
|
|
||||||
} else if constexpr ((FLAGS & GuestMemoryFlags::Safe) ||
|
|
||||||
(FLAGS & GuestMemoryFlags::Cached)) {
|
|
||||||
this->m_memory.InvalidateRegion(this->m_addr, this->size_bytes());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
} // namespace Core::Memory
|
|
@ -2,8 +2,8 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "common/settings.h"
|
#include "common/settings.h"
|
||||||
#include "hid_core/frontend/emulated_console.h"
|
#include "core/hid/emulated_console.h"
|
||||||
#include "hid_core/frontend/input_converter.h"
|
#include "core/hid/input_converter.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
EmulatedConsole::EmulatedConsole() = default;
|
EmulatedConsole::EmulatedConsole() = default;
|
@ -17,8 +17,8 @@
|
|||||||
#include "common/point.h"
|
#include "common/point.h"
|
||||||
#include "common/quaternion.h"
|
#include "common/quaternion.h"
|
||||||
#include "common/vector_math.h"
|
#include "common/vector_math.h"
|
||||||
#include "hid_core/frontend/motion_input.h"
|
#include "core/hid/hid_types.h"
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hid/motion_input.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
static constexpr std::size_t MaxTouchDevices = 32;
|
static constexpr std::size_t MaxTouchDevices = 32;
|
@ -6,9 +6,9 @@
|
|||||||
|
|
||||||
#include "common/polyfill_ranges.h"
|
#include "common/polyfill_ranges.h"
|
||||||
#include "common/thread.h"
|
#include "common/thread.h"
|
||||||
#include "hid_core/frontend/emulated_controller.h"
|
#include "core/hid/emulated_controller.h"
|
||||||
#include "hid_core/frontend/input_converter.h"
|
#include "core/hid/input_converter.h"
|
||||||
#include "hid_core/hid_util.h"
|
#include "core/hle/service/hid/hid_util.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
constexpr s32 HID_JOYSTICK_MAX = 0x7fff;
|
constexpr s32 HID_JOYSTICK_MAX = 0x7fff;
|
@ -15,9 +15,9 @@
|
|||||||
#include "common/param_package.h"
|
#include "common/param_package.h"
|
||||||
#include "common/settings.h"
|
#include "common/settings.h"
|
||||||
#include "common/vector_math.h"
|
#include "common/vector_math.h"
|
||||||
#include "hid_core/frontend/motion_input.h"
|
#include "core/hid/hid_types.h"
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hid/irs_types.h"
|
||||||
#include "hid_core/irsensor/irs_types.h"
|
#include "core/hid/motion_input.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
const std::size_t max_emulated_controllers = 2;
|
const std::size_t max_emulated_controllers = 2;
|
@ -4,8 +4,8 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
|
|
||||||
#include "hid_core/frontend/emulated_devices.h"
|
#include "core/hid/emulated_devices.h"
|
||||||
#include "hid_core/frontend/input_converter.h"
|
#include "core/hid/input_converter.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
#include "common/input.h"
|
#include "common/input.h"
|
||||||
#include "common/param_package.h"
|
#include "common/param_package.h"
|
||||||
#include "common/settings.h"
|
#include "common/settings.h"
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hid/hid_types.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
using KeyboardDevices = std::array<std::unique_ptr<Common::Input::InputDevice>,
|
using KeyboardDevices = std::array<std::unique_ptr<Common::Input::InputDevice>,
|
@ -2,11 +2,11 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
#include "hid_core/frontend/emulated_console.h"
|
#include "core/hid/emulated_console.h"
|
||||||
#include "hid_core/frontend/emulated_controller.h"
|
#include "core/hid/emulated_controller.h"
|
||||||
#include "hid_core/frontend/emulated_devices.h"
|
#include "core/hid/emulated_devices.h"
|
||||||
#include "hid_core/hid_core.h"
|
#include "core/hid/hid_core.h"
|
||||||
#include "hid_core/hid_util.h"
|
#include "core/hle/service/hid/hid_util.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
|
|
@ -6,7 +6,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "common/common_funcs.h"
|
#include "common/common_funcs.h"
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hid/hid_types.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
class EmulatedConsole;
|
class EmulatedConsole;
|
@ -5,7 +5,7 @@
|
|||||||
#include <random>
|
#include <random>
|
||||||
|
|
||||||
#include "common/input.h"
|
#include "common/input.h"
|
||||||
#include "hid_core/frontend/input_converter.h"
|
#include "core/hid/input_converter.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
|
|
@ -2,12 +2,12 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
|
#include "core/hid/hid_types.h"
|
||||||
|
#include "core/hid/input_interpreter.h"
|
||||||
|
#include "core/hle/service/hid/controllers/npad.h"
|
||||||
#include "core/hle/service/hid/hid_server.h"
|
#include "core/hle/service/hid/hid_server.h"
|
||||||
|
#include "core/hle/service/hid/resource_manager.h"
|
||||||
#include "core/hle/service/sm/sm.h"
|
#include "core/hle/service/sm/sm.h"
|
||||||
#include "hid_core/frontend/input_interpreter.h"
|
|
||||||
#include "hid_core/hid_types.h"
|
|
||||||
#include "hid_core/resource_manager.h"
|
|
||||||
#include "hid_core/resources/npad/npad.h"
|
|
||||||
|
|
||||||
InputInterpreter::InputInterpreter(Core::System& system)
|
InputInterpreter::InputInterpreter(Core::System& system)
|
||||||
: npad{system.ServiceManager()
|
: npad{system.ServiceManager()
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include "common/common_funcs.h"
|
#include "common/common_funcs.h"
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hid/hid_types.h"
|
||||||
|
|
||||||
namespace Core::IrSensor {
|
namespace Core::IrSensor {
|
||||||
|
|
@ -4,7 +4,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
#include "common/math_util.h"
|
#include "common/math_util.h"
|
||||||
#include "hid_core/frontend/motion_input.h"
|
#include "core/hid/motion_input.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
|
|
@ -81,11 +81,11 @@ enum class KMemoryState : u32 {
|
|||||||
|
|
||||||
ThreadLocal = static_cast<u32>(Svc::MemoryState::ThreadLocal) | FlagLinearMapped,
|
ThreadLocal = static_cast<u32>(Svc::MemoryState::ThreadLocal) | FlagLinearMapped,
|
||||||
|
|
||||||
Transferred = static_cast<u32>(Svc::MemoryState::Transferred) | FlagsMisc |
|
Transfered = static_cast<u32>(Svc::MemoryState::Transfered) | FlagsMisc |
|
||||||
FlagCanAlignedDeviceMap | FlagCanChangeAttribute | FlagCanUseIpc |
|
FlagCanAlignedDeviceMap | FlagCanChangeAttribute | FlagCanUseIpc |
|
||||||
FlagCanUseNonSecureIpc | FlagCanUseNonDeviceIpc,
|
FlagCanUseNonSecureIpc | FlagCanUseNonDeviceIpc,
|
||||||
|
|
||||||
SharedTransferred = static_cast<u32>(Svc::MemoryState::SharedTransferred) | FlagsMisc |
|
SharedTransfered = static_cast<u32>(Svc::MemoryState::SharedTransfered) | FlagsMisc |
|
||||||
FlagCanAlignedDeviceMap | FlagCanUseNonSecureIpc | FlagCanUseNonDeviceIpc,
|
FlagCanAlignedDeviceMap | FlagCanUseNonSecureIpc | FlagCanUseNonDeviceIpc,
|
||||||
|
|
||||||
SharedCode = static_cast<u32>(Svc::MemoryState::SharedCode) | FlagMapped |
|
SharedCode = static_cast<u32>(Svc::MemoryState::SharedCode) | FlagMapped |
|
||||||
@ -130,8 +130,8 @@ static_assert(static_cast<u32>(KMemoryState::AliasCodeData) == 0x0FFFBD09);
|
|||||||
static_assert(static_cast<u32>(KMemoryState::Ipc) == 0x045C3C0A);
|
static_assert(static_cast<u32>(KMemoryState::Ipc) == 0x045C3C0A);
|
||||||
static_assert(static_cast<u32>(KMemoryState::Stack) == 0x045C3C0B);
|
static_assert(static_cast<u32>(KMemoryState::Stack) == 0x045C3C0B);
|
||||||
static_assert(static_cast<u32>(KMemoryState::ThreadLocal) == 0x0400000C);
|
static_assert(static_cast<u32>(KMemoryState::ThreadLocal) == 0x0400000C);
|
||||||
static_assert(static_cast<u32>(KMemoryState::Transferred) == 0x055C3C0D);
|
static_assert(static_cast<u32>(KMemoryState::Transfered) == 0x055C3C0D);
|
||||||
static_assert(static_cast<u32>(KMemoryState::SharedTransferred) == 0x045C380E);
|
static_assert(static_cast<u32>(KMemoryState::SharedTransfered) == 0x045C380E);
|
||||||
static_assert(static_cast<u32>(KMemoryState::SharedCode) == 0x0440380F);
|
static_assert(static_cast<u32>(KMemoryState::SharedCode) == 0x0440380F);
|
||||||
static_assert(static_cast<u32>(KMemoryState::Inaccessible) == 0x00000010);
|
static_assert(static_cast<u32>(KMemoryState::Inaccessible) == 0x00000010);
|
||||||
static_assert(static_cast<u32>(KMemoryState::NonSecureIpc) == 0x045C3811);
|
static_assert(static_cast<u32>(KMemoryState::NonSecureIpc) == 0x045C3811);
|
||||||
|
@ -486,8 +486,8 @@ KProcessAddress KPageTableBase::GetRegionAddress(Svc::MemoryState state) const {
|
|||||||
case Svc::MemoryState::Shared:
|
case Svc::MemoryState::Shared:
|
||||||
case Svc::MemoryState::AliasCode:
|
case Svc::MemoryState::AliasCode:
|
||||||
case Svc::MemoryState::AliasCodeData:
|
case Svc::MemoryState::AliasCodeData:
|
||||||
case Svc::MemoryState::Transferred:
|
case Svc::MemoryState::Transfered:
|
||||||
case Svc::MemoryState::SharedTransferred:
|
case Svc::MemoryState::SharedTransfered:
|
||||||
case Svc::MemoryState::SharedCode:
|
case Svc::MemoryState::SharedCode:
|
||||||
case Svc::MemoryState::GeneratedCode:
|
case Svc::MemoryState::GeneratedCode:
|
||||||
case Svc::MemoryState::CodeOut:
|
case Svc::MemoryState::CodeOut:
|
||||||
@ -522,8 +522,8 @@ size_t KPageTableBase::GetRegionSize(Svc::MemoryState state) const {
|
|||||||
case Svc::MemoryState::Shared:
|
case Svc::MemoryState::Shared:
|
||||||
case Svc::MemoryState::AliasCode:
|
case Svc::MemoryState::AliasCode:
|
||||||
case Svc::MemoryState::AliasCodeData:
|
case Svc::MemoryState::AliasCodeData:
|
||||||
case Svc::MemoryState::Transferred:
|
case Svc::MemoryState::Transfered:
|
||||||
case Svc::MemoryState::SharedTransferred:
|
case Svc::MemoryState::SharedTransfered:
|
||||||
case Svc::MemoryState::SharedCode:
|
case Svc::MemoryState::SharedCode:
|
||||||
case Svc::MemoryState::GeneratedCode:
|
case Svc::MemoryState::GeneratedCode:
|
||||||
case Svc::MemoryState::CodeOut:
|
case Svc::MemoryState::CodeOut:
|
||||||
@ -564,8 +564,8 @@ bool KPageTableBase::CanContain(KProcessAddress addr, size_t size, Svc::MemorySt
|
|||||||
case Svc::MemoryState::AliasCodeData:
|
case Svc::MemoryState::AliasCodeData:
|
||||||
case Svc::MemoryState::Stack:
|
case Svc::MemoryState::Stack:
|
||||||
case Svc::MemoryState::ThreadLocal:
|
case Svc::MemoryState::ThreadLocal:
|
||||||
case Svc::MemoryState::Transferred:
|
case Svc::MemoryState::Transfered:
|
||||||
case Svc::MemoryState::SharedTransferred:
|
case Svc::MemoryState::SharedTransfered:
|
||||||
case Svc::MemoryState::SharedCode:
|
case Svc::MemoryState::SharedCode:
|
||||||
case Svc::MemoryState::GeneratedCode:
|
case Svc::MemoryState::GeneratedCode:
|
||||||
case Svc::MemoryState::CodeOut:
|
case Svc::MemoryState::CodeOut:
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
#include "common/scope_exit.h"
|
#include "common/scope_exit.h"
|
||||||
#include "common/settings.h"
|
#include "common/settings.h"
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "core/gpu_dirty_memory_manager.h"
|
|
||||||
#include "core/hle/kernel/k_process.h"
|
#include "core/hle/kernel/k_process.h"
|
||||||
#include "core/hle/kernel/k_scoped_resource_reservation.h"
|
#include "core/hle/kernel/k_scoped_resource_reservation.h"
|
||||||
#include "core/hle/kernel/k_shared_memory.h"
|
#include "core/hle/kernel/k_shared_memory.h"
|
||||||
@ -315,7 +314,7 @@ Result KProcess::Initialize(const Svc::CreateProcessParameter& params, const KPa
|
|||||||
|
|
||||||
// Ensure our memory is initialized.
|
// Ensure our memory is initialized.
|
||||||
m_memory.SetCurrentPageTable(*this);
|
m_memory.SetCurrentPageTable(*this);
|
||||||
m_memory.SetGPUDirtyManagers(m_kernel.System().GetGPUDirtyMemoryManager());
|
m_memory.SetGPUDirtyManagers(m_dirty_memory_managers);
|
||||||
|
|
||||||
// Ensure we can insert the code region.
|
// Ensure we can insert the code region.
|
||||||
R_UNLESS(m_page_table.CanContain(params.code_address, params.code_num_pages * PageSize,
|
R_UNLESS(m_page_table.CanContain(params.code_address, params.code_num_pages * PageSize,
|
||||||
@ -412,7 +411,7 @@ Result KProcess::Initialize(const Svc::CreateProcessParameter& params,
|
|||||||
|
|
||||||
// Ensure our memory is initialized.
|
// Ensure our memory is initialized.
|
||||||
m_memory.SetCurrentPageTable(*this);
|
m_memory.SetCurrentPageTable(*this);
|
||||||
m_memory.SetGPUDirtyManagers(m_kernel.System().GetGPUDirtyMemoryManager());
|
m_memory.SetGPUDirtyManagers(m_dirty_memory_managers);
|
||||||
|
|
||||||
// Ensure we can insert the code region.
|
// Ensure we can insert the code region.
|
||||||
R_UNLESS(m_page_table.CanContain(params.code_address, code_size, KMemoryState::Code),
|
R_UNLESS(m_page_table.CanContain(params.code_address, code_size, KMemoryState::Code),
|
||||||
@ -1136,7 +1135,8 @@ void KProcess::Switch(KProcess* cur_process, KProcess* next_process) {}
|
|||||||
KProcess::KProcess(KernelCore& kernel)
|
KProcess::KProcess(KernelCore& kernel)
|
||||||
: KAutoObjectWithSlabHeapAndContainer(kernel), m_page_table{kernel}, m_state_lock{kernel},
|
: KAutoObjectWithSlabHeapAndContainer(kernel), m_page_table{kernel}, m_state_lock{kernel},
|
||||||
m_list_lock{kernel}, m_cond_var{kernel.System()}, m_address_arbiter{kernel.System()},
|
m_list_lock{kernel}, m_cond_var{kernel.System()}, m_address_arbiter{kernel.System()},
|
||||||
m_handle_table{kernel}, m_exclusive_monitor{}, m_memory{kernel.System()} {}
|
m_handle_table{kernel}, m_dirty_memory_managers{},
|
||||||
|
m_exclusive_monitor{}, m_memory{kernel.System()} {}
|
||||||
KProcess::~KProcess() = default;
|
KProcess::~KProcess() = default;
|
||||||
|
|
||||||
Result KProcess::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, std::size_t code_size,
|
Result KProcess::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, std::size_t code_size,
|
||||||
@ -1318,4 +1318,10 @@ bool KProcess::RemoveWatchpoint(KProcessAddress addr, u64 size, DebugWatchpointT
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void KProcess::GatherGPUDirtyMemory(std::function<void(VAddr, size_t)>& callback) {
|
||||||
|
for (auto& manager : m_dirty_memory_managers) {
|
||||||
|
manager.Gather(callback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Kernel
|
} // namespace Kernel
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include "core/arm/arm_interface.h"
|
#include "core/arm/arm_interface.h"
|
||||||
#include "core/file_sys/program_metadata.h"
|
#include "core/file_sys/program_metadata.h"
|
||||||
|
#include "core/gpu_dirty_memory_manager.h"
|
||||||
#include "core/hle/kernel/code_set.h"
|
#include "core/hle/kernel/code_set.h"
|
||||||
#include "core/hle/kernel/k_address_arbiter.h"
|
#include "core/hle/kernel/k_address_arbiter.h"
|
||||||
#include "core/hle/kernel/k_capabilities.h"
|
#include "core/hle/kernel/k_capabilities.h"
|
||||||
@ -127,6 +128,7 @@ private:
|
|||||||
#ifdef HAS_NCE
|
#ifdef HAS_NCE
|
||||||
std::unordered_map<u64, u64> m_post_handlers{};
|
std::unordered_map<u64, u64> m_post_handlers{};
|
||||||
#endif
|
#endif
|
||||||
|
std::array<Core::GPUDirtyMemoryManager, Core::Hardware::NUM_CPU_CORES> m_dirty_memory_managers;
|
||||||
std::unique_ptr<Core::ExclusiveMonitor> m_exclusive_monitor;
|
std::unique_ptr<Core::ExclusiveMonitor> m_exclusive_monitor;
|
||||||
Core::Memory::Memory m_memory;
|
Core::Memory::Memory m_memory;
|
||||||
|
|
||||||
@ -509,6 +511,8 @@ public:
|
|||||||
return m_memory;
|
return m_memory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GatherGPUDirtyMemory(std::function<void(VAddr, size_t)>& callback);
|
||||||
|
|
||||||
Core::ExclusiveMonitor& GetExclusiveMonitor() const {
|
Core::ExclusiveMonitor& GetExclusiveMonitor() const {
|
||||||
return *m_exclusive_monitor;
|
return *m_exclusive_monitor;
|
||||||
}
|
}
|
||||||
|
@ -76,8 +76,8 @@ Result KTransferMemory::Map(KProcessAddress address, size_t size, Svc::MemoryPer
|
|||||||
|
|
||||||
// Map the memory.
|
// Map the memory.
|
||||||
const KMemoryState state = (m_owner_perm == Svc::MemoryPermission::None)
|
const KMemoryState state = (m_owner_perm == Svc::MemoryPermission::None)
|
||||||
? KMemoryState::Transferred
|
? KMemoryState::Transfered
|
||||||
: KMemoryState::SharedTransferred;
|
: KMemoryState::SharedTransfered;
|
||||||
R_TRY(GetCurrentProcess(m_kernel).GetPageTable().MapPageGroup(
|
R_TRY(GetCurrentProcess(m_kernel).GetPageTable().MapPageGroup(
|
||||||
address, *m_page_group, state, KMemoryPermission::UserReadWrite));
|
address, *m_page_group, state, KMemoryPermission::UserReadWrite));
|
||||||
|
|
||||||
@ -96,8 +96,8 @@ Result KTransferMemory::Unmap(KProcessAddress address, size_t size) {
|
|||||||
|
|
||||||
// Unmap the memory.
|
// Unmap the memory.
|
||||||
const KMemoryState state = (m_owner_perm == Svc::MemoryPermission::None)
|
const KMemoryState state = (m_owner_perm == Svc::MemoryPermission::None)
|
||||||
? KMemoryState::Transferred
|
? KMemoryState::Transfered
|
||||||
: KMemoryState::SharedTransferred;
|
: KMemoryState::SharedTransfered;
|
||||||
R_TRY(GetCurrentProcess(m_kernel).GetPageTable().UnmapPageGroup(address, *m_page_group, state));
|
R_TRY(GetCurrentProcess(m_kernel).GetPageTable().UnmapPageGroup(address, *m_page_group, state));
|
||||||
|
|
||||||
// Mark ourselves as unmapped.
|
// Mark ourselves as unmapped.
|
||||||
|
@ -90,7 +90,7 @@ Result MapTransferMemory(Core::System& system, Handle trmem_handle, uint64_t add
|
|||||||
// Verify that the mapping is in range.
|
// Verify that the mapping is in range.
|
||||||
R_UNLESS(GetCurrentProcess(system.Kernel())
|
R_UNLESS(GetCurrentProcess(system.Kernel())
|
||||||
.GetPageTable()
|
.GetPageTable()
|
||||||
.CanContain(address, size, KMemoryState::Transferred),
|
.CanContain(address, size, KMemoryState::Transfered),
|
||||||
ResultInvalidMemoryRegion);
|
ResultInvalidMemoryRegion);
|
||||||
|
|
||||||
// Map the transfer memory.
|
// Map the transfer memory.
|
||||||
@ -117,7 +117,7 @@ Result UnmapTransferMemory(Core::System& system, Handle trmem_handle, uint64_t a
|
|||||||
// Verify that the mapping is in range.
|
// Verify that the mapping is in range.
|
||||||
R_UNLESS(GetCurrentProcess(system.Kernel())
|
R_UNLESS(GetCurrentProcess(system.Kernel())
|
||||||
.GetPageTable()
|
.GetPageTable()
|
||||||
.CanContain(address, size, KMemoryState::Transferred),
|
.CanContain(address, size, KMemoryState::Transfered),
|
||||||
ResultInvalidMemoryRegion);
|
ResultInvalidMemoryRegion);
|
||||||
|
|
||||||
// Unmap the transfer memory.
|
// Unmap the transfer memory.
|
||||||
|
@ -27,8 +27,8 @@ enum class MemoryState : u32 {
|
|||||||
Ipc = 0x0A,
|
Ipc = 0x0A,
|
||||||
Stack = 0x0B,
|
Stack = 0x0B,
|
||||||
ThreadLocal = 0x0C,
|
ThreadLocal = 0x0C,
|
||||||
Transferred = 0x0D,
|
Transfered = 0x0D,
|
||||||
SharedTransferred = 0x0E,
|
SharedTransfered = 0x0E,
|
||||||
SharedCode = 0x0F,
|
SharedCode = 0x0F,
|
||||||
Inaccessible = 0x10,
|
Inaccessible = 0x10,
|
||||||
NonSecureIpc = 0x11,
|
NonSecureIpc = 0x11,
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include "core/file_sys/patch_manager.h"
|
#include "core/file_sys/patch_manager.h"
|
||||||
#include "core/file_sys/registered_cache.h"
|
#include "core/file_sys/registered_cache.h"
|
||||||
#include "core/file_sys/savedata_factory.h"
|
#include "core/file_sys/savedata_factory.h"
|
||||||
|
#include "core/hid/hid_types.h"
|
||||||
#include "core/hle/kernel/k_event.h"
|
#include "core/hle/kernel/k_event.h"
|
||||||
#include "core/hle/kernel/k_transfer_memory.h"
|
#include "core/hle/kernel/k_transfer_memory.h"
|
||||||
#include "core/hle/result.h"
|
#include "core/hle/result.h"
|
||||||
@ -36,6 +37,7 @@
|
|||||||
#include "core/hle/service/caps/caps_su.h"
|
#include "core/hle/service/caps/caps_su.h"
|
||||||
#include "core/hle/service/caps/caps_types.h"
|
#include "core/hle/service/caps/caps_types.h"
|
||||||
#include "core/hle/service/filesystem/filesystem.h"
|
#include "core/hle/service/filesystem/filesystem.h"
|
||||||
|
#include "core/hle/service/hid/controllers/npad.h"
|
||||||
#include "core/hle/service/ipc_helpers.h"
|
#include "core/hle/service/ipc_helpers.h"
|
||||||
#include "core/hle/service/ns/ns.h"
|
#include "core/hle/service/ns/ns.h"
|
||||||
#include "core/hle/service/nvnflinger/fb_share_buffer_manager.h"
|
#include "core/hle/service/nvnflinger/fb_share_buffer_manager.h"
|
||||||
@ -46,8 +48,6 @@
|
|||||||
#include "core/hle/service/vi/vi.h"
|
#include "core/hle/service/vi/vi.h"
|
||||||
#include "core/hle/service/vi/vi_results.h"
|
#include "core/hle/service/vi/vi_results.h"
|
||||||
#include "core/memory.h"
|
#include "core/memory.h"
|
||||||
#include "hid_core/hid_types.h"
|
|
||||||
#include "hid_core/resources/npad/npad.h"
|
|
||||||
|
|
||||||
namespace Service::AM {
|
namespace Service::AM {
|
||||||
|
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "core/frontend/applets/cabinet.h"
|
#include "core/frontend/applets/cabinet.h"
|
||||||
|
#include "core/hid/hid_core.h"
|
||||||
#include "core/hle/kernel/k_event.h"
|
#include "core/hle/kernel/k_event.h"
|
||||||
#include "core/hle/kernel/k_readable_event.h"
|
#include "core/hle/kernel/k_readable_event.h"
|
||||||
#include "core/hle/service/am/am.h"
|
#include "core/hle/service/am/am.h"
|
||||||
#include "core/hle/service/am/applets/applet_cabinet.h"
|
#include "core/hle/service/am/applets/applet_cabinet.h"
|
||||||
#include "core/hle/service/mii/mii_manager.h"
|
#include "core/hle/service/mii/mii_manager.h"
|
||||||
#include "core/hle/service/nfc/common/device.h"
|
#include "core/hle/service/nfc/common/device.h"
|
||||||
#include "hid_core/hid_core.h"
|
|
||||||
|
|
||||||
namespace Service::AM::Applets {
|
namespace Service::AM::Applets {
|
||||||
|
|
||||||
|
@ -9,13 +9,13 @@
|
|||||||
#include "common/string_util.h"
|
#include "common/string_util.h"
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "core/frontend/applets/controller.h"
|
#include "core/frontend/applets/controller.h"
|
||||||
|
#include "core/hid/emulated_controller.h"
|
||||||
|
#include "core/hid/hid_core.h"
|
||||||
|
#include "core/hid/hid_types.h"
|
||||||
#include "core/hle/result.h"
|
#include "core/hle/result.h"
|
||||||
#include "core/hle/service/am/am.h"
|
#include "core/hle/service/am/am.h"
|
||||||
#include "core/hle/service/am/applets/applet_controller.h"
|
#include "core/hle/service/am/applets/applet_controller.h"
|
||||||
#include "hid_core/frontend/emulated_controller.h"
|
#include "core/hle/service/hid/controllers/npad.h"
|
||||||
#include "hid_core/hid_core.h"
|
|
||||||
#include "hid_core/hid_types.h"
|
|
||||||
#include "hid_core/resources/npad/npad.h"
|
|
||||||
|
|
||||||
namespace Service::AM::Applets {
|
namespace Service::AM::Applets {
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ struct UiSettingsDisplayOptions {
|
|||||||
bool is_system_or_launcher;
|
bool is_system_or_launcher;
|
||||||
bool is_registration_permitted;
|
bool is_registration_permitted;
|
||||||
bool show_skip_button;
|
bool show_skip_button;
|
||||||
bool additional_select;
|
bool aditional_select;
|
||||||
bool show_user_selector;
|
bool show_user_selector;
|
||||||
bool is_unqualified_user_selectable;
|
bool is_unqualified_user_selectable;
|
||||||
};
|
};
|
||||||
|
@ -85,7 +85,7 @@ Result AlbumManager::GetAlbumFileList(std::vector<AlbumEntry>& out_entries, Albu
|
|||||||
}
|
}
|
||||||
|
|
||||||
Result AlbumManager::GetAlbumFileList(std::vector<ApplicationAlbumFileEntry>& out_entries,
|
Result AlbumManager::GetAlbumFileList(std::vector<ApplicationAlbumFileEntry>& out_entries,
|
||||||
ContentType content_type, s64 start_posix_time,
|
ContentType contex_type, s64 start_posix_time,
|
||||||
s64 end_posix_time, u64 aruid) const {
|
s64 end_posix_time, u64 aruid) const {
|
||||||
if (!is_mounted) {
|
if (!is_mounted) {
|
||||||
return ResultIsNotMounted;
|
return ResultIsNotMounted;
|
||||||
@ -94,7 +94,7 @@ Result AlbumManager::GetAlbumFileList(std::vector<ApplicationAlbumFileEntry>& ou
|
|||||||
std::vector<ApplicationAlbumEntry> album_entries;
|
std::vector<ApplicationAlbumEntry> album_entries;
|
||||||
const auto start_date = ConvertToAlbumDateTime(start_posix_time);
|
const auto start_date = ConvertToAlbumDateTime(start_posix_time);
|
||||||
const auto end_date = ConvertToAlbumDateTime(end_posix_time);
|
const auto end_date = ConvertToAlbumDateTime(end_posix_time);
|
||||||
const auto result = GetAlbumFileList(album_entries, content_type, start_date, end_date, aruid);
|
const auto result = GetAlbumFileList(album_entries, contex_type, start_date, end_date, aruid);
|
||||||
|
|
||||||
if (result.IsError()) {
|
if (result.IsError()) {
|
||||||
return result;
|
return result;
|
||||||
@ -113,14 +113,14 @@ Result AlbumManager::GetAlbumFileList(std::vector<ApplicationAlbumFileEntry>& ou
|
|||||||
}
|
}
|
||||||
|
|
||||||
Result AlbumManager::GetAlbumFileList(std::vector<ApplicationAlbumEntry>& out_entries,
|
Result AlbumManager::GetAlbumFileList(std::vector<ApplicationAlbumEntry>& out_entries,
|
||||||
ContentType content_type, AlbumFileDateTime start_date,
|
ContentType contex_type, AlbumFileDateTime start_date,
|
||||||
AlbumFileDateTime end_date, u64 aruid) const {
|
AlbumFileDateTime end_date, u64 aruid) const {
|
||||||
if (!is_mounted) {
|
if (!is_mounted) {
|
||||||
return ResultIsNotMounted;
|
return ResultIsNotMounted;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& [file_id, path] : album_files) {
|
for (auto& [file_id, path] : album_files) {
|
||||||
if (file_id.type != content_type) {
|
if (file_id.type != contex_type) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (file_id.date > start_date) {
|
if (file_id.date > start_date) {
|
||||||
@ -139,7 +139,7 @@ Result AlbumManager::GetAlbumFileList(std::vector<ApplicationAlbumEntry>& out_en
|
|||||||
.hash{},
|
.hash{},
|
||||||
.datetime = file_id.date,
|
.datetime = file_id.date,
|
||||||
.storage = file_id.storage,
|
.storage = file_id.storage,
|
||||||
.content = content_type,
|
.content = contex_type,
|
||||||
.unknown = 1,
|
.unknown = 1,
|
||||||
};
|
};
|
||||||
out_entries.push_back(entry);
|
out_entries.push_back(entry);
|
||||||
|
@ -45,10 +45,10 @@ public:
|
|||||||
Result GetAlbumFileList(std::vector<AlbumEntry>& out_entries, AlbumStorage storage,
|
Result GetAlbumFileList(std::vector<AlbumEntry>& out_entries, AlbumStorage storage,
|
||||||
u8 flags) const;
|
u8 flags) const;
|
||||||
Result GetAlbumFileList(std::vector<ApplicationAlbumFileEntry>& out_entries,
|
Result GetAlbumFileList(std::vector<ApplicationAlbumFileEntry>& out_entries,
|
||||||
ContentType content_type, s64 start_posix_time, s64 end_posix_time,
|
ContentType contex_type, s64 start_posix_time, s64 end_posix_time,
|
||||||
u64 aruid) const;
|
u64 aruid) const;
|
||||||
Result GetAlbumFileList(std::vector<ApplicationAlbumEntry>& out_entries,
|
Result GetAlbumFileList(std::vector<ApplicationAlbumEntry>& out_entries,
|
||||||
ContentType content_type, AlbumFileDateTime start_date,
|
ContentType contex_type, AlbumFileDateTime start_date,
|
||||||
AlbumFileDateTime end_date, u64 aruid) const;
|
AlbumFileDateTime end_date, u64 aruid) const;
|
||||||
Result GetAutoSavingStorage(bool& out_is_autosaving) const;
|
Result GetAutoSavingStorage(bool& out_is_autosaving) const;
|
||||||
Result LoadAlbumScreenShotImage(LoadAlbumScreenShotImageOutput& out_image_output,
|
Result LoadAlbumScreenShotImage(LoadAlbumScreenShotImageOutput& out_image_output,
|
||||||
|
@ -12,7 +12,7 @@ constexpr Result ResultUnknown5(ErrorModule::Capture, 5);
|
|||||||
constexpr Result ResultUnknown6(ErrorModule::Capture, 6);
|
constexpr Result ResultUnknown6(ErrorModule::Capture, 6);
|
||||||
constexpr Result ResultUnknown7(ErrorModule::Capture, 7);
|
constexpr Result ResultUnknown7(ErrorModule::Capture, 7);
|
||||||
constexpr Result ResultOutOfRange(ErrorModule::Capture, 8);
|
constexpr Result ResultOutOfRange(ErrorModule::Capture, 8);
|
||||||
constexpr Result ResultInvalidTimestamp(ErrorModule::Capture, 12);
|
constexpr Result ResulInvalidTimestamp(ErrorModule::Capture, 12);
|
||||||
constexpr Result ResultInvalidStorage(ErrorModule::Capture, 13);
|
constexpr Result ResultInvalidStorage(ErrorModule::Capture, 13);
|
||||||
constexpr Result ResultInvalidFileContents(ErrorModule::Capture, 14);
|
constexpr Result ResultInvalidFileContents(ErrorModule::Capture, 14);
|
||||||
constexpr Result ResultIsNotMounted(ErrorModule::Capture, 21);
|
constexpr Result ResultIsNotMounted(ErrorModule::Capture, 21);
|
||||||
|
@ -131,7 +131,7 @@ private:
|
|||||||
u8 is_favorite;
|
u8 is_favorite;
|
||||||
u8 same_app;
|
u8 same_app;
|
||||||
u8 same_app_played;
|
u8 same_app_played;
|
||||||
u8 arbitrary_app_played;
|
u8 arbitary_app_played;
|
||||||
u64 group_id;
|
u64 group_id;
|
||||||
};
|
};
|
||||||
static_assert(sizeof(SizedFriendFilter) == 0x10, "SizedFriendFilter is an invalid size");
|
static_assert(sizeof(SizedFriendFilter) == 0x10, "SizedFriendFilter is an invalid size");
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "core/hle/kernel/k_shared_memory.h"
|
#include "core/hle/kernel/k_shared_memory.h"
|
||||||
#include "hid_core/hid_result.h"
|
#include "core/hle/service/hid/controllers/applet_resource.h"
|
||||||
#include "hid_core/resources/applet_resource.h"
|
#include "core/hle/service/hid/controllers/types/shared_memory_format.h"
|
||||||
#include "hid_core/resources/shared_memory_format.h"
|
#include "core/hle/service/hid/errors.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
||||||
@ -87,9 +87,7 @@ Result AppletResource::RegisterAppletResourceUserId(u64 aruid, bool enable_input
|
|||||||
data_index = i;
|
data_index = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// TODO: Don't Handle pending delete here
|
if (registration_list.flag[i] == RegistrationStatus::None) {
|
||||||
if (registration_list.flag[i] == RegistrationStatus::None ||
|
|
||||||
registration_list.flag[i] == RegistrationStatus::PendingDelete) {
|
|
||||||
data_index = i;
|
data_index = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -106,22 +104,30 @@ Result AppletResource::RegisterAppletResourceUserId(u64 aruid, bool enable_input
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AppletResource::UnregisterAppletResourceUserId(u64 aruid) {
|
void AppletResource::UnregisterAppletResourceUserId(u64 aruid) {
|
||||||
const u64 index = GetIndexFromAruid(aruid);
|
u64 index = GetIndexFromAruid(aruid);
|
||||||
|
|
||||||
if (index >= AruidIndexMax) {
|
if (index < AruidIndexMax) {
|
||||||
return;
|
if (data[index].flag.is_assigned) {
|
||||||
|
data[index].shared_memory_format = nullptr;
|
||||||
|
data[index].flag.is_assigned.Assign(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FreeAppletResourceId(aruid);
|
index = GetIndexFromAruid(aruid);
|
||||||
|
if (index < AruidIndexMax) {
|
||||||
DestroySevenSixAxisTransferMemory();
|
DestroySevenSixAxisTransferMemory();
|
||||||
data[index].flag.raw = 0;
|
data[index].flag.raw = 0;
|
||||||
data[index].aruid = 0;
|
data[index].aruid = 0;
|
||||||
|
|
||||||
|
index = GetIndexFromAruid(aruid);
|
||||||
|
if (index < AruidIndexMax) {
|
||||||
registration_list.flag[index] = RegistrationStatus::PendingDelete;
|
registration_list.flag[index] = RegistrationStatus::PendingDelete;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppletResource::FreeAppletResourceId(u64 aruid) {
|
void AppletResource::FreeAppletResourceId(u64 aruid) {
|
||||||
const u64 index = GetIndexFromAruid(aruid);
|
u64 index = GetIndexFromAruid(aruid);
|
||||||
if (index >= AruidIndexMax) {
|
if (index >= AruidIndexMax) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -130,7 +136,6 @@ void AppletResource::FreeAppletResourceId(u64 aruid) {
|
|||||||
if (aruid_data.flag.is_assigned) {
|
if (aruid_data.flag.is_assigned) {
|
||||||
aruid_data.shared_memory_format = nullptr;
|
aruid_data.shared_memory_format = nullptr;
|
||||||
aruid_data.flag.is_assigned.Assign(false);
|
aruid_data.flag.is_assigned.Assign(false);
|
||||||
shared_memory_holder[index].Finalize();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,7 +144,7 @@ u64 AppletResource::GetActiveAruid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Result AppletResource::GetSharedMemoryHandle(Kernel::KSharedMemory** out_handle, u64 aruid) {
|
Result AppletResource::GetSharedMemoryHandle(Kernel::KSharedMemory** out_handle, u64 aruid) {
|
||||||
const u64 index = GetIndexFromAruid(aruid);
|
u64 index = GetIndexFromAruid(aruid);
|
||||||
if (index >= AruidIndexMax) {
|
if (index >= AruidIndexMax) {
|
||||||
return ResultAruidNotRegistered;
|
return ResultAruidNotRegistered;
|
||||||
}
|
}
|
||||||
@ -150,7 +155,7 @@ Result AppletResource::GetSharedMemoryHandle(Kernel::KSharedMemory** out_handle,
|
|||||||
|
|
||||||
Result AppletResource::GetSharedMemoryFormat(SharedMemoryFormat** out_shared_memory_format,
|
Result AppletResource::GetSharedMemoryFormat(SharedMemoryFormat** out_shared_memory_format,
|
||||||
u64 aruid) {
|
u64 aruid) {
|
||||||
const u64 index = GetIndexFromAruid(aruid);
|
u64 index = GetIndexFromAruid(aruid);
|
||||||
if (index >= AruidIndexMax) {
|
if (index >= AruidIndexMax) {
|
||||||
return ResultAruidNotRegistered;
|
return ResultAruidNotRegistered;
|
||||||
}
|
}
|
@ -9,7 +9,7 @@
|
|||||||
#include "common/bit_field.h"
|
#include "common/bit_field.h"
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "core/hle/result.h"
|
#include "core/hle/result.h"
|
||||||
#include "hid_core/resources/shared_memory_holder.h"
|
#include "core/hle/service/hid/controllers/shared_memory_holder.h"
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
class System;
|
class System;
|
@ -2,9 +2,9 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
#include "hid_core/resources/applet_resource.h"
|
#include "core/hle/service/hid/controllers/applet_resource.h"
|
||||||
#include "hid_core/resources/shared_memory_format.h"
|
#include "core/hle/service/hid/controllers/capture_button.h"
|
||||||
#include "hid_core/resources/system_buttons/capture_button.h"
|
#include "core/hle/service/hid/controllers/types/shared_memory_format.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "hid_core/resources/controller_base.h"
|
#include "core/hle/service/hid/controllers/controller_base.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -2,10 +2,10 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
#include "hid_core/frontend/emulated_console.h"
|
#include "core/hid/emulated_console.h"
|
||||||
#include "hid_core/hid_core.h"
|
#include "core/hid/hid_core.h"
|
||||||
#include "hid_core/resources/shared_memory_format.h"
|
#include "core/hle/service/hid/controllers/console_six_axis.h"
|
||||||
#include "hid_core/resources/six_axis/console_six_axis.h"
|
#include "core/hle/service/hid/controllers/types/shared_memory_format.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "hid_core/resources/controller_base.h"
|
#include "core/hle/service/hid/controllers/controller_base.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
class EmulatedConsole;
|
class EmulatedConsole;
|
@ -1,7 +1,7 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "hid_core/resources/controller_base.h"
|
#include "core/hle/service/hid/controllers/controller_base.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "core/hle/result.h"
|
#include "core/hle/result.h"
|
||||||
#include "hid_core/resources/applet_resource.h"
|
#include "core/hle/service/hid/controllers/applet_resource.h"
|
||||||
|
|
||||||
namespace Core::Timing {
|
namespace Core::Timing {
|
||||||
class CoreTiming;
|
class CoreTiming;
|
@ -3,11 +3,11 @@
|
|||||||
|
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
#include "core/frontend/emu_window.h"
|
#include "core/frontend/emu_window.h"
|
||||||
#include "hid_core/frontend/emulated_devices.h"
|
#include "core/hid/emulated_devices.h"
|
||||||
#include "hid_core/hid_core.h"
|
#include "core/hid/hid_core.h"
|
||||||
#include "hid_core/resources/applet_resource.h"
|
#include "core/hle/service/hid/controllers/applet_resource.h"
|
||||||
#include "hid_core/resources/mouse/debug_mouse.h"
|
#include "core/hle/service/hid/controllers/debug_mouse.h"
|
||||||
#include "hid_core/resources/shared_memory_format.h"
|
#include "core/hle/service/hid/controllers/types/shared_memory_format.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hle/service/hid/controllers/controller_base.h"
|
||||||
#include "hid_core/resources/controller_base.h"
|
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
class HIDCore;
|
|
||||||
class EmulatedDevices;
|
class EmulatedDevices;
|
||||||
|
struct MouseState;
|
||||||
|
struct AnalogStickState;
|
||||||
} // namespace Core::HID
|
} // namespace Core::HID
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
#include "common/settings.h"
|
#include "common/settings.h"
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
#include "hid_core/frontend/emulated_controller.h"
|
#include "core/hid/emulated_controller.h"
|
||||||
#include "hid_core/hid_core.h"
|
#include "core/hid/hid_core.h"
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hid/hid_types.h"
|
||||||
#include "hid_core/resources/applet_resource.h"
|
#include "core/hle/service/hid/controllers/applet_resource.h"
|
||||||
#include "hid_core/resources/debug_pad/debug_pad.h"
|
#include "core/hle/service/hid/controllers/debug_pad.h"
|
||||||
#include "hid_core/resources/shared_memory_format.h"
|
#include "core/hle/service/hid/controllers/types/shared_memory_format.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -3,13 +3,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "hid_core/resources/controller_base.h"
|
#include "core/hle/service/hid/controllers/controller_base.h"
|
||||||
#include "hid_core/resources/debug_pad/debug_pad_types.h"
|
#include "core/hle/service/hid/controllers/types/debug_pad_types.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
class HIDCore;
|
class HIDCore;
|
||||||
class EmulatedController;
|
}
|
||||||
} // namespace Core::HID
|
|
||||||
|
|
||||||
namespace Core::Timing {
|
namespace Core::Timing {
|
||||||
class CoreTiming;
|
class CoreTiming;
|
@ -2,9 +2,9 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
#include "hid_core/resources/applet_resource.h"
|
#include "core/hle/service/hid/controllers/applet_resource.h"
|
||||||
#include "hid_core/resources/digitizer/digitizer.h"
|
#include "core/hle/service/hid/controllers/digitizer.h"
|
||||||
#include "hid_core/resources/shared_memory_format.h"
|
#include "core/hle/service/hid/controllers/types/shared_memory_format.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "hid_core/resources/controller_base.h"
|
#include "core/hle/service/hid/controllers/controller_base.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -4,11 +4,11 @@
|
|||||||
#include "common/math_util.h"
|
#include "common/math_util.h"
|
||||||
#include "common/settings.h"
|
#include "common/settings.h"
|
||||||
#include "core/frontend/emu_window.h"
|
#include "core/frontend/emu_window.h"
|
||||||
#include "hid_core/frontend/emulated_console.h"
|
#include "core/hid/emulated_console.h"
|
||||||
#include "hid_core/hid_core.h"
|
#include "core/hid/hid_core.h"
|
||||||
#include "hid_core/resources/applet_resource.h"
|
#include "core/hle/service/hid/controllers/applet_resource.h"
|
||||||
#include "hid_core/resources/shared_memory_format.h"
|
#include "core/hle/service/hid/controllers/gesture.h"
|
||||||
#include "hid_core/resources/touch_screen/gesture.h"
|
#include "core/hle/service/hid/controllers/types/shared_memory_format.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
// HW is around 700, value is set to 400 to make it easier to trigger with mouse
|
// HW is around 700, value is set to 400 to make it easier to trigger with mouse
|
@ -6,8 +6,8 @@
|
|||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "hid_core/resources/controller_base.h"
|
#include "core/hle/service/hid/controllers/controller_base.h"
|
||||||
#include "hid_core/resources/touch_screen/touch_types.h"
|
#include "core/hle/service/hid/controllers/types/touch_types.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
class EmulatedConsole;
|
class EmulatedConsole;
|
@ -2,9 +2,9 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
#include "hid_core/resources/applet_resource.h"
|
#include "core/hle/service/hid/controllers/applet_resource.h"
|
||||||
#include "hid_core/resources/shared_memory_format.h"
|
#include "core/hle/service/hid/controllers/home_button.h"
|
||||||
#include "hid_core/resources/system_buttons/home_button.h"
|
#include "core/hle/service/hid/controllers/types/shared_memory_format.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "hid_core/resources/controller_base.h"
|
#include "core/hle/service/hid/controllers/controller_base.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -3,11 +3,11 @@
|
|||||||
|
|
||||||
#include "common/settings.h"
|
#include "common/settings.h"
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
#include "hid_core/frontend/emulated_devices.h"
|
#include "core/hid/emulated_devices.h"
|
||||||
#include "hid_core/hid_core.h"
|
#include "core/hid/hid_core.h"
|
||||||
#include "hid_core/resources/applet_resource.h"
|
#include "core/hle/service/hid/controllers/applet_resource.h"
|
||||||
#include "hid_core/resources/keyboard/keyboard.h"
|
#include "core/hle/service/hid/controllers/keyboard.h"
|
||||||
#include "hid_core/resources/shared_memory_format.h"
|
#include "core/hle/service/hid/controllers/types/shared_memory_format.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -3,13 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "hid_core/resources/controller_base.h"
|
#include "core/hle/service/hid/controllers/controller_base.h"
|
||||||
#include "hid_core/resources/keyboard/keyboard_types.h"
|
#include "core/hle/service/hid/controllers/types/keyboard_types.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
|
||||||
class HIDCore;
|
|
||||||
class EmulatedDevices;
|
|
||||||
} // namespace Core::HID
|
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
class Keyboard final : public ControllerBase {
|
class Keyboard final : public ControllerBase {
|
@ -3,11 +3,11 @@
|
|||||||
|
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
#include "core/frontend/emu_window.h"
|
#include "core/frontend/emu_window.h"
|
||||||
#include "hid_core/frontend/emulated_devices.h"
|
#include "core/hid/emulated_devices.h"
|
||||||
#include "hid_core/hid_core.h"
|
#include "core/hid/hid_core.h"
|
||||||
#include "hid_core/resources/applet_resource.h"
|
#include "core/hle/service/hid/controllers/applet_resource.h"
|
||||||
#include "hid_core/resources/mouse/mouse.h"
|
#include "core/hle/service/hid/controllers/mouse.h"
|
||||||
#include "hid_core/resources/shared_memory_format.h"
|
#include "core/hle/service/hid/controllers/types/shared_memory_format.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hle/service/hid/controllers/controller_base.h"
|
||||||
#include "hid_core/resources/controller_base.h"
|
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
class HIDCore;
|
|
||||||
class EmulatedDevices;
|
class EmulatedDevices;
|
||||||
|
struct MouseState;
|
||||||
|
struct AnalogStickState;
|
||||||
} // namespace Core::HID
|
} // namespace Core::HID
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
@ -12,16 +12,16 @@
|
|||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "common/settings.h"
|
#include "common/settings.h"
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.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_event.h"
|
||||||
#include "core/hle/kernel/k_readable_event.h"
|
#include "core/hle/kernel/k_readable_event.h"
|
||||||
|
#include "core/hle/service/hid/controllers/applet_resource.h"
|
||||||
|
#include "core/hle/service/hid/controllers/npad.h"
|
||||||
|
#include "core/hle/service/hid/controllers/types/shared_memory_format.h"
|
||||||
|
#include "core/hle/service/hid/errors.h"
|
||||||
|
#include "core/hle/service/hid/hid_util.h"
|
||||||
#include "core/hle/service/kernel_helpers.h"
|
#include "core/hle/service/kernel_helpers.h"
|
||||||
#include "hid_core/frontend/emulated_controller.h"
|
|
||||||
#include "hid_core/hid_core.h"
|
|
||||||
#include "hid_core/hid_result.h"
|
|
||||||
#include "hid_core/hid_util.h"
|
|
||||||
#include "hid_core/resources/applet_resource.h"
|
|
||||||
#include "hid_core/resources/npad/npad.h"
|
|
||||||
#include "hid_core/resources/shared_memory_format.h"
|
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
||||||
@ -870,11 +870,6 @@ void NPad::InitializeVibrationDevice(
|
|||||||
const auto aruid = applet_resource_holder.applet_resource->GetActiveAruid();
|
const auto aruid = applet_resource_holder.applet_resource->GetActiveAruid();
|
||||||
const auto npad_index = static_cast<Core::HID::NpadIdType>(vibration_device_handle.npad_id);
|
const auto npad_index = static_cast<Core::HID::NpadIdType>(vibration_device_handle.npad_id);
|
||||||
const auto device_index = static_cast<std::size_t>(vibration_device_handle.device_index);
|
const auto device_index = static_cast<std::size_t>(vibration_device_handle.device_index);
|
||||||
|
|
||||||
if (aruid == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
InitializeVibrationDeviceAtIndex(aruid, npad_index, device_index);
|
InitializeVibrationDeviceAtIndex(aruid, npad_index, device_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1344,49 +1339,4 @@ AppletDetailedUiType NPad::GetAppletDetailedUiType(Core::HID::NpadIdType npad_id
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
Result NPad::SetNpadCaptureButtonAssignment(u64 aruid, Core::HID::NpadStyleSet npad_style_set,
|
|
||||||
Core::HID::NpadButton button_assignment) {
|
|
||||||
std::scoped_lock lock{mutex};
|
|
||||||
return npad_resource.SetNpadCaptureButtonAssignment(aruid, npad_style_set, button_assignment);
|
|
||||||
}
|
|
||||||
|
|
||||||
Result NPad::ClearNpadCaptureButtonAssignment(u64 aruid) {
|
|
||||||
std::scoped_lock lock{mutex};
|
|
||||||
return npad_resource.ClearNpadCaptureButtonAssignment(aruid);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::size_t NPad::GetNpadCaptureButtonAssignment(std::span<Core::HID::NpadButton> out_list,
|
|
||||||
u64 aruid) const {
|
|
||||||
std::scoped_lock lock{mutex};
|
|
||||||
return npad_resource.GetNpadCaptureButtonAssignment(out_list, aruid);
|
|
||||||
}
|
|
||||||
|
|
||||||
Result NPad::SetNpadSystemExtStateEnabled(u64 aruid, bool is_enabled) {
|
|
||||||
std::scoped_lock lock{mutex};
|
|
||||||
const auto result = npad_resource.SetNpadSystemExtStateEnabled(aruid, is_enabled);
|
|
||||||
|
|
||||||
if (result.IsSuccess()) {
|
|
||||||
std::scoped_lock shared_lock{*applet_resource_holder.shared_mutex};
|
|
||||||
// TODO: abstracted_pad->EnableAppletToGetInput(aruid);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
Result NPad::AssigningSingleOnSlSrPress(u64 aruid, bool is_enabled) {
|
|
||||||
std::scoped_lock lock{mutex};
|
|
||||||
bool is_currently_enabled{};
|
|
||||||
Result result = npad_resource.IsAssigningSingleOnSlSrPressEnabled(is_currently_enabled, aruid);
|
|
||||||
if (result.IsSuccess() && is_enabled != is_currently_enabled) {
|
|
||||||
result = npad_resource.SetAssigningSingleOnSlSrPress(aruid, is_enabled);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
Result NPad::GetLastActiveNpad(Core::HID::NpadIdType& out_npad_id) const {
|
|
||||||
std::scoped_lock lock{mutex};
|
|
||||||
out_npad_id = hid_core.GetLastActiveController();
|
|
||||||
return ResultSuccess;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Service::HID
|
} // namespace Service::HID
|
@ -9,10 +9,10 @@
|
|||||||
#include <span>
|
#include <span>
|
||||||
|
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hid/hid_types.h"
|
||||||
#include "hid_core/resources/controller_base.h"
|
#include "core/hle/service/hid/controllers/controller_base.h"
|
||||||
#include "hid_core/resources/npad/npad_resource.h"
|
#include "core/hle/service/hid/controllers/npad/npad_resource.h"
|
||||||
#include "hid_core/resources/npad/npad_types.h"
|
#include "core/hle/service/hid/controllers/types/npad_types.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
class EmulatedController;
|
class EmulatedController;
|
||||||
@ -149,18 +149,6 @@ public:
|
|||||||
|
|
||||||
AppletDetailedUiType GetAppletDetailedUiType(Core::HID::NpadIdType npad_id);
|
AppletDetailedUiType GetAppletDetailedUiType(Core::HID::NpadIdType npad_id);
|
||||||
|
|
||||||
Result SetNpadCaptureButtonAssignment(u64 aruid, Core::HID::NpadStyleSet npad_style_set,
|
|
||||||
Core::HID::NpadButton button_assignment);
|
|
||||||
Result ClearNpadCaptureButtonAssignment(u64 aruid);
|
|
||||||
std::size_t GetNpadCaptureButtonAssignment(std::span<Core::HID::NpadButton> out_list,
|
|
||||||
u64 aruid) const;
|
|
||||||
|
|
||||||
Result SetNpadSystemExtStateEnabled(u64 aruid, bool is_enabled);
|
|
||||||
|
|
||||||
Result AssigningSingleOnSlSrPress(u64 aruid, bool is_enabled);
|
|
||||||
|
|
||||||
Result GetLastActiveNpad(Core::HID::NpadIdType& out_npad_id) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct VibrationData {
|
struct VibrationData {
|
||||||
bool device_mounted{};
|
bool device_mounted{};
|
@ -1,8 +1,8 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#include "hid_core/hid_util.h"
|
#include "core/hle/service/hid/controllers/npad/npad_data.h"
|
||||||
#include "hid_core/resources/npad/npad_data.h"
|
#include "core/hle/service/hid/hid_util.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -7,9 +7,9 @@
|
|||||||
#include <span>
|
#include <span>
|
||||||
|
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
|
#include "core/hid/hid_types.h"
|
||||||
#include "core/hle/result.h"
|
#include "core/hle/result.h"
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hle/service/hid/controllers/types/npad_types.h"
|
||||||
#include "hid_core/resources/npad/npad_types.h"
|
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
#include "core/hle/kernel/k_event.h"
|
#include "core/hle/kernel/k_event.h"
|
||||||
#include "core/hle/kernel/k_readable_event.h"
|
#include "core/hle/kernel/k_readable_event.h"
|
||||||
#include "hid_core/hid_result.h"
|
#include "core/hle/service/hid/controllers/npad/npad_resource.h"
|
||||||
#include "hid_core/hid_util.h"
|
#include "core/hle/service/hid/controllers/types/npad_types.h"
|
||||||
#include "hid_core/resources/npad/npad_resource.h"
|
#include "core/hle/service/hid/errors.h"
|
||||||
#include "hid_core/resources/npad/npad_types.h"
|
#include "core/hle/service/hid/hid_util.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
||||||
@ -46,9 +46,7 @@ Result NPadResource::RegisterAppletResourceUserId(u64 aruid) {
|
|||||||
data_index = i;
|
data_index = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// TODO: Don't Handle pending delete here
|
if (registration_list.flag[i] == RegistrationStatus::None) {
|
||||||
if (registration_list.flag[i] == RegistrationStatus::None ||
|
|
||||||
registration_list.flag[i] == RegistrationStatus::PendingDelete) {
|
|
||||||
data_index = i;
|
data_index = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
@ -8,12 +8,12 @@
|
|||||||
#include <span>
|
#include <span>
|
||||||
|
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
|
#include "core/hid/hid_types.h"
|
||||||
#include "core/hle/result.h"
|
#include "core/hle/result.h"
|
||||||
|
#include "core/hle/service/hid/controllers/applet_resource.h"
|
||||||
|
#include "core/hle/service/hid/controllers/npad/npad_data.h"
|
||||||
|
#include "core/hle/service/hid/controllers/types/npad_types.h"
|
||||||
#include "core/hle/service/kernel_helpers.h"
|
#include "core/hle/service/kernel_helpers.h"
|
||||||
#include "hid_core/hid_types.h"
|
|
||||||
#include "hid_core/resources/applet_resource.h"
|
|
||||||
#include "hid_core/resources/npad/npad_data.h"
|
|
||||||
#include "hid_core/resources/npad/npad_types.h"
|
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
class System;
|
class System;
|
@ -2,12 +2,13 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
|
#include "core/hid/emulated_controller.h"
|
||||||
|
#include "core/hid/hid_core.h"
|
||||||
|
#include "core/hid/hid_types.h"
|
||||||
#include "core/hle/kernel/k_event.h"
|
#include "core/hle/kernel/k_event.h"
|
||||||
#include "core/hle/kernel/k_readable_event.h"
|
#include "core/hle/kernel/k_readable_event.h"
|
||||||
|
#include "core/hle/service/hid/controllers/palma.h"
|
||||||
#include "core/hle/service/kernel_helpers.h"
|
#include "core/hle/service/kernel_helpers.h"
|
||||||
#include "hid_core/frontend/emulated_controller.h"
|
|
||||||
#include "hid_core/hid_core.h"
|
|
||||||
#include "hid_core/resources/palma/palma.h"
|
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -6,9 +6,8 @@
|
|||||||
#include <array>
|
#include <array>
|
||||||
#include "common/common_funcs.h"
|
#include "common/common_funcs.h"
|
||||||
#include "common/typed_address.h"
|
#include "common/typed_address.h"
|
||||||
#include "hid_core/hid_result.h"
|
#include "core/hle/service/hid/controllers/controller_base.h"
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hle/service/hid/errors.h"
|
||||||
#include "hid_core/resources/controller_base.h"
|
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
class KEvent;
|
class KEvent;
|
@ -6,11 +6,11 @@
|
|||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
#include "core/frontend/emu_window.h"
|
#include "core/frontend/emu_window.h"
|
||||||
|
#include "core/hid/emulated_console.h"
|
||||||
|
#include "core/hid/emulated_devices.h"
|
||||||
|
#include "core/hid/hid_core.h"
|
||||||
|
#include "core/hle/service/hid/controllers/seven_six_axis.h"
|
||||||
#include "core/memory.h"
|
#include "core/memory.h"
|
||||||
#include "hid_core/frontend/emulated_console.h"
|
|
||||||
#include "hid_core/frontend/emulated_devices.h"
|
|
||||||
#include "hid_core/hid_core.h"
|
|
||||||
#include "hid_core/resources/six_axis/seven_six_axis.h"
|
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
SevenSixAxis::SevenSixAxis(Core::System& system_)
|
SevenSixAxis::SevenSixAxis(Core::System& system_)
|
@ -6,8 +6,8 @@
|
|||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "common/quaternion.h"
|
#include "common/quaternion.h"
|
||||||
#include "common/typed_address.h"
|
#include "common/typed_address.h"
|
||||||
#include "hid_core/resources/controller_base.h"
|
#include "core/hle/service/hid/controllers/controller_base.h"
|
||||||
#include "hid_core/resources/ring_lifo.h"
|
#include "core/hle/service/hid/ring_lifo.h"
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
class System;
|
class System;
|
@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "core/hle/kernel/k_shared_memory.h"
|
#include "core/hle/kernel/k_shared_memory.h"
|
||||||
#include "hid_core/hid_result.h"
|
#include "core/hle/service/hid/controllers/applet_resource.h"
|
||||||
#include "hid_core/resources/applet_resource.h"
|
#include "core/hle/service/hid/controllers/shared_memory_holder.h"
|
||||||
#include "hid_core/resources/shared_memory_format.h"
|
#include "core/hle/service/hid/controllers/types/shared_memory_format.h"
|
||||||
#include "hid_core/resources/shared_memory_holder.h"
|
#include "core/hle/service/hid/errors.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
SharedMemoryHolder::SharedMemoryHolder() {}
|
SharedMemoryHolder::SharedMemoryHolder() {}
|
@ -3,13 +3,13 @@
|
|||||||
|
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
#include "hid_core/frontend/emulated_controller.h"
|
#include "core/hid/emulated_controller.h"
|
||||||
#include "hid_core/hid_core.h"
|
#include "core/hid/hid_core.h"
|
||||||
#include "hid_core/hid_result.h"
|
#include "core/hle/service/hid/controllers/npad.h"
|
||||||
#include "hid_core/hid_util.h"
|
#include "core/hle/service/hid/controllers/six_axis.h"
|
||||||
#include "hid_core/resources/npad/npad.h"
|
#include "core/hle/service/hid/controllers/types/shared_memory_format.h"
|
||||||
#include "hid_core/resources/shared_memory_format.h"
|
#include "core/hle/service/hid/errors.h"
|
||||||
#include "hid_core/resources/six_axis/six_axis.h"
|
#include "core/hle/service/hid/hid_util.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -4,9 +4,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hid/hid_types.h"
|
||||||
#include "hid_core/resources/controller_base.h"
|
#include "core/hle/service/hid/controllers/controller_base.h"
|
||||||
#include "hid_core/resources/ring_lifo.h"
|
#include "core/hle/service/hid/ring_lifo.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
class EmulatedController;
|
class EmulatedController;
|
@ -2,9 +2,9 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
#include "hid_core/resources/applet_resource.h"
|
#include "core/hle/service/hid/controllers/applet_resource.h"
|
||||||
#include "hid_core/resources/shared_memory_format.h"
|
#include "core/hle/service/hid/controllers/sleep_button.h"
|
||||||
#include "hid_core/resources/system_buttons/sleep_button.h"
|
#include "core/hle/service/hid/controllers/types/shared_memory_format.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "hid_core/resources/controller_base.h"
|
#include "core/hle/service/hid/controllers/controller_base.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -6,11 +6,11 @@
|
|||||||
#include "common/settings.h"
|
#include "common/settings.h"
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
#include "core/frontend/emu_window.h"
|
#include "core/frontend/emu_window.h"
|
||||||
#include "hid_core/frontend/emulated_console.h"
|
#include "core/hid/emulated_console.h"
|
||||||
#include "hid_core/hid_core.h"
|
#include "core/hid/hid_core.h"
|
||||||
#include "hid_core/resources/applet_resource.h"
|
#include "core/hle/service/hid/controllers/applet_resource.h"
|
||||||
#include "hid_core/resources/shared_memory_format.h"
|
#include "core/hle/service/hid/controllers/touchscreen.h"
|
||||||
#include "hid_core/resources/touch_screen/touch_screen.h"
|
#include "core/hle/service/hid/controllers/types/shared_memory_format.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -5,9 +5,9 @@
|
|||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hid/hid_types.h"
|
||||||
#include "hid_core/resources/controller_base.h"
|
#include "core/hle/service/hid/controllers/controller_base.h"
|
||||||
#include "hid_core/resources/touch_screen/touch_types.h"
|
#include "core/hle/service/hid/controllers/types/touch_types.h"
|
||||||
|
|
||||||
namespace Core::HID {
|
namespace Core::HID {
|
||||||
class EmulatedConsole;
|
class EmulatedConsole;
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include "common/bit_field.h"
|
#include "common/bit_field.h"
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hid/hid_types.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -4,7 +4,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hid/hid_types.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -6,7 +6,7 @@
|
|||||||
#include "common/bit_field.h"
|
#include "common/bit_field.h"
|
||||||
#include "common/common_funcs.h"
|
#include "common/common_funcs.h"
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hid/hid_types.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
static constexpr std::size_t MaxSupportedNpadIdTypes = 10;
|
static constexpr std::size_t MaxSupportedNpadIdTypes = 10;
|
@ -6,13 +6,13 @@
|
|||||||
#include "common/common_funcs.h"
|
#include "common/common_funcs.h"
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "common/vector_math.h"
|
#include "common/vector_math.h"
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hid/hid_types.h"
|
||||||
#include "hid_core/resources/debug_pad/debug_pad_types.h"
|
#include "core/hle/service/hid//controllers/types/debug_pad_types.h"
|
||||||
#include "hid_core/resources/keyboard/keyboard_types.h"
|
#include "core/hle/service/hid//controllers/types/keyboard_types.h"
|
||||||
#include "hid_core/resources/mouse/mouse_types.h"
|
#include "core/hle/service/hid//controllers/types/mouse_types.h"
|
||||||
#include "hid_core/resources/npad/npad_types.h"
|
#include "core/hle/service/hid//controllers/types/npad_types.h"
|
||||||
#include "hid_core/resources/ring_lifo.h"
|
#include "core/hle/service/hid//controllers/types/touch_types.h"
|
||||||
#include "hid_core/resources/touch_screen/touch_types.h"
|
#include "core/hle/service/hid/ring_lifo.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
static const std::size_t HidEntryCount = 17;
|
static const std::size_t HidEntryCount = 17;
|
@ -10,7 +10,7 @@
|
|||||||
#include "common/common_funcs.h"
|
#include "common/common_funcs.h"
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "common/point.h"
|
#include "common/point.h"
|
||||||
#include "hid_core/hid_types.h"
|
#include "core/hid/hid_types.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
static constexpr std::size_t MAX_FINGERS = 16;
|
static constexpr std::size_t MAX_FINGERS = 16;
|
@ -2,9 +2,9 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
#include "hid_core/resources/applet_resource.h"
|
#include "core/hle/service/hid/controllers/applet_resource.h"
|
||||||
#include "hid_core/resources/shared_memory_format.h"
|
#include "core/hle/service/hid/controllers/types/shared_memory_format.h"
|
||||||
#include "hid_core/resources/unique_pad/unique_pad.h"
|
#include "core/hle/service/hid/controllers/unique_pad.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "hid_core/resources/controller_base.h"
|
#include "core/hle/service/hid/controllers/controller_base.h"
|
||||||
|
|
||||||
namespace Service::HID {
|
namespace Service::HID {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user