From ad8b68c99801c3fcd8279e3887fab19e12ae03bd Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 11 Jun 2019 19:53:51 -0400 Subject: [PATCH] Switches to a proper form of zero-upon-read data. Not that it's necessarily correct. --- Components/DiskII/IWM.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Components/DiskII/IWM.cpp b/Components/DiskII/IWM.cpp index 90205339d..bf94fc118 100644 --- a/Components/DiskII/IWM.cpp +++ b/Components/DiskII/IWM.cpp @@ -58,13 +58,17 @@ uint8_t IWM::read(int address) { // return 0xff; case 0: - case ENABLE: /* Read data register. */ + case ENABLE: { /* Read data register. */ + const auto result = data_register_; + if(data_register_ & 0x80) { printf("[%02x] ", data_register_); -// data_register_ = 0; + data_register_ = 0; } printf("Reading data register\n"); - return data_register_; + + return result; + } case Q6: case Q6|ENABLE: { /* @@ -108,7 +112,8 @@ uint8_t IWM::read(int address) { // case CA0|SEL: // Disk locked (i.e. write-protect tab). printf("disk locked)\n"); - sense = drives_[active_drive_] && drives_[active_drive_]->get_is_read_only() ? 0x00 : 0x80; +// sense = drives_[active_drive_] && drives_[active_drive_]->get_is_read_only() ? 0x00 : 0x80; + sense = drives_[active_drive_] && drives_[active_drive_]->get_is_read_only() ? 0x80 : 0x00; break; case CA1: // Disk motor running.