1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-28 07:29:45 +00:00

Merge branch 'STOPReturn' into InST

This commit is contained in:
Thomas Harte 2022-06-16 15:11:06 -04:00
commit 9fde7c0f89
2 changed files with 9 additions and 0 deletions

View File

@ -382,6 +382,13 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor
// Apply the suffix status.
status_.set_status(prefetch_.w);
did_update_status();
// Ensure that after this STOP exits, the eventual RTE returns to
// after the STOP rather than to it. Unlike most instructions, STOP
// has not prefetched the next instruction, so the program counter
// is at the actual return point, not beyond it.
instruction_address_.l = program_counter_.l;
[[fallthrough]];
BeginState(WaitForInterrupt):

View File

@ -401,7 +401,9 @@ void IPF::add_unencoded_data(std::vector<Storage::Disk::PCMSegment> &track, Time
segment.length_of_a_bit = bit_length;
// Length appears to be in pre-encoded bits; double that to get encoded bits.
#ifndef NDEBUG
const auto byte_length = (num_bits + 7) >> 3;
#endif
segment.data.reserve(num_bits * 16);
auto encoder = Storage::Encodings::MFM::GetMFMEncoder(segment.data);