1
0
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:
Thomas Harte 2016-12-28 18:52:36 -05:00
parent 3a9ad3fb08
commit 8cd1575891
2 changed files with 9 additions and 1 deletions

View File

@ -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)

View File

@ -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_;