mirror of
https://github.com/TomHarte/CLK.git
synced 2024-09-08 03:54:27 +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;
|
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)
|
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_;
|
uint8_t changes = control ^ last_control_;
|
||||||
last_control_ = control;
|
last_control_ = control;
|
||||||
|
set_control_register(control, changes);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Plus3::set_control_register(uint8_t control, uint8_t changes)
|
||||||
|
{
|
||||||
if(changes&3)
|
if(changes&3)
|
||||||
{
|
{
|
||||||
switch(control&3)
|
switch(control&3)
|
||||||
|
@ -21,6 +21,7 @@ class Plus3 : public WD::WD1770 {
|
|||||||
void set_control_register(uint8_t control);
|
void set_control_register(uint8_t control);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void set_control_register(uint8_t control, uint8_t changes);
|
||||||
std::shared_ptr<Storage::Disk::Drive> drives_[2];
|
std::shared_ptr<Storage::Disk::Drive> drives_[2];
|
||||||
int selected_drive_;
|
int selected_drive_;
|
||||||
uint8_t last_control_;
|
uint8_t last_control_;
|
||||||
|
Loading…
Reference in New Issue
Block a user