diff options
| author | 2018-02-09 15:51:43 -0500 | |
|---|---|---|
| committer | 2018-02-09 15:51:43 -0500 | |
| commit | 1add3b20c4b2bf1815e6d6ea2b61845282baac25 (patch) | |
| tree | e01e249939276a9ed9289c91a6ee7b26a4a5ced7 /src | |
| parent | Merge pull request #173 from MerryMage/feature/dynarmic-fix-windows (diff) | |
| parent | nvdrv: Fix QueryEvent for libnx. (diff) | |
| download | yuzu-1add3b20c4b2bf1815e6d6ea2b61845282baac25.tar.gz yuzu-1add3b20c4b2bf1815e6d6ea2b61845282baac25.tar.xz yuzu-1add3b20c4b2bf1815e6d6ea2b61845282baac25.zip | |
Merge pull request #171 from bunnei/libnx-fixes
Various fixes for libnx, etc.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/acc/acc_u0.cpp | 16 | ||||
| -rw-r--r-- | src/core/hle/service/acc/acc_u0.h | 1 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp | 16 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/interface.cpp | 9 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/interface.h | 3 | ||||
| -rw-r--r-- | src/core/hle/service/vi/vi.cpp | 2 |
6 files changed, 38 insertions, 9 deletions
diff --git a/src/core/hle/service/acc/acc_u0.cpp b/src/core/hle/service/acc/acc_u0.cpp index ff9f6cca8..ee7d07aa7 100644 --- a/src/core/hle/service/acc/acc_u0.cpp +++ b/src/core/hle/service/acc/acc_u0.cpp | |||
| @@ -9,6 +9,9 @@ | |||
| 9 | namespace Service { | 9 | namespace Service { |
| 10 | namespace Account { | 10 | namespace Account { |
| 11 | 11 | ||
| 12 | using Uid = std::array<u64, 2>; | ||
| 13 | static constexpr Uid DEFAULT_USER_ID{0x10ull, 0x20ull}; | ||
| 14 | |||
| 12 | class IProfile final : public ServiceFramework<IProfile> { | 15 | class IProfile final : public ServiceFramework<IProfile> { |
| 13 | public: | 16 | public: |
| 14 | IProfile() : ServiceFramework("IProfile") { | 17 | IProfile() : ServiceFramework("IProfile") { |
| @@ -61,6 +64,15 @@ void ACC_U0::GetUserExistence(Kernel::HLERequestContext& ctx) { | |||
| 61 | rb.Push(true); // TODO: Check when this is supposed to return true and when not | 64 | rb.Push(true); // TODO: Check when this is supposed to return true and when not |
| 62 | } | 65 | } |
| 63 | 66 | ||
| 67 | void ACC_U0::ListAllUsers(Kernel::HLERequestContext& ctx) { | ||
| 68 | constexpr std::array<u128, 10> user_ids{DEFAULT_USER_ID}; | ||
| 69 | const auto& output_buffer = ctx.BufferDescriptorC()[0]; | ||
| 70 | Memory::WriteBlock(output_buffer.Address(), user_ids.data(), user_ids.size()); | ||
| 71 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 72 | rb.Push(RESULT_SUCCESS); | ||
| 73 | LOG_DEBUG(Service_ACC, "called"); | ||
| 74 | } | ||
| 75 | |||
| 64 | void ACC_U0::GetProfile(Kernel::HLERequestContext& ctx) { | 76 | void ACC_U0::GetProfile(Kernel::HLERequestContext& ctx) { |
| 65 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 77 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 66 | rb.Push(RESULT_SUCCESS); | 78 | rb.Push(RESULT_SUCCESS); |
| @@ -85,13 +97,13 @@ void ACC_U0::GetLastOpenedUser(Kernel::HLERequestContext& ctx) { | |||
| 85 | LOG_WARNING(Service_ACC, "(STUBBED) called"); | 97 | LOG_WARNING(Service_ACC, "(STUBBED) called"); |
| 86 | IPC::ResponseBuilder rb{ctx, 6}; | 98 | IPC::ResponseBuilder rb{ctx, 6}; |
| 87 | rb.Push(RESULT_SUCCESS); | 99 | rb.Push(RESULT_SUCCESS); |
| 88 | rb.Push<u64>(0x0); | 100 | rb.PushRaw(DEFAULT_USER_ID); |
| 89 | rb.Push<u64>(0x0); | ||
| 90 | } | 101 | } |
| 91 | 102 | ||
| 92 | ACC_U0::ACC_U0() : ServiceFramework("acc:u0") { | 103 | ACC_U0::ACC_U0() : ServiceFramework("acc:u0") { |
| 93 | static const FunctionInfo functions[] = { | 104 | static const FunctionInfo functions[] = { |
| 94 | {1, &ACC_U0::GetUserExistence, "GetUserExistence"}, | 105 | {1, &ACC_U0::GetUserExistence, "GetUserExistence"}, |
| 106 | {2, &ACC_U0::ListAllUsers, "ListAllUsers"}, | ||
| 95 | {4, &ACC_U0::GetLastOpenedUser, "GetLastOpenedUser"}, | 107 | {4, &ACC_U0::GetLastOpenedUser, "GetLastOpenedUser"}, |
| 96 | {5, &ACC_U0::GetProfile, "GetProfile"}, | 108 | {5, &ACC_U0::GetProfile, "GetProfile"}, |
| 97 | {100, &ACC_U0::InitializeApplicationInfo, "InitializeApplicationInfo"}, | 109 | {100, &ACC_U0::InitializeApplicationInfo, "InitializeApplicationInfo"}, |
diff --git a/src/core/hle/service/acc/acc_u0.h b/src/core/hle/service/acc/acc_u0.h index b38c2f95e..d7732e75b 100644 --- a/src/core/hle/service/acc/acc_u0.h +++ b/src/core/hle/service/acc/acc_u0.h | |||
| @@ -28,6 +28,7 @@ public: | |||
| 28 | 28 | ||
| 29 | private: | 29 | private: |
| 30 | void GetUserExistence(Kernel::HLERequestContext& ctx); | 30 | void GetUserExistence(Kernel::HLERequestContext& ctx); |
| 31 | void ListAllUsers(Kernel::HLERequestContext& ctx); | ||
| 31 | void GetLastOpenedUser(Kernel::HLERequestContext& ctx); | 32 | void GetLastOpenedUser(Kernel::HLERequestContext& ctx); |
| 32 | void GetProfile(Kernel::HLERequestContext& ctx); | 33 | void GetProfile(Kernel::HLERequestContext& ctx); |
| 33 | void InitializeApplicationInfo(Kernel::HLERequestContext& ctx); | 34 | void InitializeApplicationInfo(Kernel::HLERequestContext& ctx); |
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp index d7e0b1bbd..4776c8aa3 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp | |||
| @@ -104,8 +104,20 @@ u32 nvhost_ctrl_gpu::ZCullGetCtxSize(const std::vector<u8>& input, std::vector<u | |||
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | u32 nvhost_ctrl_gpu::ZCullGetInfo(const std::vector<u8>& input, std::vector<u8>& output) { | 106 | u32 nvhost_ctrl_gpu::ZCullGetInfo(const std::vector<u8>& input, std::vector<u8>& output) { |
| 107 | LOG_WARNING(Service_NVDRV, "(STUBBED) called"); | 107 | LOG_DEBUG(Service_NVDRV, "called"); |
| 108 | std::memset(output.data(), 0, output.size()); | 108 | IoctlNvgpuGpuZcullGetInfoArgs params{}; |
| 109 | std::memcpy(¶ms, input.data(), input.size()); | ||
| 110 | params.width_align_pixels = 0x20; | ||
| 111 | params.height_align_pixels = 0x20; | ||
| 112 | params.pixel_squares_by_aliquots = 0x400; | ||
| 113 | params.aliquot_total = 0x800; | ||
| 114 | params.region_byte_multiplier = 0x20; | ||
| 115 | params.region_header_size = 0x20; | ||
| 116 | params.subregion_header_size = 0xc0; | ||
| 117 | params.subregion_width_align_pixels = 0x20; | ||
| 118 | params.subregion_height_align_pixels = 0x40; | ||
| 119 | params.subregion_count = 0x10; | ||
| 120 | std::memcpy(output.data(), ¶ms, output.size()); | ||
| 109 | return 0; | 121 | return 0; |
| 110 | } | 122 | } |
| 111 | 123 | ||
diff --git a/src/core/hle/service/nvdrv/interface.cpp b/src/core/hle/service/nvdrv/interface.cpp index 0edb64cc3..367791da6 100644 --- a/src/core/hle/service/nvdrv/interface.cpp +++ b/src/core/hle/service/nvdrv/interface.cpp | |||
| @@ -78,11 +78,10 @@ void NVDRV::QueryEvent(Kernel::HLERequestContext& ctx) { | |||
| 78 | u32 event_id = rp.Pop<u32>(); | 78 | u32 event_id = rp.Pop<u32>(); |
| 79 | LOG_WARNING(Service_NVDRV, "(STUBBED) called, fd=%x, event_id=%x", fd, event_id); | 79 | LOG_WARNING(Service_NVDRV, "(STUBBED) called, fd=%x, event_id=%x", fd, event_id); |
| 80 | 80 | ||
| 81 | IPC::ResponseBuilder rb{ctx, 2, 1}; | 81 | IPC::ResponseBuilder rb{ctx, 3, 1}; |
| 82 | rb.Push(RESULT_SUCCESS); | 82 | rb.Push(RESULT_SUCCESS); |
| 83 | auto event = Kernel::Event::Create(Kernel::ResetType::Pulse, "NVEvent"); | 83 | rb.PushCopyObjects(query_event); |
| 84 | event->Signal(); | 84 | rb.Push<u32>(0); |
| 85 | rb.PushCopyObjects(event); | ||
| 86 | } | 85 | } |
| 87 | 86 | ||
| 88 | void NVDRV::SetClientPID(Kernel::HLERequestContext& ctx) { | 87 | void NVDRV::SetClientPID(Kernel::HLERequestContext& ctx) { |
| @@ -113,6 +112,8 @@ NVDRV::NVDRV(std::shared_ptr<Module> nvdrv, const char* name) | |||
| 113 | {13, &NVDRV::FinishInitialize, "FinishInitialize"}, | 112 | {13, &NVDRV::FinishInitialize, "FinishInitialize"}, |
| 114 | }; | 113 | }; |
| 115 | RegisterHandlers(functions); | 114 | RegisterHandlers(functions); |
| 115 | |||
| 116 | query_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "NVDRV::query_event"); | ||
| 116 | } | 117 | } |
| 117 | 118 | ||
| 118 | } // namespace Nvidia | 119 | } // namespace Nvidia |
diff --git a/src/core/hle/service/nvdrv/interface.h b/src/core/hle/service/nvdrv/interface.h index 8c4b068c2..daf2302af 100644 --- a/src/core/hle/service/nvdrv/interface.h +++ b/src/core/hle/service/nvdrv/interface.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include <string> | 8 | #include <string> |
| 9 | #include "core/hle/kernel/event.h" | ||
| 9 | #include "core/hle/service/nvdrv/nvdrv.h" | 10 | #include "core/hle/service/nvdrv/nvdrv.h" |
| 10 | #include "core/hle/service/service.h" | 11 | #include "core/hle/service/service.h" |
| 11 | 12 | ||
| @@ -29,6 +30,8 @@ private: | |||
| 29 | std::shared_ptr<Module> nvdrv; | 30 | std::shared_ptr<Module> nvdrv; |
| 30 | 31 | ||
| 31 | u64 pid{}; | 32 | u64 pid{}; |
| 33 | |||
| 34 | Kernel::SharedPtr<Kernel::Event> query_event; | ||
| 32 | }; | 35 | }; |
| 33 | 36 | ||
| 34 | } // namespace Nvidia | 37 | } // namespace Nvidia |
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index cfddd7c41..7508443a8 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp | |||
| @@ -657,7 +657,7 @@ void IApplicationDisplayService::CloseDisplay(Kernel::HLERequestContext& ctx) { | |||
| 657 | IPC::RequestParser rp{ctx}; | 657 | IPC::RequestParser rp{ctx}; |
| 658 | u64 display_id = rp.Pop<u64>(); | 658 | u64 display_id = rp.Pop<u64>(); |
| 659 | 659 | ||
| 660 | IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0); | 660 | IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0); |
| 661 | rb.Push(RESULT_SUCCESS); | 661 | rb.Push(RESULT_SUCCESS); |
| 662 | } | 662 | } |
| 663 | 663 | ||