mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-12 00:30:31 +00:00
Fixes cycle counting in the test machine.
This commit is contained in:
parent
c8b769de8a
commit
0e208ed432
@ -75,7 +75,7 @@ class RAM68000: public CPU::MC68000::BusHandler {
|
|||||||
|
|
||||||
HalfCycles perform_bus_operation(const CPU::MC68000::Microcycle &cycle, int is_supervisor) {
|
HalfCycles perform_bus_operation(const CPU::MC68000::Microcycle &cycle, int is_supervisor) {
|
||||||
const uint32_t word_address = cycle.word_address();
|
const uint32_t word_address = cycle.word_address();
|
||||||
duration_ += cycle.length;
|
if(instructions_remaining_) duration_ += cycle.length;
|
||||||
|
|
||||||
using Microcycle = CPU::MC68000::Microcycle;
|
using Microcycle = CPU::MC68000::Microcycle;
|
||||||
if(cycle.data_select_active()) {
|
if(cycle.data_select_active()) {
|
||||||
|
@ -205,6 +205,11 @@ struct ProcessorStorageConstructor {
|
|||||||
|
|
||||||
// Do nothing, but with a length that definitely won't map it to the other do-nothings.
|
// 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);
|
step.microcycle.length = HalfCycles(0);
|
||||||
steps.push_back(step);
|
steps.push_back(step);
|
||||||
continue;
|
continue;
|
||||||
@ -807,7 +812,7 @@ struct ProcessorStorageConstructor {
|
|||||||
// Temporary storage for the Program fields.
|
// Temporary storage for the Program fields.
|
||||||
ProcessorBase::Program program;
|
ProcessorBase::Program program;
|
||||||
|
|
||||||
// if(instruction == 0xe378) {
|
// if(instruction == 0xe569) {
|
||||||
// printf("");
|
// printf("");
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@ -3051,14 +3056,6 @@ struct ProcessorStorageConstructor {
|
|||||||
storage_.interrupt_micro_ops_ = &storage_.all_micro_ops_[interrupt_pointer];
|
storage_.interrupt_micro_ops_ = &storage_.all_micro_ops_[interrupt_pointer];
|
||||||
link_operations(storage_.interrupt_micro_ops_, &arbitrary_base);
|
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;
|
std::cout << storage_.all_bus_steps_.size() << " total steps" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user