summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Curt Coder <curtcoder@mail.com>2011-06-14 11:42:03 +0000
committer Curt Coder <curtcoder@mail.com>2011-06-14 11:42:03 +0000
commitad1f10399b57e590447d0836078a5b62e79e8263 (patch)
treed8b50f19ab3d610f7b0dd198df81357c3455c441 /src
parent733d00f28eccb40d3e990772b3148ea1e490f6d5 (diff)
Refactored the INS8250 interrupt line to use devcb. [Curt Coder]
Diffstat (limited to 'src')
-rw-r--r--src/emu/machine/ins8250.c6
-rw-r--r--src/emu/machine/ins8250.h4
-rw-r--r--src/mame/drivers/magtouch.c4
-rw-r--r--src/mame/drivers/pcat_nit.c4
4 files changed, 9 insertions, 9 deletions
diff --git a/src/emu/machine/ins8250.c b/src/emu/machine/ins8250.c
index 7d5f454ba9e..417e1348627 100644
--- a/src/emu/machine/ins8250.c
+++ b/src/emu/machine/ins8250.c
@@ -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)
typedef struct {
+ devcb_resolved_write_line out_intr_func;
const ins8250_interface *interface;
int device_type;
@@ -215,8 +216,7 @@ static void ins8250_update_interrupt(device_t *device)
}
/* set or clear the int */
- if (ins8250->interface->interrupt)
- ins8250->interface->interrupt(device, state);
+ ins8250->out_intr_func(state);
}
@@ -549,6 +549,8 @@ static void common_start( device_t *device, int device_type )
ins8250->interface = (const ins8250_interface*)device->static_config();
ins8250->device_type = device_type;
+
+ ins8250->out_intr_func.resolve(ins8250->interface->out_intr_cb, *device);
}
diff --git a/src/emu/machine/ins8250.h b/src/emu/machine/ins8250.h
index 408c585a945..ef00e544573 100644
--- a/src/emu/machine/ins8250.h
+++ b/src/emu/machine/ins8250.h
@@ -29,12 +29,10 @@ DECLARE_LEGACY_DEVICE(PC16550D, pc16550d);
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_handshake_out_func)(device_t *device, int data);
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_HANDSHAKE_OUT(name) void name(device_t *device, int data)
#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
{
long clockin;
- ins8250_interrupt_func interrupt;
+ devcb_write_line out_intr_cb;
ins8250_transmit_func transmit;
ins8250_handshake_out_func handshake_out;
diff --git a/src/mame/drivers/magtouch.c b/src/mame/drivers/magtouch.c
index 560a0d7a22a..ffdc16b65ef 100644
--- a/src/mame/drivers/magtouch.c
+++ b/src/mame/drivers/magtouch.c
@@ -107,7 +107,7 @@ static INS8250_TRANSMIT( magtouch_com_transmit )
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);
}
@@ -115,7 +115,7 @@ static INS8250_INTERRUPT( at_com_interrupt_1 )
static const ins8250_interface magtouch_com0_interface =
{
1843200,
- at_com_interrupt_1,
+ DEVCB_LINE(at_com_interrupt_1),
magtouch_com_transmit,
NULL,
NULL
diff --git a/src/mame/drivers/pcat_nit.c b/src/mame/drivers/pcat_nit.c
index fa368650bb1..ad3e300b144 100644
--- a/src/mame/drivers/pcat_nit.c
+++ b/src/mame/drivers/pcat_nit.c
@@ -112,7 +112,7 @@ static INS8250_TRANSMIT( pcat_nit_com_transmit )
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);
}
@@ -120,7 +120,7 @@ static INS8250_INTERRUPT( at_com_interrupt_1 )
static const ins8250_interface pcat_nit_com0_interface =
{
1843200,
- at_com_interrupt_1,
+ DEVCB_LINE(at_com_interrupt_1),
pcat_nit_com_transmit,
NULL,
NULL