summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar MerryMage2016-04-16 11:51:48 +0100
committerGravatar Subv2016-05-21 11:14:13 -0500
commit64068583fbefb7268a1138828611d735eae1e212 (patch)
treea5b9c40c74f32632394387cd8f2e20963fd1cea8 /src
parentAPT: Remove use of Memory::GetPointer (diff)
downloadyuzu-64068583fbefb7268a1138828611d735eae1e212.tar.gz
yuzu-64068583fbefb7268a1138828611d735eae1e212.tar.xz
yuzu-64068583fbefb7268a1138828611d735eae1e212.zip
CFG: Remove use of Memory::GetPointer
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/cfg/cfg.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp
index b9322c55d..3921653e5 100644
--- a/src/core/hle/service/cfg/cfg.cpp
+++ b/src/core/hle/service/cfg/cfg.cpp
@@ -191,28 +191,32 @@ void GetConfigInfoBlk2(Service::Interface* self) {
191 u32* cmd_buff = Kernel::GetCommandBuffer(); 191 u32* cmd_buff = Kernel::GetCommandBuffer();
192 u32 size = cmd_buff[1]; 192 u32 size = cmd_buff[1];
193 u32 block_id = cmd_buff[2]; 193 u32 block_id = cmd_buff[2];
194 u8* data_pointer = Memory::GetPointer(cmd_buff[4]); 194 VAddr data_pointer = cmd_buff[4];
195 195
196 if (data_pointer == nullptr) { 196 if (!Memory::IsValidVirtualAddress(data_pointer)) {
197 cmd_buff[1] = -1; // TODO(Subv): Find the right error code 197 cmd_buff[1] = -1; // TODO(Subv): Find the right error code
198 return; 198 return;
199 } 199 }
200 200
201 cmd_buff[1] = Service::CFG::GetConfigInfoBlock(block_id, size, 0x2, data_pointer).raw; 201 std::vector<u8> data(size);
202 cmd_buff[1] = Service::CFG::GetConfigInfoBlock(block_id, size, 0x2, data.data()).raw;
203 Memory::WriteBlock(data_pointer, data.data(), data.size());
202} 204}
203 205
204void GetConfigInfoBlk8(Service::Interface* self) { 206void GetConfigInfoBlk8(Service::Interface* self) {
205 u32* cmd_buff = Kernel::GetCommandBuffer(); 207 u32* cmd_buff = Kernel::GetCommandBuffer();
206 u32 size = cmd_buff[1]; 208 u32 size = cmd_buff[1];
207 u32 block_id = cmd_buff[2]; 209 u32 block_id = cmd_buff[2];
208 u8* data_pointer = Memory::GetPointer(cmd_buff[4]); 210 VAddr data_pointer = cmd_buff[4];
209 211
210 if (data_pointer == nullptr) { 212 if (!Memory::IsValidVirtualAddress(data_pointer)) {
211 cmd_buff[1] = -1; // TODO(Subv): Find the right error code 213 cmd_buff[1] = -1; // TODO(Subv): Find the right error code
212 return; 214 return;
213 } 215 }
214 216
215 cmd_buff[1] = Service::CFG::GetConfigInfoBlock(block_id, size, 0x8, data_pointer).raw; 217 std::vector<u8> data(size);
218 cmd_buff[1] = Service::CFG::GetConfigInfoBlock(block_id, size, 0x8, data.data()).raw;
219 Memory::WriteBlock(data_pointer, data.data(), data.size());
216} 220}
217 221
218void UpdateConfigNANDSavegame(Service::Interface* self) { 222void UpdateConfigNANDSavegame(Service::Interface* self) {