diff options
| author | 2014-04-08 19:25:03 -0400 | |
|---|---|---|
| committer | 2014-04-08 19:25:03 -0400 | |
| commit | 63e46abdb8764bc97e91bae862c8d461e61b1965 (patch) | |
| tree | e73f4aa25d7b4015a265e7bbfb6004dab7561027 /src/core/arm/arm_interface.h | |
| parent | fixed some license headers that I missed (diff) | |
| download | yuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.tar.gz yuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.tar.xz yuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.zip | |
got rid of 'src' folders in each sub-project
Diffstat (limited to 'src/core/arm/arm_interface.h')
| -rw-r--r-- | src/core/arm/arm_interface.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h new file mode 100644 index 000000000..eee2f6240 --- /dev/null +++ b/src/core/arm/arm_interface.h | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "common.h" | ||
| 8 | #include "common_types.h" | ||
| 9 | |||
| 10 | /// Generic ARM11 CPU interface | ||
| 11 | class ARM_Interface { | ||
| 12 | public: | ||
| 13 | ARM_Interface() { | ||
| 14 | num_instructions_ = 0; | ||
| 15 | } | ||
| 16 | |||
| 17 | ~ARM_Interface() { | ||
| 18 | } | ||
| 19 | |||
| 20 | /// Step CPU by one instruction | ||
| 21 | void Step() { | ||
| 22 | ExecuteInstruction(); | ||
| 23 | num_instructions_++; | ||
| 24 | } | ||
| 25 | |||
| 26 | /** | ||
| 27 | * Set the Program Counter to an address | ||
| 28 | * @param addr Address to set PC to | ||
| 29 | */ | ||
| 30 | virtual void SetPC(u32 addr) = 0; | ||
| 31 | |||
| 32 | /* | ||
| 33 | * Get the current Program Counter | ||
| 34 | * @return Returns current PC | ||
| 35 | */ | ||
| 36 | virtual u32 PC() = 0; | ||
| 37 | |||
| 38 | /** | ||
| 39 | * Get an ARM register | ||
| 40 | * @param index Register index (0-15) | ||
| 41 | * @return Returns the value in the register | ||
| 42 | */ | ||
| 43 | virtual u32 Reg(int index) = 0; | ||
| 44 | |||
| 45 | /** | ||
| 46 | * Get the current CPSR register | ||
| 47 | * @return Returns the value of the CPSR register | ||
| 48 | */ | ||
| 49 | virtual u32 CPSR() = 0; | ||
| 50 | |||
| 51 | /** | ||
| 52 | * Returns the number of clock ticks since the last rese | ||
| 53 | * @return Returns number of clock ticks | ||
| 54 | */ | ||
| 55 | virtual u64 GetTicks() = 0; | ||
| 56 | |||
| 57 | /// Getter for num_instructions_ | ||
| 58 | u64 num_instructions() { return num_instructions_; } | ||
| 59 | |||
| 60 | private: | ||
| 61 | |||
| 62 | /// Execture next instruction | ||
| 63 | virtual void ExecuteInstruction() = 0; | ||
| 64 | |||
| 65 | u64 num_instructions_; ///< Number of instructions executed | ||
| 66 | |||
| 67 | DISALLOW_COPY_AND_ASSIGN(ARM_Interface); | ||
| 68 | }; | ||