mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-04 14:30:19 +00:00
Possibly mights the tiniest bit of headway with 'the IWM'.
I'm now pretty sure that my 3.5" drive, which for now is implemented in the IWM (yuck) is just responding to queries incorrectly.
This commit is contained in:
parent
f6f9024631
commit
bde975a3b9
@ -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:
|
||||
|
@ -217,7 +217,7 @@ template <Analyser::Static::Macintosh::Target::Model model> 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 <Analyser::Static::Macintosh::Target::Model model> 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:
|
||||
|
@ -69,7 +69,7 @@
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Release"
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
enableASanStackUseAfterReturn = "YES"
|
||||
|
@ -291,8 +291,9 @@ template <class T, bool dtack_is_implicit, bool signal_will_perform> 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user