wd_fdc: separate soviet FD179x clone

This commit is contained in:
MetalliC 2015-05-31 23:03:24 +03:00
parent 14a019da20
commit 9f74d5fd7b
4 changed files with 61 additions and 7 deletions

View File

@ -9,6 +9,7 @@ const device_type FD1781x = &device_creator<fd1781_t>;
const device_type FD1791x = &device_creator<fd1791_t>;
const device_type FD1792x = &device_creator<fd1792_t>;
const device_type FD1793x = &device_creator<fd1793_t>;
const device_type KR1818VG93x = &device_creator<kr1818vg93_t>;
const device_type FD1794x = &device_creator<fd1794_t>;
const device_type FD1795x = &device_creator<fd1795_t>;
const device_type FD1797x = &device_creator<fd1797_t>;
@ -903,12 +904,17 @@ void wd_fdc_t::interrupt_start()
status_type_1 = true;
}
if(!(command & 0x0f)) {
intrq_cond = 0;
} else if ((command & 0x0f) > 8) { // assume I_IMM is set only if condition equal to 8 but not more than, Spectrum's BetaDisk require this
intrq_cond = 0;
int intcond = command & 0x0f;
if (!nonsticky_immint) {
if(intcond == 0)
intrq_cond = 0;
else
intrq_cond = (intrq_cond & I_IMM) | intcond;
} else {
intrq_cond = (intrq_cond & I_IMM) | (command & 0x0f);
if (intcond < 8)
intrq_cond = intcond;
else
intrq_cond = 0;
}
if(command & I_IMM) {
@ -2394,6 +2400,7 @@ fd1771_t::fd1771_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
int fd1771_t::calc_sector_size(UINT8 size, UINT8 command) const
@ -2418,6 +2425,7 @@ fd1781_t::fd1781_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
int fd1781_t::calc_sector_size(UINT8 size, UINT8 command) const
@ -2444,6 +2452,7 @@ fd1791_t::fd1791_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
fd1792_t::fd1792_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1792x, "FD1792", tag, owner, clock, "fd1792", __FILE__)
@ -2459,6 +2468,7 @@ fd1792_t::fd1792_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1793x, "FD1793", tag, owner, clock, "fd1793", __FILE__)
@ -2474,6 +2484,23 @@ fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
kr1818vg93_t::kr1818vg93_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1793x, "FD1793", tag, owner, clock, "fd1793", __FILE__)
{
step_times = fd179x_step_times;
delay_register_commit = 4;
delay_command_commit = 12;
disable_mfm = false;
has_enmf = false;
inverted_bus = false;
side_control = false;
side_compare = true;
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = true;
}
fd1794_t::fd1794_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1794x, "FD1794", tag, owner, clock, "fd1794", __FILE__)
@ -2489,6 +2516,7 @@ fd1794_t::fd1794_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
fd1795_t::fd1795_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1795x, "FD1795", tag, owner, clock, "fd1795", __FILE__)
@ -2504,6 +2532,7 @@ fd1795_t::fd1795_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
int fd1795_t::calc_sector_size(UINT8 size, UINT8 command) const
@ -2527,6 +2556,7 @@ fd1797_t::fd1797_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
int fd1797_t::calc_sector_size(UINT8 size, UINT8 command) const
@ -2550,6 +2580,7 @@ mb8866_t::mb8866_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
mb8876_t::mb8876_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, MB8876x, "MB8876", tag, owner, clock, "mb8876", __FILE__)
@ -2565,6 +2596,7 @@ mb8876_t::mb8876_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
mb8877_t::mb8877_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, MB8877x, "MB8877", tag, owner, clock, "mb8877", __FILE__)
@ -2580,6 +2612,7 @@ mb8877_t::mb8877_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
fd1761_t::fd1761_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1761x, "FD1761", tag, owner, clock, "fd1761", __FILE__)
@ -2595,6 +2628,7 @@ fd1761_t::fd1761_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
fd1763_t::fd1763_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1763x, "FD1763", tag, owner, clock, "fd1763", __FILE__)
@ -2610,6 +2644,7 @@ fd1763_t::fd1763_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
fd1765_t::fd1765_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1765x, "FD1765", tag, owner, clock, "fd1765", __FILE__)
@ -2625,6 +2660,7 @@ fd1765_t::fd1765_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
int fd1765_t::calc_sector_size(UINT8 size, UINT8 command) const
@ -2648,6 +2684,7 @@ fd1767_t::fd1767_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
int fd1767_t::calc_sector_size(UINT8 size, UINT8 command) const
@ -2671,6 +2708,7 @@ wd2791_t::wd2791_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, WD2793x, "WD2793", tag, owner, clock, "wd2793", __FILE__)
@ -2686,6 +2724,7 @@ wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
wd2795_t::wd2795_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, WD2795x, "WD2795", tag, owner, clock, "wd2795", __FILE__)
@ -2701,6 +2740,7 @@ wd2795_t::wd2795_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
int wd2795_t::calc_sector_size(UINT8 size, UINT8 command) const
@ -2724,6 +2764,7 @@ wd2797_t::wd2797_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}
int wd2797_t::calc_sector_size(UINT8 size, UINT8 command) const
@ -2747,6 +2788,7 @@ wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = false;
motor_control = true;
ready_hooked = false;
nonsticky_immint = false;
}
wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_digital_t(mconfig, WD1772x, "WD1772", tag, owner, clock, "wd1772", __FILE__)
@ -2764,6 +2806,7 @@ wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = false;
motor_control = true;
ready_hooked = false;
nonsticky_immint = false;
}
int wd1772_t::settle_time() const
@ -2784,4 +2827,5 @@ wd1773_t::wd1773_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = false;
motor_control = false;
ready_hooked = true;
nonsticky_immint = false;
}

View File

@ -59,6 +59,9 @@
#define MCFG_FD1793x_ADD(_tag, _clock) \
MCFG_DEVICE_ADD(_tag, FD1793x, _clock)
#define MCFG_KR1818VG93x_ADD(_tag, _clock) \
MCFG_DEVICE_ADD(_tag, KR1818VG93x, _clock)
#define MCFG_FD1794x_ADD(_tag, _clock) \
MCFG_DEVICE_ADD(_tag, FD1794x, _clock)
@ -188,6 +191,7 @@ protected:
bool head_control;
bool motor_control;
bool ready_hooked;
bool nonsticky_immint;
int clock_ratio;
const int *step_times;
int delay_register_commit;
@ -532,6 +536,11 @@ public:
fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
class kr1818vg93_t : public wd_fdc_analog_t {
public:
kr1818vg93_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
class fd1794_t : public wd_fdc_analog_t {
public:
fd1794_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
@ -647,6 +656,7 @@ extern const device_type FD1781x;
extern const device_type FD1791x;
extern const device_type FD1792x;
extern const device_type FD1793x;
extern const device_type KR1818VG93x;
extern const device_type FD1795x;
extern const device_type FD1797x;

View File

@ -182,7 +182,7 @@ static SLOT_INTERFACE_START( beta_disk_floppies )
SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT( beta_disk )
MCFG_WD2793x_ADD("wd179x", XTAL_8MHz / 8) // KR1818VG93 clone of WD1793
MCFG_KR1818VG93x_ADD("wd179x", XTAL_8MHz / 8)
MCFG_FLOPPY_DRIVE_ADD("wd179x:0", beta_disk_floppies, "drive0", beta_disk_device::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("wd179x:1", beta_disk_floppies, "drive1", beta_disk_device::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("wd179x:2", beta_disk_floppies, "drive2", beta_disk_device::floppy_formats)

View File

@ -50,7 +50,7 @@ protected:
virtual machine_config_constructor device_mconfig_additions() const;
private:
required_device<wd2793_t> m_wd179x;
required_device<kr1818vg93_t> m_wd179x;
required_device<floppy_connector> m_floppy0;
required_device<floppy_connector> m_floppy1;
required_device<floppy_connector> m_floppy2;