diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/CMakeLists.txt | 120 | ||||
-rw-r--r-- | src/core/CMakeLists.txt | 342 | ||||
-rw-r--r-- | src/core/hle/ipc.h | 4 | ||||
-rw-r--r-- | src/core/hle/ipc_helpers.h | 4 | ||||
-rw-r--r-- | src/core/hle/kernel/hle_ipc.cpp | 34 | ||||
-rw-r--r-- | src/core/hle/kernel/hle_ipc.h | 6 | ||||
-rw-r--r-- | src/core/hle/kernel/svc.cpp | 18 | ||||
-rw-r--r-- | src/core/hle/service/am/applet_oe.cpp | 86 | ||||
-rw-r--r-- | src/core/hle/service/lm/lm.cpp | 7 | ||||
-rw-r--r-- | src/core/hle/service/service.cpp | 2 | ||||
-rw-r--r-- | src/core/hle/service/sockets/bsd_u.cpp | 67 | ||||
-rw-r--r-- | src/core/hle/service/sockets/bsd_u.h | 29 | ||||
-rw-r--r-- | src/core/hle/service/sockets/sfdnsres.h | 22 | ||||
-rw-r--r-- | src/core/hle/service/sockets/sockets.cpp | 18 | ||||
-rw-r--r-- | src/core/hle/service/sockets/sockets.h | 16 | ||||
-rw-r--r-- | src/core/hle/service/vi/vi.cpp | 46 | ||||
-rw-r--r-- | src/input_common/CMakeLists.txt | 31 | ||||
-rw-r--r-- | src/tests/CMakeLists.txt | 26 | ||||
-rw-r--r-- | src/video_core/CMakeLists.txt | 34 | ||||
-rw-r--r-- | src/yuzu/CMakeLists.txt | 125 | ||||
-rw-r--r-- | src/yuzu/game_list.h | 2 | ||||
-rw-r--r-- | src/yuzu/hotkeys.cpp | 1 | ||||
-rw-r--r-- | src/yuzu_cmd/CMakeLists.txt | 25 |
23 files changed, 666 insertions, 399 deletions
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}) endif() configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp" @ONLY) -set(SRCS - break_points.cpp - file_util.cpp - hash.cpp - logging/filter.cpp - logging/text_formatter.cpp - logging/backend.cpp - memory_util.cpp - microprofile.cpp - misc.cpp - param_package.cpp - scm_rev.cpp - string_util.cpp - telemetry.cpp - thread.cpp - timer.cpp - ) - -set(HEADERS - alignment.h - assert.h - bit_field.h - bit_set.h - break_points.h - chunk_file.h - code_block.h - color.h - common_funcs.h - common_paths.h - common_types.h - file_util.h - hash.h - linear_disk_cache.h - logging/text_formatter.h - logging/filter.h - logging/log.h - logging/backend.h - math_util.h - memory_util.h - microprofile.h - microprofileui.h - param_package.h - platform.h - quaternion.h - scm_rev.h - scope_exit.h - string_util.h - swap.h - synchronized_wrapper.h - telemetry.h - thread.h - thread_queue_list.h - threadsafe_queue.h - timer.h - vector_math.h - ) +add_library(common STATIC + alignment.h + assert.h + bit_field.h + bit_set.h + break_points.cpp + break_points.h + chunk_file.h + code_block.h + color.h + common_funcs.h + common_paths.h + common_types.h + file_util.cpp + file_util.h + hash.cpp + hash.h + linear_disk_cache.h + logging/backend.cpp + logging/backend.h + logging/filter.cpp + logging/filter.h + logging/log.h + logging/text_formatter.cpp + logging/text_formatter.h + math_util.h + memory_util.cpp + memory_util.h + microprofile.cpp + microprofile.h + microprofileui.h + misc.cpp + param_package.cpp + param_package.h + platform.h + quaternion.h + scm_rev.cpp + scm_rev.h + scope_exit.h + string_util.cpp + string_util.h + swap.h + synchronized_wrapper.h + telemetry.cpp + telemetry.h + thread.cpp + thread.h + thread_queue_list.h + threadsafe_queue.h + timer.cpp + timer.h + vector_math.h +) if(ARCHITECTURE_x86_64) - set(SRCS ${SRCS} + target_sources(common + PRIVATE x64/cpu_detect.cpp - ) - - set(HEADERS ${HEADERS} x64/cpu_detect.h x64/xbyak_abi.h x64/xbyak_util.h - ) + ) endif() -create_directory_groups(${SRCS} ${HEADERS}) +create_target_directory_groups(common) -add_library(common STATIC ${SRCS} ${HEADERS}) target_link_libraries(common PUBLIC Boost::boost microprofile) if (ARCHITECTURE_x86_64) 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 @@ -set(SRCS - arm/dynarmic/arm_dynarmic.cpp - arm/unicorn/arm_unicorn.cpp - core.cpp - core_timing.cpp - file_sys/archive_backend.cpp - file_sys/disk_archive.cpp - file_sys/ivfc_archive.cpp - file_sys/path_parser.cpp - file_sys/savedata_archive.cpp - file_sys/title_metadata.cpp - frontend/emu_window.cpp - frontend/framebuffer_layout.cpp - gdbstub/gdbstub.cpp - hle/config_mem.cpp - hle/kernel/address_arbiter.cpp - hle/kernel/client_port.cpp - hle/kernel/client_session.cpp - hle/kernel/condition_variable.cpp - hle/kernel/domain.cpp - hle/kernel/event.cpp - hle/kernel/handle_table.cpp - hle/kernel/hle_ipc.cpp - hle/kernel/kernel.cpp - hle/kernel/memory.cpp - hle/kernel/mutex.cpp - hle/kernel/object_address_table.cpp - hle/kernel/process.cpp - hle/kernel/resource_limit.cpp - hle/kernel/server_port.cpp - hle/kernel/server_session.cpp - hle/kernel/shared_memory.cpp - hle/kernel/svc.cpp - hle/kernel/thread.cpp - hle/kernel/timer.cpp - hle/kernel/vm_manager.cpp - hle/kernel/wait_object.cpp - hle/lock.cpp - hle/romfs.cpp - hle/service/acc/acc.cpp - hle/service/acc/acc_u0.cpp - hle/service/am/am.cpp - hle/service/am/applet_oe.cpp - hle/service/aoc/aoc_u.cpp - hle/service/apm/apm.cpp - hle/service/audio/audio.cpp - hle/service/audio/audout_u.cpp - hle/service/hid/hid.cpp - hle/service/lm/lm.cpp - hle/service/nvdrv/devices/nvdisp_disp0.cpp - hle/service/nvdrv/devices/nvhost_as_gpu.cpp - hle/service/nvdrv/devices/nvmap.cpp - hle/service/nvdrv/interface.cpp - hle/service/nvdrv/nvdrv.cpp - hle/service/pctl/pctl.cpp - hle/service/pctl/pctl_a.cpp - hle/service/service.cpp - hle/service/sm/controller.cpp - hle/service/sm/sm.cpp - hle/service/time/time.cpp - hle/service/vi/vi.cpp - hle/service/vi/vi_m.cpp - hle/shared_page.cpp - hw/hw.cpp - hw/lcd.cpp - loader/elf.cpp - loader/linker.cpp - loader/loader.cpp - loader/nro.cpp - loader/nso.cpp - tracer/recorder.cpp - memory.cpp - perf_stats.cpp - settings.cpp - telemetry_session.cpp - ) +add_library(core STATIC + arm/arm_interface.h + arm/dynarmic/arm_dynarmic.cpp + arm/dynarmic/arm_dynarmic.h + arm/unicorn/arm_unicorn.cpp + arm/unicorn/arm_unicorn.h + core.cpp + core.h + core_timing.cpp + core_timing.h + file_sys/archive_backend.cpp + file_sys/archive_backend.h + file_sys/directory_backend.h + file_sys/disk_archive.cpp + file_sys/disk_archive.h + file_sys/errors.h + file_sys/file_backend.h + file_sys/ivfc_archive.cpp + file_sys/ivfc_archive.h + file_sys/path_parser.cpp + file_sys/path_parser.h + file_sys/savedata_archive.cpp + file_sys/savedata_archive.h + file_sys/title_metadata.cpp + file_sys/title_metadata.h + frontend/emu_window.cpp + frontend/emu_window.h + frontend/framebuffer_layout.cpp + frontend/framebuffer_layout.h + frontend/input.h + gdbstub/gdbstub.cpp + gdbstub/gdbstub.h + hle/config_mem.cpp + hle/config_mem.h + hle/ipc.h + hle/ipc_helpers.h + hle/kernel/address_arbiter.cpp + hle/kernel/address_arbiter.h + hle/kernel/client_port.cpp + hle/kernel/client_port.h + hle/kernel/client_session.cpp + hle/kernel/client_session.h + hle/kernel/condition_variable.cpp + hle/kernel/condition_variable.h + hle/kernel/domain.cpp + hle/kernel/domain.h + hle/kernel/errors.h + hle/kernel/event.cpp + hle/kernel/event.h + hle/kernel/handle_table.cpp + hle/kernel/handle_table.h + hle/kernel/hle_ipc.cpp + hle/kernel/hle_ipc.h + hle/kernel/kernel.cpp + hle/kernel/kernel.h + hle/kernel/memory.cpp + hle/kernel/memory.h + hle/kernel/mutex.cpp + hle/kernel/mutex.h + hle/kernel/object_address_table.cpp + hle/kernel/object_address_table.h + hle/kernel/process.cpp + hle/kernel/process.h + hle/kernel/resource_limit.cpp + hle/kernel/resource_limit.h + hle/kernel/server_port.cpp + hle/kernel/server_port.h + hle/kernel/server_session.cpp + hle/kernel/server_session.h + hle/kernel/session.h + hle/kernel/shared_memory.cpp + hle/kernel/shared_memory.h + hle/kernel/svc.cpp + hle/kernel/svc.h + hle/kernel/svc_wrap.h + hle/kernel/sync_object.h + hle/kernel/thread.cpp + hle/kernel/thread.h + hle/kernel/timer.cpp + hle/kernel/timer.h + hle/kernel/vm_manager.cpp + hle/kernel/vm_manager.h + hle/kernel/wait_object.cpp + hle/kernel/wait_object.h + hle/lock.cpp + hle/lock.h + hle/result.h + hle/romfs.cpp + hle/romfs.h + hle/service/acc/acc.cpp + hle/service/acc/acc.h + hle/service/acc/acc_u0.cpp + hle/service/acc/acc_u0.h + hle/service/am/am.cpp + hle/service/am/am.h + hle/service/am/applet_oe.cpp + hle/service/am/applet_oe.h + hle/service/aoc/aoc_u.cpp + hle/service/aoc/aoc_u.h + hle/service/apm/apm.cpp + hle/service/apm/apm.h + hle/service/audio/audio.cpp + hle/service/audio/audio.h + hle/service/audio/audout_u.cpp + hle/service/audio/audout_u.h + hle/service/hid/hid.cpp + hle/service/hid/hid.h + hle/service/lm/lm.cpp + hle/service/lm/lm.h + hle/service/nvdrv/devices/nvdevice.h + hle/service/nvdrv/devices/nvdisp_disp0.cpp + hle/service/nvdrv/devices/nvdisp_disp0.h + hle/service/nvdrv/devices/nvhost_as_gpu.cpp + hle/service/nvdrv/devices/nvhost_as_gpu.h + hle/service/nvdrv/devices/nvmap.cpp + hle/service/nvdrv/devices/nvmap.h + hle/service/nvdrv/interface.cpp + hle/service/nvdrv/interface.h + hle/service/nvdrv/nvdrv.cpp + hle/service/nvdrv/nvdrv.h + hle/service/pctl/pctl.cpp + hle/service/pctl/pctl.h + hle/service/pctl/pctl_a.cpp + hle/service/pctl/pctl_a.h + hle/service/service.cpp + hle/service/service.h + hle/service/sm/controller.cpp + hle/service/sm/controller.h + hle/service/sm/sm.cpp + hle/service/sm/sm.h + hle/service/sockets/bsd_u.cpp + hle/service/sockets/bsd_u.h + hle/service/sockets/sfdnsres.h + hle/service/sockets/sockets.cpp + hle/service/sockets/sockets.h + hle/service/time/time.cpp + hle/service/time/time.h + hle/service/vi/vi.cpp + hle/service/vi/vi.h + hle/service/vi/vi_m.cpp + hle/service/vi/vi_m.h + hle/shared_page.cpp + hle/shared_page.h + hw/hw.cpp + hw/hw.h + hw/lcd.cpp + hw/lcd.h + loader/elf.cpp + loader/elf.h + loader/linker.cpp + loader/linker.h + loader/loader.cpp + loader/loader.h + loader/nro.cpp + loader/nro.h + loader/nso.cpp + loader/nso.h + memory.cpp + memory.h + memory_setup.h + mmio.h + perf_stats.cpp + perf_stats.h + settings.cpp + settings.h + telemetry_session.cpp + telemetry_session.h + tracer/citrace.h + tracer/recorder.cpp + tracer/recorder.h +) -set(HEADERS - arm/arm_interface.h - arm/dynarmic/arm_dynarmic.h - arm/unicorn/arm_unicorn.h - core.h - core_timing.h - file_sys/archive_backend.h - file_sys/directory_backend.h - file_sys/disk_archive.h - file_sys/errors.h - file_sys/file_backend.h - file_sys/ivfc_archive.h - file_sys/path_parser.h - file_sys/savedata_archive.h - file_sys/title_metadata.h - frontend/emu_window.h - frontend/framebuffer_layout.h - frontend/input.h - gdbstub/gdbstub.h - hle/config_mem.h - hle/ipc.h - hle/ipc_helpers.h - hle/kernel/address_arbiter.h - hle/kernel/client_port.h - hle/kernel/client_session.h - hle/kernel/condition_variable.h - hle/kernel/domain.h - hle/kernel/errors.h - hle/kernel/event.h - hle/kernel/handle_table.h - hle/kernel/hle_ipc.h - hle/kernel/kernel.h - hle/kernel/memory.h - hle/kernel/mutex.h - hle/kernel/object_address_table.h - hle/kernel/process.h - hle/kernel/resource_limit.h - hle/kernel/server_port.h - hle/kernel/server_session.h - hle/kernel/session.h - hle/kernel/shared_memory.h - hle/kernel/sync_object.h - hle/kernel/svc.h - hle/kernel/svc_wrap.h - hle/kernel/thread.h - hle/kernel/timer.h - hle/kernel/vm_manager.h - hle/kernel/wait_object.h - hle/lock.h - hle/result.h - hle/romfs.h - hle/service/acc/acc.h - hle/service/acc/acc_u0.h - hle/service/am/am.h - hle/service/am/applet_oe.h - hle/service/aoc/aoc_u.h - hle/service/apm/apm.h - hle/service/audio/audio.h - hle/service/audio/audout_u.h - hle/service/hid/hid.h - hle/service/lm/lm.h - hle/service/nvdrv/devices/nvdevice.h - hle/service/nvdrv/devices/nvdisp_disp0.h - hle/service/nvdrv/devices/nvhost_as_gpu.h - hle/service/nvdrv/devices/nvmap.h - hle/service/nvdrv/interface.h - hle/service/nvdrv/nvdrv.h - hle/service/pctl/pctl.h - hle/service/pctl/pctl_a.h - hle/service/service.h - hle/service/sm/controller.h - hle/service/sm/sm.h - hle/service/time/time.h - hle/service/vi/vi.h - hle/service/vi/vi_m.h - hle/shared_page.h - hw/hw.h - hw/lcd.h - loader/elf.h - loader/linker.h - loader/loader.h - loader/nro.h - loader/nso.h - tracer/recorder.h - tracer/citrace.h - memory.h - memory_setup.h - mmio.h - perf_stats.h - settings.h - telemetry_session.h - ) +create_target_directory_groups(core) -create_directory_groups(${SRCS} ${HEADERS}) -add_library(core STATIC ${SRCS} ${HEADERS}) target_link_libraries(core PUBLIC common PRIVATE dynarmic video_core) 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 { address |= static_cast<VAddr>(address_bits_32_47) << 32; return address; } + + u64 Size() const { + return static_cast<u64>(size); + } }; static_assert(sizeof(BufferDescriptorC) == 8, "BufferDescriptorC size is incorrect"); 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: unsigned GetCurrentOffset() const { return static_cast<unsigned>(index); } + + void SetCurrentOffset(unsigned offset) { + index = static_cast<ptrdiff_t>(offset); + } }; 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) { for (unsigned i = 0; i < command_header->num_buf_w_descriptors; ++i) { buffer_w_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>()); } - if (command_header->buf_c_descriptor_flags != - IPC::CommandHeader::BufferDescriptorCFlag::Disabled) { - if (command_header->buf_c_descriptor_flags != - IPC::CommandHeader::BufferDescriptorCFlag::OneDescriptor) { - UNIMPLEMENTED(); - } - } + + buffer_c_offset = rp.GetCurrentOffset() + command_header->data_size; // Padding to align to 16 bytes rp.AlignWithPadding(); @@ -117,6 +112,31 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) { ASSERT(data_payload_header->magic == Common::MakeMagic('S', 'F', 'C', 'O')); } + rp.SetCurrentOffset(buffer_c_offset); + + // For Inline buffers, the response data is written directly to buffer_c_offset + // and in this case we don't have any BufferDescriptorC on the request. + if (command_header->buf_c_descriptor_flags > + IPC::CommandHeader::BufferDescriptorCFlag::InlineDescriptor) { + if (command_header->buf_c_descriptor_flags == + IPC::CommandHeader::BufferDescriptorCFlag::OneDescriptor) { + buffer_c_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorC>()); + } else { + unsigned num_buf_c_descriptors = + static_cast<unsigned>(command_header->buf_c_descriptor_flags.Value()) - 2; + + // This is used to detect possible underflows, in case something is broken + // with the two ifs above and the flags value is == 0 || == 1. + ASSERT(num_buf_c_descriptors < 14); + + for (unsigned i = 0; i < num_buf_c_descriptors; ++i) { + buffer_c_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorC>()); + } + } + } + + rp.SetCurrentOffset(data_payload_offset); + command = rp.Pop<u32_le>(); rp.Skip(1, false); // The command is actually an u64, but we don't use the high part. } 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: return buffer_b_desciptors; } + const std::vector<IPC::BufferDescriptorC>& BufferDescriptorC() const { + return buffer_c_desciptors; + } + const std::unique_ptr<IPC::DomainMessageHeader>& GetDomainMessageHeader() const { return domain_message_header; } @@ -200,8 +204,10 @@ private: std::vector<IPC::BufferDescriptorABW> buffer_a_desciptors; std::vector<IPC::BufferDescriptorABW> buffer_b_desciptors; std::vector<IPC::BufferDescriptorABW> buffer_w_desciptors; + std::vector<IPC::BufferDescriptorC> buffer_c_desciptors; unsigned data_payload_offset{}; + unsigned buffer_c_offset{}; u32_le command{}; }; 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) { } /// Connect to an OS service given the port name, returns the handle to the port to out -static ResultCode ConnectToPort(Handle* out_handle, VAddr port_name_address) { +static ResultCode ConnectToNamedPort(Handle* out_handle, VAddr port_name_address) { if (!Memory::IsValidVirtualAddress(port_name_address)) return ERR_NOT_FOUND; @@ -253,8 +253,8 @@ static ResultCode CancelSynchronization(Handle thread_handle) { } /// Attempts to locks a mutex, creating it if it does not already exist -static ResultCode LockMutex(Handle holding_thread_handle, VAddr mutex_addr, - Handle requesting_thread_handle) { +static ResultCode ArbitrateLock(Handle holding_thread_handle, VAddr mutex_addr, + Handle requesting_thread_handle) { LOG_TRACE(Kernel_SVC, "called holding_thread_handle=0x%08X, mutex_addr=0x%llx, " "requesting_current_thread_handle=0x%08X", holding_thread_handle, mutex_addr, requesting_thread_handle); @@ -277,7 +277,7 @@ static ResultCode LockMutex(Handle holding_thread_handle, VAddr mutex_addr, } /// Unlock a mutex -static ResultCode UnlockMutex(VAddr mutex_addr) { +static ResultCode ArbitrateUnlock(VAddr mutex_addr) { LOG_TRACE(Kernel_SVC, "called mutex_addr=0x%llx", mutex_addr); SharedPtr<Mutex> mutex = g_object_address_table.Get<Mutex>(mutex_addr); @@ -774,12 +774,12 @@ static const FunctionDef SVC_Table[] = { {0x17, SvcWrap<ResetSignal>, "ResetSignal"}, {0x18, SvcWrap<WaitSynchronization>, "WaitSynchronization"}, {0x19, SvcWrap<CancelSynchronization>, "CancelSynchronization"}, - {0x1A, SvcWrap<LockMutex>, "LockMutex"}, - {0x1B, SvcWrap<UnlockMutex>, "UnlockMutex"}, + {0x1A, SvcWrap<ArbitrateLock>, "ArbitrateLock"}, + {0x1B, SvcWrap<ArbitrateUnlock>, "ArbitrateUnlock"}, {0x1C, SvcWrap<WaitProcessWideKeyAtomic>, "WaitProcessWideKeyAtomic"}, {0x1D, SvcWrap<SignalProcessWideKey>, "SignalProcessWideKey"}, {0x1E, SvcWrap<GetSystemTick>, "GetSystemTick"}, - {0x1F, SvcWrap<ConnectToPort>, "ConnectToPort"}, + {0x1F, SvcWrap<ConnectToNamedPort>, "ConnectToNamedPort"}, {0x20, nullptr, "SendSyncRequestLight"}, {0x21, SvcWrap<SendSyncRequest>, "SendSyncRequest"}, {0x22, nullptr, "SendSyncRequestWithUserBuffer"}, @@ -823,8 +823,8 @@ static const FunctionDef SVC_Table[] = { {0x48, nullptr, "Unknown"}, {0x49, nullptr, "Unknown"}, {0x4A, nullptr, "Unknown"}, - {0x4B, nullptr, "Unknown"}, - {0x4C, nullptr, "Unknown"}, + {0x4B, nullptr, "CreateJitMemory"}, + {0x4C, nullptr, "MapJitMemory"}, {0x4D, nullptr, "SleepSystem"}, {0x4E, nullptr, "ReadWriteRegister"}, {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: Kernel::SharedPtr<Kernel::Event> event; }; +class IStorageAccessor final : public ServiceFramework<IStorageAccessor> { +public: + explicit IStorageAccessor(std::vector<u8> buffer) + : ServiceFramework("IStorageAccessor"), buffer(std::move(buffer)) { + static const FunctionInfo functions[] = { + {0, &IStorageAccessor::GetSize, "GetSize"}, + {11, &IStorageAccessor::Read, "Read"}, + }; + RegisterHandlers(functions); + } + +private: + std::vector<u8> buffer; + + void GetSize(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 4}; + + rb.Push(RESULT_SUCCESS); + rb.Push(static_cast<u64>(buffer.size())); + + LOG_DEBUG(Service, "called"); + } + + void Read(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + + u64 offset = rp.Pop<u64>(); + + const auto& output_buffer = ctx.BufferDescriptorC()[0]; + + ASSERT(offset + output_buffer.Size() <= buffer.size()); + + Memory::WriteBlock(output_buffer.Address(), buffer.data() + offset, output_buffer.Size()); + + IPC::RequestBuilder rb{ctx, 2}; + + rb.Push(RESULT_SUCCESS); + + LOG_DEBUG(Service, "called"); + } +}; + +class IStorage final : public ServiceFramework<IStorage> { +public: + explicit IStorage(std::vector<u8> buffer) + : ServiceFramework("IStorage"), buffer(std::move(buffer)) { + static const FunctionInfo functions[] = { + {0, &IStorage::Open, "Open"}, + }; + RegisterHandlers(functions); + } + +private: + std::vector<u8> buffer; + + void Open(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + + rb.Push(RESULT_SUCCESS); + rb.PushIpcInterface<AM::IStorageAccessor>(buffer); + + LOG_DEBUG(Service, "called"); + } +}; + class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> { public: IApplicationFunctions() : ServiceFramework("IApplicationFunctions") { static const FunctionInfo functions[] = { + {1, &IApplicationFunctions::PopLaunchParameter, "PopLaunchParameter"}, {22, &IApplicationFunctions::SetTerminateResult, "SetTerminateResult"}, {66, &IApplicationFunctions::InitializeGamePlayRecording, "InitializeGamePlayRecording"}, @@ -215,6 +281,26 @@ public: } private: + void PopLaunchParameter(Kernel::HLERequestContext& ctx) { + constexpr u8 data[0x88] = { + 0xca, 0x97, 0x94, 0xc7, // Magic + 1, 0, 0, 0, // IsAccountSelected (bool) + 1, 0, 0, 0, // User Id (word 0) + 0, 0, 0, 0, // User Id (word 1) + 0, 0, 0, 0, // User Id (word 2) + 0, 0, 0, 0 // User Id (word 3) + }; + + std::vector<u8> buffer(data, data + sizeof(data)); + + IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + + rb.Push(RESULT_SUCCESS); + rb.PushIpcInterface<AM::IStorage>(buffer); + + LOG_DEBUG(Service, "called"); + } + void SetTerminateResult(Kernel::HLERequestContext& ctx) { // Takes an input u32 Result, no output. // 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: /// Log field type enum class Field : u8 { + Skip = 1, Message = 2, Line = 3, Filename = 4, @@ -85,6 +86,11 @@ private: while (addr < end_addr) { const Field field{static_cast<Field>(Memory::Read8(addr++))}; size_t length{Memory::Read8(addr++)}; + + if (static_cast<Field>(Memory::Read8(addr)) == Field::Skip) { + ++addr; + } + switch (field) { case Field::Message: message = Memory::ReadCString(addr, length); @@ -99,6 +105,7 @@ private: function = Memory::ReadCString(addr, length); break; } + addr += length; } 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 @@ #include "core/hle/service/service.h" #include "core/hle/service/sm/controller.h" #include "core/hle/service/sm/sm.h" +#include "core/hle/service/sockets/sockets.h" #include "core/hle/service/time/time.h" #include "core/hle/service/vi/vi.h" @@ -174,6 +175,7 @@ void Init() { LM::InstallInterfaces(*SM::g_service_manager); Nvidia::InstallInterfaces(*SM::g_service_manager); PCTL::InstallInterfaces(*SM::g_service_manager); + Sockets::InstallInterfaces(*SM::g_service_manager); Time::InstallInterfaces(*SM::g_service_manager); VI::InstallInterfaces(*SM::g_service_manager); 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 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "core/hle/ipc_helpers.h" +#include "core/hle/service/sockets/bsd_u.h" + +namespace Service { +namespace Sockets { + +void BSD_U::RegisterClient(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service, "(STUBBED) called"); + + IPC::RequestBuilder rb{ctx, 3}; + + rb.Push(RESULT_SUCCESS); + rb.Push<u32>(0); // bsd errno +} + +void BSD_U::Socket(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + + u32 domain = rp.Pop<u32>(); + u32 type = rp.Pop<u32>(); + u32 protocol = rp.Pop<u32>(); + + LOG_WARNING(Service, "(STUBBED) called domain=%u type=%u protocol=%u", domain, type, protocol); + + u32 fd = next_fd++; + + IPC::RequestBuilder rb{ctx, 4}; + + rb.Push(RESULT_SUCCESS); + rb.Push<u32>(fd); + rb.Push<u32>(0); // bsd errno +} + +void BSD_U::Connect(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service, "(STUBBED) called"); + + IPC::RequestBuilder rb{ctx, 4}; + + rb.Push(RESULT_SUCCESS); + rb.Push<u32>(0); // ret + rb.Push<u32>(0); // bsd errno +} + +void BSD_U::SendTo(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service, "(STUBBED) called"); + + IPC::RequestBuilder rb{ctx, 4}; + + rb.Push(RESULT_SUCCESS); + rb.Push<u32>(0); // ret + rb.Push<u32>(0); // bsd errno +} + +BSD_U::BSD_U() : ServiceFramework("bsd:u") { + static const FunctionInfo functions[] = {{0, &BSD_U::RegisterClient, "RegisterClient"}, + {2, &BSD_U::Socket, "Socket"}, + {11, &BSD_U::SendTo, "SendTo"}, + {14, &BSD_U::Connect, "Connect"}}; + RegisterHandlers(functions); +} + +} // namespace Sockets +} // 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 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "core/hle/kernel/hle_ipc.h" +#include "core/hle/service/service.h" + +namespace Service { +namespace Sockets { + +class BSD_U final : public ServiceFramework<BSD_U> { +public: + BSD_U(); + ~BSD_U() = default; + +private: + void RegisterClient(Kernel::HLERequestContext& ctx); + void Socket(Kernel::HLERequestContext& ctx); + void Connect(Kernel::HLERequestContext& ctx); + void SendTo(Kernel::HLERequestContext& ctx); + + /// Id to use for the next open file descriptor. + u32 next_fd = 1; +}; + +} // namespace Sockets +} // 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 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "core/hle/kernel/hle_ipc.h" +#include "core/hle/service/service.h" + +namespace Service { +namespace Sockets { + +class SFDNSRES final : public ServiceFramework<SFDNSRES> { +public: + SFDNSRES() : ServiceFramework("sfdnsres") {} + ~SFDNSRES() = default; + +private: +}; + +} // namespace Sockets +} // 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 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "core/hle/service/sockets/bsd_u.h" +#include "core/hle/service/sockets/sfdnsres.h" +#include "core/hle/service/sockets/sockets.h" + +namespace Service { +namespace Sockets { + +void InstallInterfaces(SM::ServiceManager& service_manager) { + std::make_shared<BSD_U>()->InstallAsService(service_manager); + std::make_shared<SFDNSRES>()->InstallAsService(service_manager); +} + +} // namespace Sockets +} // 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 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "core/hle/service/service.h" + +namespace Service { +namespace Sockets { + +/// Registers all Sockets services with the specified service manager. +void InstallInterfaces(SM::ServiceManager& service_manager); + +} // namespace Sockets +} // 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: // This default size was chosen arbitrarily. static constexpr size_t DefaultBufferSize = 0x40; Parcel() : buffer(DefaultBufferSize) {} - Parcel(std::vector<u8> data) : buffer(std::move(data)) {} + explicit Parcel(std::vector<u8> data) : buffer(std::move(data)) {} virtual ~Parcel() = default; template <typename T> @@ -47,8 +47,9 @@ public: } std::vector<u8> ReadBlock(size_t length) { - std::vector<u8> data(length); - std::memcpy(data.data(), buffer.data() + read_index, length); + const u8* const begin = buffer.data() + read_index; + const u8* const end = begin + length; + std::vector<u8> data(begin, end); read_index += length; read_index = Common::AlignUp(read_index, 4); return data; @@ -101,9 +102,9 @@ public: } protected: - virtual void SerializeData(){}; + virtual void SerializeData() {} - virtual void DeserializeData(){}; + virtual void DeserializeData() {} private: struct Header { @@ -121,7 +122,7 @@ private: class NativeWindow : public Parcel { public: - NativeWindow(u32 id) : Parcel() { + explicit NativeWindow(u32 id) : Parcel() { data.id = id; } ~NativeWindow() override = default; @@ -147,12 +148,12 @@ private: class IGBPConnectRequestParcel : public Parcel { public: - IGBPConnectRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { + explicit IGBPConnectRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { Deserialize(); } ~IGBPConnectRequestParcel() override = default; - void DeserializeData() { + void DeserializeData() override { std::u16string token = ReadInterfaceToken(); data = Read<Data>(); } @@ -168,7 +169,7 @@ public: class IGBPConnectResponseParcel : public Parcel { public: - IGBPConnectResponseParcel(u32 width, u32 height) : Parcel() { + explicit IGBPConnectResponseParcel(u32 width, u32 height) : Parcel() { data.width = width; data.height = height; } @@ -194,12 +195,13 @@ private: class IGBPSetPreallocatedBufferRequestParcel : public Parcel { public: - IGBPSetPreallocatedBufferRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { + explicit IGBPSetPreallocatedBufferRequestParcel(const std::vector<u8>& buffer) + : Parcel(buffer) { Deserialize(); } ~IGBPSetPreallocatedBufferRequestParcel() override = default; - void DeserializeData() { + void DeserializeData() override { std::u16string token = ReadInterfaceToken(); data = Read<Data>(); ASSERT(data.graphic_buffer_length == sizeof(IGBPBuffer)); @@ -231,12 +233,12 @@ protected: class IGBPDequeueBufferRequestParcel : public Parcel { public: - IGBPDequeueBufferRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { + explicit IGBPDequeueBufferRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { Deserialize(); } ~IGBPDequeueBufferRequestParcel() override = default; - void DeserializeData() { + void DeserializeData() override { std::u16string token = ReadInterfaceToken(); data = Read<Data>(); } @@ -254,7 +256,7 @@ public: class IGBPDequeueBufferResponseParcel : public Parcel { public: - IGBPDequeueBufferResponseParcel(u32 slot) : Parcel(), slot(slot) {} + explicit IGBPDequeueBufferResponseParcel(u32 slot) : Parcel(), slot(slot) {} ~IGBPDequeueBufferResponseParcel() override = default; protected: @@ -271,12 +273,12 @@ protected: class IGBPRequestBufferRequestParcel : public Parcel { public: - IGBPRequestBufferRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { + explicit IGBPRequestBufferRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { Deserialize(); } ~IGBPRequestBufferRequestParcel() override = default; - void DeserializeData() { + void DeserializeData() override { std::u16string token = ReadInterfaceToken(); slot = Read<u32_le>(); } @@ -286,7 +288,7 @@ public: class IGBPRequestBufferResponseParcel : public Parcel { public: - IGBPRequestBufferResponseParcel(IGBPBuffer buffer) : Parcel(), buffer(buffer) {} + explicit IGBPRequestBufferResponseParcel(IGBPBuffer buffer) : Parcel(), buffer(buffer) {} ~IGBPRequestBufferResponseParcel() override = default; protected: @@ -307,12 +309,12 @@ protected: class IGBPQueueBufferRequestParcel : public Parcel { public: - IGBPQueueBufferRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { + explicit IGBPQueueBufferRequestParcel(const std::vector<u8>& buffer) : Parcel(buffer) { Deserialize(); } ~IGBPQueueBufferRequestParcel() override = default; - void DeserializeData() { + void DeserializeData() override { std::u16string token = ReadInterfaceToken(); data = Read<Data>(); } @@ -330,7 +332,7 @@ public: class IGBPQueueBufferResponseParcel : public Parcel { public: - IGBPQueueBufferResponseParcel(u32 width, u32 height) : Parcel() { + explicit IGBPQueueBufferResponseParcel(u32 width, u32 height) : Parcel() { data.width = width; data.height = height; } @@ -356,7 +358,7 @@ private: class IHOSBinderDriver final : public ServiceFramework<IHOSBinderDriver> { public: - IHOSBinderDriver(std::shared_ptr<NVFlinger> nv_flinger) + explicit IHOSBinderDriver(std::shared_ptr<NVFlinger> nv_flinger) : ServiceFramework("IHOSBinderDriver"), nv_flinger(std::move(nv_flinger)) { static const FunctionInfo functions[] = { {0, &IHOSBinderDriver::TransactParcel, "TransactParcel"}, @@ -506,7 +508,7 @@ private: class IManagerDisplayService final : public ServiceFramework<IManagerDisplayService> { public: - IManagerDisplayService(std::shared_ptr<NVFlinger> nv_flinger) + explicit IManagerDisplayService(std::shared_ptr<NVFlinger> nv_flinger) : ServiceFramework("IManagerDisplayService"), nv_flinger(std::move(nv_flinger)) { static const FunctionInfo functions[] = { {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 @@ -set(SRCS - analog_from_button.cpp - keyboard.cpp - main.cpp - motion_emu.cpp - ) +add_library(input_common STATIC + analog_from_button.cpp + analog_from_button.h + keyboard.cpp + keyboard.h + main.cpp + main.h + motion_emu.cpp + motion_emu.h -set(HEADERS - analog_from_button.h - keyboard.h - main.h - motion_emu.h - ) + $<$<BOOL:${SDL2_FOUND}>:sdl/sdl.cpp sdl/sdl.h> +) -if(SDL2_FOUND) - set(SRCS ${SRCS} sdl/sdl.cpp) - set(HEADERS ${HEADERS} sdl/sdl.h) -endif() - -create_directory_groups(${SRCS} ${HEADERS}) +create_target_directory_groups(input_common) -add_library(input_common STATIC ${SRCS} ${HEADERS}) target_link_libraries(input_common PUBLIC core PRIVATE common) 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 @@ -set(SRCS - common/param_package.cpp - core/arm/arm_test_common.cpp - core/core_timing.cpp - core/file_sys/path_parser.cpp - core/memory/memory.cpp - glad.cpp - tests.cpp - ) +add_executable(tests + common/param_package.cpp + core/arm/arm_test_common.cpp + core/arm/arm_test_common.h + core/core_timing.cpp + core/file_sys/path_parser.cpp + core/memory/memory.cpp + glad.cpp + tests.cpp +) -set(HEADERS - core/arm/arm_test_common.h - ) +create_target_directory_groups(tests) -create_directory_groups(${SRCS} ${HEADERS}) - -add_executable(tests ${SRCS} ${HEADERS}) target_link_libraries(tests PRIVATE common core) target_link_libraries(tests PRIVATE glad) # To support linker work-around 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 @@ -set(SRCS - renderer_base.cpp - renderer_opengl/gl_shader_util.cpp - renderer_opengl/gl_state.cpp - renderer_opengl/renderer_opengl.cpp - video_core.cpp - ) +add_library(video_core STATIC + renderer_base.cpp + renderer_base.h + renderer_opengl/gl_resource_manager.h + renderer_opengl/gl_shader_util.cpp + renderer_opengl/gl_shader_util.h + renderer_opengl/gl_state.cpp + renderer_opengl/gl_state.h + renderer_opengl/renderer_opengl.cpp + renderer_opengl/renderer_opengl.h + utils.h + video_core.cpp + video_core.h +) -set(HEADERS - renderer_base.h - renderer_opengl/gl_resource_manager.h - renderer_opengl/gl_shader_util.h - renderer_opengl/gl_state.h - renderer_opengl/renderer_opengl.h - utils.h - video_core.h - ) +create_target_directory_groups(video_core) -create_directory_groups(${SRCS} ${HEADERS}) - -add_library(video_core STATIC ${SRCS} ${HEADERS}) target_link_libraries(video_core PUBLIC common core) 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) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) -set(SRCS - about_dialog.cpp - configuration/config.cpp - configuration/configure_debug.cpp - configuration/configure_dialog.cpp - configuration/configure_general.cpp - configuration/configure_graphics.cpp - configuration/configure_input.cpp - configuration/configure_system.cpp - debugger/profiler.cpp - debugger/registers.cpp - debugger/wait_tree.cpp - util/spinbox.cpp - util/util.cpp - bootmanager.cpp - game_list.cpp - hotkeys.cpp - main.cpp - ui_settings.cpp - yuzu.rc - Info.plist - ) - -set(HEADERS - about_dialog.h - configuration/config.h - configuration/configure_debug.h - configuration/configure_dialog.h - configuration/configure_general.h - configuration/configure_graphics.h - configuration/configure_input.h - configuration/configure_system.h - debugger/profiler.h - debugger/registers.h - debugger/wait_tree.h - util/spinbox.h - util/util.h - bootmanager.h - game_list.h - game_list_p.h - hotkeys.h - main.h - ui_settings.h - ) +add_executable(yuzu + Info.plist + about_dialog.cpp + about_dialog.h + bootmanager.cpp + bootmanager.h + configuration/config.cpp + configuration/config.h + configuration/configure_debug.cpp + configuration/configure_debug.h + configuration/configure_dialog.cpp + configuration/configure_dialog.h + configuration/configure_general.cpp + configuration/configure_general.h + configuration/configure_graphics.cpp + configuration/configure_graphics.h + configuration/configure_input.cpp + configuration/configure_input.h + configuration/configure_system.cpp + configuration/configure_system.h + debugger/profiler.cpp + debugger/profiler.h + debugger/registers.cpp + debugger/registers.h + debugger/wait_tree.cpp + debugger/wait_tree.h + game_list.cpp + game_list.h + game_list_p.h + hotkeys.cpp + hotkeys.h + main.cpp + main.h + ui_settings.cpp + ui_settings.h + util/spinbox.cpp + util/spinbox.h + util/util.cpp + util/util.h + yuzu.rc +) set(UIS - aboutdialog.ui - configuration/configure.ui - configuration/configure_debug.ui - configuration/configure_general.ui - configuration/configure_graphics.ui - configuration/configure_input.ui - configuration/configure_system.ui - debugger/registers.ui - hotkeys.ui - main.ui - ) + aboutdialog.ui + configuration/configure.ui + configuration/configure_debug.ui + configuration/configure_general.ui + configuration/configure_graphics.ui + configuration/configure_input.ui + configuration/configure_system.ui + debugger/registers.ui + hotkeys.ui + main.ui +) file(GLOB_RECURSE ICONS ${CMAKE_SOURCE_DIR}/dist/icons/*) file(GLOB_RECURSE THEMES ${CMAKE_SOURCE_DIR}/dist/qt_themes/*) -create_directory_groups(${SRCS} ${HEADERS} ${UIS}) - qt5_wrap_ui(UI_HDRS ${UIS}) +target_sources(yuzu + PRIVATE + ${ICONS} + ${THEMES} + ${UI_HDRS} + ${UIS} +) + if (APPLE) set(MACOSX_ICON "../../dist/yuzu.icns") set_source_files_properties(${MACOSX_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) - add_executable(yuzu MACOSX_BUNDLE ${SRCS} ${HEADERS} ${UI_HDRS} ${MACOSX_ICON} ${ICONS}) + target_sources(yuzu PRIVATE ${MACOSX_ICON}) + set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE TRUE) set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) -else() - add_executable(yuzu ${SRCS} ${HEADERS} ${UI_HDRS} ${ICONS}) endif() + +create_target_directory_groups(yuzu) + target_link_libraries(yuzu PRIVATE common core input_common video_core) target_link_libraries(yuzu PRIVATE Boost::boost glad Qt5::OpenGL Qt5::Widgets) 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: QString edit_filter_text_old; protected: - bool eventFilter(QObject* obj, QEvent* event); + bool eventFilter(QObject* obj, QEvent* event) override; }; QHBoxLayout* layout_filter = nullptr; 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 @@ #include <map> #include <QKeySequence> #include <QShortcut> +#include <QTreeWidgetItem> #include <QtGlobal> #include "yuzu/hotkeys.h" #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 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) -set(SRCS - emu_window/emu_window_sdl2.cpp - config.cpp - yuzu.cpp - yuzu.rc - ) -set(HEADERS - emu_window/emu_window_sdl2.h - config.h - default_ini.h - resource.h - ) +add_executable(yuzu-cmd + config.cpp + config.h + default_ini.h + emu_window/emu_window_sdl2.cpp + emu_window/emu_window_sdl2.h + resource.h + yuzu.cpp + yuzu.rc +) -create_directory_groups(${SRCS} ${HEADERS}) +create_target_directory_groups(yuzu-cmd) -add_executable(yuzu-cmd ${SRCS} ${HEADERS}) target_link_libraries(yuzu-cmd PRIVATE common core input_common) target_link_libraries(yuzu-cmd PRIVATE inih glad) if (MSVC) |