Previous 15994 Revisions Next

r11940 Tuesday 14th June, 2011 at 10:21:25 UTC by Curt Coder
Refactored the INS8250 interrupt line to use devcb. (nw)
[src/emu/machine]ins8250.c ins8250.h
[src/mame/drivers]magtouch.c pcat_nit.c
[src/mess/drivers]avigo.c ccs2810.c h19.c pcw16.c portfoli.c zrt80.c
[src/mess/includes]portfoli.h
[src/mess/machine]at.c bebox.c isa_com.c pc.c s100_wunderbus.c svi318.c

src/mame/drivers/pcat_nit.c
r11939r11940
112112   microtouch_rx(1, &data8);
113113}
114114
115static INS8250_INTERRUPT( at_com_interrupt_1 )
115static WRITE_LINE_DEVICE_HANDLER( at_com_interrupt_1 )
116116{
117117   pic8259_ir4_w(device->machine().device("pic8259_1"), state);
118118}
r11939r11940
120120static const ins8250_interface pcat_nit_com0_interface =
121121{
122122   1843200,
123   at_com_interrupt_1,
123   DEVCB_LINE(at_com_interrupt_1),
124124   pcat_nit_com_transmit,
125125   NULL,
126126   NULL
src/mame/drivers/magtouch.c
r11939r11940
107107   microtouch_rx(1, &data8);
108108}
109109
110static INS8250_INTERRUPT( at_com_interrupt_1 )
110static WRITE_LINE_DEVICE_HANDLER( at_com_interrupt_1 )
111111{
112112   pic8259_ir4_w(device->machine().device("pic8259_1"), state);
113113}
r11939r11940
115115static const ins8250_interface magtouch_com0_interface =
116116{
117117   1843200,
118   at_com_interrupt_1,
118   DEVCB_LINE(at_com_interrupt_1),
119119   magtouch_com_transmit,
120120   NULL,
121121   NULL
src/emu/machine/ins8250.c
r11939r11940
109109#define COM_LOG(n,m,a) LOG(VERBOSE_COM,n,m,a)
110110
111111typedef struct {
112   devcb_resolved_write_line   out_intr_func;
112113   const ins8250_interface *interface;
113114   int   device_type;
114115
r11939r11940
215216   }
216217
217218   /* set or clear the int */
218   if (ins8250->interface->interrupt)
219      ins8250->interface->interrupt(device, state);
219   ins8250->out_intr_func(state);
220220}
221221
222222
r11939r11940
549549
550550   ins8250->interface = (const ins8250_interface*)device->static_config();
551551   ins8250->device_type = device_type;
552
553   ins8250->out_intr_func.resolve(ins8250->interface->out_intr_cb, *device);
552554}
553555
554556
src/emu/machine/ins8250.h
r11939r11940
2929    TYPE DEFINITIONS
3030***************************************************************************/
3131
32typedef void (*ins8250_interrupt_func)(device_t *device, int state);
3332typedef void (*ins8250_transmit_func)(device_t *device, int data);
3433typedef void (*ins8250_handshake_out_func)(device_t *device, int data);
3534typedef void (*ins8250_refresh_connect_func)(device_t *device);
3635
37#define INS8250_INTERRUPT(name)         void name(device_t *device, int state)
3836#define INS8250_TRANSMIT(name)         void name(device_t *device, int data)
3937#define INS8250_HANDSHAKE_OUT(name)      void name(device_t *device, int data)
4038#define INS8250_REFRESH_CONNECT(name)   void name(device_t *device)
r11939r11940
4240typedef struct
4341{
4442   long clockin;
45   ins8250_interrupt_func         interrupt;
43   devcb_write_line            out_intr_cb;
4644
4745   ins8250_transmit_func         transmit;
4846   ins8250_handshake_out_func      handshake_out;
src/mess/machine/s100_wunderbus.c
r11939r11940
6666//   ins8250_interface ace1_intf
6767//-------------------------------------------------
6868
69static INS8250_INTERRUPT( ace1_interrupt )
70{
71   s100_wunderbus_device *wunderbus = downcast<s100_wunderbus_device *>(device->owner());
72
73   pic8259_ir3_w(wunderbus->m_pic, state);
74}
75
7669static INS8250_TRANSMIT( ace1_transmit )
7770{
7871//   terminal_write(m_terminal, 0, data);
r11939r11940
8174static ins8250_interface ace1_intf =
8275{
8376   XTAL_18_432MHz/10,
84   ace1_interrupt,
77   DEVCB_DEVICE_LINE(I8259A_TAG, pic8259_ir3_w),
8578   ace1_transmit,
8679   NULL,
8780   NULL
r11939r11940
9285//   ins8250_interface ace2_intf
9386//-------------------------------------------------
9487
95static INS8250_INTERRUPT( ace2_interrupt )
96{
97   s100_wunderbus_device *wunderbus = downcast<s100_wunderbus_device *>(device->owner());
98
99   pic8259_ir4_w(wunderbus->m_pic, state);
100}
101
10288static ins8250_interface ace2_intf =
10389{
10490   XTAL_18_432MHz/10,
105   ace2_interrupt,
91   DEVCB_DEVICE_LINE(I8259A_TAG, pic8259_ir4_w),
10692   NULL,
10793   NULL,
10894   NULL
r11939r11940
11399//   ins8250_interface ace3_intf
114100//-------------------------------------------------
115101
116static INS8250_INTERRUPT( ace3_interrupt )
117{
118   s100_wunderbus_device *wunderbus = downcast<s100_wunderbus_device *>(device->owner());
119
120   pic8259_ir5_w(wunderbus->m_pic, state);
121}
122
123102static ins8250_interface ace3_intf =
124103{
125104   XTAL_18_432MHz/10,
126   ace3_interrupt,
105   DEVCB_DEVICE_LINE(I8259A_TAG, pic8259_ir5_w),
127106   NULL,
128107   NULL,
129108   NULL
src/mess/machine/at.c
r11939r11940
313313 **********************************************************/
314314
315315/* called when a interrupt is set/cleared from com hardware */
316static INS8250_INTERRUPT( at_com_interrupt_1 )
316static WRITE_LINE_DEVICE_HANDLER( at_com_interrupt_1 )
317317{
318318   at_state *st = device->machine().driver_data<at_state>();
319319   pic8259_ir4_w(st->m_pic8259_master, state);
320320}
321321
322static INS8250_INTERRUPT( at_com_interrupt_2 )
322static WRITE_LINE_DEVICE_HANDLER( at_com_interrupt_2 )
323323{
324324   at_state *st = device->machine().driver_data<at_state>();
325325   pic8259_ir3_w(st->m_pic8259_master, state);
r11939r11940
345345{
346346   {
347347      1843200,
348      at_com_interrupt_1,
348      DEVCB_LINE(at_com_interrupt_1),
349349      NULL,
350350      at_com_handshake_out_0,
351351      NULL
352352   },
353353   {
354354      1843200,
355      at_com_interrupt_2,
355      DEVCB_LINE(at_com_interrupt_2),
356356      NULL,
357357      at_com_handshake_out_1,
358358      NULL
359359   },
360360   {
361361      1843200,
362      at_com_interrupt_1,
362      DEVCB_LINE(at_com_interrupt_1),
363363      NULL,
364364      at_com_handshake_out_2,
365365      NULL
366366   },
367367   {
368368      1843200,
369      at_com_interrupt_2,
369      DEVCB_LINE(at_com_interrupt_2),
370370      NULL,
371371      at_com_handshake_out_3,
372372      NULL
src/mess/machine/svi318.c
r11939r11940
3434
3535/* Serial ports */
3636
37static INS8250_INTERRUPT( svi318_ins8250_interrupt )
37static WRITE_LINE_DEVICE_HANDLER( svi318_ins8250_interrupt )
3838{
3939   svi318_state *drvstate = device->machine().driver_data<svi318_state>();
4040   if (drvstate->m_svi.bankLow != SVI_CART)
r11939r11940
5353{
5454   {
5555      1000000,
56      svi318_ins8250_interrupt,
56      DEVCB_LINE(svi318_ins8250_interrupt),
5757      NULL,
5858      NULL,
5959      svi318_com_refresh_connected
6060   },
6161   {
6262      3072000,
63      svi318_ins8250_interrupt,
63      DEVCB_LINE(svi318_ins8250_interrupt),
6464      NULL,
6565      NULL,
6666      NULL
src/mess/machine/isa_com.c
r11939r11940
1010
1111
1212/* called when a interrupt is set/cleared from com hardware */
13static INS8250_INTERRUPT( pc_com_interrupt_1 )
13static WRITE_LINE_DEVICE_HANDLER( pc_com_interrupt_1 )
1414{
1515   isa8_com_device   *com  = downcast<isa8_com_device *>(device->owner());
1616   com->m_isa->irq4_w(state);
1717}
1818
19static INS8250_INTERRUPT( pc_com_interrupt_2 )
19static WRITE_LINE_DEVICE_HANDLER( pc_com_interrupt_2 )
2020{
2121   isa8_com_device   *com  = downcast<isa8_com_device *>(device->owner());
2222   com->m_isa->irq3_w(state);
r11939r11940
4040{
4141   {
4242      1843200,
43      pc_com_interrupt_1,
43      DEVCB_LINE(pc_com_interrupt_1),
4444      NULL,
4545      pc_com_handshake_out_0,
4646      NULL
4747   },
4848   {
4949      1843200,
50      pc_com_interrupt_2,
50      DEVCB_LINE(pc_com_interrupt_2),
5151      NULL,
5252      pc_com_handshake_out_1,
5353      NULL
5454   },
5555   {
5656      1843200,
57      pc_com_interrupt_1,
57      DEVCB_LINE(pc_com_interrupt_1),
5858      NULL,
5959      pc_com_handshake_out_2,
6060      NULL
6161   },
6262   {
6363      1843200,
64      pc_com_interrupt_2,
64      DEVCB_LINE(pc_com_interrupt_2),
6565      NULL,
6666      pc_com_handshake_out_3,
6767      NULL
src/mess/machine/bebox.c
r11939r11940
374374const ins8250_interface bebox_uart_inteface_0 =
375375{
376376   0,
377   DEVCB_NULL,
377378   NULL,
378379   NULL,
379   NULL,
380380   NULL
381381};
382382
383383const ins8250_interface bebox_uart_inteface_1 =
384384{
385385   0,
386   DEVCB_NULL,
386387   NULL,
387388   NULL,
388   NULL,
389389   NULL
390390};
391391
392392const ins8250_interface bebox_uart_inteface_2 =
393393{
394394   0,
395   DEVCB_NULL,
395396   NULL,
396397   NULL,
397   NULL,
398398   NULL
399399};
400400
401401const ins8250_interface bebox_uart_inteface_3 =
402402{
403403   0,
404   NULL,
404   DEVCB_NULL,
405405   bebox_uart_transmit,
406406   bebox_uart_handshake,
407407   NULL
src/mess/machine/pc.c
r11939r11940
345345 **********************************************************/
346346
347347/* called when a interrupt is set/cleared from com hardware */
348static INS8250_INTERRUPT( pc_com_interrupt_1 )
348static WRITE_LINE_DEVICE_HANDLER( pc_com_interrupt_1 )
349349{
350350   pc_state *st = device->machine().driver_data<pc_state>();
351351   pic8259_ir4_w(st->m_pic8259, state);
352352}
353353
354static INS8250_INTERRUPT( pc_com_interrupt_2 )
354static WRITE_LINE_DEVICE_HANDLER( pc_com_interrupt_2 )
355355{
356356   pc_state *st = device->machine().driver_data<pc_state>();
357357   pic8259_ir3_w(st->m_pic8259, state);
r11939r11940
377377{
378378   {
379379      1843200,
380      pc_com_interrupt_1,
380      DEVCB_LINE(pc_com_interrupt_1),
381381      NULL,
382382      pc_com_handshake_out_0,
383383      NULL
384384   },
385385   {
386386      1843200,
387      pc_com_interrupt_2,
387      DEVCB_LINE(pc_com_interrupt_2),
388388      NULL,
389389      pc_com_handshake_out_1,
390390      NULL
391391   },
392392   {
393393      1843200,
394      pc_com_interrupt_1,
394      DEVCB_LINE(pc_com_interrupt_1),
395395      NULL,
396396      pc_com_handshake_out_2,
397397      NULL
398398   },
399399   {
400400      1843200,
401      pc_com_interrupt_2,
401      DEVCB_LINE(pc_com_interrupt_2),
402402      NULL,
403403      pc_com_handshake_out_3,
404404      NULL
src/mess/includes/portfoli.h
r11939r11940
6767   DECLARE_WRITE8_MEMBER( unknown_w );
6868   DECLARE_WRITE8_MEMBER( counter_w );
6969   DECLARE_WRITE8_MEMBER( ncc1_w );
70   
71   DECLARE_WRITE_LINE_MEMBER( i8250_intrpt_w );
7072
7173   /* interrupt state */
7274   UINT8 m_ip;                     /* interrupt pending */
src/mess/drivers/pcw16.c
r11939r11940
12331233};
12341234
12351235
1236static INS8250_INTERRUPT( pcw16_com_interrupt_1 )
1236static WRITE_LINE_DEVICE_HANDLER( pcw16_com_interrupt_1 )
12371237{
12381238   pcw16_state *drvstate = device->machine().driver_data<pcw16_state>();
12391239   drvstate->m_system_status &= ~(1 << 4);
r11939r11940
12461246}
12471247
12481248
1249static INS8250_INTERRUPT( pcw16_com_interrupt_2 )
1249static WRITE_LINE_DEVICE_HANDLER( pcw16_com_interrupt_2 )
12501250{
12511251   pcw16_state *drvstate = device->machine().driver_data<pcw16_state>();
12521252   drvstate->m_system_status &= ~(1 << 3);
r11939r11940
12851285{
12861286   {
12871287      1843200,
1288      pcw16_com_interrupt_1,
1288      DEVCB_LINE(pcw16_com_interrupt_1),
12891289      NULL,
12901290      pc_mouse_handshake_in,
12911291      pcw16_com_refresh_connected_1
12921292   },
12931293   {
12941294      1843200,
1295      pcw16_com_interrupt_2,
1295      DEVCB_LINE(pcw16_com_interrupt_2),
12961296      NULL,
12971297      NULL,
12981298      pcw16_com_refresh_connected_2
src/mess/drivers/portfoli.c
r11939r11940
714714//  ins8250_interface i8250_intf
715715//-------------------------------------------------
716716
717static INS8250_INTERRUPT( i8250_intrpt_w )
717WRITE_LINE_MEMBER( portfolio_state::i8250_intrpt_w )
718718{
719   portfolio_state *driver_state = device->machine().driver_data<portfolio_state>();
720
721   driver_state->trigger_interrupt(INT_EXTERNAL);
719   trigger_interrupt(INT_EXTERNAL);
722720}
723721
724722static const ins8250_interface i8250_intf =
725723{
726724   XTAL_1_8432MHz,
727   i8250_intrpt_w,
725   DEVCB_DRIVER_LINE_MEMBER(portfolio_state, i8250_intrpt_w),
728726   NULL,
729727   NULL,
730728   NULL
src/mess/drivers/h19.c
r11939r11940
346346   }
347347}
348348
349static INS8250_INTERRUPT(h19_ace_irq)
349static WRITE_LINE_DEVICE_HANDLER(h19_ace_irq)
350350{
351351   cputag_set_input_line(device->machine(), "maincpu", 0, (state ? HOLD_LINE : CLEAR_LINE));
352352}
r11939r11940
354354static const ins8250_interface h19_ace_interface =
355355{
356356   XTAL_12_288MHz / 4, // 3.072mhz clock which gets divided down for the various baud rates
357   h19_ace_irq, // interrupt
357   DEVCB_LINE(h19_ace_irq), // interrupt
358358   NULL, // transmit func
359359   NULL, // handshake out
360360   NULL // refresh func
src/mess/drivers/avigo.c
r11939r11940
353353
354354
355355
356static INS8250_INTERRUPT( avigo_com_interrupt )
356static WRITE_LINE_DEVICE_HANDLER( avigo_com_interrupt )
357357{
358358   avigo_state *drvstate = device->machine().driver_data<avigo_state>();
359359   logerror("com int\r\n");
r11939r11940
373373static const ins8250_interface avigo_com_interface =
374374{
375375   1843200,
376   avigo_com_interrupt,
376   DEVCB_LINE(avigo_com_interrupt),
377377   NULL,
378378   NULL,
379379   NULL
src/mess/drivers/ccs2810.c
r11939r11940
100100static const ins8250_interface ccs2810_com_interface =
101101{
102102   1843200,
103   DEVCB_NULL,
103104   NULL,
104105   NULL,
105   NULL,
106106   NULL
107107};
108108
src/mess/drivers/zrt80.c
r11939r11940
252252   NULL
253253};
254254
255static INS8250_INTERRUPT( zrt80_com_interrupt )
256{
257   cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_IRQ0, state);
258}
259
260255static const ins8250_interface zrt80_com_interface =
261256{
262257   2457600,
263   zrt80_com_interrupt,
258   DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0),
264259   NULL,
265260   NULL,
266261   NULL

Previous 15994 Revisions Next


© 1998-2018 The MESS Team