arm_interpreter.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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.h"
  6. #include "core/arm/arm_interface.h"
  7. #include "core/arm/interpreter/armdefs.h"
  8. #include "core/arm/interpreter/armemu.h"
  9. class ARM_Interpreter : virtual public ARM_Interface {
  10. public:
  11. ARM_Interpreter();
  12. ~ARM_Interpreter();
  13. /**
  14. * Set the Program Counter to an address
  15. * @param addr Address to set PC to
  16. */
  17. void SetPC(u32 pc);
  18. /*
  19. * Get the current Program Counter
  20. * @return Returns current PC
  21. */
  22. u32 GetPC() const;
  23. /**
  24. * Get an ARM register
  25. * @param index Register index (0-15)
  26. * @return Returns the value in the register
  27. */
  28. u32 GetReg(int index) const;
  29. /**
  30. * Set an ARM register
  31. * @param index Register index (0-15)
  32. * @param value Value to set register to
  33. */
  34. void SetReg(int index, u32 value);
  35. /**
  36. * Get the current CPSR register
  37. * @return Returns the value of the CPSR register
  38. */
  39. u32 GetCPSR() const;
  40. /**
  41. * Returns the number of clock ticks since the last reset
  42. * @return Returns number of clock ticks
  43. */
  44. u64 GetTicks() const;
  45. protected:
  46. /// Execture next instruction
  47. void ExecuteInstruction();
  48. private:
  49. ARMul_State* m_state;
  50. };