1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-03 11:30:02 +00:00

Corrects PEA and adds an additional debugging aid.

This commit is contained in:
Thomas Harte 2019-05-29 12:47:17 -04:00
parent fcda376f33
commit 77b08febdb
2 changed files with 10 additions and 1 deletions

View File

@ -261,6 +261,13 @@ template <class T, bool dtack_is_implicit, bool signal_will_perform> void Proces
#endif
decoded_instruction_.full = prefetch_queue_.halves.high.full;
#ifndef NDEBUG
/* Debugging feature: reset the effective addresses and data latches, so that it's
more obvious if some of the instructions aren't properly feeding them. */
effective_address_[0].full = effective_address_[1].full = source_bus_data_[0].full = destination_bus_data_[0].full = 0x12344321;
#endif
#ifdef LOG_TRACE
if(should_log) {
std::cout << std::hex << (program_counter_.full - 4) << ": " << std::setw(4) << decoded_instruction_.full << '\t';
@ -272,7 +279,7 @@ template <class T, bool dtack_is_implicit, bool signal_will_perform> void Proces
}
#ifdef LOG_TRACE
should_log |= ((program_counter_.full - 4) == 0x40103e);
should_log |= ((program_counter_.full - 4) == 0x4058dc); // 0x40103e
#endif
if(instructions[decoded_instruction_.full].micro_operations) {

View File

@ -2407,6 +2407,7 @@ struct ProcessorStorageConstructor {
case XXXl: // PEA (XXX).l
case XXXw: // PEA (XXX).w
storage_.instructions[instruction].source = &storage_.effective_address_[0];
op(int(Action::CopyToEffectiveAddress) | MicroOp::DestinationMask, (mode == XXXl) ? seq("np") : nullptr);
op(address_assemble_for_mode(mode) | MicroOp::SourceMask);
op(Action::PerformOperation, seq("np nW+ nw np", { ea(1), ea(1) }));
@ -2416,6 +2417,7 @@ struct ProcessorStorageConstructor {
case d16PC: // PEA (d16, PC)
case d8AnXn: // PEA (d8, An, Xn)
case d8PCXn: // PEA (d8, PC, Xn)
storage_.instructions[instruction].source = &storage_.effective_address_[0];
op(int(Action::CopyToEffectiveAddress) | MicroOp::DestinationMask);
op(calc_action_for_mode(mode) | MicroOp::SourceMask, seq(pseq("np", mode)));
op(Action::PerformOperation, seq(pseq("np nW+ nw", mode), { ea(1), ea(1) }));