1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-05 10:28:58 +00:00

DSKLEN has to be written twice.

This commit is contained in:
Thomas Harte 2021-10-11 06:16:01 -07:00
parent 6acddfdb98
commit 7733fef3bd
2 changed files with 11 additions and 6 deletions

View File

@ -922,14 +922,18 @@ void Chipset::DiskDMA::enqueue(uint16_t value, bool matches_sync) {
}
void Chipset::DiskDMA::set_length(uint16_t value) {
dma_enable_ = value & 0x8000;
write_ = value & 0x4000;
length_ = value & 0x3fff;
buffer_read_ = buffer_write_ = 0;
if(value == last_set_length_) {
dma_enable_ = value & 0x8000;
write_ = value & 0x4000;
length_ = value & 0x3fff;
buffer_read_ = buffer_write_ = 0;
if(dma_enable_) {
LOG("Disk DMA [" << (write_ ? "write" : "read") << " of " << length_ << " to " << PADHEX(8) << pointer_[0]);
if(dma_enable_) {
LOG("Disk DMA " << (write_ ? "write" : "read") << " of " << length_ << " to " << PADHEX(8) << pointer_[0]);
}
}
last_set_length_ = value;
}
bool Chipset::DiskDMA::advance() {

View File

@ -282,6 +282,7 @@ class Chipset: private ClockingHint::Observer {
uint16_t length_;
bool dma_enable_ = false;
bool write_ = false;
uint16_t last_set_length_ = 0;
std::array<uint16_t, 4> buffer_;
size_t buffer_read_ = 0, buffer_write_ = 0;