From 7a673a24485f7892185b1e25f1a49138f4d2bdc8 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 6 Jul 2021 20:23:09 -0400 Subject: [PATCH] Avoid confusing temporary storage. --- Machines/Enterprise/Dave.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Machines/Enterprise/Dave.cpp b/Machines/Enterprise/Dave.cpp index 00a4c1ad6..39a152630 100644 --- a/Machines/Enterprise/Dave.cpp +++ b/Machines/Enterprise/Dave.cpp @@ -323,8 +323,10 @@ Cycles TimedInterruptSource::get_next_sequence_point() const { const auto &channel = channels_[int(rate_) - int(InterruptRate::ToneGenerator0)]; const int cycles_until_interrupt = channel.value + 1 + (!channel.level) * (channel.reload + 1); - int result = 250'000 - (two_second_counter_ % 250'000); - return Cycles(std::min(result, cycles_until_interrupt)); + return Cycles(std::min( + 250'000 - (two_second_counter_ % 250'000), + cycles_until_interrupt + )); } } }