summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/cfg/cfg.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2016-05-30 03:57:07 +0200
committerbunnei <bunneidev@gmail.com>2016-05-30 03:57:07 +0200
commitab4b27f0f5760c7f378f29756d3ce631bafca1b2 (patch)
tree6340ca66710e9603db24c051da0b8173b796d3c6 /src/core/hle/service/cfg/cfg.cpp
parentMerge pull request #1756 from wwylele/config-cleanup (diff)
parentMemory: Handle RasterizerCachedMemory and RasterizerCachedSpecial page types in the memory block manipulation functions. (diff)
downloadyuzu-ab4b27f0f5760c7f378f29756d3ce631bafca1b2.tar
yuzu-ab4b27f0f5760c7f378f29756d3ce631bafca1b2.tar.gz
yuzu-ab4b27f0f5760c7f378f29756d3ce631bafca1b2.tar.bz2
yuzu-ab4b27f0f5760c7f378f29756d3ce631bafca1b2.tar.lz
yuzu-ab4b27f0f5760c7f378f29756d3ce631bafca1b2.tar.xz
yuzu-ab4b27f0f5760c7f378f29756d3ce631bafca1b2.tar.zst
yuzu-ab4b27f0f5760c7f378f29756d3ce631bafca1b2.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 acc509cb0..e067db645 100644
--- a/src/core/hle/service/cfg/cfg.cpp
+++ b/src/core/hle/service/cfg/cfg.cpp
@@ -196,28 +196,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) {