1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-25 16:31:42 +00:00

Simplify control flow.

This commit is contained in:
Thomas Harte 2021-10-14 16:47:18 -07:00
parent 253a199f27
commit e27a10bde4

View File

@ -1082,15 +1082,17 @@ void Chipset::DiskController::process_input_bit(int value) {
data_ = uint16_t((data_ << 1) | value); data_ = uint16_t((data_ << 1) | value);
++bit_count_; ++bit_count_;
if(data_ == sync_word_) { const bool sync_matches = data_ == sync_word_;
if(sync_matches) {
chipset_.posit_interrupt(InterruptFlag::DiskSyncMatch); chipset_.posit_interrupt(InterruptFlag::DiskSyncMatch);
if(sync_with_word_) {
bit_count_ = 0;
}
} }
if(sync_with_word_ && data_ == sync_word_) { if(!(bit_count_ & 15)) {
disk_dma_.enqueue(data_, true); disk_dma_.enqueue(data_, sync_matches);
bit_count_ = 0;
} else if(!(bit_count_&15)) {
disk_dma_.enqueue(data_, false);
} }
} }