aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei <ericbunnie@gmail.com>2014-04-13 00:37:10 -0400
committerGravatar bunnei <ericbunnie@gmail.com>2014-04-13 00:37:10 -0400
commit67f6e414702cbb83a53392e1cca229875a186cea (patch)
treea3023c63aa8a0cc9c993bdc066c06abb4e91de87 /src
parentf2f63a0f0583d672342d300f3c8b099f56a13c7d (diff)
added a GetPointer function for reading from HLE command buffer
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/hle.cpp8
-rw-r--r--src/core/hle/hle.h6
2 files changed, 14 insertions, 0 deletions
diff --git a/src/core/hle/hle.cpp b/src/core/hle/hle.cpp
index 51432dc8..a4ab61c0 100644
--- a/src/core/hle/hle.cpp
+++ b/src/core/hle/hle.cpp
@@ -37,6 +37,14 @@ inline void Write(u32 addr, const T data) {
}
}
+u8 *GetPointer(const u32 addr) {
+ if (addr >= HLE::CMD_BUFFER_ADDR && addr < HLE::CMD_BUFFER_ADDR_END) {
+ return g_command_buffer + (addr & CMD_BUFFER_MASK);
+ } else {
+ ERROR_LOG(HLE, "unknown pointer from address %08X", addr);
+ }
+}
+
// Explicitly instantiate template functions because we aren't defining this in the header:
template void Read<u64>(u64 &var, const u32 addr);
diff --git a/src/core/hle/hle.h b/src/core/hle/hle.h
index 5ee90bcd..d02948be 100644
--- a/src/core/hle/hle.h
+++ b/src/core/hle/hle.h
@@ -46,6 +46,12 @@ inline void Read(T &var, const u32 addr);
template <typename T>
inline void Write(u32 addr, const T data);
+u8* GetPointer(const u32 Address);
+
+inline const char* GetCharPointer(const u32 address) {
+ return (const char *)GetPointer(address);
+}
+
void RegisterModule(std::string name, int num_functions, const FunctionDef *func_table);
void CallSyscall(u32 opcode);