summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-02-09 15:51:43 -0500
committerGravatar GitHub2018-02-09 15:51:43 -0500
commit1add3b20c4b2bf1815e6d6ea2b61845282baac25 (patch)
treee01e249939276a9ed9289c91a6ee7b26a4a5ced7 /src
parentMerge pull request #173 from MerryMage/feature/dynarmic-fix-windows (diff)
parentnvdrv: Fix QueryEvent for libnx. (diff)
downloadyuzu-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.cpp16
-rw-r--r--src/core/hle/service/acc/acc_u0.h1
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp16
-rw-r--r--src/core/hle/service/nvdrv/interface.cpp9
-rw-r--r--src/core/hle/service/nvdrv/interface.h3
-rw-r--r--src/core/hle/service/vi/vi.cpp2
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 @@
9namespace Service { 9namespace Service {
10namespace Account { 10namespace Account {
11 11
12using Uid = std::array<u64, 2>;
13static constexpr Uid DEFAULT_USER_ID{0x10ull, 0x20ull};
14
12class IProfile final : public ServiceFramework<IProfile> { 15class IProfile final : public ServiceFramework<IProfile> {
13public: 16public:
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
67void 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
64void ACC_U0::GetProfile(Kernel::HLERequestContext& ctx) { 76void 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
92ACC_U0::ACC_U0() : ServiceFramework("acc:u0") { 103ACC_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
29private: 29private:
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
106u32 nvhost_ctrl_gpu::ZCullGetInfo(const std::vector<u8>& input, std::vector<u8>& output) { 106u32 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(&params, 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(), &params, 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
88void NVDRV::SetClientPID(Kernel::HLERequestContext& ctx) { 87void 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