1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-26 09:29:45 +00:00

Merge pull request #66 from TomHarte/CheckOnlyWhenNeeded

Takes one more test out of the operation loop
This commit is contained in:
Thomas Harte 2016-10-30 20:31:34 -04:00 committed by GitHub
commit 1333a42a78
2 changed files with 4 additions and 5 deletions

View File

@ -24,9 +24,7 @@ class AllSuiteATests: XCTestCase {
machine.runForNumber(ofCycles: 1000)
}
if machine.value(forAddress: 0x0210) != 0xff {
NSException(name: NSExceptionName(rawValue: "Failed AllSuiteA"), reason: "Failed test \(machine.value(forAddress: 0x0210))", userInfo: nil).raise()
}
XCTAssert(machine.value(forAddress: 0x0210) == 0xff, "Failed test \(machine.value(forAddress: 0x0210))")
}
}
}

View File

@ -620,7 +620,8 @@ template <class T> class Processor {
_interrupt_requests = (_interrupt_requests & ~InterruptRequestFlags::IRQ) | _irq_request_history; \
_irq_request_history = _irq_line & _inverseInterruptFlag; \
number_of_cycles -= static_cast<T *>(this)->perform_bus_operation(nextBusOperation, busAddress, busValue); \
nextBusOperation = BusOperation::None;
nextBusOperation = BusOperation::None; \
if(number_of_cycles <= 0) break;
checkSchedule();
number_of_cycles += _cycles_left_to_run;
@ -639,7 +640,7 @@ template <class T> class Processor {
bus_access();
}
while(number_of_cycles > 0) {
while(1) {
const MicroOp cycle = program[scheduleProgramProgramCounter];
scheduleProgramProgramCounter++;