summaryrefslogtreecommitdiffstats
path: root/src/core/hle/syscall.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/hle/syscall.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/core/hle/syscall.cpp b/src/core/hle/syscall.cpp
index c5b887795..0cb563955 100644
--- a/src/core/hle/syscall.cpp
+++ b/src/core/hle/syscall.cpp
@@ -4,6 +4,10 @@
#include <map>
+#include "core/mem_map.h"
+
+#include "core/hw/hw_lcd.h"
+
#include "core/hle/function_wrappers.h"
#include "core/hle/syscall.h"
#include "core/hle/service/service.h"
@@ -13,6 +17,26 @@
namespace Syscall {
+/// Map application or GSP heap memory
+Result ControlMemory(void* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions) {
+ u32 virtual_address = 0x00000000;
+
+ switch (operation) {
+
+ // Map GSP heap memory?
+ case 0x00010003:
+ virtual_address = Memory::MapBlock_HeapGSP(size, operation, permissions);
+ break;
+
+ // Unknown ControlMemory operation
+ default:
+ ERROR_LOG(OSHLE, "Unknown ControlMemory operation %08X", operation);
+ }
+
+ Core::g_app_core->SetReg(1, Memory::MapBlock_HeapGSP(size, operation, permissions));
+ return 0;
+}
+
/// Connect to an OS service given the port name, returns the handle to the port to out
Result ConnectToPort(void* out, const char* port_name) {
Service::Interface* service = Service::g_manager->FetchFromPortName(port_name);
@@ -41,7 +65,7 @@ Result WaitSynchronization1(Handle handle, s64 nanoseconds) {
const HLE::FunctionDef Syscall_Table[] = {
{0x00, NULL, "Unknown"},
- {0x01, NULL, "ControlMemory"},
+ {0x01, WrapI_VUUUUU<ControlMemory>, "ControlMemory"},
{0x02, NULL, "QueryMemory"},
{0x03, NULL, "ExitProcess"},
{0x04, NULL, "GetProcessAffinityMask"},