From 6c588a1510cf2e7f304b0d82f96869e52611ce5c Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 28 Jun 2019 13:03:47 -0400 Subject: [PATCH] Makes some further random swings at tracking the startup procedure. --- Components/DiskII/IWM.cpp | 14 +++++++------- Machines/Apple/Macintosh/SonyDrive.cpp | 1 + .../xcschemes/Clock Signal.xcscheme | 2 +- .../Implementation/68000Implementation.hpp | 18 +++++++++++++----- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Components/DiskII/IWM.cpp b/Components/DiskII/IWM.cpp index 271da8058..0b0d137cd 100644 --- a/Components/DiskII/IWM.cpp +++ b/Components/DiskII/IWM.cpp @@ -8,7 +8,7 @@ #include "IWM.hpp" -#define NDEBUG +//#define NDEBUG #include "../../Outputs/Log.hpp" using namespace Apple; @@ -66,7 +66,7 @@ uint8_t IWM::read(int address) { // printf("\n\nIWM:%02x\n\n", data_register_); data_register_ = 0; } - LOG("Reading data register: " << PADHEX(2) << int(result)); +// LOG("Reading data register: " << PADHEX(2) << int(result)); return result; } @@ -92,16 +92,16 @@ uint8_t IWM::read(int address) { LOG("unknown)"); break; - // 4 = step finished (0 = done) + // Possible other meanings: // B = ready (0 = ready) - // 8 = motor on // // {CA1,CA0,SEL,CA2} -// case 0: // Head step direction. + case 0: // Head step direction. // (0 = inward) -// printf("head step direction)\n"); -// break; + LOG("head step direction)"); + sense = (step_direction_ > 0) ? 0 : 1; + break; case SEL: // Disk in place. // (0 = disk present) diff --git a/Machines/Apple/Macintosh/SonyDrive.cpp b/Machines/Apple/Macintosh/SonyDrive.cpp index 6a538496e..004fae9e0 100644 --- a/Machines/Apple/Macintosh/SonyDrive.cpp +++ b/Machines/Apple/Macintosh/SonyDrive.cpp @@ -25,6 +25,7 @@ void SonyDrive::did_step(Storage::Disk::HeadPosition to_position) { /* Numbers below cribbed from the Kryoflux forums. */ + printf("Head moved to %d\n", to_position.as_int()); const int zone = to_position.as_int() >> 4; switch(zone) { case 0: set_rotation_speed(393.3807f); break; 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 == 0x4012A2; - should_log &= fetched_pc != 0x4012AE; +// should_log |= fetched_pc == 0x6d9c; + should_log = fetched_pc < 0x400000;// || (fetched_pc >= 0x401A42 && fetched_pc <= 0x401A82); + // should_log |= fetched_pc == 0x4012A2; +// should_log &= fetched_pc != 0x4012AE; // should_log = (fetched_pc >= 0x408D66) && (fetched_pc <= 0x408D84); #endif @@ -329,9 +331,15 @@ template void Proces // The vector used depends on whether this is a vanilla unrecognised instruction, // or one on the A or F lines. switch(decoded_instruction_.full >> 12) { - default: populate_trap_steps(4, get_status()); break; - case 0xa: populate_trap_steps(10, get_status()); break; - case 0xf: populate_trap_steps(11, get_status()); break; + default: + populate_trap_steps(4, get_status()); + break; + case 0xa: + populate_trap_steps(10, get_status()); + break; + case 0xf: + populate_trap_steps(11, get_status()); + break; } } }