mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-01-04 18:32:19 +00:00
swim3: Create separate reset method.
And set defaults for some class fields.
This commit is contained in:
parent
e72b571069
commit
818f982c75
@ -42,6 +42,16 @@ Swim3Ctrl::Swim3Ctrl()
|
|||||||
this->name = "SWIM3";
|
this->name = "SWIM3";
|
||||||
this->supported_types = HWCompType::FLOPPY_CTRL;
|
this->supported_types = HWCompType::FLOPPY_CTRL;
|
||||||
|
|
||||||
|
this->reset();
|
||||||
|
|
||||||
|
// Attach virtual Superdrive to the internal drive connector
|
||||||
|
// TODO: make SWIM3/drive wiring user selectable
|
||||||
|
this->int_drive = std::unique_ptr<MacSuperdrive::MacSuperDrive>
|
||||||
|
(new MacSuperdrive::MacSuperDrive("Superdrive1"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Swim3Ctrl::reset()
|
||||||
|
{
|
||||||
this->setup_reg = 0;
|
this->setup_reg = 0;
|
||||||
this->mode_reg = 0;
|
this->mode_reg = 0;
|
||||||
this->int_reg = 0;
|
this->int_reg = 0;
|
||||||
@ -54,10 +64,24 @@ Swim3Ctrl::Swim3Ctrl()
|
|||||||
|
|
||||||
this->cur_state = SWIM3_IDLE;
|
this->cur_state = SWIM3_IDLE;
|
||||||
|
|
||||||
// Attach virtual Superdrive to the internal drive connector
|
this->cur_track = 0xFF;
|
||||||
// TODO: make SWIM3/drive wiring user selectable
|
this->cur_sector = 0x7F;
|
||||||
this->int_drive = std::unique_ptr<MacSuperdrive::MacSuperDrive>
|
|
||||||
(new MacSuperdrive::MacSuperDrive("Superdrive1"));
|
this->timer_val = 0;
|
||||||
|
this->phase_lines = 0;
|
||||||
|
|
||||||
|
if (this->one_us_timer_id) {
|
||||||
|
TimerManager::get_instance()->cancel_timer(this->one_us_timer_id);
|
||||||
|
this->one_us_timer_id = 0;
|
||||||
|
}
|
||||||
|
if (this->step_timer_id) {
|
||||||
|
TimerManager::get_instance()->cancel_timer(this->step_timer_id);
|
||||||
|
this->step_timer_id = 0;
|
||||||
|
}
|
||||||
|
if (this->access_timer_id) {
|
||||||
|
TimerManager::get_instance()->cancel_timer(this->access_timer_id);
|
||||||
|
this->access_timer_id = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int Swim3Ctrl::device_postinit()
|
int Swim3Ctrl::device_postinit()
|
||||||
|
@ -103,6 +103,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void reset();
|
||||||
void update_irq();
|
void update_irq();
|
||||||
void start_stepping();
|
void start_stepping();
|
||||||
void do_step();
|
void do_step();
|
||||||
@ -118,7 +119,7 @@ private:
|
|||||||
|
|
||||||
DmaBidirChannel* dma_ch;
|
DmaBidirChannel* dma_ch;
|
||||||
|
|
||||||
uint8_t timer_val = 0; // internal timer that decrements at a 1 us rate
|
uint8_t timer_val; // internal timer that decrements at a 1 us rate
|
||||||
uint8_t setup_reg;
|
uint8_t setup_reg;
|
||||||
uint8_t mode_reg;
|
uint8_t mode_reg;
|
||||||
uint8_t error;
|
uint8_t error;
|
||||||
|
Loading…
Reference in New Issue
Block a user