1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-25 18:30:21 +00:00

Moved cycle count test down to the only places where it may actually yield a different result.

This commit is contained in:
Thomas Harte 2016-10-30 20:13:44 -04:00
parent 58f888c6ad
commit 9309be229c

View File

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