imagedev/floppy: add 'dskchg_writable' property (for Sony Microfloppy drives)

This commit is contained in:
Sergey Svishchev 2016-11-25 23:28:47 +03:00
parent ec2aa711ca
commit 5fb832ed24
2 changed files with 12 additions and 2 deletions

View file

@ -180,6 +180,7 @@ floppy_image_device::floppy_image_device(const machine_config &mconfig, device_t
sides(0),
form_factor(0),
motor_always_on(false),
dskchg_writable(false),
dir(0), stp(0), wtg(0), mon(0), ss(0), idx(0), wpt(0), rdy(0), dskchg(0),
ready(false),
rpm(0),
@ -314,6 +315,7 @@ void floppy_image_device::device_start()
{
rpm = 0;
motor_always_on = false;
dskchg_writable = false;
idx = 0;
@ -450,6 +452,9 @@ image_init_result floppy_image_device::call_load()
} else if(!mon)
ready_counter = 2;
if (dskchg_writable)
dskchg = 1;
return image_init_result::PASS;
}
@ -651,7 +656,7 @@ void floppy_image_device::stp_w(int state)
if (m_make_sound) m_sound_out->step(cyl*5/tracks);
}
/* Update disk detection if applicable */
if (exists())
if (exists() && !dskchg_writable)
{
if (dskchg==0) dskchg = 1;
}
@ -696,7 +701,7 @@ void floppy_image_device::seek_phase_w(int phases)
logerror("%s: track %d.%d\n", tag(), cyl, subcyl);
/* Update disk detection if applicable */
if (exists())
if (exists() && !dskchg_writable)
if (dskchg==0)
dskchg = 1;
}
@ -2040,6 +2045,7 @@ void sony_oa_d31v::setup_characteristics()
form_factor = floppy_image::FF_35;
tracks = 70;
sides = 1;
dskchg_writable = true;
set_rpm(600);
}
@ -2075,6 +2081,7 @@ void sony_oa_d32w::setup_characteristics()
form_factor = floppy_image::FF_35;
tracks = 80;
sides = 2;
dskchg_writable = true;
set_rpm(600);
}
@ -2111,6 +2118,7 @@ void sony_oa_d32v::setup_characteristics()
form_factor = floppy_image::FF_35;
tracks = 80;
sides = 1;
dskchg_writable = true;
set_rpm(600);
}

View file

@ -124,6 +124,7 @@ public:
void dir_w(int state) { dir = state; }
void ss_w(int state) { ss = state; }
void inuse_w(int state) { }
void dskchg_w(int state) { if (dskchg_writable) dskchg = state; }
void index_resync();
attotime time_next_index();
@ -162,6 +163,7 @@ protected:
int sides; /* number of heads */
uint32_t form_factor; /* 3"5, 5"25, etc */
bool motor_always_on;
bool dskchg_writable;
/* state of input lines */
int dir; /* direction */