coprocessor.cpp 882 B

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2
  3. // Refer to the license.txt file included.
  4. #include "core/hle/coprocessor.h"
  5. #include "core/hle/hle.h"
  6. #include "core/mem_map.h"
  7. #include "core/core.h"
  8. namespace HLE {
  9. /// Returns the coprocessor (in this case, syscore) command buffer pointer
  10. Addr GetThreadCommandBuffer() {
  11. // Called on insruction: mrc p15, 0, r0, c13, c0, 3
  12. return Memory::KERNEL_MEMORY_VADDR;
  13. }
  14. /// Call an MRC (move to ARM register from coprocessor) instruction in HLE
  15. s32 CallMRC(u32 instruction) {
  16. CoprocessorOperation operation = (CoprocessorOperation)((instruction >> 20) & 0xFF);
  17. switch (operation) {
  18. case CALL_GET_THREAD_COMMAND_BUFFER:
  19. return GetThreadCommandBuffer();
  20. default:
  21. DEBUG_LOG(OSHLE, "unknown MRC call 0x%08X", instruction);
  22. break;
  23. }
  24. return -1;
  25. }
  26. } // namespace