diff options
| author | 2014-04-13 00:37:10 -0400 | |
|---|---|---|
| committer | 2014-04-13 00:37:10 -0400 | |
| commit | 67f6e414702cbb83a53392e1cca229875a186cea (patch) | |
| tree | a3023c63aa8a0cc9c993bdc066c06abb4e91de87 /src | |
| parent | fixed hw write declarations to not be const (diff) | |
| download | yuzu-67f6e414702cbb83a53392e1cca229875a186cea.tar.gz yuzu-67f6e414702cbb83a53392e1cca229875a186cea.tar.xz yuzu-67f6e414702cbb83a53392e1cca229875a186cea.zip | |
added a GetPointer function for reading from HLE command buffer
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/hle.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/hle.h | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/core/hle/hle.cpp b/src/core/hle/hle.cpp index 51432dc87..a4ab61c0c 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) { | |||
| 37 | } | 37 | } |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | u8 *GetPointer(const u32 addr) { | ||
| 41 | if (addr >= HLE::CMD_BUFFER_ADDR && addr < HLE::CMD_BUFFER_ADDR_END) { | ||
| 42 | return g_command_buffer + (addr & CMD_BUFFER_MASK); | ||
| 43 | } else { | ||
| 44 | ERROR_LOG(HLE, "unknown pointer from address %08X", addr); | ||
| 45 | } | ||
| 46 | } | ||
| 47 | |||
| 40 | // Explicitly instantiate template functions because we aren't defining this in the header: | 48 | // Explicitly instantiate template functions because we aren't defining this in the header: |
| 41 | 49 | ||
| 42 | template void Read<u64>(u64 &var, const u32 addr); | 50 | template void Read<u64>(u64 &var, const u32 addr); |
diff --git a/src/core/hle/hle.h b/src/core/hle/hle.h index 5ee90bcdc..d02948be3 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); | |||
| 46 | template <typename T> | 46 | template <typename T> |
| 47 | inline void Write(u32 addr, const T data); | 47 | inline void Write(u32 addr, const T data); |
| 48 | 48 | ||
| 49 | u8* GetPointer(const u32 Address); | ||
| 50 | |||
| 51 | inline const char* GetCharPointer(const u32 address) { | ||
| 52 | return (const char *)GetPointer(address); | ||
| 53 | } | ||
| 54 | |||
| 49 | void RegisterModule(std::string name, int num_functions, const FunctionDef *func_table); | 55 | void RegisterModule(std::string name, int num_functions, const FunctionDef *func_table); |
| 50 | 56 | ||
| 51 | void CallSyscall(u32 opcode); | 57 | void CallSyscall(u32 opcode); |