1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-24 12:30:17 +00:00

Put in the absolute minimum logic for drive motor emulation. Drive appears to be attempting head steps.

This commit is contained in:
Thomas Harte 2016-07-31 19:38:51 -04:00
parent 740ea0b7e2
commit 41893b5ef6
2 changed files with 9 additions and 3 deletions

View File

@ -104,7 +104,8 @@ void Machine::set_rom(const uint8_t *rom)
void Machine::run_for_cycles(int number_of_cycles)
{
CPU6502::Processor<Machine>::run_for_cycles(number_of_cycles);
Storage::DiskDrive::run_for_cycles(number_of_cycles);
if(_driveVIA.get_motor_enabled()) // TODO: motor speed up/down
Storage::DiskDrive::run_for_cycles(number_of_cycles);
}
#pragma mark - 6522 delegate

View File

@ -136,6 +136,10 @@ class DriveVIA: public MOS::MOS6522<DriveVIA>, public MOS::MOS6522IRQDelegate {
return _should_set_overflow;
}
bool get_motor_enabled() {
return _drive_motor;
}
void set_control_line_output(Port port, Line line, bool value) {
if(port == Port::A && line == Line::Two) {
_should_set_overflow = value;
@ -145,10 +149,10 @@ class DriveVIA: public MOS::MOS6522<DriveVIA>, public MOS::MOS6522IRQDelegate {
void set_port_output(Port port, uint8_t value, uint8_t direction_mask) {
if(port)
{
_drive_motor = !!(value&4);
// if(value&4)
// {
// printf("Head step: %d\n", value&3);
// printf("Motor: %s\n", value&4 ? "On" : "Off");
printf("Head step: %d\n", value&3);
// printf("LED: %s\n", value&8 ? "On" : "Off");
// printf("Density: %d\n", (value >> 5)&3);
// }
@ -158,6 +162,7 @@ class DriveVIA: public MOS::MOS6522<DriveVIA>, public MOS::MOS6522IRQDelegate {
private:
uint8_t _port_b, _port_a;
bool _should_set_overflow;
bool _drive_motor;
};
/*!