diff options
Diffstat (limited to 'src/core/hle/coprocessor.cpp')
| -rw-r--r-- | src/core/hle/coprocessor.cpp | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/src/core/hle/coprocessor.cpp b/src/core/hle/coprocessor.cpp index df1362176..74305331c 100644 --- a/src/core/hle/coprocessor.cpp +++ b/src/core/hle/coprocessor.cpp | |||
| @@ -9,39 +9,15 @@ | |||
| 9 | 9 | ||
| 10 | namespace HLE { | 10 | namespace HLE { |
| 11 | 11 | ||
| 12 | enum { | ||
| 13 | CMD_GX_REQUEST_DMA = 0x00000000, | ||
| 14 | }; | ||
| 15 | |||
| 16 | /// Data synchronization barrier | 12 | /// Data synchronization barrier |
| 17 | u32 DataSynchronizationBarrier(u32* command_buffer) { | 13 | u32 DataSynchronizationBarrier() { |
| 18 | u32 command = command_buffer[0]; | ||
| 19 | |||
| 20 | switch (command) { | ||
| 21 | |||
| 22 | case CMD_GX_REQUEST_DMA: | ||
| 23 | { | ||
| 24 | u32* src = (u32*)Memory::GetPointer(command_buffer[1]); | ||
| 25 | u32* dst = (u32*)Memory::GetPointer(command_buffer[2]); | ||
| 26 | u32 size = command_buffer[3]; | ||
| 27 | memcpy(dst, src, size); | ||
| 28 | } | ||
| 29 | break; | ||
| 30 | |||
| 31 | default: | ||
| 32 | ERROR_LOG(OSHLE, "MRC::DataSynchronizationBarrier unknown command 0x%08X", command); | ||
| 33 | return -1; | ||
| 34 | } | ||
| 35 | |||
| 36 | return 0; | 14 | return 0; |
| 37 | } | 15 | } |
| 38 | 16 | ||
| 39 | /// Returns the coprocessor (in this case, syscore) command buffer pointer | 17 | /// Returns the coprocessor (in this case, syscore) command buffer pointer |
| 40 | Addr GetThreadCommandBuffer() { | 18 | Addr GetThreadCommandBuffer() { |
| 41 | // Called on insruction: mrc p15, 0, r0, c13, c0, 3 | 19 | // Called on insruction: mrc p15, 0, r0, c13, c0, 3 |
| 42 | // Returns an address in OSHLE memory for the CPU to read/write to | 20 | return Memory::KERNEL_MEMORY_VADDR; |
| 43 | RETURN(CMD_BUFFER_ADDR); | ||
| 44 | return CMD_BUFFER_ADDR; | ||
| 45 | } | 21 | } |
| 46 | 22 | ||
| 47 | /// Call an MCR (move to coprocessor from ARM register) instruction in HLE | 23 | /// Call an MCR (move to coprocessor from ARM register) instruction in HLE |
| @@ -49,7 +25,7 @@ s32 CallMCR(u32 instruction, u32 value) { | |||
| 49 | CoprocessorOperation operation = (CoprocessorOperation)((instruction >> 20) & 0xFF); | 25 | CoprocessorOperation operation = (CoprocessorOperation)((instruction >> 20) & 0xFF); |
| 50 | ERROR_LOG(OSHLE, "unimplemented MCR instruction=0x%08X, operation=%02X, value=%08X", | 26 | ERROR_LOG(OSHLE, "unimplemented MCR instruction=0x%08X, operation=%02X, value=%08X", |
| 51 | instruction, operation, value); | 27 | instruction, operation, value); |
| 52 | return -1; | 28 | return 0; |
| 53 | } | 29 | } |
| 54 | 30 | ||
| 55 | /// Call an MRC (move to ARM register from coprocessor) instruction in HLE | 31 | /// Call an MRC (move to ARM register from coprocessor) instruction in HLE |
| @@ -59,7 +35,7 @@ s32 CallMRC(u32 instruction) { | |||
| 59 | switch (operation) { | 35 | switch (operation) { |
| 60 | 36 | ||
| 61 | case DATA_SYNCHRONIZATION_BARRIER: | 37 | case DATA_SYNCHRONIZATION_BARRIER: |
| 62 | return DataSynchronizationBarrier((u32*)Memory::GetPointer(PARAM(0))); | 38 | return DataSynchronizationBarrier(); |
| 63 | 39 | ||
| 64 | case CALL_GET_THREAD_COMMAND_BUFFER: | 40 | case CALL_GET_THREAD_COMMAND_BUFFER: |
| 65 | return GetThreadCommandBuffer(); | 41 | return GetThreadCommandBuffer(); |
| @@ -68,7 +44,7 @@ s32 CallMRC(u32 instruction) { | |||
| 68 | ERROR_LOG(OSHLE, "unimplemented MRC instruction 0x%08X", instruction); | 44 | ERROR_LOG(OSHLE, "unimplemented MRC instruction 0x%08X", instruction); |
| 69 | break; | 45 | break; |
| 70 | } | 46 | } |
| 71 | return -1; | 47 | return 0; |
| 72 | } | 48 | } |
| 73 | 49 | ||
| 74 | } // namespace | 50 | } // namespace |