ARM: pass MemorySystem separately in the constructor and make System optional

So that unit test can test CPU without constructing the entire system. Also remove hacks in the System class
This commit is contained in:
Weiyi Wang
2019-02-01 14:50:25 -05:00
parent 9573ee46bd
commit 64f6e5e597
14 changed files with 80 additions and 65 deletions

View File

@ -14,9 +14,14 @@ namespace Core {
struct System;
}
namespace Memory {
class MemorySystem;
}
class ARM_DynCom final : public ARM_Interface {
public:
explicit ARM_DynCom(Core::System& system, PrivilegeMode initial_mode);
explicit ARM_DynCom(Core::System* system, Memory::MemorySystem& memory,
PrivilegeMode initial_mode);
~ARM_DynCom();
void Run() override;
@ -48,6 +53,6 @@ public:
private:
void ExecuteInstructions(u64 num_instructions);
Core::System& system;
Core::System* system;
std::unique_ptr<ARMul_State> state;
};