Previous 15994 Revisions Next

r11136 Sunday 10th April, 2011 at 19:02:24 UTC by Curt Coder
Converted I8214 to C++ and moved to emu folder. (no whatsnew)
[src/emu]emu.mak
[src/emu/machine]i8214.c* i8214.h*
[src/mess]mess.mak
[src/mess/drivers]pc8801.c v1050.c
[src/mess/includes]pc8001.h v1050.h
[src/mess/machine]i8214.c i8214.h

src/emu/emu.mak
r11135r11136
171171   $(EMUMACHINE)/i2cmem.o      \
172172   $(EMUMACHINE)/i8155.o      \
173173   $(EMUMACHINE)/i8212.o      \
174   $(EMUMACHINE)/i8214.o      \
174175   $(EMUMACHINE)/i8243.o      \
175176   $(EMUMACHINE)/i8255a.o      \
176177   $(EMUMACHINE)/i8355.o      \
src/emu/machine/i8214.c
r0r11136
1/**********************************************************************
2
3    Intel 8214 Priority Interrupt Controller emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "emu.h"
11#include "i8214.h"
12#include "machine/devhelpr.h"
13
14
15
16//**************************************************************************
17//  MACROS / CONSTANTS
18//**************************************************************************
19
20#define LOG 0
21
22
23
24//**************************************************************************
25//  GLOBAL VARIABLES
26//**************************************************************************
27
28// devices
29const device_type I8214 = i8214_device_config::static_alloc_device_config;
30
31
32
33//**************************************************************************
34//  DEVICE CONFIGURATION
35//**************************************************************************
36
37GENERIC_DEVICE_CONFIG_SETUP(i8214, "I8214")
38
39
40//-------------------------------------------------
41//  device_config_complete - perform any
42//  operations now that the configuration is
43//  complete
44//-------------------------------------------------
45
46void i8214_device_config::device_config_complete()
47{
48   // inherit a copy of the static data
49   const i8214_interface *intf = reinterpret_cast<const i8214_interface *>(static_config());
50   if (intf != NULL)
51      *static_cast<i8214_interface *>(this) = *intf;
52
53   // or initialize to defaults if none provided
54   else
55   {
56      memset(&m_out_int_func, 0, sizeof(m_out_int_func));
57      memset(&m_out_enlg_func, 0, sizeof(m_out_enlg_func));
58   }
59}
60
61
62
63//**************************************************************************
64//  INLINE HELPERS
65//**************************************************************************
66
67//-------------------------------------------------
68//  trigger_interrupt -
69//-------------------------------------------------
70
71inline void i8214_device::trigger_interrupt(int level)
72{
73   if (LOG) logerror("I8214 '%s' Interrupt Level %u\n", tag(), level);
74
75   m_a = level;
76
77   // disable interrupts
78   m_int_dis = 1;
79
80   // disable next level group
81   devcb_call_write_line(&m_out_enlg_func, 0);
82
83   // toggle interrupt line
84   devcb_call_write_line(&m_out_int_func, ASSERT_LINE);
85   devcb_call_write_line(&m_out_int_func, CLEAR_LINE);
86}
87
88
89//-------------------------------------------------
90//  check_interrupt -
91//-------------------------------------------------
92
93inline void i8214_device::check_interrupt()
94{
95   int level;
96
97   if (m_int_dis || !m_etlg) return;
98
99   for (level = 7; level >= 0; level--)
100   {
101      if (!BIT(m_r, 7 - level))
102      {
103         if (m_sgs)
104         {
105            if (level > m_b)
106            {
107               trigger_interrupt(level);
108            }
109         }
110         else
111         {
112            trigger_interrupt(level);
113         }
114      }
115   }
116}
117
118
119
120//**************************************************************************
121//  LIVE DEVICE
122//**************************************************************************
123
124//-------------------------------------------------
125//  i8214_device - constructor
126//-------------------------------------------------
127
128i8214_device::i8214_device(running_machine &_machine, const i8214_device_config &config)
129    : device_t(_machine, config),
130      m_config(config)
131{
132}
133
134
135//-------------------------------------------------
136//  device_start - device-specific startup
137//-------------------------------------------------
138
139void i8214_device::device_start()
140{
141   // resolve callbacks
142   devcb_resolve_write_line(&m_out_int_func, &m_config.m_out_int_func, this);
143   devcb_resolve_write_line(&m_out_enlg_func, &m_config.m_out_enlg_func, this);
144
145   // register for state saving
146   save_item(NAME(m_inte));
147   save_item(NAME(m_int_dis));
148   save_item(NAME(m_a));
149   save_item(NAME(m_b));
150   save_item(NAME(m_r));
151   save_item(NAME(m_sgs));
152   save_item(NAME(m_etlg));
153}
154
155
156//-------------------------------------------------
157//  a_r -
158//-------------------------------------------------
159
160UINT8 i8214_device::a_r()
161{
162   UINT8 a = m_a & 0x07;
163
164   if (LOG) logerror("I8214 '%s' A: %01x\n", tag(), a);
165
166   return a;
167}
168
169
170//-------------------------------------------------
171//  b_w -
172//-------------------------------------------------
173
174void i8214_device::b_w(UINT8 data)
175{
176   m_b = data & 0x07;
177
178   if (LOG) logerror("I8214 '%s' B: %01x\n", tag(), m_b);
179
180   // enable interrupts
181   m_int_dis = 0;
182
183   // enable next level group
184   devcb_call_write_line(&m_out_enlg_func, 1);
185
186   check_interrupt();
187}
188
189
190//-------------------------------------------------
191//  r_w -
192//-------------------------------------------------
193
194void i8214_device::r_w(UINT8 data)
195{
196   if (LOG) logerror("I8214 '%s' R: %02x\n", tag(), data);
197
198   m_r = data;
199
200   check_interrupt();
201}
202
203
204//-------------------------------------------------
205//  sgs_w -
206//-------------------------------------------------
207
208WRITE_LINE_MEMBER( i8214_device::sgs_w )
209{
210   if (LOG) logerror("I8214 '%s' SGS: %u\n", tag(), state);
211
212   m_sgs = state;
213
214   check_interrupt();
215}
216
217
218//-------------------------------------------------
219//  etlg_w -
220//-------------------------------------------------
221
222WRITE_LINE_MEMBER( i8214_device::etlg_w )
223{
224   if (LOG) logerror("I8214 '%s' ETLG: %u\n", tag(), state);
225
226   m_etlg = state;
227}
228
229
230//-------------------------------------------------
231//  inte_w -
232//-------------------------------------------------
233
234WRITE_LINE_MEMBER( i8214_device::inte_w )
235{
236   if (LOG) logerror("I8214 '%s' INTE: %u\n", tag(), state);
237
238   m_inte = state;
239}
src/emu/machine/i8214.h
r0r11136
1/**********************************************************************
2
3    Intel 8214 Priority Interrupt Controller emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************
9                            _____   _____
10                   _B0   1 |*    \_/     | 24  Vcc
11                   _B1   2 |             | 23  _ECS
12                   _B2   3 |             | 22  _R7
13                  _SGS   4 |             | 21  _R6
14                  _INT   5 |             | 20  _R5
15                  _CLK   6 |    8214     | 19  _R4
16                  INTE   7 |             | 18  _R3
17                   _A0   8 |             | 17  _R2
18                   _A1   9 |             | 16  _R1
19                   _A2  10 |             | 15  _R0
20                  _ELR  11 |             | 14  ENLG
21                   GND  12 |_____________| 13  ETLG
22
23**********************************************************************/
24
25#pragma once
26
27#ifndef __I8214__
28#define __I8214__
29
30#include "emu.h"
31
32
33
34///*************************************************************************
35//  INTERFACE CONFIGURATION MACROS
36///*************************************************************************
37
38#define MCFG_I8214_ADD(_tag, _clock, _config) \
39   MCFG_DEVICE_ADD(_tag, I8214, _clock)   \
40   MCFG_DEVICE_CONFIG(_config)
41
42
43#define I8214_INTERFACE(name) \
44   const i8214_interface (name) =
45
46
47
48///*************************************************************************
49//  TYPE DEFINITIONS
50///*************************************************************************
51
52// ======================> i8214_interface
53
54struct i8214_interface
55{
56   devcb_write_line   m_out_int_func;
57   devcb_write_line   m_out_enlg_func;
58};
59
60
61// ======================> i8214_device_config
62
63class i8214_device_config :   public device_config,
64                              public i8214_interface
65{
66    friend class i8214_device;
67
68    // construction/destruction
69    i8214_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
70
71public:
72    // allocators
73    static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
74    virtual device_t *alloc_device(running_machine &machine) const;
75
76protected:
77   // device_config overrides
78   virtual void device_config_complete();
79};
80
81
82
83// ======================> i8214_device
84
85class i8214_device :   public device_t
86{
87    friend class i8214_device_config;
88
89    // construction/destruction
90    i8214_device(running_machine &_machine, const i8214_device_config &_config);
91
92public:
93   DECLARE_WRITE_LINE_MEMBER( sgs_w );
94   DECLARE_WRITE_LINE_MEMBER( etlg_w );
95   DECLARE_WRITE_LINE_MEMBER( inte_w );
96
97    UINT8 a_r();
98   void b_w(UINT8 data);
99   void r_w(UINT8 data);
100
101protected:
102    // device-level overrides
103    virtual void device_start();
104
105private:
106   inline void trigger_interrupt(int level);
107   inline void check_interrupt();
108
109   devcb_resolved_write_line   m_out_int_func;
110   devcb_resolved_write_line   m_out_enlg_func;
111
112   int m_inte;               // interrupt enable
113   int m_int_dis;            // interrupt disable flip-flop
114   int m_a;               // request level
115   int m_b;               // current status register
116   UINT8 m_r;               // interrupt request latch
117   int m_sgs;               // status group select
118   int m_etlg;               // enable this level group
119
120   const i8214_device_config &m_config;
121};
122
123
124// device type definition
125extern const device_type I8214;
126
127
128
129#endif
src/mess/machine/i8214.c
r11135r11136
1/**********************************************************************
2
3    Intel 8214 Priority Interrupt Controller emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "emu.h"
11#include "i8214.h"
12
13/***************************************************************************
14    PARAMETERS
15***************************************************************************/
16
17#define LOG 0
18
19/***************************************************************************
20    TYPE DEFINITIONS
21***************************************************************************/
22
23typedef struct _i8214_t i8214_t;
24struct _i8214_t
25{
26   devcb_resolved_write_line   out_int_func;
27   devcb_resolved_write_line   out_enlg_func;
28
29   int inte;               /* interrupt enable */
30   int int_dis;            /* interrupt disable flip-flop */
31   int a;                  /* request level */
32   int b;                  /* current status register */
33   UINT8 r;               /* interrupt request latch */
34   int sgs;               /* status group select */
35   int etlg;               /* enable this level group */
36};
37
38/***************************************************************************
39    INLINE FUNCTIONS
40***************************************************************************/
41
42INLINE i8214_t *get_safe_token(device_t *device)
43{
44   assert(device != NULL);
45   assert(device->type() == I8214);
46
47   return (i8214_t *)downcast<legacy_device_base *>(device)->token();
48}
49
50INLINE const i8214_interface *get_interface(device_t *device)
51{
52   assert(device != NULL);
53   assert((device->type() == I8214));
54
55   return (const i8214_interface *) device->baseconfig().static_config();
56}
57
58INLINE void trigger_interrupt(device_t *device, int level)
59{
60   i8214_t *i8214 = get_safe_token(device);
61
62   if (LOG) logerror("I8214 '%s' Interrupt Level %u\n", device->tag(), level);
63
64   i8214->a = level;
65
66   /* disable interrupts */
67   i8214->int_dis = 1;
68
69   /* disable next level group */
70   devcb_call_write_line(&i8214->out_enlg_func, 0);
71
72   /* toggle interrupt line */
73   devcb_call_write_line(&i8214->out_int_func, ASSERT_LINE);
74   devcb_call_write_line(&i8214->out_int_func, CLEAR_LINE);
75}
76
77INLINE void check_interrupt(device_t *device)
78{
79   i8214_t *i8214 = get_safe_token(device);
80   int level;
81
82   if (i8214->int_dis || !i8214->etlg) return;
83
84   for (level = 7; level >= 0; level--)
85   {
86      if (!BIT(i8214->r, 7 - level))
87      {
88         if (i8214->sgs)
89         {
90            if (level > i8214->b)
91            {
92               trigger_interrupt(device, level);
93            }
94         }
95         else
96         {
97            trigger_interrupt(device, level);
98         }
99      }
100   }
101}
102
103/***************************************************************************
104    IMPLEMENTATION
105***************************************************************************/
106
107/*-------------------------------------------------
108    i8214_a_r - request level read
109-------------------------------------------------*/
110
111READ8_DEVICE_HANDLER( i8214_a_r )
112{
113   i8214_t *i8214 = get_safe_token(device);
114
115   UINT8 a = i8214->a & 0x07;
116
117   if (LOG) logerror("I8214 '%s' A: %01x\n", device->tag(), a);
118
119   return a;
120}
121
122/*-------------------------------------------------
123    i8214_b_w - current status register write
124-------------------------------------------------*/
125
126WRITE8_DEVICE_HANDLER( i8214_b_w )
127{
128   i8214_t *i8214 = get_safe_token(device);
129
130   i8214->b = data & 0x07;
131   i8214->sgs = BIT(data, 3);
132
133   if (LOG) logerror("I8214 '%s' B: %01x\n", device->tag(), i8214->b);
134   if (LOG) logerror("I8214 '%s' SGS: %u\n", device->tag(), i8214->sgs);
135
136   /* enable interrupts */
137   i8214->int_dis = 0;
138
139   /* enable next level group */
140   devcb_call_write_line(&i8214->out_enlg_func, 1);
141
142   check_interrupt(device);
143}
144
145/*-------------------------------------------------
146    i8214_etlg_w - enable this level group write
147-------------------------------------------------*/
148
149WRITE_LINE_DEVICE_HANDLER( i8214_etlg_w )
150{
151   i8214_t *i8214 = get_safe_token(device);
152
153   if (LOG) logerror("I8214 '%s' ETLG: %u\n", device->tag(), state);
154
155   i8214->etlg = state;
156}
157
158/*-------------------------------------------------
159    i8214_inte_w - interrupt enable write
160-------------------------------------------------*/
161
162WRITE_LINE_DEVICE_HANDLER( i8214_inte_w )
163{
164   i8214_t *i8214 = get_safe_token(device);
165
166   if (LOG) logerror("I8214 '%s' INTE: %u\n", device->tag(), state);
167
168   i8214->inte = state;
169}
170
171/*-------------------------------------------------
172    i8214_r_w - request level write
173-------------------------------------------------*/
174
175WRITE8_DEVICE_HANDLER( i8214_r_w )
176{
177   i8214_t *i8214 = get_safe_token(device);
178
179   if (LOG) logerror("I8214 '%s' R: %02x\n", device->tag(), data);
180
181   i8214->r = data;
182
183   check_interrupt(device);
184}
185
186/*-------------------------------------------------
187    DEVICE_START( i8214 )
188-------------------------------------------------*/
189
190static DEVICE_START( i8214 )
191{
192   i8214_t *i8214 = get_safe_token(device);
193   const i8214_interface *intf = get_interface(device);
194
195   /* resolve callbacks */
196   devcb_resolve_write_line(&i8214->out_int_func, &intf->out_int_func, device);
197   devcb_resolve_write_line(&i8214->out_enlg_func, &intf->out_enlg_func, device);
198
199   /* register for state saving */
200   device->save_item(NAME(i8214->inte));
201   device->save_item(NAME(i8214->int_dis));
202   device->save_item(NAME(i8214->a));
203   device->save_item(NAME(i8214->b));
204   device->save_item(NAME(i8214->r));
205   device->save_item(NAME(i8214->sgs));
206   device->save_item(NAME(i8214->etlg));
207}
208
209/*-------------------------------------------------
210    DEVICE_GET_INFO( i8214 )
211-------------------------------------------------*/
212
213DEVICE_GET_INFO( i8214 )
214{
215   switch (state)
216   {
217      /* --- the following bits of info are returned as 64-bit signed integers --- */
218      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(i8214_t);               break;
219      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                        break;
220
221      /* --- the following bits of info are returned as pointers to data or functions --- */
222      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(i8214);      break;
223      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
224      case DEVINFO_FCT_RESET:                     /* Nothing */                        break;
225
226      /* --- the following bits of info are returned as NULL-terminated strings --- */
227      case DEVINFO_STR_NAME:                     strcpy(info->s, "Intel 8214");            break;
228      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "Intel MCS-80");         break;
229      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                  break;
230      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);               break;
231      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright MESS Team");      break;
232   }
233}
234
235DEFINE_LEGACY_DEVICE(I8214, i8214);
src/mess/machine/i8214.h
r11135r11136
1/**********************************************************************
2
3    Intel 8214 Priority Interrupt Controller emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************
9                            _____   _____
10                   _B0   1 |*    \_/     | 24  Vcc
11                   _B1   2 |             | 23  _ECS
12                   _B2   3 |             | 22  _R7
13                  _SGS   4 |             | 21  _R6
14                  _INT   5 |             | 20  _R5
15                  _CLK   6 |    8214     | 19  _R4
16                  INTE   7 |             | 18  _R3
17                   _A0   8 |             | 17  _R2
18                   _A1   9 |             | 16  _R1
19                   _A2  10 |             | 15  _R0
20                  _ELR  11 |             | 14  ENLG
21                   GND  12 |_____________| 13  ETLG
22
23**********************************************************************/
24
25#ifndef __I8214__
26#define __I8214__
27
28#include "devcb.h"
29
30/***************************************************************************
31    MACROS / CONSTANTS
32***************************************************************************/
33
34DECLARE_LEGACY_DEVICE(I8214, i8214);
35
36#define MCFG_I8214_ADD(_tag, _clock, _intrf) \
37   MCFG_DEVICE_ADD(_tag, I8214, _clock) \
38   MCFG_DEVICE_CONFIG(_intrf)
39
40#define I8214_INTERFACE(name) \
41   const i8214_interface (name)=
42
43/***************************************************************************
44    TYPE DEFINITIONS
45***************************************************************************/
46
47typedef struct _i8214_interface i8214_interface;
48struct _i8214_interface
49{
50   devcb_write_line   out_int_func;
51   devcb_write_line   out_enlg_func;
52};
53
54/***************************************************************************
55    PROTOTYPES
56***************************************************************************/
57/* request level read */
58READ8_DEVICE_HANDLER( i8214_a_r );
59
60/* current status register write (bit 3 is SGS) */
61WRITE8_DEVICE_HANDLER( i8214_b_w );
62
63/* enable this level group */
64WRITE_LINE_DEVICE_HANDLER( i8214_etlg_w );
65
66/* interrupt enable */
67WRITE_LINE_DEVICE_HANDLER( i8214_inte_w );
68
69/* interrupt requests */
70WRITE8_DEVICE_HANDLER( i8214_r_w );
71
72#endif
src/mess/includes/pc8001.h
r11135r11136
1010#include "imagedev/cassette.h"
1111#include "machine/ctronics.h"
1212#include "machine/i8257.h"
13#include "machine/i8214.h"
1413#include "machine/i8255a.h"
1514#include "machine/msm8251.h"
1615#include "machine/ram.h"
src/mess/includes/v1050.h
r11135r11136
1#pragma once
2
13#ifndef __V1050__
24#define __V1050__
35
6#define ADDRESS_MAP_MODERN
7
8#include "emu.h"
9#include "cpu/z80/z80.h"
10#include "cpu/m6502/m6502.h"
11#include "cpu/mcs48/mcs48.h"
412#include "imagedev/flopdrv.h"
513#include "machine/ram.h"
14#include "formats/basicdsk.h"
15#include "machine/ctronics.h"
16#include "machine/i8214.h"
17#include "machine/i8255a.h"
18#include "machine/msm58321.h"
19#include "machine/msm8251.h"
20#include "machine/wd17xx.h"
21#include "video/mc6845.h"
22#include "sound/discrete.h"
623
724#define SCREEN_TAG            "screen"
825
r11135r11136
6077
6178   required_device<cpu_device> m_maincpu;
6279   required_device<cpu_device> m_subcpu;
63   required_device<device_t> m_pic;
80   required_device<i8214_device> m_pic;
6481   required_device<device_t> m_rtc;
6582   required_device<device_t> m_uart_kb;
6683   required_device<device_t> m_uart_sio;
src/mess/mess.mak
r11135r11136
518518   $(MESS_MACHINE)/ctronics.o   \
519519   $(MESS_MACHINE)/er59256.o   \
520520   $(MESS_MACHINE)/hd63450.o   \
521   $(MESS_MACHINE)/i8214.o      \
522521   $(MESS_MACHINE)/i82371ab.o   \
523522   $(MESS_MACHINE)/i82439tx.o   \
524523   $(MESS_MACHINE)/i8271.o      \
src/mess/drivers/v1050.c
r11135r11136
102102
103103*/
104104
105#define ADDRESS_MAP_MODERN
106
107#include "emu.h"
108105#include "includes/v1050.h"
109#include "cpu/z80/z80.h"
110#include "cpu/m6502/m6502.h"
111#include "cpu/mcs48/mcs48.h"
112#include "imagedev/flopdrv.h"
113#include "machine/ram.h"
114#include "formats/basicdsk.h"
115#include "machine/ctronics.h"
116#include "machine/i8214.h"
117#include "machine/i8255a.h"
118#include "machine/msm58321.h"
119#include "machine/msm8251.h"
120#include "machine/wd17xx.h"
121#include "video/mc6845.h"
122#include "sound/discrete.h"
123106
124107void v1050_state::set_interrupt(UINT8 mask, int state)
125108{
r11135r11136
132115      m_int_state &= ~mask;
133116   }
134117
135   i8214_r_w(m_pic, 0, ~(m_int_state & m_int_mask));
118   m_pic->r_w(~(m_int_state & m_int_mask));
136119}
137120
138121void v1050_state::bankswitch()
r11135r11136
310293
311294WRITE8_MEMBER( v1050_state::v1050_i8214_w )
312295{
313   i8214_b_w(m_pic, 0, (data >> 1) & 0x0f);
296   m_pic->b_w((data >> 1) & 0x07);
297   m_pic->sgs_w(BIT(data, 4));
314298}
315299
316300READ8_MEMBER( v1050_state::vint_clr_r )
r11135r11136
11001084{
11011085   v1050_state *state = device->machine().driver_data<v1050_state>();
11021086
1103   UINT8 vector = 0xf0 | (i8214_a_r(state->m_pic, 0) << 1);
1087   UINT8 vector = 0xf0 | (state->m_pic->a_r() << 1);
11041088
11051089   //logerror("Interrupt Acknowledge Vector: %02x\n", vector);
11061090
r11135r11136
11141098   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
11151099
11161100   /* initialize I8214 */
1117   i8214_etlg_w(m_pic, 1);
1118   i8214_inte_w(m_pic, 1);
1101   m_pic->etlg_w(1);
1102   m_pic->inte_w(1);
11191103
11201104   /* initialize RTC */
11211105   msm58321_cs1_w(m_rtc, 1);
src/mess/drivers/pc8801.c
r11135r11136
160160
161161//#define USE_PROPER_I8214
162162
163#define UPD1990A_TAG "upd1990a"
163#define I8214_TAG      "i8214"
164#define UPD1990A_TAG   "upd1990a"
164165
165166class pc8801_state : public driver_device
166167{
167168public:
168169   pc8801_state(running_machine &machine, const driver_device_config_base &config)
169170      : driver_device(machine, config),
171        m_pic(*this, I8214_TAG),
170172        m_rtc(*this, UPD1990A_TAG)
171173   { }
172174
175   optional_device<i8214_device> m_pic;
173176   required_device<upd1990a_device> m_rtc;
174177};
175178
r11135r11136
975978static WRITE8_HANDLER( i8214_irq_level_w )
976979{
977980   if(data & 8)
978      i8214_b_w(space->machine().device("i8214"), 0, (7));
981      m_pic->b_w(7);
979982   else
980      i8214_b_w(space->machine().device("i8214"), 0, (data & 0x07));
983      m_pic->b_w(data & 0x07);
981984}
982985
983986static WRITE8_HANDLER( i8214_irq_mask_w )
r11135r11136
18651868   {
18661869      m_int_state |= irq;
18671870
1868      i8214_r_w(machine.device("i8214"), 0, ~irq);
1871      m_pic->r_w(~irq);
18691872
18701873      cputag_set_input_line(machine,"maincpu",0,ASSERT_LINE);
18711874   }
r11135r11136
18991902
19001903static IRQ_CALLBACK( pc8801_irq_callback )
19011904{
1902   UINT8 vector = (7 - i8214_a_r(device->machine().device("i8214"), 0));
1905   UINT8 vector = (7 - m_pic->a_r());
19031906
19041907   m_int_state &= ~(1<<vector);
19051908   cputag_set_input_line(device->machine(),"maincpu",0,CLEAR_LINE);
r11135r11136
20252028   #ifdef USE_PROPER_I8214
20262029   {
20272030      /* initialize I8214 */
2028      i8214_etlg_w(machine.device("i8214"), 1);
2029      i8214_inte_w(machine.device("i8214"), 1);
2031      m_pic->etlg_w(1);
2032      m_pic->inte_w(1);
20302033   }
20312034   #else
20322035   {
r11135r11136
21542157
21552158   MCFG_UPD765A_ADD("upd765", pc8801_upd765_interface)
21562159   #ifdef USE_PROPER_I8214
2157   MCFG_I8214_ADD("i8214", MASTER_CLOCK, pic_intf)
2160   MCFG_I8214_ADD(I8214_TAG, MASTER_CLOCK, pic_intf)
21582161   #endif
21592162   MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, pc8801_upd1990a_intf)
21602163   //MCFG_CENTRONICS_ADD("centronics", standard_centronics)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team