mirror of
https://github.com/holub/mame
synced 2025-05-08 07:11:42 +03:00
Refactored the INS8250 interrupt line to use devcb. [Curt Coder]
This commit is contained in:
parent
733d00f28e
commit
ad1f10399b
@ -109,6 +109,7 @@ static const char * const device_tags[NUM_TYPES] = { "ins8250", "ins8250a", "ns1
|
|||||||
#define COM_LOG(n,m,a) LOG(VERBOSE_COM,n,m,a)
|
#define COM_LOG(n,m,a) LOG(VERBOSE_COM,n,m,a)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
devcb_resolved_write_line out_intr_func;
|
||||||
const ins8250_interface *interface;
|
const ins8250_interface *interface;
|
||||||
int device_type;
|
int device_type;
|
||||||
|
|
||||||
@ -215,8 +216,7 @@ static void ins8250_update_interrupt(device_t *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* set or clear the int */
|
/* set or clear the int */
|
||||||
if (ins8250->interface->interrupt)
|
ins8250->out_intr_func(state);
|
||||||
ins8250->interface->interrupt(device, state);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -549,6 +549,8 @@ static void common_start( device_t *device, int device_type )
|
|||||||
|
|
||||||
ins8250->interface = (const ins8250_interface*)device->static_config();
|
ins8250->interface = (const ins8250_interface*)device->static_config();
|
||||||
ins8250->device_type = device_type;
|
ins8250->device_type = device_type;
|
||||||
|
|
||||||
|
ins8250->out_intr_func.resolve(ins8250->interface->out_intr_cb, *device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,12 +29,10 @@ DECLARE_LEGACY_DEVICE(PC16550D, pc16550d);
|
|||||||
TYPE DEFINITIONS
|
TYPE DEFINITIONS
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
typedef void (*ins8250_interrupt_func)(device_t *device, int state);
|
|
||||||
typedef void (*ins8250_transmit_func)(device_t *device, int data);
|
typedef void (*ins8250_transmit_func)(device_t *device, int data);
|
||||||
typedef void (*ins8250_handshake_out_func)(device_t *device, int data);
|
typedef void (*ins8250_handshake_out_func)(device_t *device, int data);
|
||||||
typedef void (*ins8250_refresh_connect_func)(device_t *device);
|
typedef void (*ins8250_refresh_connect_func)(device_t *device);
|
||||||
|
|
||||||
#define INS8250_INTERRUPT(name) void name(device_t *device, int state)
|
|
||||||
#define INS8250_TRANSMIT(name) void name(device_t *device, int data)
|
#define INS8250_TRANSMIT(name) void name(device_t *device, int data)
|
||||||
#define INS8250_HANDSHAKE_OUT(name) void name(device_t *device, int data)
|
#define INS8250_HANDSHAKE_OUT(name) void name(device_t *device, int data)
|
||||||
#define INS8250_REFRESH_CONNECT(name) void name(device_t *device)
|
#define INS8250_REFRESH_CONNECT(name) void name(device_t *device)
|
||||||
@ -42,7 +40,7 @@ typedef void (*ins8250_refresh_connect_func)(device_t *device);
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
long clockin;
|
long clockin;
|
||||||
ins8250_interrupt_func interrupt;
|
devcb_write_line out_intr_cb;
|
||||||
|
|
||||||
ins8250_transmit_func transmit;
|
ins8250_transmit_func transmit;
|
||||||
ins8250_handshake_out_func handshake_out;
|
ins8250_handshake_out_func handshake_out;
|
||||||
|
@ -107,7 +107,7 @@ static INS8250_TRANSMIT( magtouch_com_transmit )
|
|||||||
microtouch_rx(1, &data8);
|
microtouch_rx(1, &data8);
|
||||||
}
|
}
|
||||||
|
|
||||||
static INS8250_INTERRUPT( at_com_interrupt_1 )
|
static WRITE_LINE_DEVICE_HANDLER( at_com_interrupt_1 )
|
||||||
{
|
{
|
||||||
pic8259_ir4_w(device->machine().device("pic8259_1"), state);
|
pic8259_ir4_w(device->machine().device("pic8259_1"), state);
|
||||||
}
|
}
|
||||||
@ -115,7 +115,7 @@ static INS8250_INTERRUPT( at_com_interrupt_1 )
|
|||||||
static const ins8250_interface magtouch_com0_interface =
|
static const ins8250_interface magtouch_com0_interface =
|
||||||
{
|
{
|
||||||
1843200,
|
1843200,
|
||||||
at_com_interrupt_1,
|
DEVCB_LINE(at_com_interrupt_1),
|
||||||
magtouch_com_transmit,
|
magtouch_com_transmit,
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
|
@ -112,7 +112,7 @@ static INS8250_TRANSMIT( pcat_nit_com_transmit )
|
|||||||
microtouch_rx(1, &data8);
|
microtouch_rx(1, &data8);
|
||||||
}
|
}
|
||||||
|
|
||||||
static INS8250_INTERRUPT( at_com_interrupt_1 )
|
static WRITE_LINE_DEVICE_HANDLER( at_com_interrupt_1 )
|
||||||
{
|
{
|
||||||
pic8259_ir4_w(device->machine().device("pic8259_1"), state);
|
pic8259_ir4_w(device->machine().device("pic8259_1"), state);
|
||||||
}
|
}
|
||||||
@ -120,7 +120,7 @@ static INS8250_INTERRUPT( at_com_interrupt_1 )
|
|||||||
static const ins8250_interface pcat_nit_com0_interface =
|
static const ins8250_interface pcat_nit_com0_interface =
|
||||||
{
|
{
|
||||||
1843200,
|
1843200,
|
||||||
at_com_interrupt_1,
|
DEVCB_LINE(at_com_interrupt_1),
|
||||||
pcat_nit_com_transmit,
|
pcat_nit_com_transmit,
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
|
Loading…
Reference in New Issue
Block a user