mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-19 08:31:11 +00:00
Put in the absolute minimum logic for drive motor emulation. Drive appears to be attempting head steps.
This commit is contained in:
parent
740ea0b7e2
commit
41893b5ef6
@ -104,7 +104,8 @@ void Machine::set_rom(const uint8_t *rom)
|
|||||||
void Machine::run_for_cycles(int number_of_cycles)
|
void Machine::run_for_cycles(int number_of_cycles)
|
||||||
{
|
{
|
||||||
CPU6502::Processor<Machine>::run_for_cycles(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
|
#pragma mark - 6522 delegate
|
||||||
|
@ -136,6 +136,10 @@ class DriveVIA: public MOS::MOS6522<DriveVIA>, public MOS::MOS6522IRQDelegate {
|
|||||||
return _should_set_overflow;
|
return _should_set_overflow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool get_motor_enabled() {
|
||||||
|
return _drive_motor;
|
||||||
|
}
|
||||||
|
|
||||||
void set_control_line_output(Port port, Line line, bool value) {
|
void set_control_line_output(Port port, Line line, bool value) {
|
||||||
if(port == Port::A && line == Line::Two) {
|
if(port == Port::A && line == Line::Two) {
|
||||||
_should_set_overflow = value;
|
_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) {
|
void set_port_output(Port port, uint8_t value, uint8_t direction_mask) {
|
||||||
if(port)
|
if(port)
|
||||||
{
|
{
|
||||||
|
_drive_motor = !!(value&4);
|
||||||
// if(value&4)
|
// if(value&4)
|
||||||
// {
|
// {
|
||||||
// printf("Head step: %d\n", value&3);
|
printf("Head step: %d\n", value&3);
|
||||||
// printf("Motor: %s\n", value&4 ? "On" : "Off");
|
|
||||||
// printf("LED: %s\n", value&8 ? "On" : "Off");
|
// printf("LED: %s\n", value&8 ? "On" : "Off");
|
||||||
// printf("Density: %d\n", (value >> 5)&3);
|
// printf("Density: %d\n", (value >> 5)&3);
|
||||||
// }
|
// }
|
||||||
@ -158,6 +162,7 @@ class DriveVIA: public MOS::MOS6522<DriveVIA>, public MOS::MOS6522IRQDelegate {
|
|||||||
private:
|
private:
|
||||||
uint8_t _port_b, _port_a;
|
uint8_t _port_b, _port_a;
|
||||||
bool _should_set_overflow;
|
bool _should_set_overflow;
|
||||||
|
bool _drive_motor;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Loading…
Reference in New Issue
Block a user