From 7de11812133abe952edb75106258e8fd726dc0d3 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 3 Jan 2020 23:44:49 -0500 Subject: [PATCH] Make a new guess at post-overflow DIV flags, based on tests. Specifically: for DIVU, stick with the current guess of a fixed set. For DIVS, leave N and Z alone. --- .../68000/Implementation/68000Implementation.hpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/Processors/68000/Implementation/68000Implementation.hpp b/Processors/68000/Implementation/68000Implementation.hpp index 02679660d..b287c398b 100644 --- a/Processors/68000/Implementation/68000Implementation.hpp +++ b/Processors/68000/Implementation/68000Implementation.hpp @@ -86,9 +86,6 @@ template void Proces } if(active_step_->microcycle.data_select_active()) { - // TODO: if valid peripheral address is asserted, substitute a - // synhronous bus access. - // Check whether the processor needs to await DTack. if(!dtack_is_implicit && !dtack_ && !bus_error_) { execution_state_ = ExecutionState::WaitingForDTack; @@ -999,12 +996,8 @@ template void Proces const auto quotient = dividend / divisor; // If overflow would occur, appropriate flags are set and the result is not written back. - if(quotient >= 65536) { - overflow_flag_ = - zero_result_ = - negative_flag_ = 1; - // TODO: Zero and Negative flags as above are merely sufficient - // to satisfy the tests I currentl have. What should they really be? + if(quotient > 65535) { + overflow_flag_ = zero_result_ = negative_flag_ = 1; set_next_microcycle_length(HalfCycles(3*2*2)); break; } @@ -1075,11 +1068,6 @@ template void Proces if(quotient > 32767) { overflow_flag_ = 1; set_next_microcycle_length(HalfCycles(6*2*2)); - - // These are officially undefined for results that overflow, so the below is a guess. - zero_result_ = decltype(zero_result_)(dividend); - negative_flag_ = zero_result_ & 0x8000; - break; }