diff --git a/OSBindings/Mac/Clock SignalTests/EmuTOSTests.mm b/OSBindings/Mac/Clock SignalTests/EmuTOSTests.mm index 7136ab7d4..a2f578ee0 100644 --- a/OSBindings/Mac/Clock SignalTests/EmuTOSTests.mm +++ b/OSBindings/Mac/Clock SignalTests/EmuTOSTests.mm @@ -77,9 +77,11 @@ class EmuTOS: public CPU::MC68000::BusHandler { cycle.value->halves.low = (is_peripheral ? peripheral_result : base[word_address]) >> cycle.byte_shift(); break; case Microcycle::SelectWord: + assert(!(is_rom && !is_peripheral)); base[word_address] = cycle.value->full; break; case Microcycle::SelectByte: + assert(!(is_rom && !is_peripheral)); base[word_address] = (cycle.value->full & cycle.byte_mask()) | (base[word_address] & (0xffff ^ cycle.byte_mask())); break; } diff --git a/Processors/68000/Implementation/68000Implementation.hpp b/Processors/68000/Implementation/68000Implementation.hpp index 7e829c923..1e9f08a31 100644 --- a/Processors/68000/Implementation/68000Implementation.hpp +++ b/Processors/68000/Implementation/68000Implementation.hpp @@ -52,6 +52,12 @@ template void Processor: // no instruction was ongoing. Either way, do a standard instruction operation. // TODO: unless an interrupt is pending, or the trap flag is set. + std::cout << std::setw(8) << std::right; + std::cout << (extend_flag_ ? 'x' : '-') << (negative_flag_ ? 'n' : '-') << (zero_result_ ? '-' : 'z'); + std::cout << (overflow_flag_ ? 'v' : '-') << (carry_flag_ ? 'c' : '-') << '\t'; + for(int c = 0; c < 8; ++ c) std::cout << "d" << c << ":" << data_[c].full << " "; + for(int c = 0; c < 8; ++ c) std::cout << "a" << c << ":" << address_[c].full << " "; + std::cout << std::endl; decoded_instruction_ = prefetch_queue_.halves.high.full; if(!instructions[decoded_instruction_].micro_operations) { @@ -59,12 +65,7 @@ template void Processor: std::cerr << "68000 Abilities exhausted; can't manage instruction " << std::hex << decoded_instruction_ << " from " << (program_counter_.full - 4) << std::endl; return; } else { - for(int c = 0; c < 8; ++ c) std::cout << "d" << c << ":" << data_[c].full << " "; - for(int c = 0; c < 8; ++ c) std::cout << "a" << c << ":" << address_[c].full << " "; - std::cout << std::endl; - std::cout << std::hex << (program_counter_.full - 4) << ": " << decoded_instruction_ << '\t'; - std::cout << (extend_flag_ ? 'x' : '-') << (negative_flag_ ? 'n' : '-') << (zero_result_ ? '-' : 'z'); - std::cout << (overflow_flag_ ? 'v' : '-') << (carry_flag_ ? 'c' : '-') << '\t'; + std::cout << std::hex << (program_counter_.full - 4) << ": " << std::setw(4) << decoded_instruction_ << '\t'; } active_program_ = &instructions[decoded_instruction_]; @@ -194,7 +195,7 @@ template void Processor: active_micro_op_->bus_program = branch_taken_bus_steps_; } else { if(byte_offset) { - active_micro_op_->bus_program = branch_byte_not_taken_bus_steps_; + active_micro_op_->bus_program = branch_byte_not_taken_bus_steps_; } else { active_micro_op_->bus_program = branch_word_not_taken_bus_steps_; } diff --git a/Processors/68000/Implementation/68000Storage.cpp b/Processors/68000/Implementation/68000Storage.cpp index 7de81ba5a..7fa81a33b 100644 --- a/Processors/68000/Implementation/68000Storage.cpp +++ b/Processors/68000/Implementation/68000Storage.cpp @@ -1546,10 +1546,8 @@ struct ProcessorStorageConstructor { l2(combined_source_mode, combined_destination_mode) : bw2(combined_source_mode, combined_destination_mode); - // If the move is to an address register, switch the MOVE to a MOVEA and - // pretend it's to a data register; if the move is from an address register - // then just call it a move from a data register. - if(ea_mode == 0x01) { + // If the move is to an address register, switch the MOVE to a MOVEA. + if(destination_mode == 0x01) { operation = is_long_word_access ? Operation::MOVEAl : Operation::MOVEAw; }