Add VirtualClock, MockClock, dependency injection

This commit is contained in:
scawful
2023-08-20 23:45:56 -04:00
parent 2084f2d5a5
commit d538317629
9 changed files with 62 additions and 26 deletions

View File

@@ -70,7 +70,7 @@ uint8_t CPU::FetchByteDirectPage(uint8_t operand) {
}
void CPU::Update() {
auto cycles_to_run = GetCycleCount();
auto cycles_to_run = clock.GetCycleCount();
// Execute the calculated number of cycles
for (int i = 0; i < cycles_to_run; i++) {