diff options
28 files changed, 690 insertions, 429 deletions
diff --git a/.travis.yml b/.travis.yml index 7db6f297e..f94a5c75e 100644 --- a/.travis.yml +++ b/.travis.yml | |||
| @@ -24,7 +24,7 @@ matrix: | |||
| 24 | - os: osx | 24 | - os: osx |
| 25 | env: NAME="macos build" | 25 | env: NAME="macos build" |
| 26 | sudo: false | 26 | sudo: false |
| 27 | osx_image: xcode7.3 | 27 | osx_image: xcode9.2 |
| 28 | install: "./.travis/macos/deps.sh" | 28 | install: "./.travis/macos/deps.sh" |
| 29 | script: "./.travis/macos/build.sh" | 29 | script: "./.travis/macos/build.sh" |
| 30 | after_success: "./.travis/macos/upload.sh" | 30 | after_success: "./.travis/macos/upload.sh" |
diff --git a/CMakeLists.txt b/CMakeLists.txt index d814bb74f..aa2154cb1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -323,12 +323,14 @@ endif() | |||
| 323 | # This function should be passed a list of all files in a target. It will automatically generate | 323 | # This function should be passed a list of all files in a target. It will automatically generate |
| 324 | # file groups following the directory hierarchy, so that the layout of the files in IDEs matches the | 324 | # file groups following the directory hierarchy, so that the layout of the files in IDEs matches the |
| 325 | # one in the filesystem. | 325 | # one in the filesystem. |
| 326 | function(create_directory_groups) | 326 | function(create_target_directory_groups target_name) |
| 327 | # Place any files that aren't in the source list in a separate group so that they don't get in | 327 | # Place any files that aren't in the source list in a separate group so that they don't get in |
| 328 | # the way. | 328 | # the way. |
| 329 | source_group("Other Files" REGULAR_EXPRESSION ".") | 329 | source_group("Other Files" REGULAR_EXPRESSION ".") |
| 330 | 330 | ||
| 331 | foreach(file_name ${ARGV}) | 331 | get_target_property(target_sources "${target_name}" SOURCES) |
| 332 | |||
| 333 | foreach(file_name IN LISTS target_sources) | ||
| 332 | get_filename_component(dir_name "${file_name}" PATH) | 334 | get_filename_component(dir_name "${file_name}" PATH) |
| 333 | # Group names use '\' as a separator even though the entire rest of CMake uses '/'... | 335 | # Group names use '\' as a separator even though the entire rest of CMake uses '/'... |
| 334 | string(REPLACE "/" "\\" group_name "${dir_name}") | 336 | string(REPLACE "/" "\\" group_name "${dir_name}") |
diff --git a/externals/getopt/CMakeLists.txt b/externals/getopt/CMakeLists.txt index c8b745d55..ad7a2b363 100644 --- a/externals/getopt/CMakeLists.txt +++ b/externals/getopt/CMakeLists.txt | |||
| @@ -1,11 +1,9 @@ | |||
| 1 | set(SRCS | 1 | add_library(getopt |
| 2 | getopt.c | 2 | getopt.c |
| 3 | ) | 3 | getopt.h |
| 4 | set(HEADERS | 4 | ) |
| 5 | getopt.h | 5 | |
| 6 | ) | 6 | create_target_directory_groups(getopt) |
| 7 | 7 | ||
| 8 | create_directory_groups(${SRCS} ${HEADERS}) | ||
| 9 | add_library(getopt ${SRCS} ${HEADERS}) | ||
| 10 | target_compile_definitions(getopt PUBLIC STATIC_GETOPT) | 8 | target_compile_definitions(getopt PUBLIC STATIC_GETOPT) |
| 11 | target_include_directories(getopt INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) | 9 | target_include_directories(getopt INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) |
diff --git a/externals/glad/CMakeLists.txt b/externals/glad/CMakeLists.txt index 6d35a844b..c43ae475a 100644 --- a/externals/glad/CMakeLists.txt +++ b/externals/glad/CMakeLists.txt | |||
| @@ -1,13 +1,10 @@ | |||
| 1 | set(SRCS | 1 | add_library(glad STATIC |
| 2 | src/glad.c | 2 | src/glad.c |
| 3 | ) | 3 | include/KHR/khrplatform.h |
| 4 | set(HEADERS | 4 | include/glad/glad.h |
| 5 | include/KHR/khrplatform.h | 5 | ) |
| 6 | include/glad/glad.h | ||
| 7 | ) | ||
| 8 | 6 | ||
| 9 | create_directory_groups(${SRCS} ${HEADERS}) | 7 | create_target_directory_groups(glad) |
| 10 | add_library(glad STATIC ${SRCS} ${HEADERS}) | ||
| 11 | target_include_directories(glad PUBLIC "include/") | 8 | target_include_directories(glad PUBLIC "include/") |
| 12 | 9 | ||
| 13 | if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") | 10 | if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") |
diff --git a/externals/inih/CMakeLists.txt b/externals/inih/CMakeLists.txt index cff36a581..2a75852c2 100644 --- a/externals/inih/CMakeLists.txt +++ b/externals/inih/CMakeLists.txt | |||
| @@ -1,12 +1,9 @@ | |||
| 1 | set(SRCS | 1 | add_library(inih |
| 2 | inih/ini.c | 2 | inih/ini.c |
| 3 | inih/cpp/INIReader.cpp | 3 | inih/ini.h |
| 4 | ) | 4 | inih/cpp/INIReader.cpp |
| 5 | set(HEADERS | 5 | inih/cpp/INIReader.h |
| 6 | inih/ini.h | 6 | ) |
| 7 | inih/cpp/INIReader.h | ||
| 8 | ) | ||
| 9 | 7 | ||
| 10 | create_directory_groups(${SRCS} ${HEADERS}) | 8 | create_target_directory_groups(inih) |
| 11 | add_library(inih ${SRCS} ${HEADERS}) | ||
| 12 | target_include_directories(inih INTERFACE .) | 9 | target_include_directories(inih INTERFACE .) |
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 26cf9480b..1af80769a 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -24,78 +24,72 @@ if ($ENV{CI}) | |||
| 24 | endif() | 24 | endif() |
| 25 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp" @ONLY) | 25 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp" @ONLY) |
| 26 | 26 | ||
| 27 | set(SRCS | 27 | add_library(common STATIC |
| 28 | break_points.cpp | 28 | alignment.h |
| 29 | file_util.cpp | 29 | assert.h |
| 30 | hash.cpp | 30 | bit_field.h |
| 31 | logging/filter.cpp | 31 | bit_set.h |
| 32 | logging/text_formatter.cpp | 32 | break_points.cpp |
| 33 | logging/backend.cpp | 33 | break_points.h |
| 34 | memory_util.cpp | 34 | chunk_file.h |
| 35 | microprofile.cpp | 35 | code_block.h |
| 36 | misc.cpp | 36 | color.h |
| 37 | param_package.cpp | 37 | common_funcs.h |
| 38 | scm_rev.cpp | 38 | common_paths.h |
| 39 | string_util.cpp | 39 | common_types.h |
| 40 | telemetry.cpp | 40 | file_util.cpp |
| 41 | thread.cpp | 41 | file_util.h |
| 42 | timer.cpp | 42 | hash.cpp |
| 43 | ) | 43 | hash.h |
| 44 | 44 | linear_disk_cache.h | |
| 45 | set(HEADERS | 45 | logging/backend.cpp |
| 46 | alignment.h | 46 | logging/backend.h |
| 47 | assert.h | 47 | logging/filter.cpp |
| 48 | bit_field.h | 48 | logging/filter.h |
| 49 | bit_set.h | 49 | logging/log.h |
| 50 | break_points.h | 50 | logging/text_formatter.cpp |
| 51 | chunk_file.h | 51 | logging/text_formatter.h |
| 52 | code_block.h | 52 | math_util.h |
| 53 | color.h | 53 | memory_util.cpp |
| 54 | common_funcs.h | 54 | memory_util.h |
| 55 | common_paths.h | 55 | microprofile.cpp |
| 56 | common_types.h | 56 | microprofile.h |
| 57 | file_util.h | 57 | microprofileui.h |
| 58 | hash.h | 58 | misc.cpp |
| 59 | linear_disk_cache.h | 59 | param_package.cpp |
| 60 | logging/text_formatter.h | 60 | param_package.h |
| 61 | logging/filter.h | 61 | platform.h |
| 62 | logging/log.h | 62 | quaternion.h |
| 63 | logging/backend.h | 63 | scm_rev.cpp |
| 64 | math_util.h | 64 | scm_rev.h |
| 65 | memory_util.h | 65 | scope_exit.h |
| 66 | microprofile.h | 66 | string_util.cpp |
| 67 | microprofileui.h | 67 | string_util.h |
| 68 | param_package.h | 68 | swap.h |
| 69 | platform.h | 69 | synchronized_wrapper.h |
| 70 | quaternion.h | 70 | telemetry.cpp |
| 71 | scm_rev.h | 71 | telemetry.h |
| 72 | scope_exit.h | 72 | thread.cpp |
| 73 | string_util.h | 73 | thread.h |
| 74 | swap.h | 74 | thread_queue_list.h |
| 75 | synchronized_wrapper.h | 75 | threadsafe_queue.h |
| 76 | telemetry.h | 76 | timer.cpp |
| 77 | thread.h | 77 | timer.h |
| 78 | thread_queue_list.h | 78 | vector_math.h |
| 79 | threadsafe_queue.h | 79 | ) |
| 80 | timer.h | ||
| 81 | vector_math.h | ||
| 82 | ) | ||
| 83 | 80 | ||
| 84 | if(ARCHITECTURE_x86_64) | 81 | if(ARCHITECTURE_x86_64) |
| 85 | set(SRCS ${SRCS} | 82 | target_sources(common |
| 83 | PRIVATE | ||
| 86 | x64/cpu_detect.cpp | 84 | x64/cpu_detect.cpp |
| 87 | ) | ||
| 88 | |||
| 89 | set(HEADERS ${HEADERS} | ||
| 90 | x64/cpu_detect.h | 85 | x64/cpu_detect.h |
| 91 | x64/xbyak_abi.h | 86 | x64/xbyak_abi.h |
| 92 | x64/xbyak_util.h | 87 | x64/xbyak_util.h |
| 93 | ) | 88 | ) |
| 94 | endif() | 89 | endif() |
| 95 | 90 | ||
| 96 | create_directory_groups(${SRCS} ${HEADERS}) | 91 | create_target_directory_groups(common) |
| 97 | 92 | ||
| 98 | add_library(common STATIC ${SRCS} ${HEADERS}) | ||
| 99 | target_link_libraries(common PUBLIC Boost::boost microprofile) | 93 | target_link_libraries(common PUBLIC Boost::boost microprofile) |
| 100 | if (ARCHITECTURE_x86_64) | 94 | if (ARCHITECTURE_x86_64) |
| 101 | target_link_libraries(common PRIVATE xbyak) | 95 | target_link_libraries(common PRIVATE xbyak) |
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index e77261dc4..4cdfffecb 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -1,174 +1,176 @@ | |||
| 1 | set(SRCS | 1 | add_library(core STATIC |
| 2 | arm/dynarmic/arm_dynarmic.cpp | 2 | arm/arm_interface.h |
| 3 | arm/unicorn/arm_unicorn.cpp | 3 | arm/dynarmic/arm_dynarmic.cpp |
| 4 | core.cpp | 4 | arm/dynarmic/arm_dynarmic.h |
| 5 | core_timing.cpp | 5 | arm/unicorn/arm_unicorn.cpp |
| 6 | file_sys/archive_backend.cpp | 6 | arm/unicorn/arm_unicorn.h |
| 7 | file_sys/disk_archive.cpp | 7 | core.cpp |
| 8 | file_sys/ivfc_archive.cpp | 8 | core.h |
| 9 | file_sys/path_parser.cpp | 9 | core_timing.cpp |
| 10 | file_sys/savedata_archive.cpp | 10 | core_timing.h |
| 11 | file_sys/title_metadata.cpp | 11 | file_sys/archive_backend.cpp |
| 12 | frontend/emu_window.cpp | 12 | file_sys/archive_backend.h |
| 13 | frontend/framebuffer_layout.cpp | 13 | file_sys/directory_backend.h |
| 14 | gdbstub/gdbstub.cpp | 14 | file_sys/disk_archive.cpp |
| 15 | hle/config_mem.cpp | 15 | file_sys/disk_archive.h |
| 16 | hle/kernel/address_arbiter.cpp | 16 | file_sys/errors.h |
| 17 | hle/kernel/client_port.cpp | 17 | file_sys/file_backend.h |
| 18 | hle/kernel/client_session.cpp | 18 | file_sys/ivfc_archive.cpp |
| 19 | hle/kernel/condition_variable.cpp | 19 | file_sys/ivfc_archive.h |
| 20 | hle/kernel/domain.cpp | 20 | file_sys/path_parser.cpp |
| 21 | hle/kernel/event.cpp | 21 | file_sys/path_parser.h |
| 22 | hle/kernel/handle_table.cpp | 22 | file_sys/savedata_archive.cpp |
| 23 | hle/kernel/hle_ipc.cpp | 23 | file_sys/savedata_archive.h |
| 24 | hle/kernel/kernel.cpp | 24 | file_sys/title_metadata.cpp |
| 25 | hle/kernel/memory.cpp | 25 | file_sys/title_metadata.h |
| 26 | hle/kernel/mutex.cpp | 26 | frontend/emu_window.cpp |
| 27 | hle/kernel/object_address_table.cpp | 27 | frontend/emu_window.h |
| 28 | hle/kernel/process.cpp | 28 | frontend/framebuffer_layout.cpp |
| 29 | hle/kernel/resource_limit.cpp | 29 | frontend/framebuffer_layout.h |
| 30 | hle/kernel/server_port.cpp | 30 | frontend/input.h |
| 31 | hle/kernel/server_session.cpp | 31 | gdbstub/gdbstub.cpp |
| 32 | hle/kernel/shared_memory.cpp | 32 | gdbstub/gdbstub.h |
| 33 | hle/kernel/svc.cpp | 33 | hle/config_mem.cpp |
| 34 | hle/kernel/thread.cpp | 34 | hle/config_mem.h |
| 35 | hle/kernel/timer.cpp | 35 | hle/ipc.h |
| 36 | hle/kernel/vm_manager.cpp | 36 | hle/ipc_helpers.h |
| 37 | hle/kernel/wait_object.cpp | 37 | hle/kernel/address_arbiter.cpp |
| 38 | hle/lock.cpp | 38 | hle/kernel/address_arbiter.h |
| 39 | hle/romfs.cpp | 39 | hle/kernel/client_port.cpp |
| 40 | hle/service/acc/acc.cpp | 40 | hle/kernel/client_port.h |
| 41 | hle/service/acc/acc_u0.cpp | 41 | hle/kernel/client_session.cpp |
| 42 | hle/service/am/am.cpp | 42 | hle/kernel/client_session.h |
| 43 | hle/service/am/applet_oe.cpp | 43 | hle/kernel/condition_variable.cpp |
| 44 | hle/service/aoc/aoc_u.cpp | 44 | hle/kernel/condition_variable.h |
| 45 | hle/service/apm/apm.cpp | 45 | hle/kernel/domain.cpp |
| 46 | hle/service/audio/audio.cpp | 46 | hle/kernel/domain.h |
| 47 | hle/service/audio/audout_u.cpp | 47 | hle/kernel/errors.h |
| 48 | hle/service/hid/hid.cpp | 48 | hle/kernel/event.cpp |
| 49 | hle/service/lm/lm.cpp | 49 | hle/kernel/event.h |
| 50 | hle/service/nvdrv/devices/nvdisp_disp0.cpp | 50 | hle/kernel/handle_table.cpp |
| 51 | hle/service/nvdrv/devices/nvhost_as_gpu.cpp | 51 | hle/kernel/handle_table.h |
| 52 | hle/service/nvdrv/devices/nvmap.cpp | 52 | hle/kernel/hle_ipc.cpp |
| 53 | hle/service/nvdrv/interface.cpp | 53 | hle/kernel/hle_ipc.h |
| 54 | hle/service/nvdrv/nvdrv.cpp | 54 | hle/kernel/kernel.cpp |
| 55 | hle/service/pctl/pctl.cpp | 55 | hle/kernel/kernel.h |
| 56 | hle/service/pctl/pctl_a.cpp | 56 | hle/kernel/memory.cpp |
| 57 | hle/service/service.cpp | 57 | hle/kernel/memory.h |
| 58 | hle/service/sm/controller.cpp | 58 | hle/kernel/mutex.cpp |
| 59 | hle/service/sm/sm.cpp | 59 | hle/kernel/mutex.h |
| 60 | hle/service/time/time.cpp | 60 | hle/kernel/object_address_table.cpp |
| 61 | hle/service/vi/vi.cpp | 61 | hle/kernel/object_address_table.h |
| 62 | hle/service/vi/vi_m.cpp | 62 | hle/kernel/process.cpp |
| 63 | hle/shared_page.cpp | 63 | hle/kernel/process.h |
| 64 | hw/hw.cpp | 64 | hle/kernel/resource_limit.cpp |
| 65 | hw/lcd.cpp | 65 | hle/kernel/resource_limit.h |
| 66 | loader/elf.cpp | 66 | hle/kernel/server_port.cpp |
| 67 | loader/linker.cpp | 67 | hle/kernel/server_port.h |
| 68 | loader/loader.cpp | 68 | hle/kernel/server_session.cpp |
| 69 | loader/nro.cpp | 69 | hle/kernel/server_session.h |
| 70 | loader/nso.cpp | 70 | hle/kernel/session.h |
| 71 | tracer/recorder.cpp | 71 | hle/kernel/shared_memory.cpp |
| 72 | memory.cpp | 72 | hle/kernel/shared_memory.h |
| 73 | perf_stats.cpp | 73 | hle/kernel/svc.cpp |
| 74 | settings.cpp | 74 | hle/kernel/svc.h |
| 75 | telemetry_session.cpp | 75 | hle/kernel/svc_wrap.h |
| 76 | ) | 76 | hle/kernel/sync_object.h |
| 77 | hle/kernel/thread.cpp | ||
| 78 | hle/kernel/thread.h | ||
| 79 | hle/kernel/timer.cpp | ||
| 80 | hle/kernel/timer.h | ||
| 81 | hle/kernel/vm_manager.cpp | ||
| 82 | hle/kernel/vm_manager.h | ||
| 83 | hle/kernel/wait_object.cpp | ||
| 84 | hle/kernel/wait_object.h | ||
| 85 | hle/lock.cpp | ||
| 86 | hle/lock.h | ||
| 87 | hle/result.h | ||
| 88 | hle/romfs.cpp | ||
| 89 | hle/romfs.h | ||
| 90 | hle/service/acc/acc.cpp | ||
| 91 | hle/service/acc/acc.h | ||
| 92 | hle/service/acc/acc_u0.cpp | ||
| 93 | hle/service/acc/acc_u0.h | ||
| 94 | hle/service/am/am.cpp | ||
| 95 | hle/service/am/am.h | ||
| 96 | hle/service/am/applet_oe.cpp | ||
| 97 | hle/service/am/applet_oe.h | ||
| 98 | hle/service/aoc/aoc_u.cpp | ||
| 99 | hle/service/aoc/aoc_u.h | ||
| 100 | hle/service/apm/apm.cpp | ||
| 101 | hle/service/apm/apm.h | ||
| 102 | hle/service/audio/audio.cpp | ||
| 103 | hle/service/audio/audio.h | ||
| 104 | hle/service/audio/audout_u.cpp | ||
| 105 | hle/service/audio/audout_u.h | ||
| 106 | hle/service/hid/hid.cpp | ||
| 107 | hle/service/hid/hid.h | ||
| 108 | hle/service/lm/lm.cpp | ||
| 109 | hle/service/lm/lm.h | ||
| 110 | hle/service/nvdrv/devices/nvdevice.h | ||
| 111 | hle/service/nvdrv/devices/nvdisp_disp0.cpp | ||
| 112 | hle/service/nvdrv/devices/nvdisp_disp0.h | ||
| 113 | hle/service/nvdrv/devices/nvhost_as_gpu.cpp | ||
| 114 | hle/service/nvdrv/devices/nvhost_as_gpu.h | ||
| 115 | hle/service/nvdrv/devices/nvmap.cpp | ||
| 116 | hle/service/nvdrv/devices/nvmap.h | ||
| 117 | hle/service/nvdrv/interface.cpp | ||
| 118 | hle/service/nvdrv/interface.h | ||
| 119 | hle/service/nvdrv/nvdrv.cpp | ||
| 120 | hle/service/nvdrv/nvdrv.h | ||
| 121 | hle/service/pctl/pctl.cpp | ||
| 122 | hle/service/pctl/pctl.h | ||
| 123 | hle/service/pctl/pctl_a.cpp | ||
| 124 | hle/service/pctl/pctl_a.h | ||
| 125 | hle/service/service.cpp | ||
| 126 | hle/service/service.h | ||
| 127 | hle/service/sm/controller.cpp | ||
| 128 | hle/service/sm/controller.h | ||
| 129 | hle/service/sm/sm.cpp | ||
| 130 | hle/service/sm/sm.h | ||
| 131 | hle/service/sockets/bsd_u.cpp | ||
| 132 | hle/service/sockets/bsd_u.h | ||
| 133 | hle/service/sockets/sfdnsres.h | ||
| 134 | hle/service/sockets/sockets.cpp | ||
| 135 | hle/service/sockets/sockets.h | ||
| 136 | hle/service/time/time.cpp | ||
| 137 | hle/service/time/time.h | ||
| 138 | hle/service/vi/vi.cpp | ||
| 139 | hle/service/vi/vi.h | ||
| 140 | hle/service/vi/vi_m.cpp | ||
| 141 | hle/service/vi/vi_m.h | ||
| 142 | hle/shared_page.cpp | ||
| 143 | hle/shared_page.h | ||
| 144 | hw/hw.cpp | ||
| 145 | hw/hw.h | ||
| 146 | hw/lcd.cpp | ||
| 147 | hw/lcd.h | ||
| 148 | loader/elf.cpp | ||
| 149 | loader/elf.h | ||
| 150 | loader/linker.cpp | ||
| 151 | loader/linker.h | ||
| 152 | loader/loader.cpp | ||
| 153 | loader/loader.h | ||
| 154 | loader/nro.cpp | ||
| 155 | loader/nro.h | ||
| 156 | loader/nso.cpp | ||
| 157 | loader/nso.h | ||
| 158 | memory.cpp | ||
| 159 | memory.h | ||
| 160 | memory_setup.h | ||
| 161 | mmio.h | ||
| 162 | perf_stats.cpp | ||
| 163 | perf_stats.h | ||
| 164 | settings.cpp | ||
| 165 | settings.h | ||
| 166 | telemetry_session.cpp | ||
| 167 | telemetry_session.h | ||
| 168 | tracer/citrace.h | ||
| 169 | tracer/recorder.cpp | ||
| 170 | tracer/recorder.h | ||
| 171 | ) | ||
| 77 | 172 | ||
| 78 | set(HEADERS | 173 | create_target_directory_groups(core) |
| 79 | arm/arm_interface.h | ||
| 80 | arm/dynarmic/arm_dynarmic.h | ||
| 81 | arm/unicorn/arm_unicorn.h | ||
| 82 | core.h | ||
| 83 | core_timing.h | ||
| 84 | file_sys/archive_backend.h | ||
| 85 | file_sys/directory_backend.h | ||
| 86 | file_sys/disk_archive.h | ||
| 87 | file_sys/errors.h | ||
| 88 | file_sys/file_backend.h | ||
| 89 | file_sys/ivfc_archive.h | ||
| 90 | file_sys/path_parser.h | ||
| 91 | file_sys/savedata_archive.h | ||
| 92 | file_sys/title_metadata.h | ||
| 93 | frontend/emu_window.h | ||
| 94 | frontend/framebuffer_layout.h | ||
| 95 | frontend/input.h | ||
| 96 | gdbstub/gdbstub.h | ||
| 97 | hle/config_mem.h | ||
| 98 | hle/ipc.h | ||
| 99 | hle/ipc_helpers.h | ||
| 100 | hle/kernel/address_arbiter.h | ||
| 101 | hle/kernel/client_port.h | ||
| 102 | hle/kernel/client_session.h | ||
| 103 | hle/kernel/condition_variable.h | ||
| 104 | hle/kernel/domain.h | ||
| 105 | hle/kernel/errors.h | ||
| 106 | hle/kernel/event.h | ||
| 107 | hle/kernel/handle_table.h | ||
| 108 | hle/kernel/hle_ipc.h | ||
| 109 | hle/kernel/kernel.h | ||
| 110 | hle/kernel/memory.h | ||
| 111 | hle/kernel/mutex.h | ||
| 112 | hle/kernel/object_address_table.h | ||
| 113 | hle/kernel/process.h | ||
| 114 | hle/kernel/resource_limit.h | ||
| 115 | hle/kernel/server_port.h | ||
| 116 | hle/kernel/server_session.h | ||
| 117 | hle/kernel/session.h | ||
| 118 | hle/kernel/shared_memory.h | ||
| 119 | hle/kernel/sync_object.h | ||
| 120 | hle/kernel/svc.h | ||
| 121 | hle/kernel/svc_wrap.h | ||
| 122 | hle/kernel/thread.h | ||
| 123 | hle/kernel/timer.h | ||
| 124 | hle/kernel/vm_manager.h | ||
| 125 | hle/kernel/wait_object.h | ||
| 126 | hle/lock.h | ||
| 127 | hle/result.h | ||
| 128 | hle/romfs.h | ||
| 129 | hle/service/acc/acc.h | ||
| 130 | hle/service/acc/acc_u0.h | ||
| 131 | hle/service/am/am.h | ||
| 132 | hle/service/am/applet_oe.h | ||
| 133 | hle/service/aoc/aoc_u.h | ||
| 134 | hle/service/apm/apm.h | ||
| 135 | hle/service/audio/audio.h | ||
| 136 | hle/service/audio/audout_u.h | ||
| 137 | hle/service/hid/hid.h | ||
| 138 | hle/service/lm/lm.h | ||
| 139 | hle/service/nvdrv/devices/nvdevice.h | ||
| 140 | hle/service/nvdrv/devices/nvdisp_disp0.h | ||
| 141 | hle/service/nvdrv/devices/nvhost_as_gpu.h | ||
| 142 | hle/service/nvdrv/devices/nvmap.h | ||
| 143 | hle/service/nvdrv/interface.h | ||
| 144 | hle/service/nvdrv/nvdrv.h | ||
| 145 | hle/service/pctl/pctl.h | ||
| 146 | hle/service/pctl/pctl_a.h | ||
| 147 | hle/service/service.h | ||
| 148 | hle/service/sm/controller.h | ||
| 149 | hle/service/sm/sm.h | ||
| 150 | hle/service/time/time.h | ||
| 151 | hle/service/vi/vi.h | ||
| 152 | hle/service/vi/vi_m.h | ||
| 153 | hle/shared_page.h | ||
| 154 | hw/hw.h | ||
| 155 | hw/lcd.h | ||
| 156 | loader/elf.h | ||
| 157 | loader/linker.h | ||
| 158 | loader/loader.h | ||
| 159 | loader/nro.h | ||
| 160 | loader/nso.h | ||
| 161 | tracer/recorder.h | ||
| 162 | tracer/citrace.h | ||
| 163 | memory.h | ||
| 164 | memory_setup.h | ||
| 165 | mmio.h | ||
| 166 | perf_stats.h | ||
| 167 | settings.h | ||
| 168 | telemetry_session.h | ||
| 169 | ) | ||
| 170 | 174 | ||
| 171 | create_directory_groups(${SRCS} ${HEADERS}) | ||
| 172 | add_library(core STATIC ${SRCS} ${HEADERS}) | ||
| 173 | target_link_libraries(core PUBLIC common PRIVATE dynarmic video_core) | 175 | target_link_libraries(core PUBLIC common PRIVATE dynarmic video_core) |
| 174 | target_link_libraries(core PUBLIC Boost::boost PRIVATE fmt lz4_static unicorn) | 176 | target_link_libraries(core PUBLIC Boost::boost PRIVATE fmt lz4_static unicorn) |
diff --git a/src/core/hle/ipc.h b/src/core/hle/ipc.h index 1840fac12..0dcaede67 100644 --- a/src/core/hle/ipc.h +++ b/src/core/hle/ipc.h | |||
| @@ -133,6 +133,10 @@ struct BufferDescriptorC { | |||
| 133 | address |= static_cast<VAddr>(address_bits_32_47) << 32; | 133 | address |= static_cast<VAddr>(address_bits_32_47) << 32; |
| 134 | return address; | 134 | return address; |
| 135 | } | 135 | } |
| 136 | |||
| 137 | u64 Size() const { | ||
| 138 | return static_cast<u64>(size); | ||
| 139 | } | ||
| 136 | }; | 140 | }; |
| 137 | static_assert(sizeof(BufferDescriptorC) == 8, "BufferDescriptorC size is incorrect"); | 141 | static_assert(sizeof(BufferDescriptorC) == 8, "BufferDescriptorC size is incorrect"); |
| 138 | 142 | ||
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index 25530a3c8..4c9b0de28 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h | |||
| @@ -54,6 +54,10 @@ public: | |||
| 54 | unsigned GetCurrentOffset() const { | 54 | unsigned GetCurrentOffset() const { |
| 55 | return static_cast<unsigned>(index); | 55 | return static_cast<unsigned>(index); |
| 56 | } | 56 | } |
| 57 | |||
| 58 | void SetCurrentOffset(unsigned offset) { | ||
| 59 | index = static_cast<ptrdiff_t>(offset); | ||
| 60 | } | ||
| 57 | }; | 61 | }; |
| 58 | 62 | ||
| 59 | class RequestBuilder : public RequestHelperBase { | 63 | class RequestBuilder : public RequestHelperBase { |
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index ac62a0d5a..73bb6a8be 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp | |||
| @@ -81,13 +81,8 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) { | |||
| 81 | for (unsigned i = 0; i < command_header->num_buf_w_descriptors; ++i) { | 81 | for (unsigned i = 0; i < command_header->num_buf_w_descriptors; ++i) { |
| 82 | buffer_w_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>()); | 82 | buffer_w_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>()); |
| 83 | } | 83 | } |
| 84 | if (command_header->buf_c_descriptor_flags != | 84 | |
| 85 | IPC::CommandHeader::BufferDescriptorCFlag::Disabled) { | 85 | buffer_c_offset = rp.GetCurrentOffset() + command_header->data_size; |
| 86 | if (command_header->buf_c_descriptor_flags != | ||
| 87 | IPC::CommandHeader::BufferDescriptorCFlag::OneDescriptor) { | ||
| 88 | UNIMPLEMENTED(); | ||
| 89 | } | ||
| 90 | } | ||
| 91 | 86 | ||
| 92 | // Padding to align to 16 bytes | 87 | // Padding to align to 16 bytes |
| 93 | rp.AlignWithPadding(); | 88 | rp.AlignWithPadding(); |
| @@ -117,6 +112,31 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) { | |||
| 117 | ASSERT(data_payload_header->magic == Common::MakeMagic('S', 'F', 'C', 'O')); | 112 | ASSERT(data_payload_header->magic == Common::MakeMagic('S', 'F', 'C', 'O')); |
| 118 | } | 113 | } |
| 119 | 114 | ||
| 115 | rp.SetCurrentOffset(buffer_c_offset); | ||
| 116 | |||
| 117 | // For Inline buffers, the response data is written directly to buffer_c_offset | ||
| 118 | // and in this case we don't have any BufferDescriptorC on the request. | ||
| 119 | if (command_header->buf_c_descriptor_flags > | ||
| 120 | IPC::CommandHeader::BufferDescriptorCFlag::InlineDescriptor) { | ||
| 121 | if (command_header->buf_c_descriptor_flags == | ||
| 122 | IPC::CommandHeader::BufferDescriptorCFlag::OneDescriptor) { | ||
| 123 | buffer_c_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorC>()); | ||
| 124 | } else { | ||
| 125 | unsigned num_buf_c_descriptors = | ||
| 126 | static_cast<unsigned>(command_header->buf_c_descriptor_flags.Value()) - 2; | ||
| 127 | |||
| 128 | // This is used to detect possible underflows, in case something is broken | ||
| 129 | // with the two ifs above and the flags value is == 0 || == 1. | ||
| 130 | ASSERT(num_buf_c_descriptors < 14); | ||
| 131 | |||
| 132 | for (unsigned i = 0; i < num_buf_c_descriptors; ++i) { | ||
| 133 | buffer_c_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorC>()); | ||
| 134 | } | ||
| 135 | } | ||
| 136 | } | ||
| 137 | |||
| 138 | rp.SetCurrentOffset(data_payload_offset); | ||
| 139 | |||
| 120 | command = rp.Pop<u32_le>(); | 140 | command = rp.Pop<u32_le>(); |
| 121 | rp.Skip(1, false); // The command is actually an u64, but we don't use the high part. | 141 | rp.Skip(1, false); // The command is actually an u64, but we don't use the high part. |
| 122 | } | 142 | } |
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index 6dceb766d..80fa48d7f 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h | |||
| @@ -143,6 +143,10 @@ public: | |||
| 143 | return buffer_b_desciptors; | 143 | return buffer_b_desciptors; |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | const std::vector<IPC::BufferDescriptorC>& BufferDescriptorC() const { | ||
| 147 | return buffer_c_desciptors; | ||
| 148 | } | ||
| 149 | |||
| 146 | const std::unique_ptr<IPC::DomainMessageHeader>& GetDomainMessageHeader() const { | 150 | const std::unique_ptr<IPC::DomainMessageHeader>& GetDomainMessageHeader() const { |
| 147 | return domain_message_header; | 151 | return domain_message_header; |
| 148 | } | 152 | } |
| @@ -200,8 +204,10 @@ private: | |||
| 200 | std::vector<IPC::BufferDescriptorABW> buffer_a_desciptors; | 204 | std::vector<IPC::BufferDescriptorABW> buffer_a_desciptors; |
| 201 | std::vector<IPC::BufferDescriptorABW> buffer_b_desciptors; | 205 | std::vector<IPC::BufferDescriptorABW> buffer_b_desciptors; |
| 202 | std::vector<IPC::BufferDescriptorABW> buffer_w_desciptors; | 206 | std::vector<IPC::BufferDescriptorABW> buffer_w_desciptors; |
| 207 | std::vector<IPC::BufferDescriptorC> buffer_c_desciptors; | ||
| 203 | 208 | ||
| 204 | unsigned data_payload_offset{}; | 209 | unsigned data_payload_offset{}; |
| 210 | unsigned buffer_c_offset{}; | ||
| 205 | u32_le command{}; | 211 | u32_le command{}; |
| 206 | }; | 212 | }; |
| 207 | 213 | ||
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 6401af35a..45da842ef 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -57,7 +57,7 @@ static ResultCode UnmapMemory(VAddr dst_addr, VAddr src_addr, u64 size) { | |||
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | /// Connect to an OS service given the port name, returns the handle to the port to out | 59 | /// Connect to an OS service given the port name, returns the handle to the port to out |
| 60 | static ResultCode ConnectToPort(Handle* out_handle, VAddr port_name_address) { | 60 | static ResultCode ConnectToNamedPort(Handle* out_handle, VAddr port_name_address) { |
| 61 | if (!Memory::IsValidVirtualAddress(port_name_address)) | 61 | if (!Memory::IsValidVirtualAddress(port_name_address)) |
| 62 | return ERR_NOT_FOUND; | 62 | return ERR_NOT_FOUND; |
| 63 | 63 | ||
| @@ -253,8 +253,8 @@ static ResultCode CancelSynchronization(Handle thread_handle) { | |||
| 253 | } | 253 | } |
| 254 | 254 | ||
| 255 | /// Attempts to locks a mutex, creating it if it does not already exist | 255 | /// Attempts to locks a mutex, creating it if it does not already exist |
| 256 | static ResultCode LockMutex(Handle holding_thread_handle, VAddr mutex_addr, | 256 | static ResultCode ArbitrateLock(Handle holding_thread_handle, VAddr mutex_addr, |
| 257 | Handle requesting_thread_handle) { | 257 | Handle requesting_thread_handle) { |
| 258 | LOG_TRACE(Kernel_SVC, "called holding_thread_handle=0x%08X, mutex_addr=0x%llx, " | 258 | LOG_TRACE(Kernel_SVC, "called holding_thread_handle=0x%08X, mutex_addr=0x%llx, " |
| 259 | "requesting_current_thread_handle=0x%08X", | 259 | "requesting_current_thread_handle=0x%08X", |
| 260 | holding_thread_handle, mutex_addr, requesting_thread_handle); | 260 | holding_thread_handle, mutex_addr, requesting_thread_handle); |
| @@ -277,7 +277,7 @@ static ResultCode LockMutex(Handle holding_thread_handle, VAddr mutex_addr, | |||
| 277 | } | 277 | } |
| 278 | 278 | ||
| 279 | /// Unlock a mutex | 279 | /// Unlock a mutex |
| 280 | static ResultCode UnlockMutex(VAddr mutex_addr) { | 280 | static ResultCode ArbitrateUnlock(VAddr mutex_addr) { |
| 281 | LOG_TRACE(Kernel_SVC, "called mutex_addr=0x%llx", mutex_addr); | 281 | LOG_TRACE(Kernel_SVC, "called mutex_addr=0x%llx", mutex_addr); |
| 282 | 282 | ||
| 283 | SharedPtr<Mutex> mutex = g_object_address_table.Get<Mutex>(mutex_addr); | 283 | SharedPtr<Mutex> mutex = g_object_address_table.Get<Mutex>(mutex_addr); |
| @@ -774,12 +774,12 @@ static const FunctionDef SVC_Table[] = { | |||
| 774 | {0x17, SvcWrap<ResetSignal>, "ResetSignal"}, | 774 | {0x17, SvcWrap<ResetSignal>, "ResetSignal"}, |
| 775 | {0x18, SvcWrap<WaitSynchronization>, "WaitSynchronization"}, | 775 | {0x18, SvcWrap<WaitSynchronization>, "WaitSynchronization"}, |
| 776 | {0x19, SvcWrap<CancelSynchronization>, "CancelSynchronization"}, | 776 | {0x19, SvcWrap<CancelSynchronization>, "CancelSynchronization"}, |
| 777 | {0x1A, SvcWrap<LockMutex>, "LockMutex"}, | 777 | {0x1A, SvcWrap<ArbitrateLock>, "ArbitrateLock"}, |
| 778 | {0x1B, SvcWrap<UnlockMutex>, "UnlockMutex"}, | 778 | {0x1B, SvcWrap<ArbitrateUnlock>, "ArbitrateUnlock"}, |
| 779 | {0x1C, SvcWrap<WaitProcessWideKeyAtomic>, "WaitProcessWideKeyAtomic"}, | 779 | {0x1C, SvcWrap<WaitProcessWideKeyAtomic>, "WaitProcessWideKeyAtomic"}, |
| 780 | {0x1D, SvcWrap<SignalProcessWideKey>, "SignalProcessWideKey"}, | 780 | {0x1D, SvcWrap<SignalProcessWideKey>, "SignalProcessWideKey"}, |
| 781 | {0x1E, SvcWrap<GetSystemTick>, "GetSystemTick"}, | 781 | {0x1E, SvcWrap<GetSystemTick>, "GetSystemTick"}, |
| 782 | {0x1F, SvcWrap<ConnectToPort>, "ConnectToPort"}, | 782 | {0x1F, SvcWrap<ConnectToNamedPort>, "ConnectToNamedPort"}, |
| 783 | {0x20, nullptr, "SendSyncRequestLight"}, | 783 | {0x20, nullptr, "SendSyncRequestLight"}, |
| 784 | {0x21, SvcWrap<SendSyncRequest>, "SendSyncRequest"}, | 784 | {0x21, SvcWrap<SendSyncRequest>, "SendSyncRequest"}, |
| 785 | {0x22, nullptr, "SendSyncRequestWithUserBuffer"}, | 785 | {0x22, nullptr, "SendSyncRequestWithUserBuffer"}, |
| @@ -823,8 +823,8 @@ static const FunctionDef SVC_Table[] = { | |||
| 823 | {0x48, nullptr, "Unknown"}, | 823 | {0x48, nullptr, "Unknown"}, |
| 824 | {0x49, nullptr, "Unknown"}, | 824 | {0x49, nullptr, "Unknown"}, |
| 825 | {0x4A, nullptr, "Unknown"}, | 825 | {0x4A, nullptr, "Unknown"}, |
| 826 | {0x4B, nullptr, "Unknown"}, | 826 | {0x4B, nullptr, "CreateJitMemory"}, |
| 827 | {0x4C, nullptr, "Unknown"}, | 827 | {0x4C, nullptr, "MapJitMemory"}, |
| 828 | {0x4D, nullptr, "SleepSystem"}, | 828 | {0x4D, nullptr, "SleepSystem"}, |
| 829 | {0x4E, nullptr, "ReadWriteRegister"}, | 829 | {0x4E, nullptr, "ReadWriteRegister"}, |
| 830 | {0x4F, nullptr, "SetProcessActivity"}, | 830 | {0x4F, nullptr, "SetProcessActivity"}, |
diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp index b360e7e5f..0d7f9c03d 100644 --- a/src/core/hle/service/am/applet_oe.cpp +++ b/src/core/hle/service/am/applet_oe.cpp | |||
| @@ -201,10 +201,76 @@ private: | |||
| 201 | Kernel::SharedPtr<Kernel::Event> event; | 201 | Kernel::SharedPtr<Kernel::Event> event; |
| 202 | }; | 202 | }; |
| 203 | 203 | ||
| 204 | class IStorageAccessor final : public ServiceFramework<IStorageAccessor> { | ||
| 205 | public: | ||
| 206 | explicit IStorageAccessor(std::vector<u8> buffer) | ||
| 207 | : ServiceFramework("IStorageAccessor"), buffer(std::move(buffer)) { | ||
| 208 | static const FunctionInfo functions[] = { | ||
| 209 | {0, &IStorageAccessor::GetSize, "GetSize"}, | ||
| 210 | {11, &IStorageAccessor::Read, "Read"}, | ||
| 211 | }; | ||
| 212 | RegisterHandlers(functions); | ||
| 213 | } | ||
| 214 | |||
| 215 | private: | ||
| 216 | std::vector<u8> buffer; | ||
| 217 | |||
| 218 | void GetSize(Kernel::HLERequestContext& ctx) { | ||
| 219 | IPC::RequestBuilder rb{ctx, 4}; | ||
| 220 | |||
| 221 | rb.Push(RESULT_SUCCESS); | ||
| 222 | rb.Push(static_cast<u64>(buffer.size())); | ||
| 223 | |||
| 224 | LOG_DEBUG(Service, "called"); | ||
| 225 | } | ||
| 226 | |||
| 227 | void Read(Kernel::HLERequestContext& ctx) { | ||
| 228 | IPC::RequestParser rp{ctx}; | ||
| 229 | |||
| 230 | u64 offset = rp.Pop<u64>(); | ||
| 231 | |||
| 232 | const auto& output_buffer = ctx.BufferDescriptorC()[0]; | ||
| 233 | |||
| 234 | ASSERT(offset + output_buffer.Size() <= buffer.size()); | ||
| 235 | |||
| 236 | Memory::WriteBlock(output_buffer.Address(), buffer.data() + offset, output_buffer.Size()); | ||
| 237 | |||
| 238 | IPC::RequestBuilder rb{ctx, 2}; | ||
| 239 | |||
| 240 | rb.Push(RESULT_SUCCESS); | ||
| 241 | |||
| 242 | LOG_DEBUG(Service, "called"); | ||
| 243 | } | ||
| 244 | }; | ||
| 245 | |||
| 246 | class IStorage final : public ServiceFramework<IStorage> { | ||
| 247 | public: | ||
| 248 | explicit IStorage(std::vector<u8> buffer) | ||
| 249 | : ServiceFramework("IStorage"), buffer(std::move(buffer)) { | ||
| 250 | static const FunctionInfo functions[] = { | ||
| 251 | {0, &IStorage::Open, "Open"}, | ||
| 252 | }; | ||
| 253 | RegisterHandlers(functions); | ||
| 254 | } | ||
| 255 | |||
| 256 | private: | ||
| 257 | std::vector<u8> buffer; | ||
| 258 | |||
| 259 | void Open(Kernel::HLERequestContext& ctx) { | ||
| 260 | IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; | ||
| 261 | |||
| 262 | rb.Push(RESULT_SUCCESS); | ||
| 263 | rb.PushIpcInterface<AM::IStorageAccessor>(buffer); | ||
| 264 | |||
| 265 | LOG_DEBUG(Service, "called"); | ||
| 266 | } | ||
| 267 | }; | ||
| 268 | |||
| 204 | class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> { | 269 | class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> { |
| 205 | public: | 270 | public: |
| 206 | IApplicationFunctions() : ServiceFramework("IApplicationFunctions") { | 271 | IApplicationFunctions() : ServiceFramework("IApplicationFunctions") { |
| 207 | static const FunctionInfo functions[] = { | 272 | static const FunctionInfo functions[] = { |
| 273 | {1, &IApplicationFunctions::PopLaunchParameter, "PopLaunchParameter"}, | ||
| 208 | {22, &IApplicationFunctions::SetTerminateResult, "SetTerminateResult"}, | 274 | {22, &IApplicationFunctions::SetTerminateResult, "SetTerminateResult"}, |
| 209 | {66, &IApplicationFunctions::InitializeGamePlayRecording, | 275 | {66, &IApplicationFunctions::InitializeGamePlayRecording, |
| 210 | "InitializeGamePlayRecording"}, | 276 | "InitializeGamePlayRecording"}, |
| @@ -215,6 +281,26 @@ public: | |||
| 215 | } | 281 | } |
| 216 | 282 | ||
| 217 | private: | 283 | private: |
| 284 | void PopLaunchParameter(Kernel::HLERequestContext& ctx) { | ||
| 285 | constexpr u8 data[0x88] = { | ||
| 286 | 0xca, 0x97, 0x94, 0xc7, // Magic | ||
| 287 | 1, 0, 0, 0, // IsAccountSelected (bool) | ||
| 288 | 1, 0, 0, 0, // User Id (word 0) | ||
| 289 | 0, 0, 0, 0, // User Id (word 1) | ||
| 290 | 0, 0, 0, 0, // User Id (word 2) | ||
| 291 | 0, 0, 0, 0 // User Id (word 3) | ||
| 292 | }; | ||
| 293 | |||
| 294 | std::vector<u8> buffer(data, data + sizeof(data)); | ||
| 295 | |||
| 296 | IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; | ||
| 297 | |||
| 298 | rb.Push(RESULT_SUCCESS); | ||
| 299 | rb.PushIpcInterface<AM::IStorage>(buffer); | ||
| 300 | |||
| 301 | LOG_DEBUG(Service, "called"); | ||
| 302 | } | ||
| 303 | |||
| 218 | void SetTerminateResult(Kernel::HLERequestContext& ctx) { | 304 | void SetTerminateResult(Kernel::HLERequestContext& ctx) { |
| 219 | // Takes an input u32 Result, no output. | 305 | // Takes an input u32 Result, no output. |
| 220 | // For example, in some cases official apps use this with error 0x2A2 then uses svcBreak. | 306 | // For example, in some cases official apps use this with error 0x2A2 then uses svcBreak. |
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp index 2d0d2fb65..13c9ee3d3 100644 --- a/src/core/hle/service/lm/lm.cpp +++ b/src/core/hle/service/lm/lm.cpp | |||
| @@ -47,6 +47,7 @@ private: | |||
| 47 | 47 | ||
| 48 | /// Log field type | 48 | /// Log field type |
| 49 | enum class Field : u8 { | 49 | enum class Field : u8 { |
| 50 | Skip = 1, | ||
| 50 | Message = 2, | 51 | Message = 2, |
| 51 | Line = 3, | 52 | Line = 3, |
| 52 | Filename = 4, | 53 | Filename = 4, |
| @@ -85,6 +86,11 @@ private: | |||
| 85 | while (addr < end_addr) { | 86 | while (addr < end_addr) { |
| 86 | const Field field{static_cast<Field>(Memory::Read8(addr++))}; | 87 | const Field field{static_cast<Field>(Memory::Read8(addr++))}; |
| 87 | size_t length{Memory::Read8(addr++)}; | 88 | size_t length{Memory::Read8(addr++)}; |
| 89 | |||
| 90 | if (static_cast<Field>(Memory::Read8(addr)) == Field::Skip) { | ||
| 91 | ++addr; | ||
| 92 | } | ||
| 93 | |||
| 88 | switch (field) { | 94 | switch (field) { |
| 89 | case Field::Message: | 95 | case Field::Message: |
| 90 | message = Memory::ReadCString(addr, length); | 96 | message = Memory::ReadCString(addr, length); |
| @@ -99,6 +105,7 @@ private: | |||
| 99 | function = Memory::ReadCString(addr, length); | 105 | function = Memory::ReadCString(addr, length); |
| 100 | break; | 106 | break; |
| 101 | } | 107 | } |
| 108 | |||
| 102 | addr += length; | 109 | addr += length; |
| 103 | } | 110 | } |
| 104 | 111 | ||
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index fe76b381c..9a49d9e9c 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include "core/hle/service/service.h" | 26 | #include "core/hle/service/service.h" |
| 27 | #include "core/hle/service/sm/controller.h" | 27 | #include "core/hle/service/sm/controller.h" |
| 28 | #include "core/hle/service/sm/sm.h" | 28 | #include "core/hle/service/sm/sm.h" |
| 29 | #include "core/hle/service/sockets/sockets.h" | ||
| 29 | #include "core/hle/service/time/time.h" | 30 | #include "core/hle/service/time/time.h" |
| 30 | #include "core/hle/service/vi/vi.h" | 31 | #include "core/hle/service/vi/vi.h" |
| 31 | 32 | ||
| @@ -174,6 +175,7 @@ void Init() { | |||
| 174 | LM::InstallInterfaces(*SM::g_service_manager); | 175 | LM::InstallInterfaces(*SM::g_service_manager); |
| 175 | Nvidia::InstallInterfaces(*SM::g_service_manager); | 176 | Nvidia::InstallInterfaces(*SM::g_service_manager); |
| 176 | PCTL::InstallInterfaces(*SM::g_service_manager); | 177 | PCTL::InstallInterfaces(*SM::g_service_manager); |
| 178 | Sockets::InstallInterfaces(*SM::g_service_manager); | ||
| 177 | Time::InstallInterfaces(*SM::g_service_manager); | 179 | Time::InstallInterfaces(*SM::g_service_manager); |
| 178 | VI::InstallInterfaces(*SM::g_service_manager); | 180 | VI::InstallInterfaces(*SM::g_service_manager); |
| 179 | 181 | ||
diff --git a/src/core/hle/service/sockets/bsd_u.cpp b/src/core/hle/service/sockets/bsd_u.cpp new file mode 100644 index 000000000..a819acc96 --- /dev/null +++ b/src/core/hle/service/sockets/bsd_u.cpp | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/ipc_helpers.h" | ||
| 6 | #include "core/hle/service/sockets/bsd_u.h" | ||
| 7 | |||
| 8 | namespace Service { | ||
| 9 | namespace Sockets { | ||
| 10 | |||
| 11 | void BSD_U::RegisterClient(Kernel::HLERequestContext& ctx) { | ||
| 12 | LOG_WARNING(Service, "(STUBBED) called"); | ||
| 13 | |||
| 14 | IPC::RequestBuilder rb{ctx, 3}; | ||
| 15 | |||
| 16 | rb.Push(RESULT_SUCCESS); | ||
| 17 | rb.Push<u32>(0); // bsd errno | ||
| 18 | } | ||
| 19 | |||
| 20 | void BSD_U::Socket(Kernel::HLERequestContext& ctx) { | ||
| 21 | IPC::RequestParser rp{ctx}; | ||
| 22 | |||
| 23 | u32 domain = rp.Pop<u32>(); | ||
| 24 | u32 type = rp.Pop<u32>(); | ||
| 25 | u32 protocol = rp.Pop<u32>(); | ||
| 26 | |||
| 27 | LOG_WARNING(Service, "(STUBBED) called domain=%u type=%u protocol=%u", domain, type, protocol); | ||
| 28 | |||
| 29 | u32 fd = next_fd++; | ||
| 30 | |||
| 31 | IPC::RequestBuilder rb{ctx, 4}; | ||
| 32 | |||
| 33 | rb.Push(RESULT_SUCCESS); | ||
| 34 | rb.Push<u32>(fd); | ||
| 35 | rb.Push<u32>(0); // bsd errno | ||
| 36 | } | ||
| 37 | |||
| 38 | void BSD_U::Connect(Kernel::HLERequestContext& ctx) { | ||
| 39 | LOG_WARNING(Service, "(STUBBED) called"); | ||
| 40 | |||
| 41 | IPC::RequestBuilder rb{ctx, 4}; | ||
| 42 | |||
| 43 | rb.Push(RESULT_SUCCESS); | ||
| 44 | rb.Push<u32>(0); // ret | ||
| 45 | rb.Push<u32>(0); // bsd errno | ||
| 46 | } | ||
| 47 | |||
| 48 | void BSD_U::SendTo(Kernel::HLERequestContext& ctx) { | ||
| 49 | LOG_WARNING(Service, "(STUBBED) called"); | ||
| 50 | |||
| 51 | IPC::RequestBuilder rb{ctx, 4}; | ||
| 52 | |||
| 53 | rb.Push(RESULT_SUCCESS); | ||
| 54 | rb.Push<u32>(0); // ret | ||
| 55 | rb.Push<u32>(0); // bsd errno | ||
| 56 | } | ||
| 57 | |||
| 58 | BSD_U::BSD_U() : ServiceFramework("bsd:u") { | ||
| 59 | static const FunctionInfo functions[] = {{0, &BSD_U::RegisterClient, "RegisterClient"}, | ||
| 60 | {2, &BSD_U::Socket, "Socket"}, | ||
| 61 | {11, &BSD_U::SendTo, "SendTo"}, | ||
| 62 | {14, &BSD_U::Connect, "Connect"}}; | ||
| 63 | RegisterHandlers(functions); | ||
| 64 | } | ||
| 65 | |||
| 66 | } // namespace Sockets | ||
| 67 | } // namespace Service | ||
diff --git a/src/core/hle/service/sockets/bsd_u.h b/src/core/hle/service/sockets/bsd_u.h new file mode 100644 index 000000000..1fe96d850 --- /dev/null +++ b/src/core/hle/service/sockets/bsd_u.h | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/kernel/hle_ipc.h" | ||
| 8 | #include "core/hle/service/service.h" | ||
| 9 | |||
| 10 | namespace Service { | ||
| 11 | namespace Sockets { | ||
| 12 | |||
| 13 | class BSD_U final : public ServiceFramework<BSD_U> { | ||
| 14 | public: | ||
| 15 | BSD_U(); | ||
| 16 | ~BSD_U() = default; | ||
| 17 | |||
| 18 | private: | ||
| 19 | void RegisterClient(Kernel::HLERequestContext& ctx); | ||
| 20 | void Socket(Kernel::HLERequestContext& ctx); | ||
| 21 | void Connect(Kernel::HLERequestContext& ctx); | ||
| 22 | void SendTo(Kernel::HLERequestContext& ctx); | ||
| 23 | |||
| 24 | /// Id to use for the next open file descriptor. | ||
| 25 | u32 next_fd = 1; | ||
| 26 | }; | ||
| 27 | |||
| 28 | } // namespace Sockets | ||
| 29 | } // namespace Service | ||
diff --git a/src/core/hle/service/sockets/sfdnsres.h b/src/core/hle/service/sockets/sfdnsres.h new file mode 100644 index 000000000..32a3ac8c5 --- /dev/null +++ b/src/core/hle/service/sockets/sfdnsres.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/kernel/hle_ipc.h" | ||
| 8 | #include "core/hle/service/service.h" | ||
| 9 | |||
| 10 | namespace Service { | ||
| 11 | namespace Sockets { | ||
| 12 | |||
| 13 | class SFDNSRES final : public ServiceFramework<SFDNSRES> { | ||
| 14 | public: | ||
| 15 | SFDNSRES() : ServiceFramework("sfdnsres") {} | ||
| 16 | ~SFDNSRES() = default; | ||
| 17 | |||
| 18 | private: | ||
| 19 | }; | ||
| 20 | |||
| 21 | } // namespace Sockets | ||
| 22 | } // namespace Service | ||
diff --git a/src/core/hle/service/sockets/sockets.cpp b/src/core/hle/service/sockets/sockets.cpp new file mode 100644 index 000000000..f1396eaa1 --- /dev/null +++ b/src/core/hle/service/sockets/sockets.cpp | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/service/sockets/bsd_u.h" | ||
| 6 | #include "core/hle/service/sockets/sfdnsres.h" | ||
| 7 | #include "core/hle/service/sockets/sockets.h" | ||
| 8 | |||
| 9 | namespace Service { | ||
| 10 | namespace Sockets { | ||
| 11 | |||
| 12 | void InstallInterfaces(SM::ServiceManager& service_manager) { | ||
| 13 | std::make_shared<BSD_U>()->InstallAsService(service_manager); | ||
| 14 | std::make_shared<SFDNSRES>()->InstallAsService(service_manager); | ||
| 15 | } | ||
| 16 | |||
| 17 | } // namespace Sockets | ||
| 18 | } // namespace Service | ||
diff --git a/src/core/hle/service/sockets/sockets.h b/src/core/hle/service/sockets/sockets.h new file mode 100644 index 000000000..7e89c8d2c --- /dev/null +++ b/src/core/hle/service/sockets/sockets.h | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/service/service.h" | ||
| 8 | |||
| 9 | namespace Service { | ||
| 10 | namespace Sockets { | ||
| 11 | |||
| 12 | /// Registers all Sockets services with the specified service manager. | ||
| 13 | void InstallInterfaces(SM::ServiceManager& service_manager); | ||
| 14 | |||
| 15 | } // namespace Sockets | ||
| 16 | } // namespace Service | ||
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index cae2c4466..108a635d7 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp | |||
| @@ -26,7 +26,7 @@ public: | |||
| 26 | // This default size was chosen arbitrarily. | 26 | // This default size was chosen arbitrarily. |
| 27 | static constexpr size_t DefaultBufferSize = 0x40; | 27 | static constexpr size_t DefaultBufferSize = 0x40; |
| 28 | Parcel() : buffer(DefaultBufferSize) {} | 28 | Parcel() : buffer(DefaultBufferSize) {} |
| 29 | Parcel(std::vector<u8> data) : buffer(std::move(data)) {} | 29 | explicit Parcel(std::vector<u8> data) : buffer(std::move(data)) {} |
| 30 | virtual ~Parcel() = default; | 30 | virtual ~Parcel() = default; |
| 31 | 31 | ||
| 32 | template <typename T> | 32 | template <typename T> |
| @@ -47,8 +47,9 @@ public: | |||
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | std::vector<u8> ReadBlock(size_t length) { | 49 | std::vector<u8> ReadBlock(size_t length) { |
| 50 | std::vector<u8> data(length); | 50 | const u8* const begin = buffer.data() + read_index; |
| 51 | std::memcpy(data.data(), buffer.data() + read_index, length); | 51 | const u8* const end = begin + length; |
| 52 | std::vector<u8> data(begin, end); | ||
| 52 | read_index += length; | 53 | read_index += length; |
| 53 | read_index = Common::AlignUp(read_index, 4); | 54 | read_index = Common::AlignUp(read_index, 4); |
| 54 | return data; | 55 | return data; |
| @@ -101,9 +102,9 @@ public: | |||
| 101 | } | 102 | } |
| 102 | 103 | ||
| 103 | protected: | 104 | protected: |
| 104 | virtual void SerializeData(){}; | 105 | virtual void SerializeData() {} |
| 105 | 106 | ||
| 106 | virtual void DeserializeData(){}; | 107 | virtual void DeserializeData() {} |
| 107 | 108 | ||
| 108 | private: | 109 | private: |
| 109 | struct Header { | 110 | struct Header { |
| @@ -121,7 +122,7 @@ private: | |||
| 121 | 122 | ||
| 122 | class NativeWindow : public Parcel { | 123 | class NativeWindow : public Parcel { |
| 123 | public: | 124 | public: |
| 124 | NativeWindow(u32 id) : Parcel() { | 125 | explicit NativeWindow(u32 id) : Parcel() { |
| 125 | data.id = id; | 126 | data.id = id; |
| 126 | } | 127 | } |
| 127 | ~NativeWindow() override = default; | 128 | ~NativeWindow() override = default; |
| @@ -147,12 +148,12 @@ private: | |||
| 147 | 148 | ||
| 148 | class IGBPConnectRequestParcel : public Parcel { | 149 | class IGBPConnectRequestParcel : public Parcel { |
| 149 | public: | 150 | public: |
| 150 | IGBPConnectRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { | 151 | explicit IGBPConnectRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { |
| 151 | Deserialize(); | 152 | Deserialize(); |
| 152 | } | 153 | } |
| 153 | ~IGBPConnectRequestParcel() override = default; | 154 | ~IGBPConnectRequestParcel() override = default; |
| 154 | 155 | ||
| 155 | void DeserializeData() { | 156 | void DeserializeData() override { |
| 156 | std::u16string token = ReadInterfaceToken(); | 157 | std::u16string token = ReadInterfaceToken(); |
| 157 | data = Read<Data>(); | 158 | data = Read<Data>(); |
| 158 | } | 159 | } |
| @@ -168,7 +169,7 @@ public: | |||
| 168 | 169 | ||
| 169 | class IGBPConnectResponseParcel : public Parcel { | 170 | class IGBPConnectResponseParcel : public Parcel { |
| 170 | public: | 171 | public: |
| 171 | IGBPConnectResponseParcel(u32 width, u32 height) : Parcel() { | 172 | explicit IGBPConnectResponseParcel(u32 width, u32 height) : Parcel() { |
| 172 | data.width = width; | 173 | data.width = width; |
| 173 | data.height = height; | 174 | data.height = height; |
| 174 | } | 175 | } |
| @@ -194,12 +195,13 @@ private: | |||
| 194 | 195 | ||
| 195 | class IGBPSetPreallocatedBufferRequestParcel : public Parcel { | 196 | class IGBPSetPreallocatedBufferRequestParcel : public Parcel { |
| 196 | public: | 197 | public: |
| 197 | IGBPSetPreallocatedBufferRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { | 198 | explicit IGBPSetPreallocatedBufferRequestParcel(const std::vector<u8>& buffer) |
| 199 | : Parcel(buffer) { | ||
| 198 | Deserialize(); | 200 | Deserialize(); |
| 199 | } | 201 | } |
| 200 | ~IGBPSetPreallocatedBufferRequestParcel() override = default; | 202 | ~IGBPSetPreallocatedBufferRequestParcel() override = default; |
| 201 | 203 | ||
| 202 | void DeserializeData() { | 204 | void DeserializeData() override { |
| 203 | std::u16string token = ReadInterfaceToken(); | 205 | std::u16string token = ReadInterfaceToken(); |
| 204 | data = Read<Data>(); | 206 | data = Read<Data>(); |
| 205 | ASSERT(data.graphic_buffer_length == sizeof(IGBPBuffer)); | 207 | ASSERT(data.graphic_buffer_length == sizeof(IGBPBuffer)); |
| @@ -231,12 +233,12 @@ protected: | |||
| 231 | 233 | ||
| 232 | class IGBPDequeueBufferRequestParcel : public Parcel { | 234 | class IGBPDequeueBufferRequestParcel : public Parcel { |
| 233 | public: | 235 | public: |
| 234 | IGBPDequeueBufferRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { | 236 | explicit IGBPDequeueBufferRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { |
| 235 | Deserialize(); | 237 | Deserialize(); |
| 236 | } | 238 | } |
| 237 | ~IGBPDequeueBufferRequestParcel() override = default; | 239 | ~IGBPDequeueBufferRequestParcel() override = default; |
| 238 | 240 | ||
| 239 | void DeserializeData() { | 241 | void DeserializeData() override { |
| 240 | std::u16string token = ReadInterfaceToken(); | 242 | std::u16string token = ReadInterfaceToken(); |
| 241 | data = Read<Data>(); | 243 | data = Read<Data>(); |
| 242 | } | 244 | } |
| @@ -254,7 +256,7 @@ public: | |||
| 254 | 256 | ||
| 255 | class IGBPDequeueBufferResponseParcel : public Parcel { | 257 | class IGBPDequeueBufferResponseParcel : public Parcel { |
| 256 | public: | 258 | public: |
| 257 | IGBPDequeueBufferResponseParcel(u32 slot) : Parcel(), slot(slot) {} | 259 | explicit IGBPDequeueBufferResponseParcel(u32 slot) : Parcel(), slot(slot) {} |
| 258 | ~IGBPDequeueBufferResponseParcel() override = default; | 260 | ~IGBPDequeueBufferResponseParcel() override = default; |
| 259 | 261 | ||
| 260 | protected: | 262 | protected: |
| @@ -271,12 +273,12 @@ protected: | |||
| 271 | 273 | ||
| 272 | class IGBPRequestBufferRequestParcel : public Parcel { | 274 | class IGBPRequestBufferRequestParcel : public Parcel { |
| 273 | public: | 275 | public: |
| 274 | IGBPRequestBufferRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { | 276 | explicit IGBPRequestBufferRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { |
| 275 | Deserialize(); | 277 | Deserialize(); |
| 276 | } | 278 | } |
| 277 | ~IGBPRequestBufferRequestParcel() override = default; | 279 | ~IGBPRequestBufferRequestParcel() override = default; |
| 278 | 280 | ||
| 279 | void DeserializeData() { | 281 | void DeserializeData() override { |
| 280 | std::u16string token = ReadInterfaceToken(); | 282 | std::u16string token = ReadInterfaceToken(); |
| 281 | slot = Read<u32_le>(); | 283 | slot = Read<u32_le>(); |
| 282 | } | 284 | } |
| @@ -286,7 +288,7 @@ public: | |||
| 286 | 288 | ||
| 287 | class IGBPRequestBufferResponseParcel : public Parcel { | 289 | class IGBPRequestBufferResponseParcel : public Parcel { |
| 288 | public: | 290 | public: |
| 289 | IGBPRequestBufferResponseParcel(IGBPBuffer buffer) : Parcel(), buffer(buffer) {} | 291 | explicit IGBPRequestBufferResponseParcel(IGBPBuffer buffer) : Parcel(), buffer(buffer) {} |
| 290 | ~IGBPRequestBufferResponseParcel() override = default; | 292 | ~IGBPRequestBufferResponseParcel() override = default; |
| 291 | 293 | ||
| 292 | protected: | 294 | protected: |
| @@ -307,12 +309,12 @@ protected: | |||
| 307 | 309 | ||
| 308 | class IGBPQueueBufferRequestParcel : public Parcel { | 310 | class IGBPQueueBufferRequestParcel : public Parcel { |
| 309 | public: | 311 | public: |
| 310 | IGBPQueueBufferRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { | 312 | explicit IGBPQueueBufferRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { |
| 311 | Deserialize(); | 313 | Deserialize(); |
| 312 | } | 314 | } |
| 313 | ~IGBPQueueBufferRequestParcel() override = default; | 315 | ~IGBPQueueBufferRequestParcel() override = default; |
| 314 | 316 | ||
| 315 | void DeserializeData() { | 317 | void DeserializeData() override { |
| 316 | std::u16string token = ReadInterfaceToken(); | 318 | std::u16string token = ReadInterfaceToken(); |
| 317 | data = Read<Data>(); | 319 | data = Read<Data>(); |
| 318 | } | 320 | } |
| @@ -330,7 +332,7 @@ public: | |||
| 330 | 332 | ||
| 331 | class IGBPQueueBufferResponseParcel : public Parcel { | 333 | class IGBPQueueBufferResponseParcel : public Parcel { |
| 332 | public: | 334 | public: |
| 333 | IGBPQueueBufferResponseParcel(u32 width, u32 height) : Parcel() { | 335 | explicit IGBPQueueBufferResponseParcel(u32 width, u32 height) : Parcel() { |
| 334 | data.width = width; | 336 | data.width = width; |
| 335 | data.height = height; | 337 | data.height = height; |
| 336 | } | 338 | } |
| @@ -356,7 +358,7 @@ private: | |||
| 356 | 358 | ||
| 357 | class IHOSBinderDriver final : public ServiceFramework<IHOSBinderDriver> { | 359 | class IHOSBinderDriver final : public ServiceFramework<IHOSBinderDriver> { |
| 358 | public: | 360 | public: |
| 359 | IHOSBinderDriver(std::shared_ptr<NVFlinger> nv_flinger) | 361 | explicit IHOSBinderDriver(std::shared_ptr<NVFlinger> nv_flinger) |
| 360 | : ServiceFramework("IHOSBinderDriver"), nv_flinger(std::move(nv_flinger)) { | 362 | : ServiceFramework("IHOSBinderDriver"), nv_flinger(std::move(nv_flinger)) { |
| 361 | static const FunctionInfo functions[] = { | 363 | static const FunctionInfo functions[] = { |
| 362 | {0, &IHOSBinderDriver::TransactParcel, "TransactParcel"}, | 364 | {0, &IHOSBinderDriver::TransactParcel, "TransactParcel"}, |
| @@ -506,7 +508,7 @@ private: | |||
| 506 | 508 | ||
| 507 | class IManagerDisplayService final : public ServiceFramework<IManagerDisplayService> { | 509 | class IManagerDisplayService final : public ServiceFramework<IManagerDisplayService> { |
| 508 | public: | 510 | public: |
| 509 | IManagerDisplayService(std::shared_ptr<NVFlinger> nv_flinger) | 511 | explicit IManagerDisplayService(std::shared_ptr<NVFlinger> nv_flinger) |
| 510 | : ServiceFramework("IManagerDisplayService"), nv_flinger(std::move(nv_flinger)) { | 512 | : ServiceFramework("IManagerDisplayService"), nv_flinger(std::move(nv_flinger)) { |
| 511 | static const FunctionInfo functions[] = { | 513 | static const FunctionInfo functions[] = { |
| 512 | {1020, &IManagerDisplayService::CloseDisplay, "CloseDisplay"}, | 514 | {1020, &IManagerDisplayService::CloseDisplay, "CloseDisplay"}, |
diff --git a/src/input_common/CMakeLists.txt b/src/input_common/CMakeLists.txt index 92792a702..1c7db28c0 100644 --- a/src/input_common/CMakeLists.txt +++ b/src/input_common/CMakeLists.txt | |||
| @@ -1,25 +1,18 @@ | |||
| 1 | set(SRCS | 1 | add_library(input_common STATIC |
| 2 | analog_from_button.cpp | 2 | analog_from_button.cpp |
| 3 | keyboard.cpp | 3 | analog_from_button.h |
| 4 | main.cpp | 4 | keyboard.cpp |
| 5 | motion_emu.cpp | 5 | keyboard.h |
| 6 | ) | 6 | main.cpp |
| 7 | main.h | ||
| 8 | motion_emu.cpp | ||
| 9 | motion_emu.h | ||
| 7 | 10 | ||
| 8 | set(HEADERS | 11 | $<$<BOOL:${SDL2_FOUND}>:sdl/sdl.cpp sdl/sdl.h> |
| 9 | analog_from_button.h | 12 | ) |
| 10 | keyboard.h | ||
| 11 | main.h | ||
| 12 | motion_emu.h | ||
| 13 | ) | ||
| 14 | 13 | ||
| 15 | if(SDL2_FOUND) | 14 | create_target_directory_groups(input_common) |
| 16 | set(SRCS ${SRCS} sdl/sdl.cpp) | ||
| 17 | set(HEADERS ${HEADERS} sdl/sdl.h) | ||
| 18 | endif() | ||
| 19 | |||
| 20 | create_directory_groups(${SRCS} ${HEADERS}) | ||
| 21 | 15 | ||
| 22 | add_library(input_common STATIC ${SRCS} ${HEADERS}) | ||
| 23 | target_link_libraries(input_common PUBLIC core PRIVATE common) | 16 | target_link_libraries(input_common PUBLIC core PRIVATE common) |
| 24 | 17 | ||
| 25 | if(SDL2_FOUND) | 18 | if(SDL2_FOUND) |
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 1b8fb2a9f..12f1b93e0 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt | |||
| @@ -1,20 +1,16 @@ | |||
| 1 | set(SRCS | 1 | add_executable(tests |
| 2 | common/param_package.cpp | 2 | common/param_package.cpp |
| 3 | core/arm/arm_test_common.cpp | 3 | core/arm/arm_test_common.cpp |
| 4 | core/core_timing.cpp | 4 | core/arm/arm_test_common.h |
| 5 | core/file_sys/path_parser.cpp | 5 | core/core_timing.cpp |
| 6 | core/memory/memory.cpp | 6 | core/file_sys/path_parser.cpp |
| 7 | glad.cpp | 7 | core/memory/memory.cpp |
| 8 | tests.cpp | 8 | glad.cpp |
| 9 | ) | 9 | tests.cpp |
| 10 | ) | ||
| 10 | 11 | ||
| 11 | set(HEADERS | 12 | create_target_directory_groups(tests) |
| 12 | core/arm/arm_test_common.h | ||
| 13 | ) | ||
| 14 | 13 | ||
| 15 | create_directory_groups(${SRCS} ${HEADERS}) | ||
| 16 | |||
| 17 | add_executable(tests ${SRCS} ${HEADERS}) | ||
| 18 | target_link_libraries(tests PRIVATE common core) | 14 | target_link_libraries(tests PRIVATE common core) |
| 19 | target_link_libraries(tests PRIVATE glad) # To support linker work-around | 15 | target_link_libraries(tests PRIVATE glad) # To support linker work-around |
| 20 | target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} catch-single-include Threads::Threads) | 16 | target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} catch-single-include Threads::Threads) |
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index 3fd177c46..69f2b4afd 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt | |||
| @@ -1,23 +1,19 @@ | |||
| 1 | set(SRCS | 1 | add_library(video_core STATIC |
| 2 | renderer_base.cpp | 2 | renderer_base.cpp |
| 3 | renderer_opengl/gl_shader_util.cpp | 3 | renderer_base.h |
| 4 | renderer_opengl/gl_state.cpp | 4 | renderer_opengl/gl_resource_manager.h |
| 5 | renderer_opengl/renderer_opengl.cpp | 5 | renderer_opengl/gl_shader_util.cpp |
| 6 | video_core.cpp | 6 | renderer_opengl/gl_shader_util.h |
| 7 | ) | 7 | renderer_opengl/gl_state.cpp |
| 8 | renderer_opengl/gl_state.h | ||
| 9 | renderer_opengl/renderer_opengl.cpp | ||
| 10 | renderer_opengl/renderer_opengl.h | ||
| 11 | utils.h | ||
| 12 | video_core.cpp | ||
| 13 | video_core.h | ||
| 14 | ) | ||
| 8 | 15 | ||
| 9 | set(HEADERS | 16 | create_target_directory_groups(video_core) |
| 10 | renderer_base.h | ||
| 11 | renderer_opengl/gl_resource_manager.h | ||
| 12 | renderer_opengl/gl_shader_util.h | ||
| 13 | renderer_opengl/gl_state.h | ||
| 14 | renderer_opengl/renderer_opengl.h | ||
| 15 | utils.h | ||
| 16 | video_core.h | ||
| 17 | ) | ||
| 18 | 17 | ||
| 19 | create_directory_groups(${SRCS} ${HEADERS}) | ||
| 20 | |||
| 21 | add_library(video_core STATIC ${SRCS} ${HEADERS}) | ||
| 22 | target_link_libraries(video_core PUBLIC common core) | 18 | target_link_libraries(video_core PUBLIC common core) |
| 23 | target_link_libraries(video_core PRIVATE glad) | 19 | target_link_libraries(video_core PRIVATE glad) |
diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index f5c46f1e9..0c4056c49 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt | |||
| @@ -3,79 +3,84 @@ set(CMAKE_AUTORCC ON) | |||
| 3 | set(CMAKE_INCLUDE_CURRENT_DIR ON) | 3 | set(CMAKE_INCLUDE_CURRENT_DIR ON) |
| 4 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) | 4 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) |
| 5 | 5 | ||
| 6 | set(SRCS | 6 | add_executable(yuzu |
| 7 | about_dialog.cpp | 7 | Info.plist |
| 8 | configuration/config.cpp | 8 | about_dialog.cpp |
| 9 | configuration/configure_debug.cpp | 9 | about_dialog.h |
| 10 | configuration/configure_dialog.cpp | 10 | bootmanager.cpp |
| 11 | configuration/configure_general.cpp | 11 | bootmanager.h |
| 12 | configuration/configure_graphics.cpp | 12 | configuration/config.cpp |
| 13 | configuration/configure_input.cpp | 13 | configuration/config.h |
| 14 | configuration/configure_system.cpp | 14 | configuration/configure_debug.cpp |
| 15 | debugger/profiler.cpp | 15 | configuration/configure_debug.h |
| 16 | debugger/registers.cpp | 16 | configuration/configure_dialog.cpp |
| 17 | debugger/wait_tree.cpp | 17 | configuration/configure_dialog.h |
| 18 | util/spinbox.cpp | 18 | configuration/configure_general.cpp |
| 19 | util/util.cpp | 19 | configuration/configure_general.h |
| 20 | bootmanager.cpp | 20 | configuration/configure_graphics.cpp |
| 21 | game_list.cpp | 21 | configuration/configure_graphics.h |
| 22 | hotkeys.cpp | 22 | configuration/configure_input.cpp |
| 23 | main.cpp | 23 | configuration/configure_input.h |
| 24 | ui_settings.cpp | 24 | configuration/configure_system.cpp |
| 25 | yuzu.rc | 25 | configuration/configure_system.h |
| 26 | Info.plist | 26 | debugger/profiler.cpp |
| 27 | ) | 27 | debugger/profiler.h |
| 28 | 28 | debugger/registers.cpp | |
| 29 | set(HEADERS | 29 | debugger/registers.h |
| 30 | about_dialog.h | 30 | debugger/wait_tree.cpp |
| 31 | configuration/config.h | 31 | debugger/wait_tree.h |
| 32 | configuration/configure_debug.h | 32 | game_list.cpp |
| 33 | configuration/configure_dialog.h | 33 | game_list.h |
| 34 | configuration/configure_general.h | 34 | game_list_p.h |
| 35 | configuration/configure_graphics.h | 35 | hotkeys.cpp |
| 36 | configuration/configure_input.h | 36 | hotkeys.h |
| 37 | configuration/configure_system.h | 37 | main.cpp |
| 38 | debugger/profiler.h | 38 | main.h |
| 39 | debugger/registers.h | 39 | ui_settings.cpp |
| 40 | debugger/wait_tree.h | 40 | ui_settings.h |
| 41 | util/spinbox.h | 41 | util/spinbox.cpp |
| 42 | util/util.h | 42 | util/spinbox.h |
| 43 | bootmanager.h | 43 | util/util.cpp |
| 44 | game_list.h | 44 | util/util.h |
| 45 | game_list_p.h | 45 | yuzu.rc |
| 46 | hotkeys.h | 46 | ) |
| 47 | main.h | ||
| 48 | ui_settings.h | ||
| 49 | ) | ||
| 50 | 47 | ||
| 51 | set(UIS | 48 | set(UIS |
| 52 | aboutdialog.ui | 49 | aboutdialog.ui |
| 53 | configuration/configure.ui | 50 | configuration/configure.ui |
| 54 | configuration/configure_debug.ui | 51 | configuration/configure_debug.ui |
| 55 | configuration/configure_general.ui | 52 | configuration/configure_general.ui |
| 56 | configuration/configure_graphics.ui | 53 | configuration/configure_graphics.ui |
| 57 | configuration/configure_input.ui | 54 | configuration/configure_input.ui |
| 58 | configuration/configure_system.ui | 55 | configuration/configure_system.ui |
| 59 | debugger/registers.ui | 56 | debugger/registers.ui |
| 60 | hotkeys.ui | 57 | hotkeys.ui |
| 61 | main.ui | 58 | main.ui |
| 62 | ) | 59 | ) |
| 63 | 60 | ||
| 64 | file(GLOB_RECURSE ICONS ${CMAKE_SOURCE_DIR}/dist/icons/*) | 61 | file(GLOB_RECURSE ICONS ${CMAKE_SOURCE_DIR}/dist/icons/*) |
| 65 | file(GLOB_RECURSE THEMES ${CMAKE_SOURCE_DIR}/dist/qt_themes/*) | 62 | file(GLOB_RECURSE THEMES ${CMAKE_SOURCE_DIR}/dist/qt_themes/*) |
| 66 | 63 | ||
| 67 | create_directory_groups(${SRCS} ${HEADERS} ${UIS}) | ||
| 68 | |||
| 69 | qt5_wrap_ui(UI_HDRS ${UIS}) | 64 | qt5_wrap_ui(UI_HDRS ${UIS}) |
| 70 | 65 | ||
| 66 | target_sources(yuzu | ||
| 67 | PRIVATE | ||
| 68 | ${ICONS} | ||
| 69 | ${THEMES} | ||
| 70 | ${UI_HDRS} | ||
| 71 | ${UIS} | ||
| 72 | ) | ||
| 73 | |||
| 71 | if (APPLE) | 74 | if (APPLE) |
| 72 | set(MACOSX_ICON "../../dist/yuzu.icns") | 75 | set(MACOSX_ICON "../../dist/yuzu.icns") |
| 73 | set_source_files_properties(${MACOSX_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) | 76 | set_source_files_properties(${MACOSX_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) |
| 74 | add_executable(yuzu MACOSX_BUNDLE ${SRCS} ${HEADERS} ${UI_HDRS} ${MACOSX_ICON} ${ICONS}) | 77 | target_sources(yuzu PRIVATE ${MACOSX_ICON}) |
| 78 | set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE TRUE) | ||
| 75 | set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) | 79 | set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) |
| 76 | else() | ||
| 77 | add_executable(yuzu ${SRCS} ${HEADERS} ${UI_HDRS} ${ICONS}) | ||
| 78 | endif() | 80 | endif() |
| 81 | |||
| 82 | create_target_directory_groups(yuzu) | ||
| 83 | |||
| 79 | target_link_libraries(yuzu PRIVATE common core input_common video_core) | 84 | target_link_libraries(yuzu PRIVATE common core input_common video_core) |
| 80 | target_link_libraries(yuzu PRIVATE Boost::boost glad Qt5::OpenGL Qt5::Widgets) | 85 | target_link_libraries(yuzu PRIVATE Boost::boost glad Qt5::OpenGL Qt5::Widgets) |
| 81 | target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) | 86 | target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) |
diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h index 4823a1296..7aff597b7 100644 --- a/src/yuzu/game_list.h +++ b/src/yuzu/game_list.h | |||
| @@ -49,7 +49,7 @@ public: | |||
| 49 | QString edit_filter_text_old; | 49 | QString edit_filter_text_old; |
| 50 | 50 | ||
| 51 | protected: | 51 | protected: |
| 52 | bool eventFilter(QObject* obj, QEvent* event); | 52 | bool eventFilter(QObject* obj, QEvent* event) override; |
| 53 | }; | 53 | }; |
| 54 | QHBoxLayout* layout_filter = nullptr; | 54 | QHBoxLayout* layout_filter = nullptr; |
| 55 | QTreeView* tree_view = nullptr; | 55 | QTreeView* tree_view = nullptr; |
diff --git a/src/yuzu/hotkeys.cpp b/src/yuzu/hotkeys.cpp index 42f026464..61acb38ee 100644 --- a/src/yuzu/hotkeys.cpp +++ b/src/yuzu/hotkeys.cpp | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <map> | 5 | #include <map> |
| 6 | #include <QKeySequence> | 6 | #include <QKeySequence> |
| 7 | #include <QShortcut> | 7 | #include <QShortcut> |
| 8 | #include <QTreeWidgetItem> | ||
| 8 | #include <QtGlobal> | 9 | #include <QtGlobal> |
| 9 | #include "yuzu/hotkeys.h" | 10 | #include "yuzu/hotkeys.h" |
| 10 | #include "yuzu/ui_settings.h" | 11 | #include "yuzu/ui_settings.h" |
diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt index 433e210b0..297dab653 100644 --- a/src/yuzu_cmd/CMakeLists.txt +++ b/src/yuzu_cmd/CMakeLists.txt | |||
| @@ -1,21 +1,18 @@ | |||
| 1 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) | 1 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) |
| 2 | 2 | ||
| 3 | set(SRCS | 3 | add_executable(yuzu-cmd |
| 4 | emu_window/emu_window_sdl2.cpp | 4 | config.cpp |
| 5 | config.cpp | 5 | config.h |
| 6 | yuzu.cpp | 6 | default_ini.h |
| 7 | yuzu.rc | 7 | emu_window/emu_window_sdl2.cpp |
| 8 | ) | 8 | emu_window/emu_window_sdl2.h |
| 9 | set(HEADERS | 9 | resource.h |
| 10 | emu_window/emu_window_sdl2.h | 10 | yuzu.cpp |
| 11 | config.h | 11 | yuzu.rc |
| 12 | default_ini.h | 12 | ) |
| 13 | resource.h | ||
| 14 | ) | ||
| 15 | 13 | ||
| 16 | create_directory_groups(${SRCS} ${HEADERS}) | 14 | create_target_directory_groups(yuzu-cmd) |
| 17 | 15 | ||
| 18 | add_executable(yuzu-cmd ${SRCS} ${HEADERS}) | ||
| 19 | target_link_libraries(yuzu-cmd PRIVATE common core input_common) | 16 | target_link_libraries(yuzu-cmd PRIVATE common core input_common) |
| 20 | target_link_libraries(yuzu-cmd PRIVATE inih glad) | 17 | target_link_libraries(yuzu-cmd PRIVATE inih glad) |
| 21 | if (MSVC) | 18 | if (MSVC) |