1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-10-01 13:58:20 +00:00

Makes some further random swings at tracking the startup procedure.

This commit is contained in:
Thomas Harte 2019-06-28 13:03:47 -04:00
parent 651fd9c4a5
commit 6c588a1510
4 changed files with 22 additions and 13 deletions

View File

@ -8,7 +8,7 @@
#include "IWM.hpp" #include "IWM.hpp"
#define NDEBUG //#define NDEBUG
#include "../../Outputs/Log.hpp" #include "../../Outputs/Log.hpp"
using namespace Apple; using namespace Apple;
@ -66,7 +66,7 @@ uint8_t IWM::read(int address) {
// printf("\n\nIWM:%02x\n\n", data_register_); // printf("\n\nIWM:%02x\n\n", data_register_);
data_register_ = 0; data_register_ = 0;
} }
LOG("Reading data register: " << PADHEX(2) << int(result)); // LOG("Reading data register: " << PADHEX(2) << int(result));
return result; return result;
} }
@ -92,16 +92,16 @@ uint8_t IWM::read(int address) {
LOG("unknown)"); LOG("unknown)");
break; break;
// 4 = step finished (0 = done) // Possible other meanings:
// B = ready (0 = ready) // B = ready (0 = ready)
// 8 = motor on
// //
// {CA1,CA0,SEL,CA2} // {CA1,CA0,SEL,CA2}
// case 0: // Head step direction. case 0: // Head step direction.
// (0 = inward) // (0 = inward)
// printf("head step direction)\n"); LOG("head step direction)");
// break; sense = (step_direction_ > 0) ? 0 : 1;
break;
case SEL: // Disk in place. case SEL: // Disk in place.
// (0 = disk present) // (0 = disk present)

View File

@ -25,6 +25,7 @@ void SonyDrive::did_step(Storage::Disk::HeadPosition to_position) {
/* /*
Numbers below cribbed from the Kryoflux forums. 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; const int zone = to_position.as_int() >> 4;
switch(zone) { switch(zone) {
case 0: set_rotation_speed(393.3807f); break; case 0: set_rotation_speed(393.3807f); break;

View File

@ -69,7 +69,7 @@
</AdditionalOptions> </AdditionalOptions>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Release" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableASanStackUseAfterReturn = "YES" enableASanStackUseAfterReturn = "YES"

View File

@ -297,8 +297,10 @@ template <class T, bool dtack_is_implicit, bool signal_will_perform> void Proces
#ifdef LOG_TRACE #ifdef LOG_TRACE
const uint32_t fetched_pc = (program_counter_.full - 4)&0xffffff; const uint32_t fetched_pc = (program_counter_.full - 4)&0xffffff;
should_log |= fetched_pc == 0x4012A2; // should_log |= fetched_pc == 0x6d9c;
should_log &= fetched_pc != 0x4012AE; 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); // should_log = (fetched_pc >= 0x408D66) && (fetched_pc <= 0x408D84);
#endif #endif
@ -329,9 +331,15 @@ template <class T, bool dtack_is_implicit, bool signal_will_perform> void Proces
// The vector used depends on whether this is a vanilla unrecognised instruction, // The vector used depends on whether this is a vanilla unrecognised instruction,
// or one on the A or F lines. // or one on the A or F lines.
switch(decoded_instruction_.full >> 12) { switch(decoded_instruction_.full >> 12) {
default: populate_trap_steps(4, get_status()); break; default:
case 0xa: populate_trap_steps(10, get_status()); break; populate_trap_steps(4, get_status());
case 0xf: populate_trap_steps(11, get_status()); break; break;
case 0xa:
populate_trap_steps(10, get_status());
break;
case 0xf:
populate_trap_steps(11, get_status());
break;
} }
} }
} }