1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-03 11:30:02 +00:00

Fixes cycle counting in the test machine.

This commit is contained in:
Thomas Harte 2019-06-24 17:55:09 -04:00
parent c8b769de8a
commit 0e208ed432
2 changed files with 8 additions and 11 deletions

View File

@ -75,7 +75,7 @@ class RAM68000: public CPU::MC68000::BusHandler {
HalfCycles perform_bus_operation(const CPU::MC68000::Microcycle &cycle, int is_supervisor) {
const uint32_t word_address = cycle.word_address();
duration_ += cycle.length;
if(instructions_remaining_) duration_ += cycle.length;
using Microcycle = CPU::MC68000::Microcycle;
if(cycle.data_select_active()) {

View File

@ -204,7 +204,12 @@ struct ProcessorStorageConstructor {
}
// Do nothing, but with a length that definitely won't map it to the other do-nothings.
if(token == "r"){
if(token == "r") {
#ifndef NDEBUG
// If this is a debug build, not where the resizeable microcycle is
// (and double check that there's only the one).
step.microcycle.is_resizeable = true;
#endif
step.microcycle.length = HalfCycles(0);
steps.push_back(step);
continue;
@ -807,7 +812,7 @@ struct ProcessorStorageConstructor {
// Temporary storage for the Program fields.
ProcessorBase::Program program;
// if(instruction == 0xe378) {
// if(instruction == 0xe569) {
// printf("");
// }
@ -3051,14 +3056,6 @@ struct ProcessorStorageConstructor {
storage_.interrupt_micro_ops_ = &storage_.all_micro_ops_[interrupt_pointer];
link_operations(storage_.interrupt_micro_ops_, &arbitrary_base);
// If this is a debug build, not where the resizeable microcycle is
// (and double check that there's only the one).
#ifndef NDEBUG
for(auto &bus_step: storage_.all_bus_steps_) {
bus_step.microcycle.is_resizeable = bus_step.microcycle.length == HalfCycles(0);
}
#endif
std::cout << storage_.all_bus_steps_.size() << " total steps" << std::endl;
}