1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-22 12:33:29 +00:00

Adds a route to not bumping time.

This commit is contained in:
Thomas Harte 2019-07-29 17:17:04 -04:00
parent 2f2478d2d3
commit 9859f99513
2 changed files with 11 additions and 1 deletions

View File

@ -38,6 +38,11 @@ template <class T, class LocalTimeScale, class TargetTimeScale = LocalTimeScale>
return &object_;
}
/// Returns a pointer to the included object without flushing time.
inline T *last_valid() {
return &object_;
}
/// Flushes all accumulated time.
inline void flush() {
if(!is_flushed_) object_.run_for(time_since_update_.template flush<TargetTimeScale>());
@ -80,6 +85,11 @@ template <class T, class LocalTimeScale, class TargetTimeScale = LocalTimeScale>
return &object_;
}
/// Returns a pointer to the included object without flushing time.
inline T *last_valid() {
return &object_;
}
/// Flushes all accumulated time.
inline void flush() {
if(!is_flushed_) {

View File

@ -237,7 +237,7 @@ class ConcreteMachine:
*cycle.value = vdp_->get_current_line();
break;
case 0x41:
*cycle.value = vdp_->get_latched_horizontal_counter();
*cycle.value = vdp_.last_valid()->get_latched_horizontal_counter();
break;
case 0x80: case 0x81:
*cycle.value = vdp_->get_register(address);