summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-02-09 21:51:43 +0100
committerGitHub <noreply@github.com>2018-02-09 21:51:43 +0100
commit1add3b20c4b2bf1815e6d6ea2b61845282baac25 (patch)
treee01e249939276a9ed9289c91a6ee7b26a4a5ced7 /src/core/hle
parentMerge pull request #173 from MerryMage/feature/dynarmic-fix-windows (diff)
parentnvdrv: Fix QueryEvent for libnx. (diff)
downloadyuzu-1add3b20c4b2bf1815e6d6ea2b61845282baac25.tar
yuzu-1add3b20c4b2bf1815e6d6ea2b61845282baac25.tar.gz
yuzu-1add3b20c4b2bf1815e6d6ea2b61845282baac25.tar.bz2
yuzu-1add3b20c4b2bf1815e6d6ea2b61845282baac25.tar.lz
yuzu-1add3b20c4b2bf1815e6d6ea2b61845282baac25.tar.xz
yuzu-1add3b20c4b2bf1815e6d6ea2b61845282baac25.tar.zst
yuzu-1add3b20c4b2bf1815e6d6ea2b61845282baac25.zip
Diffstat (limited to 'src/core/hle')
-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 @@
namespace Service {
namespace Account {
+using Uid = std::array<u64, 2>;
+static constexpr Uid DEFAULT_USER_ID{0x10ull, 0x20ull};
+
class IProfile final : public ServiceFramework<IProfile> {
public:
IProfile() : ServiceFramework("IProfile") {
@@ -61,6 +64,15 @@ void ACC_U0::GetUserExistence(Kernel::HLERequestContext& ctx) {
rb.Push(true); // TODO: Check when this is supposed to return true and when not
}
+void ACC_U0::ListAllUsers(Kernel::HLERequestContext& ctx) {
+ constexpr std::array<u128, 10> user_ids{DEFAULT_USER_ID};
+ const auto& output_buffer = ctx.BufferDescriptorC()[0];
+ Memory::WriteBlock(output_buffer.Address(), user_ids.data(), user_ids.size());
+ IPC::ResponseBuilder rb{ctx, 2};
+ rb.Push(RESULT_SUCCESS);
+ LOG_DEBUG(Service_ACC, "called");
+}
+
void ACC_U0::GetProfile(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
@@ -85,13 +97,13 @@ void ACC_U0::GetLastOpenedUser(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_ACC, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 6};
rb.Push(RESULT_SUCCESS);
- rb.Push<u64>(0x0);
- rb.Push<u64>(0x0);
+ rb.PushRaw(DEFAULT_USER_ID);
}
ACC_U0::ACC_U0() : ServiceFramework("acc:u0") {
static const FunctionInfo functions[] = {
{1, &ACC_U0::GetUserExistence, "GetUserExistence"},
+ {2, &ACC_U0::ListAllUsers, "ListAllUsers"},
{4, &ACC_U0::GetLastOpenedUser, "GetLastOpenedUser"},
{5, &ACC_U0::GetProfile, "GetProfile"},
{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:
private:
void GetUserExistence(Kernel::HLERequestContext& ctx);
+ void ListAllUsers(Kernel::HLERequestContext& ctx);
void GetLastOpenedUser(Kernel::HLERequestContext& ctx);
void GetProfile(Kernel::HLERequestContext& ctx);
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
}
u32 nvhost_ctrl_gpu::ZCullGetInfo(const std::vector<u8>& input, std::vector<u8>& output) {
- LOG_WARNING(Service_NVDRV, "(STUBBED) called");
- std::memset(output.data(), 0, output.size());
+ LOG_DEBUG(Service_NVDRV, "called");
+ IoctlNvgpuGpuZcullGetInfoArgs params{};
+ std::memcpy(&params, input.data(), input.size());
+ params.width_align_pixels = 0x20;
+ params.height_align_pixels = 0x20;
+ params.pixel_squares_by_aliquots = 0x400;
+ params.aliquot_total = 0x800;
+ params.region_byte_multiplier = 0x20;
+ params.region_header_size = 0x20;
+ params.subregion_header_size = 0xc0;
+ params.subregion_width_align_pixels = 0x20;
+ params.subregion_height_align_pixels = 0x40;
+ params.subregion_count = 0x10;
+ std::memcpy(output.data(), &params, output.size());
return 0;
}
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) {
u32 event_id = rp.Pop<u32>();
LOG_WARNING(Service_NVDRV, "(STUBBED) called, fd=%x, event_id=%x", fd, event_id);
- IPC::ResponseBuilder rb{ctx, 2, 1};
+ IPC::ResponseBuilder rb{ctx, 3, 1};
rb.Push(RESULT_SUCCESS);
- auto event = Kernel::Event::Create(Kernel::ResetType::Pulse, "NVEvent");
- event->Signal();
- rb.PushCopyObjects(event);
+ rb.PushCopyObjects(query_event);
+ rb.Push<u32>(0);
}
void NVDRV::SetClientPID(Kernel::HLERequestContext& ctx) {
@@ -113,6 +112,8 @@ NVDRV::NVDRV(std::shared_ptr<Module> nvdrv, const char* name)
{13, &NVDRV::FinishInitialize, "FinishInitialize"},
};
RegisterHandlers(functions);
+
+ query_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "NVDRV::query_event");
}
} // 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 @@
#include <memory>
#include <string>
+#include "core/hle/kernel/event.h"
#include "core/hle/service/nvdrv/nvdrv.h"
#include "core/hle/service/service.h"
@@ -29,6 +30,8 @@ private:
std::shared_ptr<Module> nvdrv;
u64 pid{};
+
+ Kernel::SharedPtr<Kernel::Event> query_event;
};
} // 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) {
IPC::RequestParser rp{ctx};
u64 display_id = rp.Pop<u64>();
- IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0);
+ IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0);
rb.Push(RESULT_SUCCESS);
}