summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Subv2018-02-17 13:56:21 -0500
committerGravatar Subv2018-02-17 14:01:01 -0500
commit416f692f6e1b8a4c838977b0cf6d9ae2ecbd15d6 (patch)
treef852ec3328473f214155234c3ad03e40b80768e2 /src
parentParcel: Ensure we don't read past the end of the parcels in Vi. (diff)
downloadyuzu-416f692f6e1b8a4c838977b0cf6d9ae2ecbd15d6.tar.gz
yuzu-416f692f6e1b8a4c838977b0cf6d9ae2ecbd15d6.tar.xz
yuzu-416f692f6e1b8a4c838977b0cf6d9ae2ecbd15d6.zip
nvmap: Make IocFromId return the same existing handle instead of creating a new one.
Games like Puyo Puyo Tetris and BOTW seem to depend on the buffer always having the same handle
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/nvdrv/devices/nvmap.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvmap.cpp b/src/core/hle/service/nvdrv/devices/nvmap.cpp
index cd8c0c605..b3842eb4c 100644
--- a/src/core/hle/service/nvdrv/devices/nvmap.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvmap.cpp
@@ -103,11 +103,8 @@ u32 nvmap::IocFromId(const std::vector<u8>& input, std::vector<u8>& output) {
103 [&](const auto& entry) { return entry.second->id == params.id; }); 103 [&](const auto& entry) { return entry.second->id == params.id; });
104 ASSERT(itr != handles.end()); 104 ASSERT(itr != handles.end());
105 105
106 // Make a new handle for the object 106 // Return the existing handle instead of creating a new one.
107 u32 handle = next_handle++; 107 params.handle = itr->first;
108 handles[handle] = itr->second;
109
110 params.handle = handle;
111 108
112 std::memcpy(output.data(), &params, sizeof(params)); 109 std::memcpy(output.data(), &params, sizeof(params));
113 return 0; 110 return 0;