summaryrefslogtreecommitdiff
path: root/src/core/hle/coprocessor.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2014-05-08 17:16:35 -0400
committerGravatar bunnei2014-05-08 17:16:35 -0400
commitbdc54d0d4897841a4d24aee80311bfb1f0eba884 (patch)
tree558d87c83fe8f7e8e3e57644407c872244ee5a3a /src/core/hle/coprocessor.cpp
parentMerge pull request #16 from Sethpaien/master (diff)
parentremoved unknown fields from GX_CmdBufferHeader (diff)
downloadyuzu-bdc54d0d4897841a4d24aee80311bfb1f0eba884.tar.gz
yuzu-bdc54d0d4897841a4d24aee80311bfb1f0eba884.tar.xz
yuzu-bdc54d0d4897841a4d24aee80311bfb1f0eba884.zip
Merge pull request #15 from bunnei/hle-services
Various fixes/improvements to HLE of 3DS services, mostly cleans up GSP call decoding
Diffstat (limited to 'src/core/hle/coprocessor.cpp')
-rw-r--r--src/core/hle/coprocessor.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/core/hle/coprocessor.cpp b/src/core/hle/coprocessor.cpp
new file mode 100644
index 000000000..74305331c
--- /dev/null
+++ b/src/core/hle/coprocessor.cpp
@@ -0,0 +1,50 @@
1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2
3// Refer to the license.txt file included.
4
5#include "core/hle/coprocessor.h"
6#include "core/hle/hle.h"
7#include "core/mem_map.h"
8#include "core/core.h"
9
10namespace HLE {
11
12/// Data synchronization barrier
13u32 DataSynchronizationBarrier() {
14 return 0;
15}
16
17/// Returns the coprocessor (in this case, syscore) command buffer pointer
18Addr GetThreadCommandBuffer() {
19 // Called on insruction: mrc p15, 0, r0, c13, c0, 3
20 return Memory::KERNEL_MEMORY_VADDR;
21}
22
23/// Call an MCR (move to coprocessor from ARM register) instruction in HLE
24s32 CallMCR(u32 instruction, u32 value) {
25 CoprocessorOperation operation = (CoprocessorOperation)((instruction >> 20) & 0xFF);
26 ERROR_LOG(OSHLE, "unimplemented MCR instruction=0x%08X, operation=%02X, value=%08X",
27 instruction, operation, value);
28 return 0;
29}
30
31/// Call an MRC (move to ARM register from coprocessor) instruction in HLE
32s32 CallMRC(u32 instruction) {
33 CoprocessorOperation operation = (CoprocessorOperation)((instruction >> 20) & 0xFF);
34
35 switch (operation) {
36
37 case DATA_SYNCHRONIZATION_BARRIER:
38 return DataSynchronizationBarrier();
39
40 case CALL_GET_THREAD_COMMAND_BUFFER:
41 return GetThreadCommandBuffer();
42
43 default:
44 ERROR_LOG(OSHLE, "unimplemented MRC instruction 0x%08X", instruction);
45 break;
46 }
47 return 0;
48}
49
50} // namespace