hle.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "common/common_types.h"
  6. #include "core/core.h"
  7. ////////////////////////////////////////////////////////////////////////////////////////////////////
  8. #define PARAM(n) Core::g_app_core->GetReg(n)
  9. #define PARAM64(n) (Core::g_app_core->GetReg(n) | ((u64)Core::g_app_core->GetReg(n + 1) << 32))
  10. #define RETURN(n) Core::g_app_core->SetReg(0, n)
  11. ////////////////////////////////////////////////////////////////////////////////////////////////////
  12. namespace HLE {
  13. typedef u32 Addr;
  14. typedef void (*Func)();
  15. struct FunctionDef {
  16. u32 id;
  17. Func func;
  18. std::string name;
  19. };
  20. struct ModuleDef {
  21. std::string name;
  22. int num_funcs;
  23. const FunctionDef* func_table;
  24. };
  25. void RegisterModule(std::string name, int num_functions, const FunctionDef *func_table);
  26. void CallSyscall(u32 opcode);
  27. void EatCycles(u32 cycles);
  28. void ReSchedule(const char *reason);
  29. void Init();
  30. void Shutdown();
  31. } // namespace