diff --git a/Components/DiskII/IWM.cpp b/Components/DiskII/IWM.cpp index 6e2a0553c..2c6af7ee6 100644 --- a/Components/DiskII/IWM.cpp +++ b/Components/DiskII/IWM.cpp @@ -102,7 +102,7 @@ uint8_t IWM::read(int address) { case SEL: // Disk in place. LOG("disk in place)"); - sense = drives_[active_drive_] && drives_[active_drive_]->has_disk() ? 0x00 : 0x80; + sense = drives_[active_drive_] && drives_[active_drive_]->has_disk() ? 0 : 1; break; // case CA0: // Disk head step completed (1 = still stepping?). @@ -112,21 +112,21 @@ uint8_t IWM::read(int address) { case CA0|SEL: // Disk locked (i.e. write-protect tab). LOG("disk locked)"); // 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; + sense = drives_[active_drive_] && drives_[active_drive_]->get_is_read_only() ? 1 : 0; break; case CA1: // Disk motor running. LOG("disk motor running)"); - sense = drives_[active_drive_] && drives_[active_drive_]->get_motor_on() ? 0x00 : 0x80; + sense = drives_[active_drive_] && drives_[active_drive_]->get_motor_on() ? 0 : 1; break; case CA1|SEL: // Head at track 0. LOG("head at track 0)"); - sense = drives_[active_drive_] && drives_[active_drive_]->get_is_track_zero() ? 0x00 : 0x80; + sense = drives_[active_drive_] && drives_[active_drive_]->get_is_track_zero() ? 0 : 1; break; case CA1|CA0|SEL: // Tachometer (?) - sense = drives_[active_drive_] && drives_[active_drive_]->get_tachometer() ? 0x00 : 0x80; + sense = drives_[active_drive_] && drives_[active_drive_]->get_tachometer() ? 0 : 1; LOG("tachometer " << PADHEX(2) << int(sense) << ")"); break; @@ -140,20 +140,25 @@ uint8_t IWM::read(int address) { // case CA2|CA1: // Single- or double-sided drive. LOG("single- or double-sided drive)"); - sense = drives_[active_drive_] && (drives_[active_drive_]->get_head_count() == 1) ? 0x80 : 0x00; + sense = drives_[active_drive_] && (drives_[active_drive_]->get_head_count() == 1) ? 1 : 0; + break; + + case CA2|CA1|CA0: // Present/HD. (per the Mac Plus ROM) + LOG("present/HD)"); + sense = drives_[active_drive_] ? 0 : 1; break; - case CA2|CA1|CA0: // Drive installed. (per the Mac Plus ROM) case CA2|CA1|CA0|SEL: // Drive installed. (per Inside Macintosh) LOG("drive installed)"); - sense = drives_[active_drive_] ? 0x00 : 0x80; + sense = drives_[active_drive_] ? 0 : 1; break; } - return + return uint8_t( (mode_&0x1f) | (drive_motor_on_ ? 0x20 : 0x00) | - sense; + (sense << 7) + ); } break; case Q7: case Q7|ENABLE: diff --git a/Machines/Apple/Macintosh/Macintosh.cpp b/Machines/Apple/Macintosh/Macintosh.cpp index bceb72964..c16a569d7 100644 --- a/Machines/Apple/Macintosh/Macintosh.cpp +++ b/Machines/Apple/Macintosh/Macintosh.cpp @@ -217,7 +217,7 @@ template class ConcreteMachin case 0x68f000: // The IWM; this is a purely polled device, so can be run on demand. -// printf("[%06x]: ", mc68000_.get_state().program_counter); + printf("[%06x]: ", mc68000_.get_state().program_counter); iwm_.flush(); if(cycle.operation & Microcycle::Read) { cycle.value->halves.low = iwm_.iwm.read(register_address); @@ -295,6 +295,10 @@ template class ConcreteMachin if(!(operation & Microcycle::Read) || word_address >= 0x300000) operation = 0; } + if(!(operation & Microcycle::Read) && (word_address == (0x0000182e >> 1))) { + printf("Write to 0000182e: %04x from %08x\n", cycle.value->full, mc68000_.get_state().program_counter); + } + const auto masked_operation = operation & (Microcycle::SelectWord | Microcycle::SelectByte | Microcycle::Read | Microcycle::InterruptAcknowledge); switch(masked_operation) { default: diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal.xcscheme b/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal.xcscheme index cdac581d4..9c2dca9ce 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal.xcscheme +++ b/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal.xcscheme @@ -69,7 +69,7 @@ void Proces #ifdef LOG_TRACE const uint32_t fetched_pc = (program_counter_.full - 4)&0xffffff; + should_log |= fetched_pc >= 0x417E66; //1300 - should_log = (fetched_pc >= 0x400D9A) && (fetched_pc <= 0x400EAA); +// should_log = (fetched_pc >= 0x400D9A) && (fetched_pc <= 0x400EAA); // == 0x0003ea); // should_log |= // (((program_counter_.full - 4)&0xffffff) == 0x418CDE) || // E_Sony_RdData