match cpu registers on reset to hardware, cleanup

This commit is contained in:
scawful
2024-04-25 00:50:39 -04:00
parent b4f2fdc57e
commit d76525201f
6 changed files with 18 additions and 79 deletions

View File

@@ -36,18 +36,12 @@ class InstructionEntry {
std::string instruction; // Human-readable instruction text
};
const int kCpuClockSpeed = 21477272; // 21.477272 MHz
class Cpu : public Loggable, public core::ExperimentFlags {
public:
explicit Cpu(memory::Memory& mem, Clock& vclock,
memory::CpuCallbacks& callbacks)
: memory(mem), clock(vclock), callbacks_(callbacks) {}
enum class UpdateMode { Run, Step, Pause };
void Init(bool verbose = false) { clock.SetFrequency(kCpuClockSpeed); }
void Reset(bool hard = false);
void Update(UpdateMode mode = UpdateMode::Run, int stepCount = 1);
void RunOpcode();