mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-22 12:33:29 +00:00
Similar fix to that over in Oric land: ensure a known, effective initial value for the Plus 3's control register.
This commit is contained in:
parent
3a9ad3fb08
commit
8cd1575891
@ -10,7 +10,10 @@
|
||||
|
||||
using namespace Electron;
|
||||
|
||||
Plus3::Plus3() : WD1770(P1770) {}
|
||||
Plus3::Plus3() : WD1770(P1770), last_control_(0)
|
||||
{
|
||||
set_control_register(last_control_, 0xff);
|
||||
}
|
||||
|
||||
void Plus3::set_disk(std::shared_ptr<Storage::Disk::Disk> disk, int drive)
|
||||
{
|
||||
@ -31,7 +34,11 @@ void Plus3::set_control_register(uint8_t control)
|
||||
|
||||
uint8_t changes = control ^ last_control_;
|
||||
last_control_ = control;
|
||||
set_control_register(control, changes);
|
||||
}
|
||||
|
||||
void Plus3::set_control_register(uint8_t control, uint8_t changes)
|
||||
{
|
||||
if(changes&3)
|
||||
{
|
||||
switch(control&3)
|
||||
|
@ -21,6 +21,7 @@ class Plus3 : public WD::WD1770 {
|
||||
void set_control_register(uint8_t control);
|
||||
|
||||
private:
|
||||
void set_control_register(uint8_t control, uint8_t changes);
|
||||
std::shared_ptr<Storage::Disk::Drive> drives_[2];
|
||||
int selected_drive_;
|
||||
uint8_t last_control_;
|
||||
|
Loading…
Reference in New Issue
Block a user