1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-29 15:29:36 +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"
#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)

View File

@ -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;

View File

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

View File

@ -297,8 +297,10 @@ 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 == 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 <class T, bool dtack_is_implicit, bool signal_will_perform> 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;
}
}
}