From 91e19deb3931dcb1ee2b692b3d9b039bc601e2c3 Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 12 Feb 2018 21:17:04 -0500 Subject: [PATCH] vi: Add FENCE_HACK, which is useful for booting BOTW. --- src/core/hle/service/vi/vi.cpp | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index cfdd4bf2a6..8b4ed30d2d 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp @@ -262,6 +262,11 @@ public: Data data; }; +// TODO(bunnei): Remove this. When set to 1, games will think a fence is valid and boot further. +// This will break libnx and potentially other apps that more stringently check this. This is here +// purely as a convenience, and should go away once we implement fences. +static constexpr u32 FENCE_HACK = 0; + class IGBPDequeueBufferResponseParcel : public Parcel { public: explicit IGBPDequeueBufferResponseParcel(u32 slot) : Parcel(), slot(slot) {} @@ -269,11 +274,20 @@ public: protected: void SerializeData() override { - Write(slot); - // TODO(Subv): Find out how this Fence is used. - std::array fence = {}; - Write(fence); - Write(0); + // TODO(bunnei): Find out what this all means. Writing anything non-zero here breaks libnx. + Write(0); + Write(FENCE_HACK); + Write(0); + Write(0); + Write(0); + Write(0); + Write(0); + Write(0); + Write(0); + Write(0); + Write(0); + Write(0); + Write(0); } u32_le slot; @@ -304,7 +318,7 @@ protected: void SerializeData() override { // TODO(bunnei): Find out what this all means. Writing anything non-zero here breaks libnx. Write(0); - Write(0); + Write(FENCE_HACK); Write(0); Write(buffer); Write(0); @@ -560,7 +574,7 @@ private: } std::shared_ptr nv_flinger; -}; +}; // namespace VI class ISystemDisplayService final : public ServiceFramework { public: