From c4cbe9476c3def3d5d887f1e2f9a5e63fecdaba7 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 2 Jul 2019 13:54:21 -0400 Subject: [PATCH] Corrects EA selection logic, fixing MOVEP. --- Processors/68000/Implementation/68000Storage.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Processors/68000/Implementation/68000Storage.cpp b/Processors/68000/Implementation/68000Storage.cpp index 9524ee894..a9e915d0d 100644 --- a/Processors/68000/Implementation/68000Storage.cpp +++ b/Processors/68000/Implementation/68000Storage.cpp @@ -361,12 +361,11 @@ struct ProcessorStorageConstructor { step.microcycle.operation = Microcycle::SameAddress | (is_read ? Microcycle::Read : 0) | (read_full_words ? Microcycle::SelectWord : Microcycle::SelectByte); if(post_adjustment) { - // nr and nR should affect address 0; nw, nW, nrd and nRd should affect address 1. - if(tolower(access_pattern[1]) == 'r' && token_length == 2) { + assert((*address_iterator == &storage_.effective_address_[0].full) || (*address_iterator == &storage_.effective_address_[1].full)); + if(*address_iterator == &storage_.effective_address_[0].full) { step.action = (post_adjustment > 0) ? Action::IncrementEffectiveAddress0 : Action::DecrementEffectiveAddress0; } else { step.action = (post_adjustment > 0) ? Action::IncrementEffectiveAddress1 : Action::DecrementEffectiveAddress1; - } } steps.push_back(step);