mirror of
https://github.com/holub/mame
synced 2025-07-04 01:18:59 +03:00
(MESS) microdrv: devcb2. (nw)
This commit is contained in:
parent
ff4661978f
commit
226b3a9d37
@ -833,7 +833,6 @@ wd17xx_interface ql_wd17xx_interface =
|
|||||||
|
|
||||||
static MICRODRIVE_CONFIG( mdv1_config )
|
static MICRODRIVE_CONFIG( mdv1_config )
|
||||||
{
|
{
|
||||||
DEVCB_DEVICE_LINE_MEMBER(MDV_2, microdrive_image_device, comms_in_w),
|
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
@ -845,7 +844,6 @@ static MICRODRIVE_CONFIG( mdv1_config )
|
|||||||
|
|
||||||
static MICRODRIVE_CONFIG( mdv2_config )
|
static MICRODRIVE_CONFIG( mdv2_config )
|
||||||
{
|
{
|
||||||
DEVCB_NULL,
|
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
@ -990,6 +988,7 @@ static MACHINE_CONFIG_START( ql, ql_state )
|
|||||||
|
|
||||||
MCFG_WD1772_ADD(WD1772_TAG,ql_wd17xx_interface)
|
MCFG_WD1772_ADD(WD1772_TAG,ql_wd17xx_interface)
|
||||||
MCFG_MICRODRIVE_ADD(MDV_1, mdv1_config)
|
MCFG_MICRODRIVE_ADD(MDV_1, mdv1_config)
|
||||||
|
MCFG_MICRODRIVE_COMMS_OUT_CALLBACK(DEVWRITELINE(MDV_2, microdrive_image_device, comms_in_w))
|
||||||
MCFG_MICRODRIVE_ADD(MDV_2, mdv2_config)
|
MCFG_MICRODRIVE_ADD(MDV_2, mdv2_config)
|
||||||
MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, NULL) // wired as DCE
|
MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, NULL) // wired as DCE
|
||||||
MCFG_RS232_PORT_ADD(RS232_B_TAG, default_rs232_devices, NULL) // wired as DTE
|
MCFG_RS232_PORT_ADD(RS232_B_TAG, default_rs232_devices, NULL) // wired as DTE
|
||||||
|
@ -41,9 +41,10 @@ const device_type MICRODRIVE = &device_creator<microdrive_image_device>;
|
|||||||
// microdrive_image_device - constructor
|
// microdrive_image_device - constructor
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
microdrive_image_device::microdrive_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
microdrive_image_device::microdrive_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||||
: device_t(mconfig, MICRODRIVE, "Microdrive", tag, owner, clock, "microdrive_image", __FILE__),
|
device_t(mconfig, MICRODRIVE, "Microdrive", tag, owner, clock, "microdrive_image", __FILE__),
|
||||||
device_image_interface(mconfig, *this)
|
device_image_interface(mconfig, *this),
|
||||||
|
m_write_comms_out(*this)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +72,6 @@ void microdrive_image_device::device_config_complete()
|
|||||||
// or initialize to defaults if none provided
|
// or initialize to defaults if none provided
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
memset(&m_out_comms_out_cb, 0, sizeof(m_out_comms_out_cb));
|
|
||||||
memset(&m_interface, 0, sizeof(m_interface));
|
memset(&m_interface, 0, sizeof(m_interface));
|
||||||
memset(&m_device_displayinfo, 0, sizeof(m_device_displayinfo));
|
memset(&m_device_displayinfo, 0, sizeof(m_device_displayinfo));
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ void microdrive_image_device::device_config_complete()
|
|||||||
void microdrive_image_device::device_start()
|
void microdrive_image_device::device_start()
|
||||||
{
|
{
|
||||||
// resolve callbacks
|
// resolve callbacks
|
||||||
m_out_comms_out_func.resolve(m_out_comms_out_cb, *this);
|
m_write_comms_out.resolve_safe();
|
||||||
|
|
||||||
// allocate track buffers
|
// allocate track buffers
|
||||||
m_left = auto_alloc_array(machine(), UINT8, MDV_IMAGE_LENGTH / 2);
|
m_left = auto_alloc_array(machine(), UINT8, MDV_IMAGE_LENGTH / 2);
|
||||||
@ -146,7 +146,7 @@ WRITE_LINE_MEMBER( microdrive_image_device::clk_w )
|
|||||||
{
|
{
|
||||||
m_comms_out = m_comms_in;
|
m_comms_out = m_comms_in;
|
||||||
if (LOG) logerror("Microdrive '%s' COMMS OUT: %u\n", tag(), m_comms_out);
|
if (LOG) logerror("Microdrive '%s' COMMS OUT: %u\n", tag(), m_comms_out);
|
||||||
m_out_comms_out_func(m_comms_out);
|
m_write_comms_out(m_comms_out);
|
||||||
m_bit_timer->enable(m_comms_out);
|
m_bit_timer->enable(m_comms_out);
|
||||||
}
|
}
|
||||||
m_clk = state;
|
m_clk = state;
|
||||||
|
@ -11,14 +11,37 @@
|
|||||||
#ifndef __MICRODRV__
|
#ifndef __MICRODRV__
|
||||||
#define __MICRODRV__
|
#define __MICRODRV__
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//**************************************************************************
|
||||||
|
// INTERFACE CONFIGURATION MACROS
|
||||||
|
//**************************************************************************
|
||||||
|
|
||||||
|
#define MDV_1 "mdv1"
|
||||||
|
#define MDV_2 "mdv2"
|
||||||
|
|
||||||
|
|
||||||
|
#define MCFG_MICRODRIVE_ADD(_tag, _config) \
|
||||||
|
MCFG_DEVICE_ADD(_tag, MICRODRIVE, 0) \
|
||||||
|
MCFG_DEVICE_CONFIG(_config)
|
||||||
|
|
||||||
|
#define MICRODRIVE_CONFIG(_name) \
|
||||||
|
const microdrive_interface (_name) =
|
||||||
|
|
||||||
|
|
||||||
|
#define MCFG_MICRODRIVE_COMMS_OUT_CALLBACK(_write) \
|
||||||
|
devcb = µdrive_image_device::set_comms_out_wr_callback(*device, DEVCB2_##_write);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
TYPE DEFINITIONS
|
TYPE DEFINITIONS
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
// ======================> microdrive_interface
|
// ======================> microdrive_interface
|
||||||
|
|
||||||
struct microdrive_interface
|
struct microdrive_interface
|
||||||
{
|
{
|
||||||
devcb_write_line m_out_comms_out_cb;
|
|
||||||
const char * m_interface;
|
const char * m_interface;
|
||||||
device_image_display_info_func m_device_displayinfo;
|
device_image_display_info_func m_device_displayinfo;
|
||||||
};
|
};
|
||||||
@ -34,6 +57,8 @@ public:
|
|||||||
microdrive_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
microdrive_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||||
virtual ~microdrive_image_device();
|
virtual ~microdrive_image_device();
|
||||||
|
|
||||||
|
template<class _Object> static devcb2_base &set_comms_out_wr_callback(device_t &device, _Object object) { return downcast<microdrive_image_device &>(device).m_write_comms_out.set_callback(object); }
|
||||||
|
|
||||||
// image-level overrides
|
// image-level overrides
|
||||||
virtual bool call_load();
|
virtual bool call_load();
|
||||||
virtual void call_unload();
|
virtual void call_unload();
|
||||||
@ -66,7 +91,7 @@ protected:
|
|||||||
virtual void device_start();
|
virtual void device_start();
|
||||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||||
private:
|
private:
|
||||||
devcb_resolved_write_line m_out_comms_out_func;
|
devcb2_write_line m_write_comms_out;
|
||||||
|
|
||||||
int m_clk;
|
int m_clk;
|
||||||
int m_comms_in;
|
int m_comms_in;
|
||||||
@ -83,21 +108,10 @@ private:
|
|||||||
emu_timer *m_bit_timer;
|
emu_timer *m_bit_timer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// device type definition
|
// device type definition
|
||||||
extern const device_type MICRODRIVE;
|
extern const device_type MICRODRIVE;
|
||||||
|
|
||||||
/***************************************************************************
|
|
||||||
DEVICE CONFIGURATION MACROS
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
#define MDV_1 "mdv1"
|
|
||||||
#define MDV_2 "mdv2"
|
|
||||||
|
|
||||||
#define MCFG_MICRODRIVE_ADD(_tag, _config) \
|
|
||||||
MCFG_DEVICE_ADD(_tag, MICRODRIVE, 0) \
|
|
||||||
MCFG_DEVICE_CONFIG(_config)
|
|
||||||
|
|
||||||
#define MICRODRIVE_CONFIG(_name) \
|
|
||||||
const microdrive_interface (_name) =
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user