mirror of
https://github.com/mamedev/mame.git
synced 2024-11-18 10:06:19 +01:00
upd765: add the motorola mcs3201
This commit is contained in:
parent
f5aa9dc35d
commit
7642857c68
2 changed files with 54 additions and 1 deletions
|
@ -12,6 +12,7 @@ const device_type PC_FDC_SUPERIO = &device_creator<pc_fdc_superio_device>;
|
|||
const device_type DP8473 = &device_creator<dp8473_device>;
|
||||
const device_type PC8477A = &device_creator<pc8477a_device>;
|
||||
const device_type WD37C65C = &device_creator<wd37c65c_device>;
|
||||
const device_type MCS3201 = &device_creator<mcs3201_device>;
|
||||
|
||||
DEVICE_ADDRESS_MAP_START(map, 8, upd765a_device)
|
||||
AM_RANGE(0x0, 0x0) AM_READ(msr_r)
|
||||
|
@ -86,6 +87,14 @@ DEVICE_ADDRESS_MAP_START(map, 8, wd37c65c_device)
|
|||
AM_RANGE(0x1, 0x1) AM_READWRITE(fifo_r, fifo_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
DEVICE_ADDRESS_MAP_START( map, 8, mcs3201_device )
|
||||
AM_RANGE(0x0, 0x0) AM_READ(input_r)
|
||||
AM_RANGE(0x2, 0x2) AM_WRITE(dor_w)
|
||||
AM_RANGE(0x4, 0x4) AM_READ(msr_r)
|
||||
AM_RANGE(0x5, 0x5) AM_READWRITE(fifo_r, fifo_w)
|
||||
AM_RANGE(0x7, 0x7) AM_READWRITE(dir_r, ccr_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
int upd765_family_device::rates[4] = { 500000, 300000, 250000, 1000000 };
|
||||
|
||||
|
@ -2202,7 +2211,6 @@ bool upd765_family_device::sector_matches() const
|
|||
cur_live.idbuf[3] == command[5];
|
||||
}
|
||||
|
||||
|
||||
upd765a_device::upd765a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, UPD765A, "UPD765A", tag, owner, clock, "upd765a", __FILE__)
|
||||
{
|
||||
dor_reset = 0x0c;
|
||||
|
@ -2262,3 +2270,24 @@ wd37c65c_device::wd37c65c_device(const machine_config &mconfig, const char *tag,
|
|||
ready_connected = false;
|
||||
select_connected = true;
|
||||
}
|
||||
|
||||
mcs3201_device::mcs3201_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
upd765_family_device(mconfig, MCS3201, "Motorola MCS3201", tag, owner, clock, "mcs3201", __FILE__),
|
||||
m_input_handler(*this)
|
||||
{
|
||||
dor_reset = 0x0c;
|
||||
ready_polled = false;
|
||||
ready_connected = false;
|
||||
select_connected = true;
|
||||
}
|
||||
|
||||
void mcs3201_device::device_start()
|
||||
{
|
||||
upd765_family_device::device_start();
|
||||
m_input_handler.resolve_safe(0);
|
||||
}
|
||||
|
||||
READ8_MEMBER( mcs3201_device::input_r )
|
||||
{
|
||||
return m_input_handler();
|
||||
}
|
||||
|
|
|
@ -49,6 +49,12 @@
|
|||
#define MCFG_WD37C65C_ADD(_tag) \
|
||||
MCFG_DEVICE_ADD(_tag, WD37C65C, 0)
|
||||
|
||||
#define MCFG_MCS3201_ADD(_tag) \
|
||||
MCFG_DEVICE_ADD(_tag, MCS3201, 0)
|
||||
|
||||
#define MCFG_MCS3201_INPUT_HANDLER(_devcb) \
|
||||
devcb = &mcs3201_device::set_input_handler(*device, DEVCB2_##_devcb);
|
||||
|
||||
/* Interface required for PC ISA wrapping */
|
||||
class pc_fdc_interface : public device_t {
|
||||
public:
|
||||
|
@ -461,6 +467,23 @@ public:
|
|||
virtual DECLARE_ADDRESS_MAP(map, 8);
|
||||
};
|
||||
|
||||
class mcs3201_device : public upd765_family_device {
|
||||
public:
|
||||
mcs3201_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// static configuration helpers
|
||||
template<class _Object> static devcb2_base &set_input_handler(device_t &device, _Object object) { return downcast<mcs3201_device &>(device).m_input_handler.set_callback(object); }
|
||||
|
||||
virtual DECLARE_ADDRESS_MAP(map, 8);
|
||||
DECLARE_READ8_MEMBER( input_r );
|
||||
|
||||
protected:
|
||||
virtual void device_start();
|
||||
|
||||
private:
|
||||
devcb2_read8 m_input_handler;
|
||||
};
|
||||
|
||||
extern const device_type UPD765A;
|
||||
extern const device_type UPD765B;
|
||||
extern const device_type I8272A;
|
||||
|
@ -471,5 +494,6 @@ extern const device_type PC_FDC_SUPERIO;
|
|||
extern const device_type DP8473;
|
||||
extern const device_type PC8477A;
|
||||
extern const device_type WD37C65C;
|
||||
extern const device_type MCS3201;
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue