diff --git a/Machines/ZX8081/ZX8081.cpp b/Machines/ZX8081/ZX8081.cpp index 8c6dc32d8..43994044a 100644 --- a/Machines/ZX8081/ZX8081.cpp +++ b/Machines/ZX8081/ZX8081.cpp @@ -29,7 +29,7 @@ Machine::Machine() : clear_all_keys(); } -int Machine::perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) { +Cycles Machine::perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) { HalfCycles previous_counter = horizontal_counter_; horizontal_counter_ += cycle.length; @@ -65,7 +65,7 @@ int Machine::perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) { } if(!cycle.is_terminal()) { - return 0; + return Cycles(0); } uint16_t address = cycle.address ? *cycle.address : 0; @@ -182,7 +182,7 @@ int Machine::perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) { if(typer_) typer_->update(cycle.length.as_int()); - return 0; + return Cycles(0); } void Machine::flush() { diff --git a/Machines/ZX8081/ZX8081.hpp b/Machines/ZX8081/ZX8081.hpp index 031ce8b7e..a27d3d380 100644 --- a/Machines/ZX8081/ZX8081.hpp +++ b/Machines/ZX8081/ZX8081.hpp @@ -47,7 +47,7 @@ class Machine: public: Machine(); - int perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle); + Cycles perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle); void flush(); void setup_output(float aspect_ratio); diff --git a/Processors/Z80/Z80.hpp b/Processors/Z80/Z80.hpp index 035b255cd..2fe5df078 100644 --- a/Processors/Z80/Z80.hpp +++ b/Processors/Z80/Z80.hpp @@ -888,7 +888,7 @@ template class Processor: public ClockReceiver> { while(bus_request_line_) { static PartialMachineCycle bus_acknowledge_cycle = {PartialMachineCycle::BusAcknowledge, 1, nullptr, nullptr, false}; - number_of_cycles_ -= Cycles(static_cast(this)->perform_machine_cycle(bus_acknowledge_cycle) + 1); + number_of_cycles_ -= static_cast(this)->perform_machine_cycle(bus_acknowledge_cycle) + Cycles(1); if(!number_of_cycles_) { static_cast(this)->flush(); return; @@ -1703,8 +1703,8 @@ template class Processor: public ClockReceiver> { */ void flush() {} - int perform_machine_cycle(const PartialMachineCycle &cycle) { - return 0; + Cycles perform_machine_cycle(const PartialMachineCycle &cycle) { + return Cycles(0); } /*! diff --git a/Processors/Z80/Z80AllRAM.cpp b/Processors/Z80/Z80AllRAM.cpp index bd6e4caa5..982231fc3 100644 --- a/Processors/Z80/Z80AllRAM.cpp +++ b/Processors/Z80/Z80AllRAM.cpp @@ -16,10 +16,10 @@ class ConcreteAllRAMProcessor: public AllRAMProcessor, public Processorz80_all_ram_processor_did_perform_bus_operation(*this, cycle.operation, address, cycle.value ? *cycle.value : 0x00, timestamp_); } - return 0; + return Cycles(0); } void run_for(const Cycles &cycles) {