summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/cfg/cfg.cpp
diff options
context:
space:
mode:
authorMerryMage <MerryMage@users.noreply.github.com>2016-04-16 12:51:48 +0200
committerSubv <subv2112@gmail.com>2016-05-21 18:14:13 +0200
commit64068583fbefb7268a1138828611d735eae1e212 (patch)
treea5b9c40c74f32632394387cd8f2e20963fd1cea8 /src/core/hle/service/cfg/cfg.cpp
parentAPT: Remove use of Memory::GetPointer (diff)
downloadyuzu-64068583fbefb7268a1138828611d735eae1e212.tar
yuzu-64068583fbefb7268a1138828611d735eae1e212.tar.gz
yuzu-64068583fbefb7268a1138828611d735eae1e212.tar.bz2
yuzu-64068583fbefb7268a1138828611d735eae1e212.tar.lz
yuzu-64068583fbefb7268a1138828611d735eae1e212.tar.xz
yuzu-64068583fbefb7268a1138828611d735eae1e212.tar.zst
yuzu-64068583fbefb7268a1138828611d735eae1e212.zip
Diffstat (limited to 'src/core/hle/service/cfg/cfg.cpp')
-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) {
u32* cmd_buff = Kernel::GetCommandBuffer();
u32 size = cmd_buff[1];
u32 block_id = cmd_buff[2];
- u8* data_pointer = Memory::GetPointer(cmd_buff[4]);
+ VAddr data_pointer = cmd_buff[4];
- if (data_pointer == nullptr) {
+ if (!Memory::IsValidVirtualAddress(data_pointer)) {
cmd_buff[1] = -1; // TODO(Subv): Find the right error code
return;
}
- cmd_buff[1] = Service::CFG::GetConfigInfoBlock(block_id, size, 0x2, data_pointer).raw;
+ std::vector<u8> data(size);
+ cmd_buff[1] = Service::CFG::GetConfigInfoBlock(block_id, size, 0x2, data.data()).raw;
+ Memory::WriteBlock(data_pointer, data.data(), data.size());
}
void GetConfigInfoBlk8(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
u32 size = cmd_buff[1];
u32 block_id = cmd_buff[2];
- u8* data_pointer = Memory::GetPointer(cmd_buff[4]);
+ VAddr data_pointer = cmd_buff[4];
- if (data_pointer == nullptr) {
+ if (!Memory::IsValidVirtualAddress(data_pointer)) {
cmd_buff[1] = -1; // TODO(Subv): Find the right error code
return;
}
- cmd_buff[1] = Service::CFG::GetConfigInfoBlock(block_id, size, 0x8, data_pointer).raw;
+ std::vector<u8> data(size);
+ cmd_buff[1] = Service::CFG::GetConfigInfoBlock(block_id, size, 0x8, data.data()).raw;
+ Memory::WriteBlock(data_pointer, data.data(), data.size());
}
void UpdateConfigNANDSavegame(Service::Interface* self) {