mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-26 15:32:04 +00:00
Corrects duration-based iteration.
This commit is contained in:
parent
adef2e9b4e
commit
6e9ce50569
@ -108,6 +108,7 @@ template <
|
||||
|
||||
// Temporary implementation: just interpret.
|
||||
program_.clear();
|
||||
program_index_ = 0;
|
||||
static_cast<Executor *>(this)->parse(address, ProgramCounterType(max_address));
|
||||
|
||||
// const auto page = find_page(address);
|
||||
@ -149,8 +150,9 @@ template <
|
||||
while(remaining_duration_ > 0) {
|
||||
has_branched_ = false;
|
||||
while(remaining_duration_ > 0 && !has_branched_) {
|
||||
(static_cast<Executor *>(this)->*performers_[program_index_])();
|
||||
const auto performer = performers_[program_[program_index_]];
|
||||
++program_index_;
|
||||
(static_cast<Executor *>(this)->*performer)();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ template<bool is_brk> inline void Executor::perform_interrupt() {
|
||||
}
|
||||
|
||||
template <Operation operation, AddressingMode addressing_mode> void Executor::perform() {
|
||||
printf("%04x\t%02x\t%d %d\t[x:%02x s:%02x]\n", program_counter_ & 0x1fff, memory_[program_counter_ & 0x1fff], int(operation), int(addressing_mode), x_, s_);
|
||||
printf("%04x\t%02x\t%d %d\t[x:%02x s:%02x]\t(%s)\n", program_counter_ & 0x1fff, memory_[program_counter_ & 0x1fff], int(operation), int(addressing_mode), x_, s_, __PRETTY_FUNCTION__ );
|
||||
|
||||
// Post cycle cost; this emulation _does not provide accurate timing_.
|
||||
// TODO: post actual cycle counts. For now count instructions only.
|
||||
|
Loading…
x
Reference in New Issue
Block a user